Open mobile map (map package)

Loading

Code

import QtQuick 2.6
import Esri.ArcGISRuntime 100.3
import Esri.ArcGISExtras 1.1

Rectangle {
    width: 800
    height: 600

    property url dataPath: System.userHomePath + "/ArcGIS/Runtime/Data/mmpk/"

    // 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];
            }
        }
    }
}


In this topic
  1. Code