summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2016-03-29 15:30:31 -0700
committerAnsis Brammanis <brammanis@gmail.com>2016-03-30 13:13:53 -0700
commit387f37d035d08a1832ad693e8d9401d7f29857bd (patch)
treebe5ea66bb7d8d0f5403d733382616bcb7c4adb4d /src
parentff7cdb1ba5c93f51901dcab940ee42d863606f35 (diff)
downloadqtlocation-mapboxgl-387f37d035d08a1832ad693e8d9401d7f29857bd.tar.gz
[core] increase geojson buffer size to match -js
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/annotation/shape_annotation_impl.cpp3
-rw-r--r--src/mbgl/style/style_parser.cpp8
-rw-r--r--src/mbgl/tile/geometry_tile.hpp3
3 files changed, 10 insertions, 4 deletions
diff --git a/src/mbgl/annotation/shape_annotation_impl.cpp b/src/mbgl/annotation/shape_annotation_impl.cpp
index 9adebf177b..c333492810 100644
--- a/src/mbgl/annotation/shape_annotation_impl.cpp
+++ b/src/mbgl/annotation/shape_annotation_impl.cpp
@@ -108,7 +108,8 @@ void ShapeAnnotationImpl::updateTile(const TileID& tileID, AnnotationTile& tile)
mapbox::geojsonvt::Options options;
options.maxZoom = maxZoom;
- options.buffer = 128u;
+ options.buffer = 255u;
+ options.extent = util::EXTENT;
options.tolerance = baseTolerance;
shapeTiler = std::make_unique<mapbox::geojsonvt::GeoJSONVT>(features, options);
}
diff --git a/src/mbgl/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp
index ca0fe94056..be26af56ad 100644
--- a/src/mbgl/style/style_parser.cpp
+++ b/src/mbgl/style/style_parser.cpp
@@ -245,13 +245,17 @@ void StyleParser::parseSources(const JSValue& value) {
std::unique_ptr<mapbox::geojsonvt::GeoJSONVT> StyleParser::parseGeoJSON(const JSValue& value) {
using namespace mapbox::geojsonvt;
+ Options options;
+ options.buffer = util::EXTENT / util::tileSize * 128;
+ options.extent = util::EXTENT;
+
try {
- return std::make_unique<GeoJSONVT>(Convert::convert(value, 0));
+ return std::make_unique<GeoJSONVT>(Convert::convert(value, 0), options);
} catch (const std::exception& ex) {
Log::Error(Event::ParseStyle, "Failed to parse GeoJSON data: %s", ex.what());
// Create an empty GeoJSON VT object to make sure we're not infinitely waiting for
// tiles to load.
- return std::make_unique<GeoJSONVT>(std::vector<ProjectedFeature>{});
+ return std::make_unique<GeoJSONVT>(std::vector<ProjectedFeature>{}, options);
}
}
diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp
index f1930ef3de..7021b7a8b2 100644
--- a/src/mbgl/tile/geometry_tile.hpp
+++ b/src/mbgl/tile/geometry_tile.hpp
@@ -9,6 +9,7 @@
#include <mbgl/util/vec.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/optional.hpp>
+#include <mbgl/util/constants.hpp>
#include <cstdint>
#include <string>
@@ -33,7 +34,7 @@ using GeometryCollection = std::vector<GeometryCoordinates>;
class GeometryTileFeature : private util::noncopyable {
public:
- static const uint32_t defaultExtent = 4096;
+ static const uint32_t defaultExtent = util::EXTENT;
virtual ~GeometryTileFeature() = default;
virtual FeatureType getType() const = 0;