eddof13

AGSGeometryEngine normalizeCentralMeridianOfGeometry does not work with cached layer

Discussion created by eddof13 on Sep 26, 2011
Latest reply on Sep 27, 2011 by eddof13
Example usage of this is in the FeatureLayerEditing sample and the OnlineOfflineEditing sample:

I noticed today that after caching a layer (and then loading it from JSON), I was getting null geometries when calling AGSGeometryEngine's normalizeCentralMeridianOfGeometry on anything.

For example (taken from FeatureLayerEditingSample):
popup.graphic.geometry = [[AGSGeometryEngine defaultGeometryEngine]simplifyGeometry:popup.graphic.geometry];
popup.graphic.geometry = [[AGSGeometryEngine defaultGeometryEngine]normalizeCentralMeridianOfGeometry:popup.graphic.geometry];


This code works fine when online, but when loading from JSON, the second line gets null geometry.
I got around it by just taking out the second line, but if anyone knows what is causing it I'd appreciate it.

Here's the json representation of popup.graphic.geometry while it is online:
{"x":-8936932.302947983,"y":4691798.109359831,"spatialReference":{"wkid":102100}}


Here's the json representation of popup.graphic.geometry after it is cached:
{"x":562370.4708862299,"y":4293844.423522947,"spatialReference":{"wkt":"PROJCS[\"NAD_1983_UTM_Zone_17N\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",500000.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-81.0],PARAMETER[\"Scale_Factor\",0.9996],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0],AUTHORITY[\"EPSG\",26917]]","wkid":26917}}


I also would like to know why the json representation changes so drastically when loaded offline?

Outcomes