summaryrefslogtreecommitdiff
path: root/src/mbgl/tile
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-04-02 17:41:55 -0700
committerAnsis Brammanis <ansis.brammanis@gmail.com>2018-04-26 18:03:17 -0400
commitf86fe44dbd4de44c9fc8cb364521f966039289d7 (patch)
tree5fa9b4dd9b039640407c5ede97a4d7b94a25c230 /src/mbgl/tile
parentf7d20a587199ccee42469ecea2299ae73bfaae49 (diff)
downloadqtlocation-mapboxgl-f86fe44dbd4de44c9fc8cb364521f966039289d7.tar.gz
[core] fix circle querying for scale and alignment
This fixes circle querying for cases where either circle-pitch-alignment=map or circle-pitch-scaling=viewport
Diffstat (limited to 'src/mbgl/tile')
-rw-r--r--src/mbgl/tile/geometry_tile.cpp12
-rw-r--r--src/mbgl/tile/geometry_tile.hpp3
-rw-r--r--src/mbgl/tile/tile.cpp3
-rw-r--r--src/mbgl/tile/tile.hpp3
4 files changed, 15 insertions, 6 deletions
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp
index 92a226d3c1..cb4b6aa39c 100644
--- a/src/mbgl/tile/geometry_tile.cpp
+++ b/src/mbgl/tile/geometry_tile.cpp
@@ -217,21 +217,27 @@ void GeometryTile::queryRenderedFeatures(
const GeometryCoordinates& queryGeometry,
const TransformState& transformState,
const std::vector<const RenderLayer*>& layers,
- const RenderedQueryOptions& options) {
+ const RenderedQueryOptions& options,
+ const mat4& projMatrix) {
if (!getData()) return;
const float queryPadding = getQueryPadding(layers);
+ mat4 posMatrix;
+ transformState.matrixFor(posMatrix, id.toUnwrapped());
+ matrix::multiply(posMatrix, projMatrix, posMatrix);
+
latestFeatureIndex->query(result,
queryGeometry,
- transformState.getAngle(),
+ transformState,
+ posMatrix,
util::tileSize * id.overscaleFactor(),
std::pow(2, transformState.getZoom() - id.overscaledZ),
options,
id.toUnwrapped(),
layers,
- queryPadding);
+ queryPadding * transformState.maxPitchScaleFactor());
}
void GeometryTile::querySourceFeatures(
diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp
index a43bf44940..d0490f1009 100644
--- a/src/mbgl/tile/geometry_tile.hpp
+++ b/src/mbgl/tile/geometry_tile.hpp
@@ -54,7 +54,8 @@ public:
const GeometryCoordinates& queryGeometry,
const TransformState&,
const std::vector<const RenderLayer*>& layers,
- const RenderedQueryOptions& options) override;
+ const RenderedQueryOptions& options,
+ const mat4& projMatrix) override;
void querySourceFeatures(
std::vector<Feature>& result,
diff --git a/src/mbgl/tile/tile.cpp b/src/mbgl/tile/tile.cpp
index 56698e84c4..b95944f10e 100644
--- a/src/mbgl/tile/tile.cpp
+++ b/src/mbgl/tile/tile.cpp
@@ -37,7 +37,8 @@ void Tile::queryRenderedFeatures(
const GeometryCoordinates&,
const TransformState&,
const std::vector<const RenderLayer*>&,
- const RenderedQueryOptions&) {}
+ const RenderedQueryOptions&,
+ const mat4&) {}
float Tile::getQueryPadding(const std::vector<const RenderLayer*>&) {
return 0;
diff --git a/src/mbgl/tile/tile.hpp b/src/mbgl/tile/tile.hpp
index 5f7a076850..23d6864205 100644
--- a/src/mbgl/tile/tile.hpp
+++ b/src/mbgl/tile/tile.hpp
@@ -57,7 +57,8 @@ public:
const GeometryCoordinates& queryGeometry,
const TransformState&,
const std::vector<const RenderLayer*>&,
- const RenderedQueryOptions& options);
+ const RenderedQueryOptions& options,
+ const mat4& projMatrix);
virtual void querySourceFeatures(
std::vector<Feature>& result,