Skip to content

Commit

Permalink
Mapbox Sailfish test
Browse files Browse the repository at this point in the history
Github issue #181
  • Loading branch information
micuintus committed Apr 24, 2019
1 parent 62232f4 commit 3866c3b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
19 changes: 17 additions & 2 deletions qml/components-Sailfish/Map.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import QtLocation 5.0
import MapboxMap 1.0
import QtPositioning 5.3

Map {
MapboxMap {
id: map
MapboxMapGestureArea {
map: map
}
center: QtPositioning.coordinate(60.170448, 24.942046)
zoomLevel: 4.0
minimumZoomLevel: 0
maximumZoomLevel: 20
pixelRatio: 3.0

accessToken: "pk.eyJ1IjoibWljdSIsImEiOiJjaXdxd2MzcW4wMDBrMnlxZHc1cmtzdnhjIn0.a2u7IrIYN1kGCue-BU8zEg"
cacheDatabaseMaximalSize: 20*1024*1024
cacheDatabasePath: "/tmp/mbgl-cache.db"

plugin : Plugin { name: "osm" }
styleUrl: "mapbox://styles/mapbox/outdoors-v10"
}
7 changes: 2 additions & 5 deletions qml/pages/VenueMapOverviewPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ BVApp.Page {
// remove once SFOS is on QtLocation > 5.6
property bool dirty: false

gesture {
enabled: true
}

// Work around QTBUG-47366;
// remove once SFOS is on QtLocation > 5.6
Expand All @@ -98,7 +95,7 @@ BVApp.Page {
anchorPoint.x: venueMarkerImage.width / 2
anchorPoint.y: venueMarkerImage.height

coordinate: QtPositioning.coordinate(model.latCoord, model.longCoord)
coordinate: QtPositioning.coordinate(model.latCoord ? model.latCoord : 0, model.longCoord)

sourceItem: BVApp.IconButton {
id: venueMarkerImage
Expand All @@ -119,7 +116,7 @@ BVApp.Page {
}

Component.onCompleted: {
addMapItem(currentPosition);
// addMapItem(currentPosition);
centerAndZoom();
}

Expand Down
4 changes: 0 additions & 4 deletions qml/pages/VenueMapPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ Rectangle {
id: map
anchors.fill: parent

// user shall not move the map, but click to open the coordinates in the dedicated map app.
gesture {
enabled: false
}

Component.onCompleted: {
addMapItem(venueMarker)
Expand Down

0 comments on commit 3866c3b

Please sign in to comment.