Select to view content in your preferred language

3D elevation sometimes not working in Android

933
4
10-16-2023 05:18 AM
PietroMaps
Emerging Contributor

Hi everyone,

I am using Appstudio to create a 3D GIS mobile app. I am using the SceneView to visualize 3D maps with elevations. I have a strange bug: sometimes the elevation seems to not work in Android, while it works in all the other platforms (Windows, iOS and Mac). The bug seems to be totally random and I cannot fully reproduce the behaviour every time (except  during official presentations, where it never work!). 

This is the demo code:

 

import QtQuick 2.13
import QtQuick.Controls 2.13

import ArcGIS.AppFramework 1.0
import Esri.ArcGISRuntime 100.15


Rectangle {
    width: 800
    height: 600

    property real size: 0.01
    property int maxZ: 1000
    property var colors: []

    // Create a scene view
    SceneView {
        id: sceneView
        anchors.fill: parent

        // create a scene...scene is a default property of sceneview
        // and thus will get added to the sceneview
        Scene {
            // add a basemap
            Basemap {
                initStyle: Enums.BasemapStyleArcGISImageryStandard
            }

            // add a surface...surface is a default property of scene
            Surface {
                // add an arcgis tiled elevation source...elevation source is a default property of surface
                ArcGISTiledElevationSource {
                    url: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
                }
            }
        }

        GraphicsOverlay {
            id: graphicsOverlay

            SimpleRenderer {
                RendererSceneProperties {
                    extrusionMode: Enums.ExtrusionModeBaseHeight
                    extrusionExpression: "[height]"
                }
                SimpleFillSymbol{
                    style: Enums.SimpleFillSymbolStyleSolid;
                    color: "red"
                }
            }
        }

        Component.onCompleted: {
            // Set the focus on SceneView to initially enable keyboard navigation
            forceActiveFocus();

            // set viewpoint to the specified camera
            setViewpointCameraAndWait(camera);
        }
    }

    // create the camera to be used as the scene view's viewpoint
    Camera {
        id: camera
        location: Point {
            x: 83.9
            y: 28.4
            z: 10010.0
            spatialReference: SpatialReference { wkid: 4326 }
        }
        heading: 10.0
        pitch: 80.0
        roll: 0.0
    }
}

 

 

I am using Cloud make to create Android builds.

Thanks in advance! 

0 Kudos
4 Replies
TroyFoster
Frequent Contributor

I dont do android development, but is it possible to listen to the loadErrorChanged and loadStatusChanged signals for all your different components and then log somehow the errors that occurred?

https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-loadable.html

0 Kudos
PietroMaps
Emerging Contributor

@TroyFoster ok thanks I can try to log the error. I will update this post when and if I'll get something.

0 Kudos
TroyFoster
Frequent Contributor

My Esri conspiracy theory: none of the samples on github have error handling to keep people coming back to these forums as a way of increasing engagement with users.  Since probably 70% of the questions on here would be clarified by printing out the error message.

0 Kudos
PietroMaps
Emerging Contributor

Regarding the issue, yes printing the error should help to figure our where the issue is, but it's strange that this happens only when using the application in Android. Honestly, for me this is a bug of the framework. I will keep you updated btw!

0 Kudos