how to add Maplayers and or Sublayers on demand?

Hi, I'm new to SF Maps, and currently evaluating it. 


I wonder how it is possible to add a layer or sublayer to the map after the map widget is created?


I would like to do the tile and polygon request after the page is shown to the user. 

Also that the user can enable and disable layers on the fly. 

Usually, in the direct SDKs, you can do this with a MapController you get after the map is initialized. 

But I haven't found anything like this in the SFMaps Demos and docs. 

Is it not there or did I miss it?


1 Reply

YG Yuvaraj Gajaraj Syncfusion Team May 23, 2022 06:36 PM UTC

Hi Matthias,


Greetings from Syncfusion. We do not have any properties to add or remove the MapSubLayer, but you can achieve this requirement. We have created a sample, here in the button click event we have added and removed the map's sublayer dynamically. We have attached the sample below for your reference and you can change this based on your scenario.


Regards,

Yuvaraj.


Attachment: f175130_98bed847.zip

Loader.
Up arrow icon