Hi,
I am trying to initialize a JMap with a spatial reference and extent (Valid EPSG code)
JMap jMap = new JMap(SpatialReference.create(32056), new Envelope(145027.3621, 124064.7350, 868193.2922, 1582086.7001));
I am able to launch everything perfectly and as an mpk (from ESRI sample) which gets projected correctly.
new ArcGISLocalDynamicMapServiceLayer(getPathSampleData() + "mpks/USCitiesStates.mpk");
I am able to perform various operations like Zoom and pan etc
Now I remove all layers and dispose the JMap (without close the application/jvm). Then try to do the same thing (like a projection on the fly). Since there is no setter method Spatial reference on JMap so I am creating the JMap again on click of a button and adding the mpk package as above.
The Map loads fine which correct extents. I am also able to see the map panning correctly in all directions but the zoom in and zoom out starts to fail with the following exception.
Requested an image but received content type text. Either the token used to access this server has expired or the parameters of this request are invalid.
at com.esri.core.internal.io.handler.a.a(Unknown Source)
at com.esri.core.internal.tasks.ags.j.a(Unknown Source)
at com.esri.core.internal.tasks.ags.j.execute(Unknown Source)
at com.esri.map.DynamicLayer$a.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
When I inspect the request I find that the image size if missing from the request parameter. Why is Zoom failing which pan is working fine !!!
Regards
Sachin