-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] Add interface to add images to the style #6375
Conversation
@tmpsantos, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @1ec5 and @incanus to be potential reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to mapbox/mapbox-gl-style-spec#220.
Based on the discussion there, we want to use "image" as an umbrella term that encompasses "icons" (e.g. icon-image
) and "patterns" (e.g. background-pattern
). Want to start with that naming convention here?
@@ -161,6 +161,10 @@ class Map : private util::noncopyable { | |||
void addLayer(std::unique_ptr<style::Layer>, const optional<std::string>& beforeLayerID = {}); | |||
void removeLayer(const std::string& layerID); | |||
|
|||
// Add icon, bound to the style | |||
void addIcon(const std::string&, std::shared_ptr<const SpriteImage>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be std::unique_ptr
for consistency with addLayer
and addSource
.
b0c56dd
to
807be46
Compare
@jfirebaugh Thanks for reviewing. Changes made.
Makes sense. |
Unlike annotations, they will go away when we change the style.
807be46
to
4d3356d
Compare
Unlike annotations, they will go away when we change the style. This API can also be used to change a sprite downloaded by a style at runtime.