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

Fix identity functions for 'text-field' (i.e. 'formatted' type) #7351

Merged
merged 1 commit into from
Oct 1, 2018

Conversation

ChrisLoer
Copy link
Contributor

@ChrisLoer ChrisLoer commented Oct 1, 2018

Fixes issue #7311.

An identity function for the text-field property would return nothing because the type of the input wouldn't match the 'formatted' type expected for that property.

This PR restores previous behavior by using the Formatted.fromString function.

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page
  • tagged @mapbox/studio and/or @mapbox/maps-design if this PR includes style spec changes

cc @jplante @ryanhamley @mollymerp

@ChrisLoer ChrisLoer requested a review from ryanhamley October 1, 2018 21:53
Copy link
Contributor

@ryanhamley ryanhamley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@ChrisLoer
Copy link
Contributor Author

For posterity, my manual test was just to add this:

    map.addLayer({
        "id": "points",
        "type": "symbol",
        "source": "points",
        "layout": {
            "text-field": { "property": "name", "type": "identity" },
            "text-font": ["Open Sans Semibold", "Arial Unicode MS Bold"]
        }
    });

@ChrisLoer ChrisLoer merged commit 53cf0d6 into master Oct 1, 2018
@ChrisLoer ChrisLoer deleted the format-identity branch October 1, 2018 23:11
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

Successfully merging this pull request may close these issues.

2 participants