menu

MAUI

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

    Show / Hide Table of Contents

    Class MapLatLngBounds

    Represents MapLatLngBounds class.

    Inheritance
    System.Object
    MapLatLngBounds
    Namespace: Syncfusion.Maui.Maps
    Assembly: Syncfusion.Maui.Maps.dll
    Syntax
    public class MapLatLngBounds : BindableObject
    Examples
    • XAML
    • C#
     <map:SfMaps>
        <map:SfMaps.Layer>
           <map:MapTileLayer UrlTemplate = "https://tile.openstreetmap.org/{z}/{x}/{y}.png" >
                <map:MapTileLayer.ZoomPanBehavior>
                     <map:MapZoomPanBehavior ZoomLevel = "5" />
                </map:MapTileLayer.ZoomPanBehavior>
                <map:MapTileLayer.LatLngBounds>
                    <map:MapLatLngBounds>
                          <map:MapLatLngBounds.Northeast>
                              <map:MapLatLng>
                                 <x:Arguments>
                                     <x:Double>38.909804</x:Double>
                                     <x:Double>-77.043442</x:Double>
                                 </x:Arguments>
                             </map:MapLatLng>
                          </map:MapLatLngBounds.Northeast>
                          <map:MapLatLngBounds.Southwest>
                              <map:MapLatLng>
                                 <x:Arguments>
                                     <x:Double>13.048155</x:Double>
                                     <x:Double>80.083858</x:Double>
                                 </x:Arguments>
                             </map:MapLatLng>
                         </map:MapLatLngBounds.Southwest>
                     </map:MapLatLngBounds>
                 </map:MapTileLayer.LatLngBounds>
             </map:MapTileLayer>
        </map:SfMaps.Layer>
    </map:SfMaps>
    SfMaps map = new SfMaps();
    MapTileLayer tileLayer = new MapTileLayer();
    tileLayer.UrlTemplate = "https://tile.openstreetmap.org/{z}/{x}/{y}.png";
    MapZoomPanBehavior zoomPanBehavior = new MapZoomPanBehavior();
    zoomPanBehavior.ZoomLevel = 5;
    tileLayer.ZoomPanBehavior = zoomPanBehavior;
    MapLatLngBounds bounds = new MapLatLngBounds();
    bounds.Northeast = new MapLatLng(38.909804, -77.043442);
    bounds.Southwest = new MapLatLng(13.048155, 80.083858);
    tileLayer.LatLngBounds = bounds;
    map.Layer = tileLayer;
    this.Content = map;

    Constructors

    MapLatLngBounds()

    Declaration
    public MapLatLngBounds()

    Fields

    NortheastProperty

    Identifies the Northeast bindable property.

    Declaration
    public static readonly BindableProperty NortheastProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for Northeast bindable property.

    SouthwestProperty

    Identifies the Southwest bindable property.

    Declaration
    public static readonly BindableProperty SouthwestProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for Southwest bindable property.

    Properties

    Northeast

    Gets or sets the northeast corner of the geo bounds.

    Declaration
    public MapLatLng Northeast { get; set; }
    Property Value
    Type Description
    MapLatLng

    The geo bounds value of northest.

    Examples
    • XAML
    • C#
     <map:SfMaps>
        <map:SfMaps.Layer>
           <map:MapTileLayer UrlTemplate = "https://tile.openstreetmap.org/{z}/{x}/{y}.png" >
                <map:MapTileLayer.ZoomPanBehavior>
                     <map:MapZoomPanBehavior ZoomLevel = "5" />
                </map:MapTileLayer.ZoomPanBehavior>
                <map:MapTileLayer.LatLngBounds>
                    <map:MapLatLngBounds>
                          <map:MapLatLngBounds.Northeast>
                              <map:MapLatLng>
                                 <x:Arguments>
                                     <x:Double>38.909804</x:Double>
                                     <x:Double>-77.043442</x:Double>
                                 </x:Arguments>
                             </map:MapLatLng>
                          </map:MapLatLngBounds.Northeast>
                          <map:MapLatLngBounds.Southwest>
                              <map:MapLatLng>
                                 <x:Arguments>
                                     <x:Double>13.048155</x:Double>
                                     <x:Double>80.083858</x:Double>
                                 </x:Arguments>
                             </map:MapLatLng>
                         </map:MapLatLngBounds.Southwest>
                     </map:MapLatLngBounds>
                 </map:MapTileLayer.LatLngBounds>
             </map:MapTileLayer>
        </map:SfMaps.Layer>
    </map:SfMaps>
    SfMaps map = new SfMaps();
    MapTileLayer tileLayer = new MapTileLayer();
    tileLayer.UrlTemplate = "https://tile.openstreetmap.org/{z}/{x}/{y}.png";
    MapZoomPanBehavior zoomPanBehavior = new MapZoomPanBehavior();
    zoomPanBehavior.ZoomLevel = 5;
    tileLayer.ZoomPanBehavior = zoomPanBehavior;
    MapLatLngBounds bounds = new MapLatLngBounds();
    bounds.Northeast = new MapLatLng(38.909804, -77.043442);
    bounds.Southwest = new MapLatLng(13.048155, 80.083858);
    tileLayer.LatLngBounds = bounds;
    map.Layer = tileLayer;
    this.Content = map;

    Southwest

    Gets or sets the southwest corner of the geo bounds.

    Declaration
    public MapLatLng Southwest { get; set; }
    Property Value
    Type Description
    MapLatLng

    The geo bounds value of southwest.

    Examples
    • XAML
    • C#
     <map:SfMaps>
        <map:SfMaps.Layer>
           <map:MapTileLayer UrlTemplate = "https://tile.openstreetmap.org/{z}/{x}/{y}.png" >
                <map:MapTileLayer.ZoomPanBehavior>
                     <map:MapZoomPanBehavior ZoomLevel = "5" />
                </map:MapTileLayer.ZoomPanBehavior>
                <map:MapTileLayer.LatLngBounds>
                    <map:MapLatLngBounds>
                          <map:MapLatLngBounds.Northeast>
                              <map:MapLatLng>
                                 <x:Arguments>
                                     <x:Double>38.909804</x:Double>
                                     <x:Double>-77.043442</x:Double>
                                 </x:Arguments>
                             </map:MapLatLng>
                          </map:MapLatLngBounds.Northeast>
                          <map:MapLatLngBounds.Southwest>
                              <map:MapLatLng>
                                 <x:Arguments>
                                     <x:Double>13.048155</x:Double>
                                     <x:Double>80.083858</x:Double>
                                 </x:Arguments>
                             </map:MapLatLng>
                         </map:MapLatLngBounds.Southwest>
                     </map:MapLatLngBounds>
                 </map:MapTileLayer.LatLngBounds>
             </map:MapTileLayer>
        </map:SfMaps.Layer>
    </map:SfMaps>
    SfMaps map = new SfMaps();
    MapTileLayer tileLayer = new MapTileLayer();
    tileLayer.UrlTemplate = "https://tile.openstreetmap.org/{z}/{x}/{y}.png";
    MapZoomPanBehavior zoomPanBehavior = new MapZoomPanBehavior();
    zoomPanBehavior.ZoomLevel = 5;
    tileLayer.ZoomPanBehavior = zoomPanBehavior;
    MapLatLngBounds bounds = new MapLatLngBounds();
    bounds.Northeast = new MapLatLng(38.909804, -77.043442);
    bounds.Southwest = new MapLatLng(13.048155, 80.083858);
    tileLayer.LatLngBounds = bounds;
    map.Layer = tileLayer;
    this.Content = map;
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved