Prevents mutation of a provider's metadata object. Before this, if a metadata.idField had not been set, it was added by winnow and set to OBJECTID. This caused some issues with checking to see if a provider had or had not set the metadata.idField for certain code executions.
If an idField has been set in the provider, use a feature's value for this property as the OBJECTID. Then delete the idField property from the feature's attributes - this prevents sending the same data on two attributes (the idField and the OBJECTID)
If an idField has NOT been set in the provider, create an integer hash from the stringified feature and use that as the OBJECTID.
If an idField has been set in the provider and is thus used as an OBJECTID, incoming queries that request OBJECTID as one of the outFields need to be remapped to the idField so that a proper SELECT can occur.
This PR contains following changes:
Prevents mutation of a provider's metadata object. Before this, if a
metadata.idField
had not been set, it was added by winnow and set to OBJECTID. This caused some issues with checking to see if a provider had or had not set themetadata.idField
for certain code executions.If an
idField
has been set in the provider, use a feature's value for this property as the OBJECTID. Then delete theidField
property from the feature's attributes - this prevents sending the same data on two attributes (the idField and the OBJECTID)If an
idField
has NOT been set in the provider, create an integer hash from the stringified feature and use that as the OBJECTID.If an
idField
has been set in the provider and is thus used as an OBJECTID, incoming queries that request OBJECTID as one of theoutFields
need to be remapped to theidField
so that a properSELECT
can occur.