Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Add features initializer to MGLGeoJSONSource #6524

Merged
merged 2 commits into from
Oct 14, 2016

Commits on Oct 14, 2016

  1. [ios, macos] Add feature initializer

    This adds a features initializer to MGLGeoJSONSource. The initializer
    takes shapes and converts them to JSON representation before passing
    to core. This also adds methods to the MGLShape concrete subclasses
    so that they can represent themselves in NSDictionary form suitable
    for transforming to JSON (GeoJSON).
    ituaijagbone authored and boundsj committed Oct 14, 2016
    Configuration menu
    Copy the full SHA
    9e6acdc View commit details
    Browse the repository at this point in the history
  2. [ios, macos] Teach features and shapes about GeoJSON and mbgl types

    MGLShape subclasses can now return NSDictionaries that represent the shapes' GeoJSON geometries. MGLFeature classes can now return NSDictionaries that represent the features as GeoJSON features. This makes it trivial to serialize iOS and macOS shapes and features into GeoJSON.
    
    MGLFeature instances can also return a representation of themselves as an mbgl::Feature. This capability is used in a refactoring of the implementations of MGLGeoJSONSource to more efficiently transform MGLFeatures into mbgl::Features so they can be fed directly into mbgl::GeoJSONSource without having to round trip through NSJSONSerialization. The MGLFeature identifier is converted into the mbgl::identifier type based on the type of the identifier. The MGLFeature attributes are recursively converted into an mbgl::PropertyMap and each value is converted into one of the types that the PropertyMap's Value variant supports.
    boundsj committed Oct 14, 2016
    Configuration menu
    Copy the full SHA
    6ffe51b View commit details
    Browse the repository at this point in the history