Exception Map is not in a ready state

3358
6
Jump to solution
11-06-2014 11:04 AM
IvanZazueta
New Contributor

How know state of Map?

0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor

The editor can't be activated while the map view spatial reference has not been established.

To know that, you can either subscribe to MapView.SpatialReferenceeChanged event, or wait for all layers to load by using MapView.LayersLoadedAsync:

await MyMapView.LayersLoadedAsync();

View solution in original post

0 Kudos
6 Replies
IvanZazueta
New Contributor

Image.png

0 Kudos
DominiqueBroux
Esri Frequent Contributor

The editor can't be activated while the map view spatial reference has not been established.

To know that, you can either subscribe to MapView.SpatialReferenceeChanged event, or wait for all layers to load by using MapView.LayersLoadedAsync:

await MyMapView.LayersLoadedAsync();

0 Kudos
IvanZazueta
New Contributor

thanks for replying, the code I show is the example of Area and Perimeter, sometimes it works and sometimes not, use mapView1.LayersLoadedAsync await() and also sometimes works and sometimes does not, any answer thanks in advance.

2014-11-07_103026.png

0 Kudos
dotMorten_esri
Esri Frequent Contributor

Due to the async loading of the map view, use the spatial reference changed event, rather than waiting for the layers loaded as suggested by Dominique. This is more reliable since the spatial reference might or might not have been established when the layers loaded, depending on the network traffic and timings.

IvanZazueta
New Contributor

Thanks and you can fix it, one more question, as I can save the drawn polygon, then when you look at the polygon information is loaded.

Thank you again.

0 Kudos
KatherineDalton
Esri Regular Contributor

Thanks Ivan. We've updated the sample accordingly.


Katy

Katy Dalton | Technical Consultant
THE SCIENCE OF WHERE™
0 Kudos