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

[core] Add interface to add images to the style #6375

Merged
merged 2 commits into from
Sep 22, 2016
Merged

Conversation

tmpsantos
Copy link
Contributor

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.

@mention-bot
Copy link

@tmpsantos, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @1ec5 and @incanus to be potential reviewers.

@tmpsantos tmpsantos added the Core The cross-platform C++ core, aka mbgl label Sep 19, 2016
Copy link
Contributor

@jfirebaugh jfirebaugh left a 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>);
Copy link
Contributor

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.

@tmpsantos
Copy link
Contributor Author

@jfirebaugh Thanks for reviewing. Changes made.

Want to start with that naming convention here?

Makes sense.

@brunoabinader brunoabinader changed the title [core] Add interface to add sprites to the style [core] Add interface to add images to the style Sep 22, 2016
@tmpsantos tmpsantos merged commit 4d3356d into master Sep 22, 2016
@tmpsantos tmpsantos deleted the tmpsantos-add_icon branch September 22, 2016 20:48
@1ec5
Copy link
Contributor

1ec5 commented Sep 22, 2016

Tracking iOS/macOS support for style image management in #6436. #6434 covers Qt.

/cc @zugaldia

@zugaldia
Copy link
Member

@1ec5 Thanks for the heads up. Android's work in now tracked in #6459.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants