Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SPDX-FileCopyrightText: 2023-2024 Open Mobile Platform LLC <community@omp.ru>
- // SPDX-License-Identifier: BSD-3-Clause
- import QtQuick 2.0
- import Sailfish.Silica 1.0
- import QtPositioning 5.2
- import MfwMap 1.0
- //import "wrapper.js" as VkMapWrapper
- //import "mmr-gl.js" as VkMap
- Page {
- id: mainPage
- objectName: "mainPage"
- allowedOrientations: Orientation.All
- MfwMap {
- id: map
- width: parent.width
- height: parent.height - header.height
- anchors.top: header.bottom
- zoomLevel: 17.0
- metersPerPixelTolerance: 0.1
- urlDebug: false
- cacheDatabaseStoreSettings: true
- center: QtPositioning.coordinate(55.752121, 37.617664) // Moscow
- // accessToken: "pk.eyJ1Ijoic2xhdmFjaGVybmlrb2ZmIiwiYSI6ImNsZDBlemo0ejAxdnUzd3Fxc242Y2g2dHAifQ.YptKmH0xY8nfDfZnhdPiFg"
- // styleUrl: "mapbox://styles/mapbox/streets-v10"
- apiKey: "8d47d57ee2eacf1935cb4338708369257961f41e84e0f66fafeb5c6b78f09b2c"
- apiBaseUrl: "https://maps.vk.com/api"
- accessToken: "8d47d57ee2eacf1935cb4338708369257961f41e84e0f66fafeb5c6b78f09b2c"
- styleUrl: "https://maps.vk.com/api/styles/main_style.json?api_key=8d47d57ee2eacf1935cb4338708369257961f41e84e0f66fafeb5c6b78f09b2c"
- // styleUrl: "mmr://api/styles/main_style.json"
- // apiBaseUrl: "https://tiles.maps.vk.com/tiles/8/153/76.pbf?api_key=8d47d57ee2eacf1935cb4338708369257961f41e84e0f66fafeb5c6b78f09b2c"
- onGestureInProgressChanged: {
- mainPage.forwardNavigation = !gestureInProgress
- mainPage.backNavigation = !gestureInProgress
- }
- Text {
- id: license
- text: qsTr("License logo clicked")
- anchors.margins: 20 * Theme.pixelRatio
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- visible: false
- }
- onLogoClicked: {
- license.visible = true
- }
- }
- PageHeader {
- id: header
- objectName: "pageHeader"
- title: qsTr("Source control")
- }
- Rectangle {
- anchors.fill: menu
- anchors.margins: -20 * Theme.pixelRatio
- radius: 30
- clip: true
- color: "grey"
- }
- Column {
- id: menu
- anchors.top: header.bottom
- anchors.right: parent.right
- anchors.margins: 30 * Theme.pixelRatio
- Button {
- text: qsTr("MapTiler")
- border.color: "black"
- onClicked: {
- map.apiKey = "rIkhrE0BML0xS89iIyfG"
- map.styleUrl = "https://api.maptiler.com/maps/streets/style.json?key=rIkhrE0BML0xS89iIyfG"
- map.accessToken = ""
- map.apiBaseUrl = "https://api.mapbox.com"
- }
- }
- Button {
- text: qsTr("Mapbox")
- border.color: "black"
- onClicked: {
- map.accessToken = "pk.eyJ1Ijoic2xhdmFjaGVybmlrb2ZmIiwiYSI6ImNsZDBlemo0ejAxdnUzd3Fxc242Y2g2dHAifQ.YptKmH0xY8nfDfZnhdPiFg"
- map.styleUrl = "mapbox://styles/mapbox/streets-v10"
- map.apiKey = ""
- map.apiBaseUrl = "https://api.mapbox.com"
- }
- }
- Button {
- text: qsTr("Vk")
- border.color: "black"
- onClicked: {
- map.accessToken = "8d47d57ee2eacf1935cb4338708369257961f41e84e0f66fafeb5c6b78f09b2c"
- map.apiKey = "8d47d57ee2eacf1935cb4338708369257961f41e84e0f66fafeb5c6b78f09b2c"
- map.styleUrl = "mmr://api/styles/main_style.json"
- map.apiBaseUrl = "https://maps.vk.com/api"
- }
- }
- }
- Component.onCompleted: {
- console.log("map.apiBaseUrl = " + map.apiBaseUrl)
- console.log("map.styleUrl = " + map.styleUrl)
- console.log("map.apiKey = " + map.apiKey)
- console.log("map.accessToken = " + map.accessToken)
- console.log("map.mode = " + map.mode)
- console.log("map.urlSuffix = " + map.urlSuffix)
- // VkMapWrapper.createMap();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement