Class SfMap
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.Maps
Assembly: Syncfusion.SfMaps.WPF.dll
Syntax
public class SfMap : Control, IDisposable
Constructors
SfMap()
Creates a new Instance for the SfMap.And initialize its values.
Declaration
public SfMap()
Fields
BaseMapIndexProperty
// Using a DependencyProperty as the backing store for BaseMapIndex. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty BaseMapIndexProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
EnableLayerChangeAnimationProperty
// Using a DependencyProperty as the backing store for EnableLayerChangeAnimation. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty EnableLayerChangeAnimationProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
EnablePanProperty
// Using a DependencyProperty as the backing store for EnablePan. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty EnablePanProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
EnableZoomOnSelectionProperty
// Using a DependencyProperty as the backing store for EnableZoomOnSelection. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty EnableZoomOnSelectionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
EnableZoomProperty
// Using a DependencyProperty as the backing store for EnableZoom. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty EnableZoomProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HeaderProperty
// Using a DependencyProperty as the backing store for Header. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty HeaderProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LatitudeLongitudeTypeProperty
// Using a DependencyProperty as the backing store for LatitudeLongitudeType. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LatitudeLongitudeTypeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LayersProperty
// Using a DependencyProperty as the backing store for Layers. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LayersProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LegendSettingsProperty
Using a DependencyProperty as the backing store for LegendSettings. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendSettingsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MapCoordsProperty
// Using a DependencyProperty as the backing store for MapCoords. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapCoordsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MapResourceDictionaryProperty
Dependency registration for Syncfusion.UI.Xaml.Maps.SfMap.MapResourceDictionary
Declaration
public static readonly DependencyProperty MapResourceDictionaryProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MapStyleProperty
// Using a DependencyProperty as the backing store for MapStyle. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MaxZoomProperty
// Using a DependencyProperty as the backing store for MaxZoom. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MaxZoomProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MinZoomProperty
// Using a DependencyProperty as the backing store for MinZoom. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MinZoomProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
NavigationControlPositionProperty
// Using a DependencyProperty as the backing store for NavigationControlPosition. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty NavigationControlPositionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
NavigationControlScaleProperty
// Using a DependencyProperty as the backing store for NavigationControlScale. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty NavigationControlScaleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ShowCoordsProperty
// Using a DependencyProperty as the backing store for ShowCoords. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ShowCoordsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ShowNavigationControlProperty
// Using a DependencyProperty as the backing store for ShowNavigationControl. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ShowNavigationControlProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ZoomFactorProperty
Identifies ZoomFactor Dependency Property
Declaration
public static readonly DependencyProperty ZoomFactorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ZoomLevelProperty
// Using a DependencyProperty as the backing store for ZoomLevel. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ZoomLevelProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
BaseMapIndex
Gets or sets the index of the layer which is loaded initially.
Declaration
public int BaseMapIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Type :System.Int32 |
Remarks
Use this property to set the initial layer to be loaded in the map.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
ShapeFileLayer layer1 = new ShapeFileLayer();
layer.Uri = "MapApp.US.shp";
syncMap.Layers.Add(layer);
syncMap.Layers.Add(layer1);
syncMap.BaseMapIndex = 1;
}
}
}
EnableLayerChangeAnimation
Gets or Sets EnableLayerChangeAnimation
Declaration
public bool EnableLayerChangeAnimation { get; set; }
Property Value
Type |
---|
System.Boolean |
EnablePan
Enables or disables the Panning feature of the map.
Declaration
public bool EnablePan { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Type :System.Boolean "True" value enables the Panning;And "False" will disable the Panning. Default Value is "True". |
Remarks
Use this property to enable or disable the panning feature of the map. "True" value will enable the panning feature."False" value will disable the panning feature.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
syncMap.EnablePan = false;
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
}
}
}
EnableZoom
Enables or disables the Zooming feature of the map.
Declaration
public bool EnableZoom { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Type :System.Boolean "True" value enables the Zooming;And "False" will disable the Zooming. Default Value is "True". |
Remarks
Use this property to enable or disable the zooming feature of the map. "True" value will enable the zoom feature."False" value will disable the zooming feature.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
syncMap.EnableZoom = false;
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
}
}
}
EnableZoomOnSelection
Enables or disables the ZoomOnSelection feature of the map.
Declaration
public bool EnableZoomOnSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Type :System.Boolean "True" value enables the Zooming;And "False" will disable the Zooming. Default Value is "True". |
Remarks
Use this property to enable or disable the zoom on selection feature of the map. "True" value will enable the zoom on selection feature."False" value will disable the zoom on selection feature.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
syncMap.EnableZoomOnSelection = false;
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
}
}
}
Header
Gets or sets the Header of the SfMap.
Declaration
public object Header { get; set; }
Property Value
Type | Description |
---|---|
System.Object | Type :System.Object |
Remarks
Use this property to set the header for the SfMap. Header is the title which shown on top of the SfMap.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
syncMap.Header = new TextBlock { Text="World SfMap", HorizontalAlignment=HorizontalAlignment.Center,VerticalAlignment=VerticalAlignment.Center };
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
}
}
}
LatitudeLongitudeType
Gets or sets display type of LatitudeLangitude values on the top right of the map.
Declaration
public LatLonType LatitudeLongitudeType { get; set; }
Property Value
Type | Description |
---|---|
LatLonType | Type :LatLonType |
Remarks
Use this property to determine how to display the latitude values. There are two types,
DMS and Decimal
Decimal will be shown as normal numbers.
DMS will be shown as Degrees,Minutes and Seconds.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.LatitudeLongitudeType = LatLonType.Decimal;
syncMap.LatitudeLongitudeType = LatLonType.DMS;
syncMap.Layers.Add(layer);
}
}
}
Layers
Gets or sets the Layers for the map. Layers are the content for the map.
Declaration
public ObservableCollection<MapLayer> Layers { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<MapLayer> |
Remarks
Use this property to add or remove the layers of the map. Each layer in Layers are the container of the map elements.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
}
}
}
LegendSettings
Gets or Sets LegendSetting
Declaration
public LegendSetting LegendSettings { get; set; }
Property Value
Type |
---|
LegendSetting |
MapCoords
Gets the co ordinates of the map in terms of latitude and longitude values.
Declaration
public Point MapCoords { get; }
Property Value
Type | Description |
---|---|
System.Windows.Point | Type :System.Windows.Point |
Remarks
This is read only property to get the current latitude and longitude values when hovering on the map.
MapStyle
Gets or sets the style for the map.
Declaration
public Style MapStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Style | Type :System.Windows.Style |
MaxZoom
Gets or sets the maximum zoom level of the map.
Declaration
public int MaxZoom { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Type : System.Int32 |
Remarks
Use this property to set the maximum zoom level of the map. The map cannot be zoomed beyond the MaxZoom value.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
syncMap.MaxZoom = 30;
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
}
}
}
MinZoom
Gets or sets the minimum zoom level of the map.
Declaration
public int MinZoom { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Type :System.Int32 Default value will be 1. |
Remarks
Use this property to set the minimum zoom level of the map. The map cannot be zoomed out below the MinZoom.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
syncMap.MinZoom = 3;
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
}
}
}
NavigationControlPosition
Gets or Sets NavigationControlPosition to the Maps
Declaration
public NavigationControlPositions NavigationControlPosition { get; set; }
Property Value
Type |
---|
NavigationControlPositions |
NavigationControlScale
Gets or Sets NavigationControlScale for Map
Declaration
public double NavigationControlScale { get; set; }
Property Value
Type |
---|
System.Double |
PanCommand
Gets the command for panning the map.
Declaration
public ICommand PanCommand { get; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | Type :System.Windows.Input.ICommand |
Remarks
Use this command to pan the map. Command parameter will specify the direction to be panned.
There are four command parameters can be given,
Left,Right,Top and Bottom
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
Button topPan = new Button();
topPan.Command = syncMap.PanCommand;
topPan.CommandParameter = "Top";
Button bottomPan = new Button();
bottomPan.Command = syncMap.PanCommand;
bottomPan.CommandParameter = "Bottom";
Button leftPan = new Button();
leftPan.Command = syncMap.PanCommand;
leftPan.CommandParameter = "Left";
Button rightPan = new Button();
rightPan.Command = syncMap.PanCommand;
rightPan.CommandParameter = "Right";
syncMap.Layers.Add(layer);
}
}
}
PanResetCommand
Gets the command for resetting the pan values.
Declaration
public ICommand PanResetCommand { get; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | Type :System.Windows.Input.ICommand |
Remarks
Use this command to reset the pan values of the map.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
Button cmdButton = new Button();
cmdButton.Command = syncMap.PanResetCommand;
syncMap.Layers.Add(layer);
}
}
}
RefreshCommand
Gets the Refresh Command for the Maps.Invokes refresh functionality of the map.
Declaration
public ICommand RefreshCommand { get; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | Type :System.Windows.Input.ICommand |
Remarks
Use this command to refresh the map.While refreshing the map, all elements will be cleared then added again.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
Button cmdButton = new Button();
cmdButton.Command = syncMap.RefreshCommand;
syncMap.Layers.Add(layer);
}
}
}
ResetCommand
Gets the ResetCommand for SfMap..
Declaration
public ICommand ResetCommand { get; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | Type System.Windows.Input.ICommand |
Remarks
Use this property to invoke Reset command of the map. This command will clear all the elements of the map.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
Button cmdButton = new Button();
cmdButton.Command = syncMap.ResetCommand;
syncMap.Layers.Add(layer);
}
}
}
ShowCoords
Gets or sets a value indicating whether the latitude and longitude value can be viewed or not.
Declaration
public bool ShowCoords { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if ; otherwise, false. |
Remarks
Use this property to enables or disables the visibility of the Latitude and Longitude values on the top right of the SfMap
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
syncMap.ShowCoords = false;
}
}
}
ShowNavigationControl
Enables or disables NavigationControl
Declaration
public bool ShowNavigationControl { get; set; }
Property Value
Type |
---|
System.Boolean |
ZoomFactor
Gets / ses the value of zooming factor
Declaration
public double ZoomFactor { get; set; }
Property Value
Type |
---|
System.Double |
ZoomInCommand
Gets the command for Zoom in the map.
Declaration
public ICommand ZoomInCommand { get; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | Type :System.Windows.Input.ICommand |
Remarks
Use this command to zoom in the map.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
Button cmdButton = new Button();
cmdButton.Command = syncMap.ZoomInCommand;
syncMap.Layers.Add(layer);
}
}
}
ZoomLevel
Gets or sets the ZoomLevel for the map.Based the ZoomLevel value the map will be zoomed.
Declaration
public int ZoomLevel { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Type :System.Int32 The default value is 1 |
Remarks
Use this property to zoom in or zoom out the map. If the ZoomLavel is increased then map will be zoomed in.If value is decreases the map will be zoomed out.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
syncMap.ZoomLevel = 3;
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
}
}
}
ZoomOutCommand
Gets the Command for zoom out the map.
Declaration
public ICommand ZoomOutCommand { get; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | Type :System.Windows.Input.ICommand |
Remarks
Use this command to zoom out the map.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
Button cmdButton = new Button();
cmdButton.Command = syncMap.ZoomOutCommand;
syncMap.Layers.Add(layer);
}
}
}
ZoomResetCommand
Gets the command for reset the zoom of the map.
Declaration
public ICommand ZoomResetCommand { get; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | Type :System.Windows.Input.ICommand |
Remarks
Use this command to reset the zoom of the map.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
Button cmdButton = new Button();
cmdButton.Command = syncMap.ZoomResetCommand;
syncMap.Layers.Add(layer);
}
}
}
Methods
add_Panned(PanEventHandler)
Declaration
public void add_Panned(PanEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
PanEventHandler | value |
add_Panning(PanEventHandler)
Declaration
public void add_Panning(PanEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
PanEventHandler | value |
add_ZoomedIn(ZoomEventHandler)
Declaration
public void add_ZoomedIn(ZoomEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ZoomEventHandler | value |
add_ZoomedOut(ZoomEventHandler)
Declaration
public void add_ZoomedOut(ZoomEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ZoomEventHandler | value |
Dispose()
Dispose method invoked while unloading map control.
Declaration
public void Dispose()
OnApplyTemplate()
Defines OnApplyTemplate
Declaration
public override void OnApplyTemplate()
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | e |
OnKeyUp(KeyEventArgs)
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | e |
OnManipulationCompleted(ManipulationCompletedEventArgs)
Declaration
protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.ManipulationCompletedEventArgs | e |
OnManipulationDelta(ManipulationDeltaEventArgs)
Declaration
protected override void OnManipulationDelta(ManipulationDeltaEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.ManipulationDeltaEventArgs | e |
OnManipulationStarted(ManipulationStartedEventArgs)
Declaration
protected override void OnManipulationStarted(ManipulationStartedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.ManipulationStartedEventArgs | e |
OnMouseLeave(MouseEventArgs)
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e |
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e |
OnMouseWheel(MouseWheelEventArgs)
Declaration
protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseWheelEventArgs | e |
OnScaleChanged(DependencyObject, DependencyPropertyChangedEventArgs)
Occurs when the value of the NavigationControlScale property changes.
Declaration
public static void OnScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | d | |
System.Windows.DependencyPropertyChangedEventArgs | e |
Pan(Double, Double)
Method gets called to pan the map.
Declaration
public void Pan(double panx, double pany)
Parameters
Type | Name | Description |
---|---|---|
System.Double | panx | The pan x value. |
System.Double | pany | The pan y value. |
remove_Panned(PanEventHandler)
Declaration
public void remove_Panned(PanEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
PanEventHandler | value |
remove_Panning(PanEventHandler)
Declaration
public void remove_Panning(PanEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
PanEventHandler | value |
remove_ZoomedIn(ZoomEventHandler)
Declaration
public void remove_ZoomedIn(ZoomEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ZoomEventHandler | value |
remove_ZoomedOut(ZoomEventHandler)
Declaration
public void remove_ZoomedOut(ZoomEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
ZoomEventHandler | value |
Zoom(Double)
Zoom the map with given zoom value.
Declaration
public void Zoom(double zoomValue)
Parameters
Type | Name | Description |
---|---|---|
System.Double | zoomValue | Scale value of the map. |
Remarks
Use this method to zoom in or zoom out the map based on the zoomValue parameter. zoomValue is the scale value of the zoom feature.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
syncMap.Zoom(2);
}
}
}
Events
MapToolTipOpening
Occurs when any tooltip on the SfMap control is opened.
Declaration
public event EventHandler<ToolTipOpeningEventArgs> MapToolTipOpening
Event Type
Type |
---|
System.EventHandler<ToolTipOpeningEventArgs> |
Panned
Occurs after panned the map.
Declaration
public event PanEventHandler Panned
Event Type
Type |
---|
PanEventHandler |
Remarks
Panned event will be triggered after panned the map. Use this event handler to do any operation after the map was panned.The event argument contains the Latitude, Longitude values and and PanningDirection.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
syncMap.Panned += syncMap_Panned;
}
void syncMap_Panned(object sender, PanEventArgs args)
{
var latitude = args.Latitude;
var longitude = args.Longitude;
var direction = args.PanningDirection;
}
}
}
Panning
Occurs while panning the map.
Declaration
public event PanEventHandler Panning
Event Type
Type |
---|
PanEventHandler |
Remarks
Panned event will be triggered while panning the map. Use this event handler to do any operation while the map is panning.The event argument contains the Latitude, Longitude values and and PanningDirection.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
syncMap.Panning += syncMap_Panning;
}
void syncMap_Panning(object sender, PanEventArgs args)
{
var latitude = args.Latitude;
var longitude = args.Longitude;
var direction = args.PanningDirection;
}
}
}
ZoomedIn
Occurs when zooming the map.
Declaration
public event ZoomEventHandler ZoomedIn
Event Type
Type |
---|
ZoomEventHandler |
Remarks
ZoomedIn event will be triggered when zooming in the map. Use this event handler to do any operation when zooming the map.The event argument contains the Latitude, Longitude values and ZoomLevel.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
syncMap.ZoomedIn += syncMap_ZoomedIn;
}
void syncMap_ZoomedIn(object sender, ZoomEventArgs args)
{
var latitude = args.Latitude;
var longitude = args.Longitude;
var zoomlevel = args.ZoomLevel;
}
}
}
ZoomedOut
Occurs when zoomed out the map.
Declaration
public event ZoomEventHandler ZoomedOut
Event Type
Type |
---|
ZoomEventHandler |
Remarks
ZoomedOut event will be triggered when zooming out the map. Use this event handler to do any operation when zooming out the map.The event argument contains the Latitude, Longitude values and ZoomLevel.
Examples
using Syncfusion.UI.Xaml.Maps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
syncMap.ZoomedOut += syncMap_ZoomedOut;
}
void syncMap_ZoomedOut(object sender, ZoomEventArgs args)
{
var latitude = args.Latitude;
var longitude = args.Longitude;
var zoomlevel = args.ZoomLevel;
}
}
}