Hi Anda_skoa,
Thanks for the reply. I don't want my maps stored in Qrc.
Scenario:
Maps will be copied to SD Card manually, The qt application will display the map from the SD Card.
In this case how to set the SD card Path.
Code snippets what I tried according to ESRI ArcGIS Runtime SDK for Qt 100.0.0:
import QtQuick 2.6
import Esri.ArcGISRuntime 100.0
import Esri.ArcGISExtras 1.1
Rectangle {
width: 800
height: 600
property real scaleFactor: System.displayScaleFactor
// property string dataPath: System.userHomePath + "/ArcGIS/Runtime/Data/mmpk/"
[B][I]property string dataPath: "file:///storage/sdcard1/"[/I][/B]
// Create MapView
MapView {
id: mapView
anchors.fill: parent
}
// Create a Mobile Map Package and set the path
MobileMapPackage {
id: mmpk
path: dataPath + "Yellowstone.mmpk"
// load the mobile map package
Component.onCompleted: {
mmpk.load();
}
// wait for the mobile map package to load
onLoadStatusChanged: {
if (loadStatus === Enums.LoadStatusLoaded) {
// set the map view's map to the first map in the mobile map package
mapView.map = mmpk.maps[0];
}
}
}
Rectangle {
anchors.fill: parent
color: "transparent"
border {
width: 0.5 * scaleFactor
color: "black"
}
}
}
import QtQuick 2.6
import Esri.ArcGISRuntime 100.0
import Esri.ArcGISExtras 1.1
Rectangle {
width: 800
height: 600
property real scaleFactor: System.displayScaleFactor
// property string dataPath: System.userHomePath + "/ArcGIS/Runtime/Data/mmpk/"
[B][I]property string dataPath: "file:///storage/sdcard1/"[/I][/B]
// Create MapView
MapView {
id: mapView
anchors.fill: parent
}
// Create a Mobile Map Package and set the path
MobileMapPackage {
id: mmpk
path: dataPath + "Yellowstone.mmpk"
// load the mobile map package
Component.onCompleted: {
mmpk.load();
}
// wait for the mobile map package to load
onLoadStatusChanged: {
if (loadStatus === Enums.LoadStatusLoaded) {
// set the map view's map to the first map in the mobile map package
mapView.map = mmpk.maps[0];
}
}
}
Rectangle {
anchors.fill: parent
color: "transparent"
border {
width: 0.5 * scaleFactor
color: "black"
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks