diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-11-12 14:58:13 -0800 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-11-12 14:58:13 -0800 |
commit | f2bc00267cd6430f85763beeb03b98109ff7b023 (patch) | |
tree | c589e1f6cc0759d5806af3b01a5c4d3773232deb /include/mbgl/style/sources/geojson_source.hpp | |
parent | 9f3cc7b7075b29595dec394733b10fbd26f274e4 (diff) | |
download | qtlocation-mapboxgl-upstream/feature-state-changesets.tar.gz |
Prototype ChangeSets based approach to feature state.upstream/feature-state-changesets
- A change set keeps track of all feature state changes for a source between two render.
- The change set is applied to the TilePyramid to update the full feature state map, and generate the map of update features for the single frame.
The Front end renderer may throttle updates. This results in some changesets not making it to the renderer, and data in that set being dropped entirely.
To workaround this the front end renderers would need to accumulate the changes, or some other way to collect all change sets between throttled frames.
Diffstat (limited to 'include/mbgl/style/sources/geojson_source.hpp')
-rw-r--r-- | include/mbgl/style/sources/geojson_source.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp index a03b910279..803588ac7e 100644 --- a/include/mbgl/style/sources/geojson_source.hpp +++ b/include/mbgl/style/sources/geojson_source.hpp @@ -2,8 +2,10 @@ #include <mbgl/style/source.hpp> #include <mbgl/util/geojson.hpp> +#include <mbgl/util/feature_state.hpp> #include <mbgl/util/optional.hpp> #include <mbgl/util/constants.hpp> +#include <mbgl/util/immutable.hpp> namespace mbgl { @@ -33,6 +35,7 @@ public: void setURL(const std::string& url); void setGeoJSON(const GeoJSON&); + void setFeatureState(const FeatureIdentifier&, const std::string&, const mbgl::Value&); optional<std::string> getURL() const; @@ -41,9 +44,11 @@ public: void loadDescription(FileSource&) final; + Immutable<std::vector<FeatureStateChange>> collectFeatureStates(); private: optional<std::string> url; std::unique_ptr<AsyncRequest> req; + Mutable<std::vector<FeatureStateChange>> stateChanges; }; template <> |