@@ -47,13 +47,13 @@ export var FeatureLayer = L.FeatureGroup.extend({
4747 this . _staticFeature = true ;
4848 this . isVisible = true ; //placeholder for when this actually gets updated in the future
4949 this . zoomBounds = M . getZoomBounds ( mapml , native . zoom ) ;
50- this . layerBounds = M . getLayerBounds ( mapml ) ;
50+ this . layerBounds = M . getBounds ( mapml ) ;
5151 L . extend ( this . options , this . zoomBounds ) ;
5252 }
5353 this . addData ( mapml , native . cs , native . zoom ) ;
5454 } else if ( ! mapml ) {
5555 this . isVisible = false ;
56- this . layerBounds = this . options . extent ;
56+ this . layerBounds = null ;
5757 this . zoomBounds = this . options . zoomBounds ;
5858 }
5959 } ,
@@ -273,6 +273,14 @@ export var FeatureLayer = L.FeatureGroup.extend({
273273 }
274274
275275 let layer = this . geometryToLayer ( mapml , options , nativeCS , + zoom , title ) ;
276+ let ext = mapml . extent ,
277+ xmin = ext . topLeft . pcrs . horizontal ,
278+ ymin = ext . bottomRight . pcrs . vertical ,
279+ xmax = ext . bottomRight . pcrs . horizontal ,
280+ ymax = ext . topLeft . pcrs . vertical ,
281+ bnd = L . bounds ( L . point ( xmin , ymin ) , L . point ( xmax , ymax ) ) ;
282+
283+ this . layerBounds = this . layerBounds ? this . layerBounds . extend ( bnd ) : bnd ;
276284 if ( layer ) {
277285 // if the layer is being used as a query handler output, it will have
278286 // a color option set. Otherwise, copy classes from the feature
0 commit comments