summaryrefslogtreecommitdiff
path: root/src/mbgl/tile
diff options
context:
space:
mode:
authorzmiao <miao.zhao@mapbox.com>2020-01-29 12:46:16 +0200
committerzmiao <miao.zhao@mapbox.com>2020-02-12 12:24:05 +0200
commit3e99c08ea610d791b21f1631308451687c464d98 (patch)
treec7f3e20ad9ddc161ab3378d37bde9aa31675da83 /src/mbgl/tile
parent4f18d5fa92df175ac30f856a9273a00349b56cc3 (diff)
downloadqtlocation-mapboxgl-3e99c08ea610d791b21f1631308451687c464d98.tar.gz
Enable parse within expression
Add geometry type checker
Diffstat (limited to 'src/mbgl/tile')
-rw-r--r--src/mbgl/tile/geometry_tile_data.cpp2
-rw-r--r--src/mbgl/tile/geometry_tile_data.hpp2
-rw-r--r--src/mbgl/tile/geometry_tile_worker.cpp7
3 files changed, 7 insertions, 4 deletions
diff --git a/src/mbgl/tile/geometry_tile_data.cpp b/src/mbgl/tile/geometry_tile_data.cpp
index f723a94800..838f37f0da 100644
--- a/src/mbgl/tile/geometry_tile_data.cpp
+++ b/src/mbgl/tile/geometry_tile_data.cpp
@@ -99,7 +99,7 @@ void limitHoles(GeometryCollection& polygon, uint32_t maxHoles) {
}
}
-static Feature::geometry_type convertGeometry(const GeometryTileFeature& geometryTileFeature, const CanonicalTileID& tileID) {
+Feature::geometry_type convertGeometry(const GeometryTileFeature& geometryTileFeature, const CanonicalTileID& tileID) {
const double size = util::EXTENT * std::pow(2, tileID.z);
const double x0 = util::EXTENT * static_cast<double>(tileID.x);
const double y0 = util::EXTENT * static_cast<double>(tileID.y);
diff --git a/src/mbgl/tile/geometry_tile_data.hpp b/src/mbgl/tile/geometry_tile_data.hpp
index 49620982c1..a0a069f3d1 100644
--- a/src/mbgl/tile/geometry_tile_data.hpp
+++ b/src/mbgl/tile/geometry_tile_data.hpp
@@ -80,6 +80,8 @@ std::vector<GeometryCollection> classifyRings(const GeometryCollection&);
// Truncate polygon to the largest `maxHoles` inner rings by area.
void limitHoles(GeometryCollection&, uint32_t maxHoles);
+Feature::geometry_type convertGeometry(const GeometryTileFeature& geometryTileFeature, const CanonicalTileID& tileID);
+
// convert from GeometryTileFeature to Feature (eventually we should eliminate GeometryTileFeature)
Feature convertFeature(const GeometryTileFeature&, const CanonicalTileID&);
diff --git a/src/mbgl/tile/geometry_tile_worker.cpp b/src/mbgl/tile/geometry_tile_worker.cpp
index c38464bb04..0729ed2aa5 100644
--- a/src/mbgl/tile/geometry_tile_worker.cpp
+++ b/src/mbgl/tile/geometry_tile_worker.cpp
@@ -391,7 +391,7 @@ void GeometryTileWorker::parse() {
if (layout->hasDependencies()) {
layouts.push_back(std::move(layout));
} else {
- layout->createBucket({}, featureIndex, renderData, firstLoad, showCollisionBoxes);
+ layout->createBucket({}, featureIndex, renderData, firstLoad, showCollisionBoxes, id.canonical);
}
} else {
const Filter& filter = leaderImpl.filter;
@@ -405,7 +405,7 @@ void GeometryTileWorker::parse() {
continue;
const GeometryCollection& geometries = feature->getGeometries();
- bucket->addFeature(*feature, geometries, {}, PatternLayerMap(), i);
+ bucket->addFeature(*feature, geometries, {}, PatternLayerMap(), i, id.canonical);
featureIndex->insert(geometries, i, sourceLayerID, leaderImpl.id);
}
@@ -467,7 +467,8 @@ void GeometryTileWorker::finalizeLayout() {
}
// layout adds the bucket to buckets
- layout->createBucket(iconAtlas.patternPositions, featureIndex, renderData, firstLoad, showCollisionBoxes);
+ layout->createBucket(
+ iconAtlas.patternPositions, featureIndex, renderData, firstLoad, showCollisionBoxes, id.canonical);
}
}