Esri / arcgis-runtime-samples-android

ArcGIS Runtime SDK for Android Samples

Home Page:https://developers.arcgis.com/android/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

android arcgis WebTiledLayer

will12190 opened this issue · comments

GitHub is ONLY used for issues pertaining to ArcGIS Runtime SDK Samples. Use GeoNet for any general ArcGIS Runtime Android SDK questions.

ArcGIS Android SDK I use; Use the webtiledlayer to load a TIF graph on the network. The requested resources need to transmit other parameters such as token; Now how do I view the log of requests and replies? Now TIF has been unable to load successfully, and there is no prompt. Where can I track the problem?

Does Android SDK have a log switch? I see that the IOS SDK has log printing

You can look into the load error for more information on why the load was unsuccessful: https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/layers/Layer.html#getLoadError()

But I'd ask that you use the ArcGIS Community for questions not immediately relevant to the samples in this repo: https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/bd-p/arcgis-runtime-sdk-for-android-questions

Thanks!

You can look into the load error for more information on why the load was unsuccessful: https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/layers/Layer.html#getLoadError()

But I'd ask that you use the ArcGIS Community for questions not immediately relevant to the samples in this repo: https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/bd-p/arcgis-runtime-sdk-for-android-questions

Thanks!

The log shows that the status is loaded; But the picture didn't show up;Can you take a look? The code is as follows

ArcGISRuntimeEnvironment.setLicense("runtimelite,1000,rud2872614694,none,TRB3LNBHPDKL6XCFK250");
ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);

    sceneView.setAttributionTextVisible(false);

    //底图
    val elevationSource =

ArcGISTiledElevationSource("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer");
val surface = Surface(listOf(elevationSource));

    val arcGISScene = ArcGISScene(Basemap.createImagery());
    arcGISScene.baseSurface = surface;

    val camera = Camera(
        52.40978629261867,
        13.04650812949785,
        284.73511,
        295.75,
        76.80,
        0.0
    );
    sceneView.setViewpointCamera(camera);

    sceneView.scene = arcGISScene;
    sceneView.atmosphereEffect = AtmosphereEffect.REALISTIC;


    val webTiledLayer =
        WebTiledLayer("https://geogenius.ap-southeast-1.myhuaweicloud.com/v1/0c9e96f1f600f38e2f58c00099ba34e9/image/tile/{col}/{row}/{level}?url=obs://geo-geogenius-admin1df3ae0a/szy_test/testdata.tif&color_formula=Gamma%20R%201%20Sigmoidal%20R%201%200.5&bands=1");
    //https://geogenius.ap-southeast-1.myhuaweicloud.com/v1/0c9e96f1f600f38e2f58c00099ba34e9/image/tile/70286/43051/17?url=obs://geo-geogenius-admin1df3ae0a/szy_test/testdata.tif&color_formula=Gamma%20R%201%20Sigmoidal%20R%201%200.5&bands=1

    webTiledLayer.requestConfiguration = RequestConfiguration();
    webTiledLayer.requestConfiguration.headers.put(
        "x-auth-token",
        "****"
    );

    arcGISScene.operationalLayers.add(webTiledLayer);

    webTiledLayer.loadAsync();
    webTiledLayer.addDoneLoadingListener {
        Log.e(TAG, "loadStatus="+webTiledLayer.loadStatus);
        if (webTiledLayer.loadStatus == LoadStatus.LOADED) {
            Log.e(TAG, "load sucess");
        } else {
            val error = "Error loading image raster layer: " + webTiledLayer.loadError;
            Log.e(TAG, error);
        }
    }