diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-12-05 17:54:34 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-12-05 17:54:34 +0200 |
commit | 08fd54aaf41868530221e5ccdca653238744fd17 (patch) | |
tree | 939226e22d7d12286ca3db4a1da6c0b04b010d6d | |
parent | 97b5648f5e53dc55933a3c498b925f32209a0345 (diff) | |
download | qtlocation-mapboxgl-upstream/overflow_fix_fred_mikhail.tar.gz |
source on flyupstream/overflow_fix_fred_mikhail
-rw-r--r-- | platform/glfw/glfw_view.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp index cecdbb00c4..678c200e15 100644 --- a/platform/glfw/glfw_view.cpp +++ b/platform/glfw/glfw_view.cpp @@ -41,6 +41,7 @@ #include <sstream> #include <fstream> + namespace { std::string read_file(const std::string &filename) { std::ifstream file(filename, std::ios::binary); @@ -642,6 +643,14 @@ void GLFWView::setShouldClose() { void GLFWView::setWindowTitle(const std::string& title) { glfwSetWindowTitle(window, (std::string { "Mapbox GL: " } + title).c_str()); } +namespace { +mapbox::geojson::geometry makeTestLineString() { + mapbox::geojson::line_string result; + result.push_back({7, 52}); + result.push_back({8, 52}); + return result; +} +} // namespace void GLFWView::onDidFinishLoadingStyle() { if (show3DExtrusions) { @@ -651,7 +660,8 @@ void GLFWView::onDidFinishLoadingStyle() { mbgl::style::GeoJSONOptions options; options.lineMetrics = true; auto source = std::make_unique<mbgl::style::GeoJSONSource>("mysource", options); - source->setGeoJSON(mapbox::geojson::parse(read_file("crashline.geojson"))); + //source->setGeoJSON(mapbox::geojson::parse(read_file("/home/mikhail/git/mapbox-gl-native/crashline.geojson"))); + source->setGeoJSON(makeTestLineString()); map->getStyle().addSource(std::move(source)); auto layer = std::make_unique<mbgl::style::LineLayer>("mylayer", "mysource"); |