[core, node, darwin, android, qt] Make image ID part of Image

More like Source and Layer.
This commit is contained in:
John Firebaugh
2017-05-15 14:09:06 -07:00
parent c0f6e5ccef
commit cc1ea759a6
41 changed files with 176 additions and 185 deletions

View File

@@ -148,7 +148,7 @@ public:
LatLng latLngForPixel(const ScreenCoordinate&) const;
// Annotations
void addAnnotationImage(const std::string&, std::unique_ptr<style::Image>);
void addAnnotationImage(std::unique_ptr<style::Image>);
void removeAnnotationImage(const std::string&);
double getTopOffsetPixelsForAnnotationImage(const std::string&);
@@ -169,7 +169,7 @@ public:
std::unique_ptr<style::Layer> removeLayer(const std::string& layerID);
// Images
void addImage(const std::string&, std::unique_ptr<style::Image>);
void addImage(std::unique_ptr<style::Image>);
void removeImage(const std::string&);
const style::Image* getImage(const std::string&);

View File

@@ -3,12 +3,16 @@
#include <mbgl/util/image.hpp>
#include <mbgl/util/immutable.hpp>
#include <string>
namespace mbgl {
namespace style {
class Image {
public:
Image(PremultipliedImage&&, float pixelRatio, bool sdf = false);
Image(std::string id, PremultipliedImage&&, float pixelRatio, bool sdf = false);
std::string getID() const;
const PremultipliedImage& getImage() const;