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

Commit 387f37d

Browse files
committed
[core] increase geojson buffer size to match -js
1 parent ff7cdb1 commit 387f37d

File tree

8 files changed

+15
-9
lines changed

8 files changed

+15
-9
lines changed

platform/android/scripts/configure.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LIBUV_VERSION=1.7.5
88
ZLIB_VERSION=system
99
NUNICODE_VERSION=1.6
1010
LIBZIP_VERSION=0.11.2
11-
GEOJSONVT_VERSION=3.1.0
11+
GEOJSONVT_VERSION=4.0.0
1212
VARIANT_VERSION=1.1.0
1313
RAPIDJSON_VERSION=1.0.2
1414
JNI_HPP_VERSION=2.0.0

platform/ios/scripts/configure.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BOOST_VERSION=1.59.0
44
SQLITE_VERSION=system
55
LIBUV_VERSION=1.7.5
66
ZLIB_VERSION=system
7-
GEOJSONVT_VERSION=3.1.0
7+
GEOJSONVT_VERSION=4.0.0
88
VARIANT_VERSION=1.1.0
99
RAPIDJSON_VERSION=1.0.2
1010
GTEST_VERSION=1.7.0

platform/linux/scripts/configure.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SQLITE_VERSION=3.9.1
1010
LIBUV_VERSION=1.7.5
1111
ZLIB_VERSION=system
1212
NUNICODE_VERSION=1.6
13-
GEOJSONVT_VERSION=3.1.0
13+
GEOJSONVT_VERSION=4.0.0
1414
VARIANT_VERSION=1.1.0
1515
RAPIDJSON_VERSION=1.0.2
1616
GTEST_VERSION=1.7.0

platform/osx/scripts/configure.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SQLITE_VERSION=3.9.1
88
LIBUV_VERSION=1.7.5
99
ZLIB_VERSION=system
1010
NUNICODE_VERSION=1.6
11-
GEOJSONVT_VERSION=3.1.0
11+
GEOJSONVT_VERSION=4.0.0
1212
VARIANT_VERSION=1.1.0
1313
RAPIDJSON_VERSION=1.0.2
1414
GTEST_VERSION=1.7.0

src/mbgl/annotation/shape_annotation_impl.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ void ShapeAnnotationImpl::updateTile(const TileID& tileID, AnnotationTile& tile)
108108

109109
mapbox::geojsonvt::Options options;
110110
options.maxZoom = maxZoom;
111-
options.buffer = 128u;
111+
options.buffer = 255u;
112+
options.extent = util::EXTENT;
112113
options.tolerance = baseTolerance;
113114
shapeTiler = std::make_unique<mapbox::geojsonvt::GeoJSONVT>(features, options);
114115
}

src/mbgl/style/style_parser.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,17 @@ void StyleParser::parseSources(const JSValue& value) {
245245
std::unique_ptr<mapbox::geojsonvt::GeoJSONVT> StyleParser::parseGeoJSON(const JSValue& value) {
246246
using namespace mapbox::geojsonvt;
247247

248+
Options options;
249+
options.buffer = util::EXTENT / util::tileSize * 128;
250+
options.extent = util::EXTENT;
251+
248252
try {
249-
return std::make_unique<GeoJSONVT>(Convert::convert(value, 0));
253+
return std::make_unique<GeoJSONVT>(Convert::convert(value, 0), options);
250254
} catch (const std::exception& ex) {
251255
Log::Error(Event::ParseStyle, "Failed to parse GeoJSON data: %s", ex.what());
252256
// Create an empty GeoJSON VT object to make sure we're not infinitely waiting for
253257
// tiles to load.
254-
return std::make_unique<GeoJSONVT>(std::vector<ProjectedFeature>{});
258+
return std::make_unique<GeoJSONVT>(std::vector<ProjectedFeature>{}, options);
255259
}
256260
}
257261

src/mbgl/tile/geometry_tile.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <mbgl/util/vec.hpp>
1010
#include <mbgl/util/noncopyable.hpp>
1111
#include <mbgl/util/optional.hpp>
12+
#include <mbgl/util/constants.hpp>
1213

1314
#include <cstdint>
1415
#include <string>
@@ -33,7 +34,7 @@ using GeometryCollection = std::vector<GeometryCoordinates>;
3334

3435
class GeometryTileFeature : private util::noncopyable {
3536
public:
36-
static const uint32_t defaultExtent = 4096;
37+
static const uint32_t defaultExtent = util::EXTENT;
3738

3839
virtual ~GeometryTileFeature() = default;
3940
virtual FeatureType getType() const = 0;

0 commit comments

Comments
 (0)