Robert, et al
On further testing (click on the 3rd button "city models") I see that there are duplicates in my object ids which are being used to create the countries layer. This causing my application to run slow. A look at the console.log of the featureCollection on line 300 rquery.run(function(error, featureCollection, response) will show what I mean
Is there a way to remove the duplicates (so there is only one objectid per country) before the layer is added to my map?
Spec attached
Thanks for the suggestions Ken.
But my question is for a specific case.
The problem is here: rquery.objectIds();... This creates an
array of opjectIds with dupes.
I am trying to remove the dupes before I pass the array to :
countries = L.geoJson(featureCollection).addTo(map);
The above examples could be tweaked a little for that.
var unique = {};
var distinctFeatures = featuresCollection.features.filter(function(feature) {
var oid = feature.properties.OBJECTID;
if (!unique[oid]) {
unique[oid] = oid;
return true;
}
return false;
});
featureCollection.features = distinctFeatures;
That's a quick and dirty way of doing it based on the example Ken provided.
Thanks Rene!!
I work with this and let you know if I still problems
Chris