The ArcGIS type LocationDisplay is not creatable

475
5
Jump to solution
05-05-2020 05:51 AM
RaulLeos
New Contributor II

I am not so experience with programming, I built a custom app with appstudio for arcgis 1.0 and on the process of the upgrade to appstudio for arcgis 4.2 some modules and classes have changed. I not that familiar with all the changes. Now I am getting a error message "the arcgis type location display is not creatable"

here is part of the code where i get the error message.
onLoadStatusChanged: {

if (loadStatus === Enums.LoadStatusLoaded) {
mapView.locationDisplay.autoPanMode = Enums.LocationDisplayAutoPanModeRecenter;
mapView.locationDisplay.start();
}
}

// onLoadStatusChanged: {
// if (status === Enums.MapStatusReady) {
// positionSource.active = true;
// }
// }
//CREATE USER POSITION DISPLAY modified 042120

LocationDisplay {
id: locationDisplay
positionSource: PositionSource {
id: positionSource
}
}

0 Kudos
1 Solution

Accepted Solutions
ErwinSoekianto
Esri Regular Contributor

Raul,

Upgrading from AppStudio 1.0 to AppStudio 4.2 is a huge jump, there are a lot of libraries that might be deprecated already. This error specifically is I think related to the different version of ArcGIS Runtime SDK for Qt‌ from 10.2.x to 100.7.

These are the documentation related to the Map View and Location Display object on the latest ArcGIS Runtime SDK for Qt, 

- Sample, Display device location | ArcGIS for Developers  

- LocationDisplay Object, LocationDisplay QML Type | ArcGIS for Developers 

This statement from the LocationDisplay doc might help you, 

Each MapView has its own instance of LocationDisplay. This means that you don't have to explicitly instantiate LocationDisplay, but rather, a newly created MapView already has a LocationDisplay that should be used.

I hope this is helpful,

Erwin.

View solution in original post

0 Kudos
5 Replies
ErwinSoekianto
Esri Regular Contributor

Raul,

Upgrading from AppStudio 1.0 to AppStudio 4.2 is a huge jump, there are a lot of libraries that might be deprecated already. This error specifically is I think related to the different version of ArcGIS Runtime SDK for Qt‌ from 10.2.x to 100.7.

These are the documentation related to the Map View and Location Display object on the latest ArcGIS Runtime SDK for Qt, 

- Sample, Display device location | ArcGIS for Developers  

- LocationDisplay Object, LocationDisplay QML Type | ArcGIS for Developers 

This statement from the LocationDisplay doc might help you, 

Each MapView has its own instance of LocationDisplay. This means that you don't have to explicitly instantiate LocationDisplay, but rather, a newly created MapView already has a LocationDisplay that should be used.

I hope this is helpful,

Erwin.

0 Kudos
RaulLeos
New Contributor II

Hi Erwin,

Thank you so much for the explanation, this really worked.

RaulLeos
New Contributor II

Hi Erwin,

I am not able to capture data and getting this error message. Need help

MyApp.qml:243: ReferenceError: positionDisplay is not defined

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Raul, 

I think positionDisplay was available in ArcGIS Runtime version 10.2 Position display—ArcGIS Runtime SDK for Qt | ArcGIS for Developers , but no longer in version 100.x , Migrate to 100.x from 10.2.x—ArcGIS Runtime SDK for Qt | ArcGIS for Developers 

You should remove or replace it with the library that is available in version 100.x

Thank you,

Erwin

0 Kudos
RaulLeos
New Contributor II

Hi Erwin,

Here again, I was able to build application with some referenceErrors.

On executing the Mobile App

First one - userCredText is not defined

 Second - Unable to assign [undefined] to int

On performing field collection I get this 

Cannot read property 'x' of undefined

Your assistance will be greatly appreciated.

0 Kudos