-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend LatLngBounds and map.fitBounds() #59
Comments
Currently not possible. |
@jskidd3 The below snippet code works in v1.0.11. const GORYOKAKU_POINTS = [
new plugin.google.maps.LatLng(41.79883, 140.75675),
new plugin.google.maps.LatLng(41.799240000000005, 140.75875000000002),
new plugin.google.maps.LatLng(41.797650000000004, 140.75905),
new plugin.google.maps.LatLng(41.79637, 140.76018000000002),
new plugin.google.maps.LatLng(41.79567, 140.75845),
new plugin.google.maps.LatLng(41.794470000000004, 140.75714000000002),
new plugin.google.maps.LatLng(41.795010000000005, 140.75611),
new plugin.google.maps.LatLng(41.79477000000001, 140.75484),
new plugin.google.maps.LatLng(41.79576, 140.75475),
new plugin.google.maps.LatLng(41.796150000000004, 140.75364000000002),
new plugin.google.maps.LatLng(41.79744, 140.75454000000002),
new plugin.google.maps.LatLng(41.79909000000001, 140.75465),
new plugin.google.maps.LatLng(41.79883, 140.75673)
];
map.animateCamera({
'target' : latLngBounds
}); However, the below code will also works from v1.0.12. const GORYOKAKU_POINTS = [
new plugin.google.maps.LatLng(41.79883, 140.75675),
new plugin.google.maps.LatLng(41.799240000000005, 140.75875000000002),
new plugin.google.maps.LatLng(41.797650000000004, 140.75905),
new plugin.google.maps.LatLng(41.79637, 140.76018000000002),
new plugin.google.maps.LatLng(41.79567, 140.75845),
new plugin.google.maps.LatLng(41.794470000000004, 140.75714000000002),
new plugin.google.maps.LatLng(41.795010000000005, 140.75611),
new plugin.google.maps.LatLng(41.79477000000001, 140.75484),
new plugin.google.maps.LatLng(41.79576, 140.75475),
new plugin.google.maps.LatLng(41.796150000000004, 140.75364000000002),
new plugin.google.maps.LatLng(41.79744, 140.75454000000002),
new plugin.google.maps.LatLng(41.79909000000001, 140.75465),
new plugin.google.maps.LatLng(41.79883, 140.75673)
];
var latLngBounds = new plugin.google.maps.LatLngBounds(GORYOKAKU_POINTS);
map.animateCamera({
'target' : latLngBounds
}); |
I released the plugin version 1.1.0 (old version name v1.0.12). Please uninstall the plugin, then install it again. |
wf9a5m75
added a commit
that referenced
this issue
Mar 1, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would it be possible to have a method added that allows us to extend LatLngBounds?
https://developers.google.com/maps/documentation/javascript/reference?csw=1#LatLngBounds
It would be ideal if it functioned the same way as the JavaScript API does. You simply extend the LatLngBounds by passing a LatLng object.
As for the
map.fitBounds()
, this would essentially move the camera into a position that shows all the points inside the LatLngBounds, just like the JavaScript API.Thanks
The text was updated successfully, but these errors were encountered: