Accessing secure layer in Appstudio version 2

521
1
Jump to solution
07-24-2017 06:54 AM
KarpagamElango
New Contributor

Hi,

Can this be updated for the new Appstudio version 2

Access Secured ArcGIS Layers in your App using Runtime · Esri/arcgis-appstudio-samples Wiki · GitHub...

Access secured layer with credentials saved in the app.

Thanks

Karpa

0 Kudos
1 Solution

Accepted Solutions
NakulManocha
Esri Regular Contributor

Hi there,

Here is the working code using Runtime 100.1. The old code is using the Runtime 10.2.6. The new Runtime 100.1 got few changes as far as component names go. Plus now there is a new MapView component which is container for Map component. Please refer our samples which are based on the newer runtime. The new samples are available within the AppStudio Desktop and the github. For doc help please refer here. I hope this helps.

Thanks,

Nakul

import QtQuick.Controls 2.1
import QtQuick 2.3
import ArcGIS.AppFramework 1.0
import Esri.ArcGISRuntime 100.1
App {
    id: app
    width: 800
    height: 532
    Credential{
        id:cred
        username: "user1"
        password: "user1"
    }

    ServiceFeatureTable {
        id: serviceFeatureTable
        url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire_secure_ac/FeatureServer/0"
        credential: cred
    }
    MapView{
        anchors.fill: parent
        Map {
            id: map
            Basemap {
                ArcGISTiledLayer {
                    url: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
                }
            }
            FeatureLayer{
                featureTable: serviceFeatureTable
            }
        }
    }
}

View solution in original post

1 Reply
NakulManocha
Esri Regular Contributor

Hi there,

Here is the working code using Runtime 100.1. The old code is using the Runtime 10.2.6. The new Runtime 100.1 got few changes as far as component names go. Plus now there is a new MapView component which is container for Map component. Please refer our samples which are based on the newer runtime. The new samples are available within the AppStudio Desktop and the github. For doc help please refer here. I hope this helps.

Thanks,

Nakul

import QtQuick.Controls 2.1
import QtQuick 2.3
import ArcGIS.AppFramework 1.0
import Esri.ArcGISRuntime 100.1
App {
    id: app
    width: 800
    height: 532
    Credential{
        id:cred
        username: "user1"
        password: "user1"
    }

    ServiceFeatureTable {
        id: serviceFeatureTable
        url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire_secure_ac/FeatureServer/0"
        credential: cred
    }
    MapView{
        anchors.fill: parent
        Map {
            id: map
            Basemap {
                ArcGISTiledLayer {
                    url: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
                }
            }
            FeatureLayer{
                featureTable: serviceFeatureTable
            }
        }
    }
}

View solution in original post