Zoom to layer issue using appStudio QT

1969
12
Jump to solution
01-27-2021 04:09 AM
EricAtkinson1
New Contributor III

Hi all,

I'm having issues with zoom to feature code. I am using the code in the sample "Listed Related features" but doesn't seem to work and the confusing part is that there are no errors displaying. 

mapView.setViewpointGeometryAndPadding(feature.geometry, 30);

Is this correct or does anyone know of another way I can zoom to feature while clicking on a feature on the map?

Thanks all 

0 Kudos
12 Replies
JaredCaccamo
Esri Contributor

Hello @EricAtkinson1 ,

 

Could you possibly zip up a reproducible project?(preferably simplified to the the function in question  MapView.setViewpointGeometryAndPadding and the minimum supporting code to reproduce the problem). Also could you possibly try the latest version of the SDK to see if this is still a problem at the current release? You can also utilize the sample data above that I used if providing your data is not an option.

0 Kudos
EricAtkinson1
New Contributor III

Hey Jared,

I've been really trying to solve this myself but no deal. I have attached a zip file with my partial code (where i believe the issue is) in with your original code. All my other features are working including searching address and it zooms to that location. I have attached a screenshot of my app for understanding of what I am trying to achieve (zoom into in feature on selecting).

 Everything else works just for some reason the zoom to feature.

Cheers,

 

Eric 

0 Kudos
EricAtkinson1
New Contributor III

I figured it out. Thanks for all your help 👍

mapView.setViewpointCenterAndScale(feature.geometry, 1000);

 

0 Kudos