ILayer/IFeatureLayer to JSON

815
5
Jump to solution
05-01-2012 04:38 PM
JamesVillanueva
New Contributor III
Is there a way of converting ILayer or IFeatuureLayer to JSON? The reason I ask is I do not always want to publish these as services and it would be nice to pass all features, attributes, and symbologies to the client.
0 Kudos
1 Solution

Accepted Solutions
nicogis
MVP Frequent Contributor
0 Kudos
5 Replies
DubravkoAntonic
New Contributor III
Yes you can user REST service in ArcGis Server, but if you ask for Desktop evironment I don't know for that kind of object, and more of it I'm not sure why would use that.
Simple ILayer and IFeaturelayer converter to JSonLayer is done in one day.

Regards Dubravko
0 Kudos
nicogis
MVP Frequent Contributor
0 Kudos
JamesVillanueva
New Contributor III
Nico that worked great for featureclasses. Can something similar be done for renderers as well? Thanks.
0 Kudos
nicogis
MVP Frequent Contributor
I discover: in 10.1 you have available ESRI.ArcGIS.Geodatabase.IJSONConverterGdb (class JSONConverterGdb ) where you have available read and write recorset and query domain.
http://resourcesbeta.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//002500000nqz000000

for renderer do you mean renderer objects (chaption 15) geospecification esri? http://www.esri.com/library/whitepapers/pdfs/geoservices-rest-spec.pdf if yes I think that you must use IJSONWriter and read single properties of object render and serialze with IJSONWriter http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004200000108000000
0 Kudos
JamesVillanueva
New Contributor III
Thanks again. This is exactly what I needed to know.
0 Kudos