koop
koop copied to clipboard
How to map provided data properties to GeoServices feature.id
I'm trying to expose a GeoJSON FeatureCollection using the GeoServices output with Koop. The Model implementation sets an 'id' on the resulting feature using a property pulled from the source of the data, but when querying the FeatureServer the 'id' of each feature is not present in the results. I can't find any place inside FeatureServer's source where an 'id' field is actually written out during query results processing. Is this a missing feature? I'm trying to visualize the data using an L.esri.FeatureLayer on a Leaflet map and it apparently needs ids to be on each feature in order to track and maintain them.
hello! i'm pretty sure i can reproduce the behavior you describe by setting isModern: true
in my own constructor.
http://jsbin.com/jucepul/1/edit?html,output
are you seeing appropriate behavior in Esri Leaflet when you request f=json
from the service instead of f=geojson
?
I can force GeoJSON with isModern:true
but the underlying FeatureManager class inside esri-leaflet still uses feature.id
to track features being added. I noticed in your example your features did not provide an "id" at the feature level, but still manage to all render inside the Leaflet map. Unsure why that is at this point. Further digging required.
If anyone can shed light on mapping the data provider's id to the outgoing GeoServices feature id, that would be most excellent.
@pn-im you can set geojson.metadata.idField