如何在一幅图片上。按照真实经纬度标注
发布网友
发布时间:2022-06-06 11:26
我来回答
共1个回答
热心网友
时间:2022-07-10 04:18
运行一下试试 不然你就在修改一下啦
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Google Maps JavaScript API Example - simple</title>
<script src="http://maps.google.com/maps?file=api&v=1&key=aaaaa"
type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id="map" style="width: 900px; height: 700px"></div>
<script language="javascript">
if(GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(39.917,116.397),4);
GEvent.addListener(map,"click",function(overlay,point,marker)
{
if(point)
{
document.getElementById("show_x").innerHTML = point.x;
document.getElementById("show_y").innerHTML = point.y;
if(marker)
{
map.removeOverlay(marker);
}
else
{
map.addOverlay(new GMarker(point));
}
}
});
}
</script>
<P id="show_y"></P>
<P id="show_x"></P>
</body>
</html>