//Mapクラスの作成
var mapMain = new Map("divMap",{
basemap:"oceans",
center: [136, 35],
zoom:7
});
mapMain.on("click", addPoint);
function addPoint(evt) {
var longitude = evt.mapPoint.getLongitude()
var latitude = evt.mapPoint.getLatitude()
mapMain.infoWindow.setTitle("Coordinates");
mapMain.infoWindow.setContent(
"lat/lon : " + latitude.toFixed(6) + ", " + longitude.toFixed(6) +
"<br>screen x/y : " + evt.screenPoint.x + ", " + evt.screenPoint.y
);
mapMain.infoWindow.show(evt.mapPoint, mapMain.getInfoWindowAnchor(evt.screenPoint));
}
記事
