koopjs / koop-socrata

Socrata provider for Koop.
Other
8 stars 7 forks source link

displayField should not be hard-coded to 'name' #1

Closed ajturner closed 9 years ago

ajturner commented 10 years ago

See this service that doesn't have a field called name. If there is no name, default to the first string?

{
"currentVersion": 10.21,
"id": 0,
"name": "psp3-bvzw",
"type": "Feature Layer",
"displayField": "name",
"description": "",
"copyrightText": "",
"defaultVisibility": true,
"relationships": [
...
chelm commented 10 years ago

Good catch

chelm commented 9 years ago

display field is set to ID now.

ajturner commented 9 years ago

Is it always set to ID? Or does it pick up a better string attribute?

chelm commented 9 years ago

Its always set to id ATM, but could grab the first string field. This would change at the koop/core level, not in the provider. Though I bet it'd be smart to be able to have a provider pass in a field to use too...

ajturner commented 9 years ago

Keep ID for now - this is really an app level setting anyways. It can be configured via popup template in the item metadata.