Select to view content in your preferred language

Change map spatial reference, map not showing

567
1
02-17-2023 12:12 PM
novruzjaf
Emerging Contributor

Hi, I use ArcGIS Runtime SDK 100 for android. I create polygon objects on the map and log the geometry points, the points are correct. But I started sketcher editor and edited the geometry. The geometry coordinates are UTM coordinates and not correct coordinates. I use SpatialReference.getWGS84 for spatial reference and coordinates set lat, long. I tried setting Spatial reference for the map, but the maps not working spatial reference WGS84. Please help me. Thanks

0 Kudos
1 Reply
Shubham_Sharma
Esri Contributor

The edited geometry from "SketchEditor.getGeometry()" has the same spatial reference as the map used in the MapView. To set your map to WGS84: 

ArcGISMap map = new ArcGISMap(SpatialReferences.getWgs84());
map.setBasemap(new Basemap(BasemapStyle.ARCGIS_DARK_GRAY));

 

To convert the spatial reference of geometry to match the spatial reference of the MapView, 

Geometry projectedGeometry = GeometryEngine.project(geometry, mapView.getSpatialReference());

 

Check out the Sketch editorSet map spatial reference, and GeometryEngine.Project

0 Kudos