[core] Remove unused and mis-parsed properties from Tileset

latitude and longitude were reversed. Fortunately they were not used.
This commit is contained in:
John Firebaugh
2016-06-14 12:46:29 -07:00
parent 41760b5696
commit d48333f26d
2 changed files with 2 additions and 34 deletions

View File

@@ -68,27 +68,6 @@ void parseTileJSONMember(const JSValue& value, uint8_t& target, const char* name
target = uint;
}
void parseTileJSONMember(const JSValue& value, std::array<double, 4>& target, const char* name) {
if (!value.HasMember(name)) {
return;
}
const JSValue& property = value[name];
if (!property.IsArray() || property.Size() > 4) {
return;
}
for (rapidjson::SizeType i = 0; i < property.Size(); i++) {
if (!property[i].IsNumber()) {
return;
}
}
for (rapidjson::SizeType i = 0; i < property.Size(); i++) {
target[i] = property[i].GetDouble();
}
}
Tileset parseTileJSON(const JSValue& value) {
Tileset result;
@@ -97,13 +76,6 @@ Tileset parseTileJSON(const JSValue& value) {
parseTileJSONMember(value, result.zoomRange.max, "maxzoom");
parseTileJSONMember(value, result.attribution, "attribution");
std::array<double, 4> array;
parseTileJSONMember(value, array, "center");
result.center = { array[0], array[1] };
result.zoom = array[2];
parseTileJSONMember(value, array, "bounds");
result.bounds = LatLngBounds::hull({ array[0], array[1] }, { array[2], array[3] });
return result;
}

View File

@@ -1,10 +1,7 @@
#pragma once
#include <mbgl/util/constants.hpp>
#include <mbgl/util/range.hpp>
#include <mbgl/util/geo.hpp>
#include <array>
#include <vector>
#include <string>
#include <cstdint>
@@ -16,9 +13,8 @@ public:
std::vector<std::string> tiles;
Range<uint8_t> zoomRange { 0, 22 };
std::string attribution;
LatLng center;
double zoom = 0;
LatLngBounds bounds = LatLngBounds::world();
// TileJSON also includes center, zoom, and bounds, but they are not used by mbgl.
};
} // namespace mbgl