Place map example doesn't work fine!
-
Hi,
Whenever I run Places map example I get this error message .
How can I replace MapQuest service with something work?!
BTW, I tried to pull this thread up but unfortunately I didn't get a suitable response on it :(
-
@Schluchti said in Place map example doesn't work fine!:
Does it need to be OSM as map provider? Otherwise you could use mapbox, which works pretty well.
How can I do it?
-
You have to sign up at mapbox to get an API key. Then change your plugin key to "mapbox" and provide the mapbox Map ID and mapbox Access Token.
-
You have to sign up at mapbox to get an API key. Then change your plugin key to "mapbox" and provide the mapbox Map ID and mapbox Access Token.
@Schluchti Thanks
I tried to modify the example depending on MapBox requesremtns but unfortunately I get this error message:
qml: Plugin Error (mapbox): The service provider does not support the QPlaceManager type.
places_map.qml
//! [Imports] import QtQuick 2.0 import QtPositioning 5.5 import QtLocation 5.6 //! [Imports] Rectangle { width: 360 height: 640 //! [Initialize Plugin] Plugin { id: myPlugin name: "mapbox" PluginParameter { name: "mapbox.access_token"; value: "pk.eyJ1IjoibWJub2ltaSIsImEiOiJjaXZjYmY2Z2QwMDZhMnl5NGdwIn0.bCTFiaCGUDthspXPQKqi-A" } PluginParameter { name: "mapbox.map_id"; value: "mbnoimi.handle" } } //! [Initialize Plugin] //! [Current Location] PositionSource { id: positionSource property variant lastSearchPosition: locationOslo active: true updateInterval: 120000 // 2 mins onPositionChanged: { var currentPosition = positionSource.position.coordinate map.center = currentPosition var distance = currentPosition.distanceTo(lastSearchPosition) if (distance > 500) { // 500m from last performed pizza search lastSearchPosition = currentPosition searchModel.searchArea = QtPositioning.circle(currentPosition) searchModel.update() } } } //! [Current Location] //! [PlaceSearchModel] property variant locationOslo: QtPositioning.coordinate( 59.93, 10.76) PlaceSearchModel { id: searchModel plugin: myPlugin searchTerm: "Pizza" searchArea: QtPositioning.circle(locationOslo) Component.onCompleted: update() } //! [PlaceSearchModel] //! [Places MapItemView] Map { id: map anchors.fill: parent plugin: myPlugin; center: locationOslo zoomLevel: 13 MapItemView { model: searchModel delegate: MapQuickItem { coordinate: place.location.coordinate anchorPoint.x: image.width * 0.5 anchorPoint.y: image.height sourceItem: Column { Image { id: image; source: "marker.png" } Text { text: title; font.bold: true } } } } } //! [Places MapItemView] Connections { target: searchModel onStatusChanged: { if (searchModel.status == PlaceSearchModel.Error) console.log(searchModel.errorString()); } } }
-
This discusses why it doesn't work any longer - https://forum.qt.io/topic/69190/openstreetmap-finish-to-work-any-alternatives/5
It has been this way since July of 2016.
-
This discusses why it doesn't work any longer - https://forum.qt.io/topic/69190/openstreetmap-finish-to-work-any-alternatives/5
It has been this way since July of 2016.
@ldanzinger said in Place map example doesn't work fine!:
This discusses why it doesn't work any longer - https://forum.qt.io/topic/69190/openstreetmap-finish-to-work-any-alternatives/5
It has been this way since July of 2016.
I already know that. My problem with MapBox itself which suppose to be the valid alternative to OSM plugin
-
The documentation does not mention support for place searching (which your example code uses) - http://doc.qt.io/qt-5/location-plugin-mapbox.html
Are you needing to perform place searching, or just map viewing?
-
The documentation does not mention support for place searching (which your example code uses) - http://doc.qt.io/qt-5/location-plugin-mapbox.html
Are you needing to perform place searching, or just map viewing?
@ldanzinger said in Place map example doesn't work fine!:
Are you needing to perform place searching, or just map viewing?
I need place searching
-
@ldanzinger said in Place map example doesn't work fine!:
Are you needing to perform place searching, or just map viewing?
I need place searching
@mbnoimi : I get a same problem with you. Have you solved it yet ? If yes, can you give me a solution ?, thank you so much.
-
@mbnoimi : I get a same problem with you. Have you solved it yet ? If yes, can you give me a solution ?, thank you so much.
@huynhthaihoa said in Place map example doesn't work fine!:
@mbnoimi : I get a same problem with you. Have you solved it yet ? If yes, can you give me a solution ?, thank you so much.
Unfortunately I couldn't find any solution until now although I posted this issue since a while!
-
I filed a bug report about this bug , Meanwhile I wish to get some help from Qt gurus because Qt location doesn't useful without accessing a stored places!