Closed jziggas closed 4 years ago
I agree. This, and maybe other methods, need to be included in the geodesic-classes.
Yeah there may be more missing methods but that's as far as I went with it. I noticed GeodesicCircleClass extends L.Layer
but it almost seems like it should be extending or otherwise also inheriting (mixin?) from L.Circle
to get those methods. 🤷♂
Related code in leaflet.js: https://github.com/Leaflet/Leaflet/blob/441c5fb0a877ada5d055f0d5f1fa1db8ce7c2957/src/layer/FeatureGroup.js#L84
Release is v2.3.1
Thanks!
I have a FeatureGroup that can contain a number of Rectangles, Circles, or GeodesicCircles. On page load I call
map.fitResults(featureGroup.getBounds())
to zoom in and fit the view of the map to nicely contain all of the geoshapes. It looks like callinggetBounds()
on a FeatureGroup internally callsgetBounds()
on each of the underlying layers, but GeodesicCircle doesn't have that method and an error gets thrown when that layer is reached.Polylines however do have the
getBounds()
method and I was able to temporarily resolve this issue by defining a new method on each instance of a GeodesicCircle: