summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-02-11 13:56:16 -0800
committerKonstantin Käfer <mail@kkaefer.com>2015-03-06 15:42:34 +0100
commite00bae4f1c9fed201dd01f641f7849d4178e0e7c (patch)
tree1b5b5c14317ffda3f302c539729f0c5b0b7fc122 /src
parentcf235c65926d72d00d2eb1a6ace9f9ab2d701a5c (diff)
downloadqtlocation-mapboxgl-e00bae4f1c9fed201dd01f641f7849d4178e0e7c.tar.gz
lock the StyleBucket to avoid crashing
stopgap until we have a solution that doesn't mutate the style objects while parsing a tile
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/map.cpp4
-rw-r--r--src/mbgl/map/vector_tile_data.cpp1
-rw-r--r--src/mbgl/style/style_bucket.hpp8
-rw-r--r--src/mbgl/style/style_parser.cpp2
4 files changed, 10 insertions, 5 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 73e188848f..518bc5bb96 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -416,6 +416,10 @@ void Map::setLatLng(LatLng latLng, std::chrono::steady_clock::duration duration)
update();
}
+LatLng Map::getLatLng() const {
+ return state.getLatLng();
+}
+
void Map::startPanning() {
transform.startPanning();
update();
diff --git a/src/mbgl/map/vector_tile_data.cpp b/src/mbgl/map/vector_tile_data.cpp
index 40fc7badf0..68974aadf4 100644
--- a/src/mbgl/map/vector_tile_data.cpp
+++ b/src/mbgl/map/vector_tile_data.cpp
@@ -4,6 +4,7 @@
#include <mbgl/map/map.hpp>
#include <mbgl/style/style_layer.hpp>
#include <mbgl/style/style_bucket.hpp>
+#include <mbgl/style/style_source.hpp>
#include <mbgl/geometry/glyph_atlas.hpp>
#include <mbgl/platform/log.hpp>
diff --git a/src/mbgl/style/style_bucket.hpp b/src/mbgl/style/style_bucket.hpp
index 17924490be..b79b324b0c 100644
--- a/src/mbgl/style/style_bucket.hpp
+++ b/src/mbgl/style/style_bucket.hpp
@@ -1,23 +1,23 @@
#ifndef MBGL_STYLE_STYLE_BUCKET
#define MBGL_STYLE_STYLE_BUCKET
-#include <mbgl/style/types.hpp>
#include <mbgl/style/filter_expression.hpp>
-#include <mbgl/style/style_source.hpp>
#include <mbgl/style/class_properties.hpp>
-#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/ptr.hpp>
+#include <mbgl/util/noncopyable.hpp>
+#include <mbgl/util/uv.hpp>
namespace mbgl {
-class Source;
+class StyleSource;
class StyleBucket : public util::noncopyable {
public:
typedef util::ptr<StyleBucket> Ptr;
inline StyleBucket(StyleLayerType type_) : type(type_) {}
+
const StyleLayerType type;
std::string name;
util::ptr<StyleSource> style_source;
diff --git a/src/mbgl/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp
index 4745cf2833..930f46d30d 100644
--- a/src/mbgl/style/style_parser.cpp
+++ b/src/mbgl/style/style_parser.cpp
@@ -4,6 +4,7 @@
#include <mbgl/util/constants.hpp>
#include <mbgl/util/std.hpp>
#include <mbgl/util/vec.hpp>
+#include <mbgl/util/uv_detail.hpp>
#include <mbgl/platform/log.hpp>
#include <csscolorparser/csscolorparser.hpp>
@@ -319,7 +320,6 @@ template <> inline float defaultBaseValue<Color>() { return 1.0; }
template <typename T>
std::tuple<bool, Function<T>> StyleParser::parseFunction(JSVal value, const char *property_name) {
-
if (!value.IsObject()) {
return std::tuple<bool, Function<T>> { true, ConstantFunction<T>(std::get<1>(parseProperty<T>(value, property_name))) };
}