We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

LabelSource not binding at runtime

I am using the following XAML in my application based on your Databinding demo code.

<syncfusion:MapControl ShowLatLonPoints="False" ShapeFill="#F5F1EE" ShapeStroke="#B5B3B1" Name="Map" LayeredContent="{Binding ElementName=shapeLayer}"  >
                        <syncfusion:MapControl.Layers>
                            <syncfusion:Layers>
                                <syncfusion:ShapeFileLayer  LabelSource="{Binding CountryCount}" Uri="Application.Assets.world.shp" x:Name="shapeLayer"/>
                            </syncfusion:Layers>
                        </syncfusion:MapControl.Layers>
                    </syncfusion:MapControl>

When the map loads none of the labels are showing up.  The only difference I can see is that in your sample you use the source as a StaticResource instead of databinding to a ViewModel.  Can you provide some guidance? 

The LabelSource object I am binding too is an exact copy of your ObservableCollection<MapsLabel>. 

1 Reply

RA Rajkumar Syncfusion Team May 16, 2012 01:10 PM UTC

Hi John,

Sorry for the delayed response.

We have analyzed the reported issue and this issue occurs when the “ShapeFileLayer” is placed inside the Layers collection. However this can be achieved by placing ShapeFileLayer inside “LayeredContent” as in below code snippet, the labels will display in Map.

Code Snippet:
[Xaml]

<syncfusion:MapControl  LatitudeLongitudeType="Decimal" ShapeFill="#FFB67373" ShapeStroke="#B5B3B1" Name="Map"  ShapeStrokeThickness="1.5" EnableHoverEffects="True" ShapeHoverFill="#3FB67373" ShowNavigationControl="False" ShowLatLonPoints="False"  >
<syncfusion:MapControl.LayeredContent>
<syncfusion:ShapeFileLayer Margin="100"    LabelSource="{Binding Labels}" Uri="DataBindingDemo.ShapeFiles.states.shp" x:Name="shapeLayer"/>
</syncfusion:MapControl.LayeredContent>
</syncfusion:MapControl>

We are analyzing the problem while using inside "ShapeFileLayer" in source level and we will update you the status.

Please let us know if you have any concerns.

Regards,
Rajkumar B R


Loader.
Live Chat Icon For mobile
Up arrow icon