How to include small mobile map package in AppStudio app?

2260
17
Jump to solution
07-17-2017 09:19 AM
MapEnglish
Occasional Contributor

I'm new to AppStudio and QML. How would one accomplish this inside QtCreator? We'd like to deploy an app that opens by default with an mmpk that's compiled with the app. Is there a sample that shows this?

Thanks,

Matt English

0 Kudos
1 Solution

Accepted Solutions
nakulmanocha
Esri Regular Contributor

Matt English‌ - Did my last post answer your question or are you still having this issue?

View solution in original post

0 Kudos
17 Replies
nakulmanocha
Esri Regular Contributor

We have a sample which demonstrates that. Go to New App> Search for Open

For more advance implementation on how to include mmpk and switch between offline and online look into the Quick Report template source code (RefineLocationPage.qml)

-Nakul

MapEnglish
Occasional Contributor

This sample downloads the mmpk. What if we want to include the mmpk with the app so that it can work completely offline? How do we set up a qml project and a folder structure so that the mmpk gets compiled with the app?

0 Kudos
nakulmanocha
Esri Regular Contributor

The "Open Mobile Map" sample comes with the mmpk file (Yellowstone.mmpk) within the app. Check the data folder within the app folder. Hence the mmpk gets compiled with the app.

0 Kudos
MapEnglish
Occasional Contributor

That sample copies the mmpk from a known location outside of the app to a created data folder no? How do I set up a qmlproject to include the mmpk in the project from the get-go? When I open that sample with AppStudio player it seems to copy the mmpk from a location within the Player app, not the sample app itself. 

0 Kudos
MapEnglish
Occasional Contributor

A more basic question would be: in QtCreator,  how do I add a "data" folder to my qml project and place a mmpk in there? It's not clear how to do this. 

0 Kudos
nakulmanocha
Esri Regular Contributor

You can do that in the file explorer of your OS such as windows. Once you do that. It should get automatically included in your QML project within Qt Creator. And you can confirm that by going to the File system from default Projects (item) of your project  using the dropdown menu.

0 Kudos
nakulmanocha
Esri Regular Contributor

That known location is within the app not outside the app (see image below). To set up your project just drop the mmpk in the data folder of your app. And then follow the same code to copy the mmpk to the folder as used in the sample. The reason behind the copy is because when you include mmpk within your app you cannot use local relative path in your code since on devices like iOS and Android the apps have access to only virtual file system. So we will have to copy the mmpk internally once the app opens. 

This is explained here

Working with Offline content · Esri/arcgis-appstudio-samples Wiki · GitHub 

I hope this helps.

Nakul

MapEnglish
Occasional Contributor

I know this is gonna seem dumb but how do you add a data folder in your project in QtCreator? Can't figure this out. If I add it in File Explorer it doesn't show up in the project tree. Sorry for the basic question, I'm a newbie to this. 

0 Kudos
nakulmanocha
Esri Regular Contributor

see comment above.

0 Kudos