tombatossals / angular-leaflet-directive

AngularJS directive to embed an interact with maps managed by Leaflet library
http://tombatossals.github.io/angular-leaflet-directive
MIT License
1.5k stars 637 forks source link

getBounds method for zooming the map #233

Closed littlebeeper closed 9 years ago

littlebeeper commented 10 years ago

Below is the usage example from leaflet documentation.

// create a red polyline from an arrays of LatLng points var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);

// zoom the map to the polyline map.fitBounds(polyline.getBounds());

There is no way for creating bounds from given Latlngs or from a path array

nmccready commented 9 years ago

Did you ever figure this out?

tombatossals commented 9 years ago

I'm going to close this as old issue, there are some examples of how to use the bounds facilities here:

http://tombatossals.github.io/angular-leaflet-directive/examples/0000-viewer.html#/basic/bounds-example