Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocationField: use Pelias' "label" attribute for addresses #347

Open
fpurcell opened this issue Feb 9, 2022 · 1 comment
Open

LocationField: use Pelias' "label" attribute for addresses #347

fpurcell opened this issue Feb 9, 2022 · 1 comment
Assignees

Comments

@fpurcell
Copy link
Member

fpurcell commented Feb 9, 2022

The OTP-UI LocationField is building strings based on name, city, state, etc...
Screen Shot 2022-02-09 at 1 29 18 PM

We want not to do this in our apps. So need a method for controlling how Pelias records are rendered (e.g., for TriMet, always simply use the "label" attribute from Pelias' results).

For a regional app, we don't need to see state and zipcode in the geocoder results. Thus, we (TriMet's instance of Pelias) do things to clean and shorten address and other data. The geocode record's result string we want to see used is represented in the "label" attribute for all our Pelias records. Ala, this result from Pelias:
Screen Shot 2022-02-09 at 1 40 05 PM

@fpurcell fpurcell self-assigned this Feb 9, 2022
@miles-grant-ibigroup
Copy link
Collaborator

This will be the relevant line. Apologies for not making this a breaking change! I think a fix could either be supporting a custom layerDisplayMap or a new prop that just disables generateLabel altogether.

const { main, secondary } = generateLabel(feature.properties);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants