Select to view content in your preferred language

.NET MAUI application on iOS loads offline vector package but doesn't show

248
7
2 weeks ago
Labels (3)
GKmieliauskas
Esri Regular Contributor

Hi,

We have application with offline content (vtpk).  We use vptk packages as basemap. It works fine on Android but on iOS doesn't (blank screen). I have tried different vector tile packages, but only with one of them I succeeded. It was in different coordinate system (WGS 1984 Web Mercator) then our application packages. Our application packages spatial reference wkid is 3346. Another one difference is that working package was created later and maybe with different software versions because we migrate application from AppStudio code to ArcGIS Maps for .NET MAUI. Code below:

 

 

ArcGISVectorTiledLayer layer = new ArcGISVectorTiledLayer(new Uri(tileCachePath));

_map = new Map(SpatialReference.Create(3346))
{
    Basemap = new Basemap(layer),
    MinScale = 8000000,
    MaxScale = 1200
};

_map.LoadStatusChanged += OnMapsLoadStatusChanged;


        private void OnMapsLoadStatusChanged(object sender, LoadStatusEventArgs e)
        {
                switch(e.Status)
                {
                    case LoadStatus.Loading:
                        Logger.Debug($"Map's load status : {e.Status}");
                        break;
                    case LoadStatus.Loaded:
                        _map.InitialViewpoint = new Viewpoint(new MapPoint(499629.435, 6124677.283, SpatialReference.Create(3346)), 7500000);
                        break;
                    case LoadStatus.FailedToLoad:
                        Logger.Error($"Map's load status : {e.Status}");
                        break;
                }
        }

 

 

Map and viewpoint spatial reference were changed depending on vtpk source.

Any help would be appreciated.

Tags (3)
0 Kudos
7 Replies
PreetiMaske
Esri Regular Contributor

It's bizzare it would work on Android but not on iOS.
What do you see on iOS when you run the app:
- White mapview with esri logo or
- Gray map with empty grid
- Do you see any attribution text on the bottom?
- What is map's loadstatus when it does not render on iOS?

You could also try subscribing to `MapView.LayerViewStateChanged`  to get more info on layer's rendering state.

I am happy to try if you are able to share the vtpk that does not render on iOS.

0 Kudos
GKmieliauskas
Esri Regular Contributor

Thanks for helpful comments @PreetiMaske .

I subscribed to `MapView.LayerViewStateChanged` and get error #7003 on vector tiled layer view state changing. Could you help me please with error code meaning?

GKmieliauskas_0-1719475468531.png

 

0 Kudos
PreetiMaske
Esri Regular Contributor

If you expand further down you could see the the error message as well via `Status` property. 

Anyways, for a VTPK, that indicates we could not understand something in one of the internal files. For example, we could not parse some of the style json inside the VTPK. 
It should not happen if it was directly authored from Pro.

How are the VTPKs authored for you? Did you use ArcGIS Pro ?

0 Kudos
GKmieliauskas
Esri Regular Contributor

The error message says:

Invalid request response: Cannot load vtpk from '/var/mobile/Containers/Data/Application/7171FE95-8F47-43D7-AC3C-2332C3EC3670/Documents/waterways/offlinecache/************.vtpk'. Message was: IO error.

Package was created with ArcGIS Pro, but I don't know which version. I will send you vtpk url for testing.

0 Kudos
PreetiMaske
Esri Regular Contributor

I was able to open and render the vtpk you shared with me on an iPad.

What version on ArcGIS Maps SDK for .NET are you using?

0 Kudos
GKmieliauskas
Esri Regular Contributor

I am using  Esri.ArcGISRuntime.Maui version 200.4.0.

We have made new package, published it and now it works on iOS.

0 Kudos
PreetiMaske
Esri Regular Contributor

Good to hear it is working for you!

0 Kudos