Skip to content
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

Closed
jskidd3 opened this issue May 14, 2014 · 3 comments
Closed

Extend LatLngBounds and map.fitBounds() #59

jskidd3 opened this issue May 14, 2014 · 3 comments
Labels
Milestone

Comments

@jskidd3
Copy link

jskidd3 commented May 14, 2014

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

@jskidd3 jskidd3 changed the title Extend LatLngBounds Extend LatLngBounds and map.fitBounds() May 14, 2014
@wf9a5m75
Copy link
Member

Currently not possible.

@wf9a5m75
Copy link
Member

@jskidd3
You may know, if you want to fit to bounds, you just pass the array of LatLng to the target property.

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
});

@wf9a5m75 wf9a5m75 added this to the v1.0.12 milestone May 18, 2014
@wf9a5m75
Copy link
Member

I released the plugin version 1.1.0 (old version name v1.0.12). Please uninstall the plugin, then install it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants