How to Get Geometry Type of a Feature Layer

4398
2
11-20-2013 07:11 PM
Nadeera_RukshanMemmenda_Arachc
New Contributor
Hi,

I created a feature layer and tried to get the geometry type of that layer. But this doesn't work. I need this to define a selection symbol depending on the geometry type.

featureLayer = new esri.layers.FeatureLayer(layerListArray[0], layerOptions);

featureLayer.geometryType; (This doesn't work)

featureLayer.setSelectionSymbol(markerSymbol);
map.addLayer(featureLayer);


Need a help...
0 Kudos
2 Replies
ManojrajTeli
Occasional Contributor II
Hi,

Actually
FeatureLayer.geometryType 
should work but if that doesn't work also then when the layer get added to map you can get geometry type of feature layer .Suppose the feature layer Id is Layer1 then use this
map._layers["Layer1"].geometryType
.

Thanks
Manojraj
Nadeera_RukshanMemmenda_Arachc
New Contributor
Thanks for the reply. Now I understood that, map should be fully loaded to get the geometry type of a layer. So, when i call FeatureLayer.geometryType inside layer-add-result event. it works fine.
0 Kudos