[core] Normalize tile coordinates in VectorTile (#4966)
Previously, vector tile coordinates were being normalized to util::EXTENT in each place they were used, and for annotation and GeoJSON sources that don't require normalization.
This commit is contained in:
@@ -114,6 +114,7 @@ GeometryCollection VectorTileFeature::getGeometries() const {
|
||||
uint32_t length = 0;
|
||||
int32_t x = 0;
|
||||
int32_t y = 0;
|
||||
const float scale = float(util::EXTENT) / layer.extent;
|
||||
|
||||
GeometryCollection lines;
|
||||
|
||||
@@ -139,7 +140,7 @@ GeometryCollection VectorTileFeature::getGeometries() const {
|
||||
line = &lines.back();
|
||||
}
|
||||
|
||||
line->emplace_back(x, y);
|
||||
line->emplace_back(::round(x * scale), ::round(y * scale));
|
||||
|
||||
} else if (cmd == 7) { // closePolygon
|
||||
if (!line->empty()) {
|
||||
@@ -154,10 +155,6 @@ GeometryCollection VectorTileFeature::getGeometries() const {
|
||||
return lines;
|
||||
}
|
||||
|
||||
uint32_t VectorTileFeature::getExtent() const {
|
||||
return layer.extent;
|
||||
}
|
||||
|
||||
VectorTile::VectorTile(std::shared_ptr<const std::string> data_)
|
||||
: data(std::move(data_)) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user