Class MapLayer
Represents MapLayer. The MapLayer class servers as a base class for all the type of layers in the maps.
Namespace: Syncfusion.SfMaps.XForms
Assembly: Syncfusion.SfMaps.XForms.dll
Syntax
public abstract class MapLayer : Element, IThemeElement
Constructors
MapLayer()
Initializes a new instance of the MapLayer class.
Declaration
public MapLayer()
Fields
MarkerItemsSourceProperty
Gets or sets the marker items source property.
Declaration
public static readonly BindableProperty MarkerItemsSourceProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MarkerSettingsProperty
Gets or setsv the marker setting property.
Declaration
public static readonly BindableProperty MarkerSettingsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MarkersProperty
Gets or sets the marker property.
Declaration
public static readonly BindableProperty MarkersProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MarkerTemplateProperty
Gets or sets the marker template property.
Declaration
public static readonly BindableProperty MarkerTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ResetOldSelectedViewProperty
Gets or sets whether need to reset previous marker selection view.
Declaration
public static readonly BindableProperty ResetOldSelectedViewProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
SublayersProperty
Gets or sets the Sublayers property.
Declaration
public static readonly BindableProperty SublayersProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Properties
MarkerItemsSource
Gets or sets the MapMarker markers collection to maps layer to add markers on maps. This property is recommended when using custom map markers that are inherited from MapMarker and can only be used to assign markers in code behind. To add markers from XAML page, use Markers property of the layer.
Declaration
public IEnumerable<MapMarker> MarkerItemsSource { get; set; }
Property Value
Type |
---|
System.Collections.Generic.IEnumerable<MapMarker> |
Markers
Gets or sets the value for markers.
Declaration
public ObservableCollection<MapMarker> Markers { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<MapMarker> |
MarkerSettings
Gets or sets the value for marker setting.
Declaration
public MapMarkerSetting MarkerSettings { get; set; }
Property Value
Type |
---|
MapMarkerSetting |
MarkerTemplate
Gets or sets the value for marker template.
Declaration
public DataTemplate MarkerTemplate { get; set; }
Property Value
Type |
---|
Xamarin.Forms.DataTemplate |
ResetOldSelectedView
Gets or sets a value indicating whether need to reset previous marker selection view.
Declaration
public bool ResetOldSelectedView { get; set; }
Property Value
Type |
---|
System.Boolean |
Sublayers
Gets or sets the Sublayer for the map layer.
Declaration
public ObservableCollection<ShapeFileLayer> Sublayers { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<ShapeFileLayer> |
Methods
GeopointToViewPoint(Double, Double)
Convert latitude and longitude values to view's x and y points.
Declaration
public Point GeopointToViewPoint(double latitude, double longitude)
Parameters
Type | Name | Description |
---|---|---|
System.Double | latitude | To get the latitude value. |
System.Double | longitude | To get the longitude value. |
Returns
Type | Description |
---|---|
Xamarin.Forms.Point | returns the point X and pointY values. |
GetLatLonFromPoint(Point)
Convert point X and point Y to longitude and latitude values.
Declaration
public Point GetLatLonFromPoint(Point point)
Parameters
Type | Name | Description |
---|---|---|
Xamarin.Forms.Point | point | To get point x and y value. |
Returns
Type | Description |
---|---|
Xamarin.Forms.Point | returns the longitude and latitude values. |
OnMapMarkerSelected(MapMarker)
This method is called when the map marker is selected.
Declaration
public void OnMapMarkerSelected(MapMarker marker)
Parameters
Type | Name | Description |
---|---|---|
MapMarker | marker | Arguments. |
OnMarkerSelected(MapMarker)
This method is called when the map marker is selected.
Declaration
public DataTemplate OnMarkerSelected(MapMarker selectedMarker)
Parameters
Type | Name | Description |
---|---|---|
MapMarker | selectedMarker | MapMarker. |
Returns
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | Custom View. |
Events
MarkerSelected
Event raised when a marker is selected
Declaration
public event EventHandler<MarkerSelectedEventArgs> MarkerSelected
Event Type
Type |
---|
System.EventHandler<MarkerSelectedEventArgs> |