Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ Tiled2dMapVectorLayerParserResult Tiled2dMapVectorLayerParserHelper::parseStyleJ

} else if (type == "vector" && val["tiles"].is_array()) {
tileJsons[key] = val;
} else if (type == "geojson") {
nlohmann::json geojson;
} else if (type == "geojson" || type == "geobuf") {
Options options;
const auto sourceDataFormat = type == "geobuf" ? GeoDataFormat::Geobuf : GeoDataFormat::GeoJson;

if (val["minzoom"].is_number_integer()) {
options.minZoom = val["minzoom"].get<uint8_t>();
Expand All @@ -226,7 +226,14 @@ Tiled2dMapVectorLayerParserResult Tiled2dMapVectorLayerParserHelper::parseStyleJ
options.extent = val["extent"].get<uint32_t>();
}
if (val["data"].is_string()) {
geojsonSources[key] = GeoJsonVTFactory::getGeoJsonVt(key, replaceUrlParams(val["data"].get<std::string>(), sourceUrlParams), loaders, localDataProvider, stringTable, options);
geojsonSources[key] = GeoJsonVTFactory::getGeoJsonVt(
key,
replaceUrlParams(val["data"].get<std::string>(), sourceUrlParams),
loaders,
localDataProvider,
stringTable,
sourceDataFormat,
options);
} else {
try {
geojsonSources[key] = GeoJsonVTFactory::getGeoJsonVt(GeoJsonParser::getGeoJson(val["data"], *stringTable), stringTable, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ class GeoJsonVTFactory {
const std::string &geoJsonUrl,
const std::vector<std::shared_ptr<::LoaderInterface>> &loaders, const std::shared_ptr<Tiled2dMapVectorLayerLocalDataProviderInterface> &localDataProvider,
const std::shared_ptr<StringInterner> &stringTable,
GeoDataFormat dataFormat,
const Options& options = Options()) {
std::shared_ptr<GeoJSONVT> vt = std::make_shared<GeoJSONVT>(sourceName, geoJsonUrl, loaders, localDataProvider, stringTable, options);
std::shared_ptr<GeoJSONVT> vt =
std::make_shared<GeoJSONVT>(sourceName, geoJsonUrl, loaders, localDataProvider, stringTable, dataFormat, options);
vt->load();
return vt;
}
Expand Down
Loading