Hi all,
I'm creating a widget and want it to zoom to a particular lat/lon. All functionality of the widgit works great except the zoom. It will pan to the point but not zoom in no matter what zoom level I put. There are no zoom restrictions on the map itself, whatever zoom level the map is in, it stays at and pans to the point. I've tried several different ways to do this, here is my latest relevant code. Here mapViewRef refers to a JimuMapView instance.
```
Solved! Go to Solution.
Is it possible your basemap does not have defined LODs (zoom levels)? What happens if you replace the zoom property with the scale property?
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#GoToTarget2D
Okay, solved my own problem....
Instead of setting mapViewRef.current.view.zoom = 14; I used mapViewRef.current.view.scale = 1000; and it now zooms to the point.
Thanks, but didn't help, still panning not zooming.
Hello
How can I get the entered text value with searchWidget?
Have you tried re-ordering your functions? See what happens if you call goTo() after the add().
Hello
How can I get the entered text value with searchWidget?
Your question is vague and not an answer to this post, please start a new thread with your question.
Hi,
Yes, I also recently tried "goTo" THEN zoom but it STILL won't zoom:
`
Is it possible your basemap does not have defined LODs (zoom levels)? What happens if you replace the zoom property with the scale property?
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#GoToTarget2D
Oh, wow, I actually did that and it worked, but I didn't see this post until after! Thanks!