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

method to extend bounds to certain latlng point #29

Open
Freundschaft opened this issue Apr 5, 2014 · 3 comments
Open

method to extend bounds to certain latlng point #29

Freundschaft opened this issue Apr 5, 2014 · 3 comments

Comments

@Freundschaft
Copy link

is there any plan to include a method that extends existing bounds to a new point similar to what google and leaflet have with ther latlngbounds.extend methods?

cheers
Qiong

@Freundschaft
Copy link
Author

ah I guess it would be possible to extend the polygon of the parameter that is passed to getbounds and thereby extend the resulting bounds object, am I correct?

Best
Qiong

@manuelbieh
Copy link
Owner

Do you have an example how Google and Leaflet are doing it? I'm not quite sure if I understood what exactly you are meaning ;)

@Freundschaft
Copy link
Author

sure: the API provided by google is here:
https://developers.google.com/maps/documentation/javascript/reference?csw=1#LatLngBounds

basically you can invoke .extend(LatLng) on a Bounds object and then the LatLngBounds object is extended by that point.

What I do when I run code written by using your library I would use the following instead:

var routePolygon = new Array();
routePolygon.push(new LatLng(lat, lng));
geolib.getBounds(routePolygon)

instead of

LatLngBounds.extend(LatLng);

basically I already figured out how to do it, but it would be nice if the library would work in the same way as Google / Leaflet.

I am working on a couple of other useful additions to the library, so at one point (probably in a month or so, cause I'm going on vacation) I could contribute a couple of additions to the library.

Thanks & Best Regards
Qiong

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

No branches or pull requests

2 participants