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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Displaying custom markers on an OpenStreetMap map

Thread ID:

Created:

Updated:

Platform:

Replies:

145297 Jun 16,2019 10:24 PM UTC Jun 18,2019 05:36 AM UTC Xamarin.Forms 3
loading
Tags: SfMaps
James Lavery
Asked On June 16, 2019 10:24 PM UTC

Hi,
I need to display a list of markers on an SfMaps control, with the markers defined in a List - i.e. have an ItemsSource for the Layer.

However, it seems that ItemsSource is only available for a ShapeFileLayer.

How can I have a List of items displayed on an ImageryLayer? I need to create a custom Marker with bound properties - the attributes of the marker being bound to the Item's properties (to display wind speed and direction at the location).

Regards,

James



Bharathiraja K [Syncfusion]
Replied On June 17, 2019 12:50 PM UTC

Hi James, 
 
Greetings from Syncfusion. ShapeFileLayers’s ItemsSource property is used to bound the data to the shape file. You can add the custom marker in a Markers collection and bind the properties using MarkerTemplate as like the below code snippet. 
 
[XAML]: 
 
<maps:ImageryLayer Markers="{Binding CustomMarkers}"> 
                
                <maps:ImageryLayer.MarkerTemplate> 
                    <DataTemplate> 
                        <StackLayout Orientation="Horizontal"> 
                        <Image Source="{Binding ImageName}" Scale="1"  
                               Aspect="AspectFit " HorizontalOptions="StartAndExpand" VerticalOptions="Center"  
                               HeightRequest="15" WidthRequest="23" /> 
                        <Label Text="{Binding Label}"/> 
                        </StackLayout> 
                    </DataTemplate> 
                </maps:ImageryLayer.MarkerTemplate> 
                 
</maps:ImageryLayer> 
 
 
Please find the sample for your reference. 
 
 
Refer the following help document link for to know more about Markers. 
 
Regards, 
Bharathi.  


James Lavery
Replied On June 17, 2019 12:55 PM UTC

Thank you - that's exactly what I needed!

Regards,

James

Rachel A [Syncfusion]
Replied On June 18, 2019 05:36 AM UTC

Hi James, 
 
Thanks for your feedback. 
 
Regards, 
Rachel. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon