Scene Not Loading the Map Properly

385
1
Jump to solution
08-30-2022 01:24 AM
AnthonyWalsh3
New Contributor II

I asked a similar question once (File Geodatabase Not Loading Properly on SceneView), but since I couldn't get a useful answer and there are now more details on the problem, I want to ask this again. 

Problem: When I try to load a map, image, file geodatabase etc. using LocalServerArcGISMapImageLayer (the function I used is provided below) on a scene, only a small part of the map is shown (part of North America & Pacific Ocean) as seen in the image below: 

RuntimeHata.png(This is a basemap image that  should cover whole earth surface)

 The same code works without any problems for the MapView in the same app. The function I use for loading a single image can be seen below: (I use this function instead of a simpler way using Raster and RasterLayer classes, because .ECW files and filegeotabases can only be loaded using Local Server as far as I know.)

public async static void DisplayImg(Geomodel geomodel, string imgFolderPath, string imgFileName)
{
    LocalMapService localMapService = new LocalMapService(EMPTY_MPKX_PATH);
    RasterWorkSpace rasterWorkSpace = new RasterWorkSpace("Raster", imgFolderPath);
    RasterSublayerSource rasterSublayerSource = new RasterSublayerSource(rasterWorkSpace.Id, imgFileName);
    ArcGISMapImageSublayer arcGISMapImageSublayer = new ArcGISMapImageSublayer(0, rasterSublayerSource);
    localMapService.SetDynamicWorkspaces( new List<DynamicWorkspace>(){rasterWorkSpace} );
    await localMapService.StartAsync();

    ArcGISMapImageLayer arcGISMapImageLayer = new ArcGISMapImageLayer(localMapService.Url);
    await arcGISMapImageLayer.LoadAsync();
    ArcGISMapImageLayer.Sublayers.Add(arcGISMapImageSublayer);
    geomodel.OperationalLayers.Add(arcGISMapImageLayer);
}

(The Function for loading file geodatabase is similar, using LocalMapService, ArcGISMapImageSublayer, ArcGISMapImageLayer classes)

 

Questions:

Is there something wrong in this function (again, same function works fine for Map)?, Is there any other ways to load .ecw files (directly) or file geotabases?

What could this be related to? Previously, this problem did not occur on some computers, but now it seems it is problematic on all computers I tried.

Note: this happens on arcgisruntime and localserver 100.15 versions. 100.14 version could not load .ecw files.

 

0 Kudos
1 Solution

Accepted Solutions
AnthonyWalsh3
New Contributor II

I finally figured out that the file (EMPTY_MPKX_PATH) passed as a parameter while initiating LocalMapServer has not proper extent. After creating a new mpkx file that covers whole world, I managed to load scene properly.

View solution in original post

0 Kudos
1 Reply
AnthonyWalsh3
New Contributor II

I finally figured out that the file (EMPTY_MPKX_PATH) passed as a parameter while initiating LocalMapServer has not proper extent. After creating a new mpkx file that covers whole world, I managed to load scene properly.

0 Kudos