Hi, I have a client side only feature layer that I add graphics to based on external data. When I use mapView.goTo(featureLayer.source) it properly changes the zoom and panning to bring all graphics into view. However it does not take into account the sizing of the graphics themselves so while the points are all view some graphics will be cut off out of full view.
Is there a way to goTo a collection of graphics but give it a buffer so that it goes out far enough to ensure the graphics are fully in view? I can determine the buffer myself but cant find in the documentation how to do this.
Thanks
Solved! Go to Solution.
Jason,
That may have to be a side effect you have to deal with for now. In the 3.x API there was a graphicsUtils class that allowed to to get the extent of the of a FeatureLayers graphics (and thus handled the clientside FL not having a fullextent), but it has not been added to 4.x yet.
What I don't understand is that the calculations have to be in the sdk somewhere because goTo figures it out and scales/pans to it correct?
Correct it is probably some private internal function of the view or the FeatureLayer.
Jason,
Have you tried to get the extent of the featureLayer and then expanding/buffer the geometry by a factor. That way your target geometry will always be bigger then the featureLayer.
-Thejus
I don't see how that works. its a custom empty feature layer added on the fly. when I check the fullextent property of the feature layer its null