ShareData: Dynamic value

I am looking to pass dynamic value (dynamically select the Json file) so I can have one control and reuse it with different maps. I am creating the file but when I set this on Initialized in my control i keep getting error.

<MapsLayer ShapeData='@MapUrl'>
<MapsShapeSettings Fill="#E5E5E5">
<MapsShapeBorder Color="black" Width="0.1">MapsShapeBorder>
MapsShapeSettings>
@* To add data labels *@
<MapsDataLabelSettings Visible="true" LabelPath="name">MapsDataLabelSettings>
<MapsShapeSettings Autofill="true">MapsShapeSettings>
MapsLayer>

MapsLayers>

1 Reply

SB Swetha Babu Syncfusion Team April 13, 2020 12:05 PM UTC

Hi Vijay, 

Greetings from Syncfusion. 

You can render multiple layers with maps control. To achieve this, you need to add multiple layers to the MapsLayers property of the control. You can select the layer to be displayed in the view page using the BaseLayerIndex property in maps. We have created a sample to demonstrate the same and it can be downloaded from the following link. 


In the above sample, a button component is used to change the layer of the maps. The geometric map renders initially. On button click, the maps component will render OSM map. 

Please let us know that the above sample meets your requirements. If not, please provide us more details about your requirements. It will be helpful for us to analyze further and assist you better. 

Regards, 
Swetha Babu

Loader.
Up arrow icon