|
2017-12-18
, 06:08
|
Posts: 58 |
Thanked: 223 times |
Joined on Apr 2017
@ Germany
|
#42
|
onDoubleClicked: { console.log("onDoubleClicked: " + mouse) map.setZoomLevel(map.zoomLevel + 1, Qt.point(mouse.x, mouse.y) ); } onDoubleClickedGeo: { console.log("onDoubleClickedGeo: " + geocoordinate); map.fitView(geocoordinate); //TODO: does not work! }
map.fitView(QtPositioning.coordinate(51.9854, 9.2743)); //TODO does not work!
|
2017-12-18
, 06:56
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#43
|
@rinigus another question:
on double tap on the map I want to zoom in and center the map at this position. Problem is the fitView does not work. I tried:
I have also problems with fitView if I want to center on a specific coordinate, it just does not work:Code:onDoubleClicked: { console.log("onDoubleClicked: " + mouse) map.setZoomLevel(map.zoomLevel + 1, Qt.point(mouse.x, mouse.y) ); } onDoubleClickedGeo: { console.log("onDoubleClickedGeo: " + geocoordinate); map.fitView(geocoordinate); //TODO: does not work! }
Code:map.fitView(QtPositioning.coordinate(51.9854, 9.2743)); //TODO does not work!
map.fitView([geocoordinate]);
|
2017-12-18
, 07:38
|
Posts: 58 |
Thanked: 223 times |
Joined on Apr 2017
@ Germany
|
#44
|
|
2017-12-18
, 07:41
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#45
|
The Following User Says Thank You to rinigus For This Useful Post: | ||
|
2017-12-18
, 13:09
|
Posts: 58 |
Thanked: 223 times |
Joined on Apr 2017
@ Germany
|
#46
|
map.addImagePath("image", Qt.resolvedUrl(app.getIcon("./images/position.png"))) map.addLayer("image_layer", {"type": "symbol", "source": "source_name"}); map.setLayoutProperty(constants.layerStill, "icon-image", "image"); map.setLayoutProperty(constants.layerStill, "icon-size", 1.0 / map.pixelRatio); map.setLayoutProperty(constants.layerStill, "visibility", "visible");
The Following 2 Users Say Thank You to jdrescher For This Useful Post: | ||
|
2017-12-18
, 13:20
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#47
|
I'm sorry, but I have an other question.
I want to place an image on the map. I looked into the api and also in the sources of poor maps GL and came up with this:
There is no error but also no icon on the map. It's also unclear where do I have to put the coordinates?Code:map.addImagePath("image", Qt.resolvedUrl(app.getIcon("./images/position.png"))) map.addLayer("image_layer", {"type": "symbol", "source": "source_name"}); map.setLayoutProperty(constants.layerStill, "icon-image", "image"); map.setLayoutProperty(constants.layerStill, "icon-size", 1.0 / map.pixelRatio); map.setLayoutProperty(constants.layerStill, "visibility", "visible");
map.addSourcePoint("source_name", some_coordinate)
The Following 4 Users Say Thank You to rinigus For This Useful Post: | ||
|
2017-12-18
, 14:00
|
Posts: 58 |
Thanked: 223 times |
Joined on Apr 2017
@ Germany
|
#48
|
You are very close. You are just missing definition of the source - "source_name".
map.addSourcePoint("source_name", QtPositioning.coordinate(51.9854, 9.2743)); map.addImagePath("image", Qt.resolvedUrl("./images/position-circle-blue.png")); map.addLayer("image_layer", {"type": "symbol", "source": "source_name"}); map.setLayoutProperty("image_layer", "icon-image", "image"); map.setLayoutProperty("image_layer", "icon-size", 1.0 / map.pixelRatio); map.setLayoutProperty("image_layer", "visibility", "visible");
The Following 5 Users Say Thank You to jdrescher For This Useful Post: | ||
|
2017-12-18
, 18:15
|
Posts: 959 |
Thanked: 3,427 times |
Joined on Apr 2012
|
#50
|
The Following 2 Users Say Thank You to taixzo For This Useful Post: | ||