Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class MapLayer

    Show / Hide Table of Contents

    Class MapLayer

    Represents MapLayer. The MapLayer class servers as a base class for all the type of layers in the maps.

    Inheritance
    System.Object
    MapLayer
    ImageryLayer
    ShapeFileLayer
    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 Description
    Xamarin.Forms.BindableProperty

    MarkerSettingsProperty

    Gets or setsv the marker setting property.

    Declaration
    public static readonly BindableProperty MarkerSettingsProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    MarkersProperty

    Gets or sets the marker property.

    Declaration
    public static readonly BindableProperty MarkersProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    MarkerTemplateProperty

    Gets or sets the marker template property.

    Declaration
    public static readonly BindableProperty MarkerTemplateProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    ResetOldSelectedViewProperty

    Gets or sets whether need to reset previous marker selection view.

    Declaration
    public static readonly BindableProperty ResetOldSelectedViewProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    SublayersProperty

    Gets or sets the Sublayers property.

    Declaration
    public static readonly BindableProperty SublayersProperty
    Field Value
    Type Description
    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 Description
    System.Collections.Generic.IEnumerable<MapMarker>

    Markers

    Gets or sets the value for markers.

    Declaration
    public ObservableCollection<MapMarker> Markers { get; set; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ObservableCollection<MapMarker>

    MarkerSettings

    Gets or sets the value for marker setting.

    Declaration
    public MapMarkerSetting MarkerSettings { get; set; }
    Property Value
    Type Description
    MapMarkerSetting

    MarkerTemplate

    Gets or sets the value for marker template.

    Declaration
    public DataTemplate MarkerTemplate { get; set; }
    Property Value
    Type Description
    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 Description
    System.Boolean

    Sublayers

    Gets or sets the Sublayer for the map layer.

    Declaration
    public ObservableCollection<ShapeFileLayer> Sublayers { get; set; }
    Property Value
    Type Description
    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 Description
    System.EventHandler<MarkerSelectedEventArgs>
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved