Hey, it is hard to explain. I’ll first give a working code snippet and then provide the steps to reproduce:
import Felgo 3.0
import QtLocation 5.5
import QtPositioning 5.2
import QtQuick 2.5
App {
NavigationStack {
id: navigationStack
Page {
title: "Map Overlay"
Component {
id: detailPageComponent
Page {}
}
// show the map
AppMap {
anchors.fill: parent
plugin: Plugin {
name: "mapbox"
// configure your own map_id and access_token here
parameters: [ PluginParameter {
name: "mapbox.mapping.map_id"
value: "mapbox.streets"
},
PluginParameter {
name: "mapbox.access_token"
value: "pk.eyJ1IjoiZ3R2cGxheSIsImEiOiJjaWZ0Y2pkM2cwMXZqdWVsenJhcGZ3ZDl5In0.6xMVtyc0CkYNYup76iMVNQ"
},
PluginParameter {
name: "mapbox.mapping.highdpi_tiles"
value: true
}]
}
MapQuickItem {
// overlay will be placed at the map center
coordinate: QtPositioning.coordinate(parent.userPosition.coordinate.latitude + 0.001, parent.userPosition.coordinate.longitude)
// the anchor point specifies the point of the sourceItem that will be placed at the given coordinate
anchorPoint: Qt.point(sourceItem.width/2, sourceItem.height/2)
// source item holds the actual item that is displayed on the map
sourceItem: Rectangle {
width: dp(150)
height: dp(50)
color: "white"
AppText {
text: "This is a marker!"
anchors.centerIn: parent
}
}
MouseArea {
anchors.fill: parent
onClicked: navigationStack.push(detailPageComponent)
}
} // MapQuickItem
// configure the map to try to display the user's position
showUserPosition: true
// check for user position initially when component is created
Component.onCompleted: {
if(userPositionAvailable)
center = userPosition.coordinate
}
// once we successfully received the location, we zoom to the user position
onUserPositionAvailableChanged: {
if(userPositionAvailable)
zoomToUserPosition()
}
} // AppMap
}
}
}
The code is mainly from https://felgo.com/doc/apps-howtos/#show-user-position with a little bit of extra code to demonstrate the bug.
Steps to reproduce:
- Click somewhere in the Marker-rectangle, e.g. in the upper right corner
- A new empty page is pushed to the navigation stack
- Go back to the map view via the navigation
- Immediately click the Marker-rectangle again, but somewhere else, e.g. upper left corner
Behaviour:
- What should happen is, that the page is pushed again, but what happens is actually nothing
- You have to move the map a bit (the marker then jumps to the cursor) to be able to push the page again onto the navigation stack
I am using Felgo 2.15.1 on macOS. Could someone confirm or refute that?
Best,
Julian