menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class MapMarkerCollection - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class MapMarkerCollection

    Represents the map marker collection.

    Inheritance
    System.Object
    MapMarkerCollection
    Namespace: Syncfusion.Maui.Maps
    Assembly: Syncfusion.Maui.Maps.dll
    Syntax
    public class MapMarkerCollection : ObservableCollection<MapMarker>
    Examples
    • XAML
    • C#
    <map:SfMaps>
       <map:SfMaps.Layer>
          <map:MapShapeLayer x:Name="layer"
                             ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
    
             <map:MapShapeLayer.Markers>
                 <map:MapMarkerCollection>
                     <map:MapMarker x:Name="Seattle"
                                    Latitude="47.60621"
                                    Longitude="-122.332071" />
                     <map:MapMarker x:Name="Belem"
                                    Latitude="-1.455833"
                                    Longitude="-48.503887" />
                 </map:MapMarkerCollection>
             </map:MapShapeLayer.Markers>
    
          </map:MapShapeLayer>
       </map:SfMaps.Layer>
    </map:SfMaps>
    SfMaps maps = new SfMaps();
    MapShapeLayer layer = new MapShapeLayer();
    layer.ShapesSource = MapSource.FromUri(new Uri("https://cdn.syncfusion.com/maps/map-data/world-map.json"));
    MapMarker mapMarker1 = new MapMarker();
    mapMarker1.Latitude = 47.60621;
    mapMarker1.Longitude = -122.332071;
    MapMarker mapMarker2 = new MapMarker();
    mapMarker2.Latitude = -1.455833;
    mapMarker2.Longitude = -48.503887;
    MapMarkerCollection mapMarkers = new MapMarkerCollection();
    mapMarkers.Add(mapMarker1);
    mapMarkers.Add(mapMarker2);
    layer.Markers = mapMarkers;
    maps.Layer = layer;
    this.Content = maps;

    Constructors

    MapMarkerCollection()

    Declaration
    public MapMarkerCollection()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved