Select to view content in your preferred language

JavaScript replacing ArcObjects

2535
1
Jump to solution
08-22-2013 12:28 PM
LeoDonahue
Deactivated User
Can the JavaScript API be a complete replacement for the following ArcObjects classes?

com.esri.arcgis.carto.FeatureLayer;
com.esri.arcgis.carto.IFeatureLayer;
com.esri.arcgis.geodatabase.Feature;
com.esri.arcgis.geodatabase.IFeature;
com.esri.arcgis.geodatabase.IFeatureClass;
com.esri.arcgis.geodatabase.IFeatureCursor;
com.esri.arcgis.geodatabase.IQueryFilter;
com.esri.arcgis.geodatabase.ISpatialFilter;
com.esri.arcgis.geodatabase.QueryFilter;
com.esri.arcgis.geodatabase.SpatialFilter;
com.esri.arcgis.geometry.Polygon;

I'm faced with converting some ArcObjects projects in ArcGIS Server to either JavaScript or push the functionality into SOE's.  Just curious if JavaScript is mature enough for the things we would normally do using FeatureCursors and FeatureClasses with respect to accessing the attribute data.
0 Kudos
1 Solution

Accepted Solutions
JasonZou
Frequent Contributor
As to accessing the attributes, Javascript API should meet most of your needs. Check QueryTask, FeatureLayer.queryFeatures etc. Here are many query related samples available: https://developers.arcgis.com/en/javascript/jssamples/#search/query. One thing for sure, JS API can never completely reach the ability ArcObjects can. That's why SOE is needed sometime. But JS API is well designed to meet most of your online mapping needs.

As to your specific question, here are the counterpart classes I can think of to match the ability of the listed ArcObjects classes.

esri.layers.FeatureLayer:
com.esri.arcgis.carto.FeatureLayer;
com.esri.arcgis.carto.IFeatureLayer;

esri.Graphic:
com.esri.arcgis.geodatabase.Feature;
com.esri.arcgis.geodatabase.IFeature;

// no good match from JS API. But you should be able to accomplish most of the abilities by
// combining the power of
esri.Graphic, esri.layers.FeatureLayer, esri.layers.GraphicsLayer
com.esri.arcgis.geodatabase.IFeatureClass;

FeatureSet: object returned from the queryTask, featureLayer.queryFeatures, and featureLayer.selectFeatures.
com.esri.arcgis.geodatabase.IFeatureCursor;

esri.tasks.Query:
com.esri.arcgis.geodatabase.IQueryFilter;
com.esri.arcgis.geodatabase.ISpatialFilter;
com.esri.arcgis.geodatabase.QueryFilter;
com.esri.arcgis.geodatabase.SpatialFilter;

esri.geometry.Polygon:
com.esri.arcgis.geometry.Polygon;

View solution in original post

0 Kudos
1 Reply
JasonZou
Frequent Contributor
As to accessing the attributes, Javascript API should meet most of your needs. Check QueryTask, FeatureLayer.queryFeatures etc. Here are many query related samples available: https://developers.arcgis.com/en/javascript/jssamples/#search/query. One thing for sure, JS API can never completely reach the ability ArcObjects can. That's why SOE is needed sometime. But JS API is well designed to meet most of your online mapping needs.

As to your specific question, here are the counterpart classes I can think of to match the ability of the listed ArcObjects classes.

esri.layers.FeatureLayer:
com.esri.arcgis.carto.FeatureLayer;
com.esri.arcgis.carto.IFeatureLayer;

esri.Graphic:
com.esri.arcgis.geodatabase.Feature;
com.esri.arcgis.geodatabase.IFeature;

// no good match from JS API. But you should be able to accomplish most of the abilities by
// combining the power of
esri.Graphic, esri.layers.FeatureLayer, esri.layers.GraphicsLayer
com.esri.arcgis.geodatabase.IFeatureClass;

FeatureSet: object returned from the queryTask, featureLayer.queryFeatures, and featureLayer.selectFeatures.
com.esri.arcgis.geodatabase.IFeatureCursor;

esri.tasks.Query:
com.esri.arcgis.geodatabase.IQueryFilter;
com.esri.arcgis.geodatabase.ISpatialFilter;
com.esri.arcgis.geodatabase.QueryFilter;
com.esri.arcgis.geodatabase.SpatialFilter;

esri.geometry.Polygon:
com.esri.arcgis.geometry.Polygon;
0 Kudos