google map api sample
来源:互联网 发布:mysql 5.9修改密码 编辑:程序博客网 时间:2024/05/14 03:29
HTML>
<HEAD>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<TITLE>WMI Scripting HTML</TITLE>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAdI0zGVgYqTKHphoxD6Ts7RStrDQCRAqEw3qj75gyDXKipO0rfhSjjCwKU9CeQlegTB_-A2G4yly6wg"
type="text/javascript"></script>
<script>
var map;
var center;
var showmark = false;
var marker ;
function initialize()
{
if (GBrowserIsCompatible())
{
function doMarkersSetCallback(markers){
var marker2 = markers[0].marker;
marker2.hide();
marker.setLatLng(marker2.getLatLng());
for (var num = 0; num < markers.length; num ++)
{
markers[num].marker.hide();
}
marker.openInfoWindowHtml(marker2.getLatLng().toString());
// alert("搜索得到的经纬度是:" + marker2.getLatLng());
// var p;
// alert("doMarkersSetCallback");
//return null;
}
function doGenerateMarkerHtmlCallback() {
// alert("doGenerateMarkerHtmlCallback");
//return null;
}
map = new GMap2(document.getElementById("gmap"), {googleBarOptions:
{
onMarkersSetCallback:doMarkersSetCallback,
onGenerateMarkerHtmlCallback:doGenerateMarkerHtmlCallback,
suppressInitialResultSelection:false
}}
);
map.addControl(new GSmallMapControl());
map.enableGoogleBar();
map.addControl(new GMapTypeControl());
map.getPane(G_MAP_FLOAT_SHADOW_PANE).style.display = "none";
center = new GLatLng(0,0);
map.setCenter(center, 1);
var ico = new GIcon(G_DEFAULT_ICON);
ico.image="green.png";
marker = new GMarker(center, {draggable: true,icon: ico});
// marker = new GMarker(center, {draggable: true});
GEvent.addListener(marker, "dragend", function(point) {
var WINDOW_HTML = '<div><img src = "green.png"/> </div>';
// alert("标点现在的经纬度是:" + point);
marker.openInfoWindowHtml('<div><img src = "green.png"/> </div>' + point.toUrlValue());
});
GEvent.addListener(map, "mousemove", function(point) {
if (showmark)
marker.setLatLng(point);
});
GEvent.addListener(map, "click", function(o, p) {
if (showmark) {
// alert("您点击的位置的经纬度是:" + p);
marker.setLatLng(p);
showmark = false;
marker.openInfoWindowHtml(p.toString());
}
});
//Options = new GGoogleBarOptions(suppressInitialResultSelection : false);
//GGoogleBarOptions.suppressInitialResultSelection =false;
map.addOverlay(marker);
// marker.openInfoWindowHtml("dddddddddddddddddddd");
}
//document.getElementById("gmap").style.visibility = "false";
}
function Button1_onclick() {
showmark = true;
}
</script>
</HEAD>
<body onload="initialize()">
<div id = "gmap" style="position:absolute; z-index:0; width: 780px; height: 420px; left: 23px; top: 20px;">
</div>
<img src = "green.png" input id="Button1" type="button" style="z-index:1;position:relative; left: 66px; top: 18px; width: 20px; height: 34px;"
onclick="return Button1_onclick()" />
</body>
</HTML>
- google map api sample
- Google API Sample
- google map api练习 Google+Map+API
- Google Map API入门
- google map api中文版
- Google Map API
- Google map api
- Google map api key
- google-map-api
- google -- map -- api
- 关于google map API
- apply google map api
- google map api v3
- 调用google map api
- 申请Google map API
- Google map API
- Google map api family
- google map api
- spring实现将hibernate的session绑定到请求的方法
- 精典语录
- git使用(二)(转载)
- s3c2410 NandFlash K9F1208U0A /K9F1208U0B的读取操作1 (转)
- 如何获取本机MAC地址 和 IP
- google map api sample
- 谈谈你对MVC和三层架构的理解?(月薪三万的面试题)
- MDI 界面开发
- http://spdbank.asia is my site.
- git使用(三)(转载)
- 【转】windows上的db2连接linux上db2的通信问题
- Linux多线程编程
- MVC框架
- js屏蔽右键 显示菜单或者选择页面上的信息(FF、IE均能用)