【发布时间】:2018-01-26 06:38:25
【问题描述】:
我正在使用 Google maps V3,我想使用 northEastLat、northEastLng、southWestLat 和 southWestLng 坐标设置地图视图端口可见区域。我已经有了坐标,只需要知道如何编写脚本来重新定位地图。谢谢。
var northEastLat = data.northEastLat;
var northEastLng = data.northEastLng;
var southWestLat = data.southWestLat;
var southWestLng = data.southWestLng;
var mapOptions = {
center: new google.maps.LatLng(northEastLat, northEastLng, southWestLat, southWestLng), // i know this is wrong, not sure how to do it...
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
// create the map and reference the div#map-canvas container
var mapDiv = document.getElementById("map_canvas");
mapCanvas = new google.maps.Map(mapDiv, mapOptions);
mapCanvas.setMapTypeId(google.maps.MapTypeId.ROADMAP);
【问题讨论】:
标签: php mysql google-maps google-maps-api-3