ThinkGeo.com    |     Documentation    |     Premium Support

ThinkGeo 14 - AsyncLayer problem

Hi,

After updating to last version I have a problem in my 2023 blazor projects.

Some class are deprecated (ex : OpenStreetMapLayer >> OpenStreetMapAsyncLayer) and I don’t find any solution to use them.

For example, I have this code :

OpenStreetMapLayer layer = new OpenStreetMapLayer(); 
layer.SendingHttpRequest += Osm_SendingWebRequest; 
layer.CustomServerUris.Add(new Uri("https://tile.openstreetmap.org/{0}/{1}/{2}.png"));
 osmLayers.Add(layer);

I changed it to OpenStreetMapAsyncLayer but after that it wasn’t compatible with osmLayers cause it’s a GeoCollection of Layer.

If I change the list to GeoCollection of AsyncLayer, then I have another problem in my html code cause AsyncLayer can’t be cast to Layer.

 <LayerOverlay Id="OSMLayerOverlay"               
MaxExtent="@(new RectangleShape(-20037508, 20037508, 20037508, -20037508))"                
Layers="@osmLayers" IsVisible=false>

Everything was working before I updated to the last version :frowning:

Can you please help me???

Thanks

Hi Ismael,

Sorry for the confusion.

AsyncLayer and Layer are both inherit from LayerBase. As a result the LayerOverlay.Layers should now be a collection of LayerBase instead of Layer. We have fixed this issue in the latest beta020, please pull the latest and have a try.

Thanks,
Ben

1 Like

Hi Ben,

Thank you, I’ll try today !

Sure! We will put this feature in the next production update v14.2.2, maybe in a month or so.

1 Like

Thank you Ben, it’s buildng but not working :frowning:

Hi Ben,
After testing, unfortunately the OpenStreetMapAsyncLayer it’s not loaded.
Everything was working well before updating to v14 :frowning:
Any idea?


Cdt

Finally, it’s working !!!

That’s Awesome ! :+1: