openlayers 3 - Adding feature with duplicate ID to Vector source -
right now, if add 2 features same id vector source, seems second 1 discarded. there anyway force openlayers replace features existing ids?
i don't think built in, best option:
var features=layer.getsource().getfeatures(); for(var i=0;i<features.length;i++){ if(features[i].get('id')==id){ layer.getsource().removefeature(features[i]); break; } } }
Comments
Post a Comment