Whatever I try I cannot get a basemap to show with a Mobile Map Package. I would rather show a local vtpk instead of an esri online basemap. Here is my code:
Item {
anchors.fill: parent
signal openMenu()
property string searchPane: ""
property string inputdata: "ZooScapeMKE.mmpk"
property string locatorFileName: "Locator-MKE.loc"
property string filePath: "../data/"
MapView {
id: mapView
anchors.fill: parent
focus: true
}
MobileMapPackage {
id: mmpk
path: filePath + inputdata
Component.onCompleted: {
mmpk.load();
}
onLoadStatusChanged: {
if (loadStatus === Enums.LoadStatusLoaded) {
mapView.map = mmpk.maps[0];
console.log(mapView.map.spatialReference.wkid);
mapView.map.minScale = 15000;
mapView.map.maxScale = 1000;
var basemapLayer = ArcGISRuntimeEnvironment.createObject("ArcGISVectorTiledLayer", {url: filePath + "BasemapGrayMKE.vtpk"});
mapView.map.basemap.baseLayers.append(basemapLayer);
}
}
}
}