我怎样才能让这个谷歌地图调整到折线边界的范围?
我认为我使用这个是正确的:
var bounds = new google.maps.LatLngBounds();
decodedPath.getPath().forEach(function(LatLng) {
bounds.extend(LatLng);
});
map.setBounds(bounds);
但我也认为我把它放在了错误的地方。
我怎样才能让这个谷歌地图调整到折线边界的范围?
我认为我使用这个是正确的:
var bounds = new google.maps.LatLngBounds();
decodedPath.getPath().forEach(function(LatLng) {
bounds.extend(LatLng);
});
map.setBounds(bounds);
但我也认为我把它放在了错误的地方。