summaryrefslogtreecommitdiff
path: root/src/mbgl/tile
diff options
context:
space:
mode:
authorLangston Smith <langston.smith@mapbox.com>2018-03-05 17:56:29 -0800
committerLangston Smith <langston.smith@mapbox.com>2018-03-05 17:56:29 -0800
commitaab4b971509f6f76943e2578cb13addc13ae079b (patch)
treef671cbf3dc5c7d5078423704df165eeb070f4d0f /src/mbgl/tile
parent6996e2d81abb8ea2ad23a6efe1502809bbe7e882 (diff)
parent136e536159a1e22aa4a92c4e6463893600b809d0 (diff)
downloadqtlocation-mapboxgl-aab4b971509f6f76943e2578cb13addc13ae079b.tar.gz
Merge branch 'master' into ls-android-readme-snapshot-dependency-line-cleanup
Diffstat (limited to 'src/mbgl/tile')
-rw-r--r--src/mbgl/tile/custom_geometry_tile.cpp2
-rw-r--r--src/mbgl/tile/raster_dem_tile.cpp3
-rw-r--r--src/mbgl/tile/raster_dem_tile.hpp1
-rw-r--r--src/mbgl/tile/raster_dem_tile_worker.cpp4
-rw-r--r--src/mbgl/tile/raster_dem_tile_worker.hpp3
5 files changed, 8 insertions, 5 deletions
diff --git a/src/mbgl/tile/custom_geometry_tile.cpp b/src/mbgl/tile/custom_geometry_tile.cpp
index 7c8a85c4a4..33962ad87d 100644
--- a/src/mbgl/tile/custom_geometry_tile.cpp
+++ b/src/mbgl/tile/custom_geometry_tile.cpp
@@ -39,7 +39,7 @@ void CustomGeometryTile::setTileData(const GeoJSON& geoJSON) {
vtOptions.extent = util::EXTENT;
vtOptions.buffer = ::round(scale * options.buffer);
vtOptions.tolerance = scale * options.tolerance;
- featureData = mapbox::geojsonvt::geoJSONToTile(geoJSON, id.canonical.z, id.canonical.x, id.canonical.y, vtOptions).features;
+ featureData = mapbox::geojsonvt::geoJSONToTile(geoJSON, id.canonical.z, id.canonical.x, id.canonical.y, vtOptions, options.wrap, options.clip).features;
} else {
setNecessity(TileNecessity::Optional);
}
diff --git a/src/mbgl/tile/raster_dem_tile.cpp b/src/mbgl/tile/raster_dem_tile.cpp
index b270378ece..5db298cf4c 100644
--- a/src/mbgl/tile/raster_dem_tile.cpp
+++ b/src/mbgl/tile/raster_dem_tile.cpp
@@ -21,6 +21,7 @@ RasterDEMTile::RasterDEMTile(const OverscaledTileID& id_,
worker(parameters.workerScheduler,
ActorRef<RasterDEMTile>(*this, mailbox)) {
+ encoding = tileset.encoding;
if ( id.canonical.y == 0 ){
// this tile doesn't have upper neighboring tiles so marked those as backfilled
neighboringTiles = neighboringTiles | DEMTileNeighbors::NoUpper;
@@ -47,7 +48,7 @@ void RasterDEMTile::setMetadata(optional<Timestamp> modified_, optional<Timestam
void RasterDEMTile::setData(std::shared_ptr<const std::string> data) {
pending = true;
++correlationID;
- worker.invoke(&RasterDEMTileWorker::parse, data, correlationID);
+ worker.invoke(&RasterDEMTileWorker::parse, data, correlationID, encoding);
}
void RasterDEMTile::onParsed(std::unique_ptr<HillshadeBucket> result, const uint64_t resultCorrelationID) {
diff --git a/src/mbgl/tile/raster_dem_tile.hpp b/src/mbgl/tile/raster_dem_tile.hpp
index 68f8a91e00..0c8dd75961 100644
--- a/src/mbgl/tile/raster_dem_tile.hpp
+++ b/src/mbgl/tile/raster_dem_tile.hpp
@@ -94,6 +94,7 @@ private:
Actor<RasterDEMTileWorker> worker;
uint64_t correlationID = 0;
+ Tileset::DEMEncoding encoding;
// Contains the Bucket object for the tile. Buckets are render
// objects and they get added by tile parsing operations.
diff --git a/src/mbgl/tile/raster_dem_tile_worker.cpp b/src/mbgl/tile/raster_dem_tile_worker.cpp
index ed8573788f..7338e578c7 100644
--- a/src/mbgl/tile/raster_dem_tile_worker.cpp
+++ b/src/mbgl/tile/raster_dem_tile_worker.cpp
@@ -10,14 +10,14 @@ RasterDEMTileWorker::RasterDEMTileWorker(ActorRef<RasterDEMTileWorker>, ActorRef
: parent(std::move(parent_)) {
}
-void RasterDEMTileWorker::parse(std::shared_ptr<const std::string> data, uint64_t correlationID) {
+void RasterDEMTileWorker::parse(std::shared_ptr<const std::string> data, uint64_t correlationID, Tileset::DEMEncoding encoding) {
if (!data) {
parent.invoke(&RasterDEMTile::onParsed, nullptr, correlationID); // No data; empty tile.
return;
}
try {
- auto bucket = std::make_unique<HillshadeBucket>(decodeImage(*data));
+ auto bucket = std::make_unique<HillshadeBucket>(decodeImage(*data), encoding);
parent.invoke(&RasterDEMTile::onParsed, std::move(bucket), correlationID);
} catch (...) {
parent.invoke(&RasterDEMTile::onError, std::current_exception(), correlationID);
diff --git a/src/mbgl/tile/raster_dem_tile_worker.hpp b/src/mbgl/tile/raster_dem_tile_worker.hpp
index 14fd1f43b5..5a8222bc2d 100644
--- a/src/mbgl/tile/raster_dem_tile_worker.hpp
+++ b/src/mbgl/tile/raster_dem_tile_worker.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <mbgl/actor/actor_ref.hpp>
+#include <mbgl/util/tileset.hpp>
#include <memory>
#include <string>
@@ -13,7 +14,7 @@ class RasterDEMTileWorker {
public:
RasterDEMTileWorker(ActorRef<RasterDEMTileWorker>, ActorRef<RasterDEMTile>);
- void parse(std::shared_ptr<const std::string> data, uint64_t correlationID);
+ void parse(std::shared_ptr<const std::string> data, uint64_t correlationID, Tileset::DEMEncoding encoding);
private:
ActorRef<RasterDEMTile> parent;