How to center the map depending on graphics on it ?it means that all graphics on map, (markers, plygons and polylines) must be shown
Mohamed EzzerI
What I would do, if working with only one layer, is use the getFullExtent() method on that layer and then use mapView.setExtent to then set the extent that I would like to zoom to. This of course would all have to occur after the layer is fully initialized.
Layer.GetFullExtent()
Layer | ArcGIS Android 10.2.8 API
MapView.SetExtent()
MapView | ArcGIS Android 10.2.8 API
I hope this helps!
It didn't work, it's focus to the center of the map
Le 4 août 2016 13:05, "Alexander Nohe" <geonet@esri.com> a écrit :
GeoNet <https://community.esri.com/?et=watches.email.thread>How to center the map depending on graphics on it ?reply from Alexander Nohe<https://community.esri.com/people/ANohe-esristaff?et=watches.email.thread>in ArcGIS Runtime SDK for Android - View the full discussion<https://community.esri.com/message/625776?et=watches.email.thread#comment-625776>
GeoNet <https://community.esri.com/?et=watches.email.thread>
How to center the map depending on graphics on it ?
reply from Alexander Nohe
<https://community.esri.com/people/ANohe-esristaff?et=watches.email.thread>
in ArcGIS Runtime SDK for Android - View the full discussion
<https://community.esri.com/message/625776?et=watches.email.thread#comment-625776>
Are you waiting for the map to be fully initialized?
mapView.setOnStatusChangedListener(new OnStatusChangedListener() { @Override public void onStatusChanged(Object o, STATUS status) { if (status == STATUS.INITIALIZED) { //Do Something } } });
Additionally, are you placing your coordinates in web mercator projection?
Thx for the feedback, i dont understand what do you mean by mercator
projection, but i can tell you that i m placing my coordinates using
mvHelper.addMarkerGraphic and mvHelper.addPolygonGraphic
Le 5 août 2016 14:25, "Alexander Nohe" <geonet@esri.com> a écrit :
GeoNet <https://community.esri.com/?et=watches.email.thread>How to center the map depending on graphics on it ?reply from Alexander Nohe<https://community.esri.com/people/ANohe-esristaff?et=watches.email.thread>in ArcGIS Runtime SDK for Android - View the full discussion<https://community.esri.com/message/626204?et=watches.email.thread#comment-626204>
<https://community.esri.com/message/626204?et=watches.email.thread#comment-626204>
This should explain projections:
Spatial references—ArcGIS Runtime SDK for Android | ArcGIS for Developers
Mapping Projections Explained
Additionally, what code are you using to zoom to the extent? It is possible that if you are zooming to -38, 71, that you will be zoomed into the center of the map because the map projections unit of measurement would then be in meters, not decimal degrees as you may expect.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.