Filtering Layers From KML

3259
1
05-02-2015 03:51 AM
CharlesGant
New Contributor III

I have looked but couldn't find anything.  Is it possible to plot only specific layers of a KML.  Specifically, I want to plot all polygons, but no placemarks.

1 Reply
OwenEarley
Occasional Contributor III

I haven't tried this but you could loop through the featureInfos array and only process the Polygon type.

var kmlLayer = new KMLLayer( ... );
  var featureInfos = kmlLayer.folders[0].featureInfos;
  array.forEach(featureInfos,function(info){
    // Test if info.type == Polygon   
    // if it is a polygon do something with the feature - like add it to a graphics layer
  });