Launch AppStudio Map Tour Template at a specific page index using AppLink?

700
5
03-21-2018 01:02 PM
MapEnglish
Occasional Contributor

2 part question:

  1. How to set up a custom applink? I found this
  2. Generally speaking, what does the code look like in qml to parse an applink query string and open the map tour template at a specific page? This is the behaviour we want, but in AppStudio

Cheers,

Matt English

0 Kudos
5 Replies
LoayehJumbam
New Contributor II

Hi Matt,

We have updated the github link with information on how you can capture the url parameters from a custom app link. Here is the code snippet.

We will include this as an upcoming enhancement for the map tour template.

Thanks,

Loayeh

0 Kudos
MapEnglish
Occasional Contributor

Is it possible to test this in AppStudio Player or from within Qt Creator? If so, how? 

0 Kudos
LoayehJumbam
New Contributor II

Matt, no it is not possible to test this within the player. You will need to have a built app installed on your device. You can install a built app and test the app's link by accessing the link from a browser. Doing this prompts you to launch the app.

I can, for example, write the app below, and give it an app link of applink1. When I build and install the app on my device, I can call it from a browser by visiting the link applink1://?latitude=40

import QtQuick 2.7

import ArcGIS.AppFramework 1.0

App {
    id: app


    width: 400
    height: 640

    Text {
        id: txt
        text: "No parameter called latitude exists"
        anchors.fill: parent
        wrapMode: Text.WordWrap
        font.pointSize: 24
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
    }

    onOpenUrl: {
        var urlInfo = AppFramework.urlInfo(url);
        var openParameters = urlInfo.queryParameters;

        if (openParameters.hasOwnProperty("latitude")) {
            txt.text = "Latitude is " + openParameters.latitude;
        }
    }
}

0 Kudos
MapEnglish
Occasional Contributor

As a follow-on to this, based on the queryParameters I'd like to bypass the landing page and open up a particular map tour from the gallery - there may be 10 tours in the gallery. What would the code look like to do this?

Thanks,

Matt

0 Kudos
by Anonymous User
Not applicable

Hi,

Launching Map Tour at a specific page through a custom URL Scheme is supported since AppStudio 3.0 release.  

You can check how to use it in this blog post.  I hope it helps

Thanks,

Tina 

0 Kudos