summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-12-05 17:54:34 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-12-05 17:54:34 +0200
commit08fd54aaf41868530221e5ccdca653238744fd17 (patch)
tree939226e22d7d12286ca3db4a1da6c0b04b010d6d
parent97b5648f5e53dc55933a3c498b925f32209a0345 (diff)
downloadqtlocation-mapboxgl-upstream/overflow_fix_fred_mikhail.tar.gz
-rw-r--r--platform/glfw/glfw_view.cpp12
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");