Skip to content

GeoJSON features identifier and structured properties are losts #7464

Description

@noirbizarre

mapbox-gl-js version: 0.50.0

browser: Any

Steps to Trigger Behavior

  1. Load any GeoJSON with string id on features and Array or Object as properties
  2. Catch any mouse event with a features property or use any query*Features helper
  3. Look at the missing id and the stringified properties on features

Link to Demonstration

https://jsfiddle.net/dcwp7xu4/1/

Expected Behavior

The feature string id is present on the feature object and properties are restitued as provided (same type, same content) by the source GeoJSON (and as specified in the GeoJSON specifications)

Actual Behavior

  • String identifier (id) is missing on the features
  • Arrays and objects are stringified

Related issues

It seems to be a recurring issue on different levels:

Most of them didn't had advancement for months or years.
There is even a merged pull request hardening this behavior #7106 (String identifier is a really common use case so why force number ID instead of ensuring string are properly handled)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions