Hi all,
Hopefully in the right forum for this. Just downloaded the Android ArcGIS API last wekk, and been playing with it. One thing I'm trying to do but unsuccessful at the moment is get the map's spatial reference so I can set extents in degrees, no matter what spatial reference the base layer uses.
I put the code in the onStatusChanged method for both the map and layer (status=INITIALIZED) with the same result. Here's the piece of code I'm trying to make work:
SpatialReference mercatorWeb = SpatialReference.create(102100);
Point ll = (Point)GeometryEngine.project(new Point(-96.5,40.0), mercatorWeb, map.getSpatialReference());
Point ur = (Point)GeometryEngine.project(new Point(-95.5,41.0), mercatorWeb, map.getSpatialReference());
Envelope ext = new Envelope(ll.getX(), ll.getY(), ur.getX(), ur.getY());
map.setExtent(ext);
No matter what I try, the map.getSpatialReference returns null, even if the status is INITIALIZED. Same thing if I try a layer instead.
Any help on this much appreciated.