blob: 4d4d02c5ff3ca9102f8f7896bca2218a1db18331 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include <mbgl/util/get_geometries.hpp>
#include <mbgl/util/constants.hpp>
namespace mbgl {
GeometryCollection getGeometries(const GeometryTileFeature& feature) {
const float scale = float(util::EXTENT) / feature.getExtent();
GeometryCollection geometryCollection = feature.getGeometries();
for (auto& line : geometryCollection) {
for (auto& point : line) {
point.x = std::round(point.x * scale);
point.y = std::round(point.y * scale);
}
}
return geometryCollection;
}
} // namespace mbgl
|