summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-03-06 14:22:11 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-03-18 01:26:22 +0200
commit4909169996b333bdb004508544d4b97da1c45412 (patch)
tree9e03d3e63f03015307c878dbfdb26de53532d056 /include
parent94de5d7f4afdee7391b93e562438feff48b30add (diff)
downloadqtlocation-mapboxgl-4909169996b333bdb004508544d4b97da1c45412.tar.gz
[core] Added user-defined transition properties when modifying classes
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/map.hpp8
-rw-r--r--include/mbgl/style/property_transition.hpp20
2 files changed, 25 insertions, 3 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 3db516123d..6edc7f6d2c 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -11,6 +11,7 @@
#include <mbgl/util/vec.hpp>
#include <mbgl/annotation/annotation.hpp>
#include <mbgl/style/types.hpp>
+#include <mbgl/style/property_transition.hpp>
#include <cstdint>
#include <string>
@@ -64,10 +65,11 @@ public:
void update(Update update);
// Styling
- void addClass(const std::string&);
- void removeClass(const std::string&);
+ void addClass(const std::string&, const PropertyTransition& = {});
+ void removeClass(const std::string&, const PropertyTransition& = {});
+ void setClasses(const std::vector<std::string>&, const PropertyTransition& = {});
+
bool hasClass(const std::string&) const;
- void setClasses(const std::vector<std::string>&);
std::vector<std::string> getClasses() const;
void setDefaultFadeDuration(const Duration&);
diff --git a/include/mbgl/style/property_transition.hpp b/include/mbgl/style/property_transition.hpp
new file mode 100644
index 0000000000..fa837f11a3
--- /dev/null
+++ b/include/mbgl/style/property_transition.hpp
@@ -0,0 +1,20 @@
+#ifndef MBGL_STYLE_PROPERTY_TRANSITION
+#define MBGL_STYLE_PROPERTY_TRANSITION
+
+#include <mbgl/util/chrono.hpp>
+#include <mbgl/util/optional.hpp>
+
+namespace mbgl {
+
+class PropertyTransition {
+public:
+ PropertyTransition(const optional<Duration>& duration_ = {}, const optional<Duration>& delay_ = {})
+ : duration(duration_), delay(delay_) {}
+
+ optional<Duration> duration;
+ optional<Duration> delay;
+};
+
+} // namespace mbgl
+
+#endif // MBGL_STYLE_PROPERTY_TRANSITION