Class ShapeFileLayer
Represents the ShapeFileLayer class.
Implements
Inherited Members
Namespace: Syncfusion.UI.Xaml.Maps
Assembly: Syncfusion.SfMaps.WPF.dll
Syntax
public class ShapeFileLayer : MapLayer, IDisposable
Remarks
The ShapeFileLayer is one of the Layer in the SfMap. This shape file layer will read the ShapeFile(.shp) and dBase(.dbf) file and parse them in to SfMap Elements.
Examples
The Following code demonstrate how to create a ShapeFileLayer in C#.
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);
this.mainGrid.Children.Add(syncMap);
}
}
}
Constructors
ShapeFileLayer()
Initializes a new instance of the ShapeFileLayer class.
Declaration
public ShapeFileLayer()
Fields
ActualTemplateProperty
// Using a DependencyProperty as the backing store for ActualTemplate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ActualTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
AnnotationsProperty
// Using a DependencyProperty as the backing store for CustomSymbols. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty AnnotationsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
AnnotationTemplateProperty
// Using a DependencyProperty as the backing store for SymbolTemplate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty AnnotationTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
baselayer
ShapeFileLayer
Declaration
protected ShapeFileLayer baselayer
Field Value
| Type |
|---|
| ShapeFileLayer |
BoundingBoxProperty
// Using a DependencyProperty as the backing store for BoundingBox. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty BoundingBoxProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
BubbleMarkerSettingProperty
// Using a DependencyProperty as the backing store for BubbleMarkerSetting. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty BubbleMarkerSettingProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
BubblesProperty
// Using a DependencyProperty as the backing store for Bubbles. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty BubblesProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
CrossCursorStrokeProperty
// Using a DependencyProperty as the backing store for CrossCursorStroke. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty CrossCursorStrokeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
CrossCursorStrokeThicknessProperty
// Using a DependencyProperty as the backing store for CrossCursorStrokeThickness. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty CrossCursorStrokeThicknessProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
CrossCursorVisibilityProperty
// Using a DependencyProperty as the backing store for CrossCursorVisibility. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty CrossCursorVisibilityProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
CurrentColorPaletteProperty
// Using a DependencyProperty as the backing store for CurrentColorPalette. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty CurrentColorPaletteProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
CustomDataSourceProperty
// Using a DependencyProperty as the backing store for CustomDataSource. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty CustomDataSourceProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
CustomDataSourceTemplateProperty
// Using a DependencyProperty as the backing store for CustomDataSourceTemplate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty CustomDataSourceTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
CustomDataSymbolsProperty
// Using a DependencyProperty as the backing store for CustomDataSymbols. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty CustomDataSymbolsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
DistanceProperty
// Using a DependencyProperty as the backing store for Distance. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty DistanceProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
EnableMultiSelectionProperty
// Using a DependencyProperty as the backing store for EnableMultiSelection. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty EnableMultiSelectionProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
EnableSelectionProperty
// Using a DependencyProperty as the backing store for EnableSelection. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty EnableSelectionProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
HideIntersectLabelsProperty
Using a DependencyProperty as the backing store for HideIntersectLabels. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty HideIntersectLabelsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
isBaseLayer
Determines the BaseLayer
Declaration
protected bool isBaseLayer
Field Value
| Type |
|---|
| System.Boolean |
IsTileMapProperty
// Using a DependencyProperty as the backing store for IsTileMap. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty IsTileMapProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ItemsSourceProperty
// Using a DependencyProperty as the backing store for ItemsSource. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ItemsTemplateProperty
// Using a DependencyProperty as the backing store for ItemsTemplate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ItemsTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LabelOrientationProperty
// Using a DependencyProperty as the backing store for LabelOrientation. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LabelOrientationProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LabelPathProperty
// Using a DependencyProperty as the backing store for LabelPath. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LabelPathProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LayerHeightProperty
// Using a DependencyProperty as the backing store for MapHeight. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LayerHeightProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LayerWidthProperty
// Using a DependencyProperty as the backing store for MapWidth. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LayerWidthProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LayoutTypeProperty
// Using a DependencyProperty as the backing store for LayoutType. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LayoutTypeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendColumnSplitProperty
// Using a DependencyProperty as the backing store for LegendIcon. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendColumnSplitProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendEndLabelProperty
// Using a DependencyProperty as the backing store for Legend. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendEndLabelProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendHeaderProperty
// Using a DependencyProperty as the backing store for LegendIcon. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendHeaderProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendIconProperty
// Using a DependencyProperty as the backing store for LegendIcon. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendIconProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendModeProperty
// Using a DependencyProperty as the backing store for LegendMode. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendModeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendPositionProperty
// Using a DependencyProperty as the backing store for LegendPosition. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendPositionProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendPositionXProperty
// Using a DependencyProperty as the backing store for LegendPositionX. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendPositionXProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendPositionYProperty
// Using a DependencyProperty as the backing store for LegendPositionY. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendPositionYProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendsProperty
// Using a DependencyProperty as the backing store for Legend. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendStartLabelProperty
// Using a DependencyProperty as the backing store for Legend. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendStartLabelProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendTemplateProperty
// Using a DependencyProperty as the backing store for CustomTemplate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendTypeProperty
// Using a DependencyProperty as the backing store for LegendIcon. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendTypeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LegendVisibilityProperty
// Using a DependencyProperty as the backing store for LegendVisibility. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty LegendVisibilityProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapElementsProperty
Declaration
public static readonly DependencyProperty MapElementsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapItemSettingProperty
// Using a DependencyProperty as the backing store for MapItemSetting. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapItemSettingProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapItemsProperty
// Using a DependencyProperty as the backing store for MapItems. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapItemsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapItemsVisibilityProperty
// Using a DependencyProperty as the backing store for MapItemsVisibility. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapItemsVisibilityProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapPointHorizontalAlignmentProperty
The dependency property of MapPointHorizontalAlignment property.
Declaration
public static readonly DependencyProperty MapPointHorizontalAlignmentProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapPointIconProperty
// Using a DependencyProperty as the backing store for MapPointIcon. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapPointIconProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapPointIconSizeProperty
The dependency property of MapPointIconSize property
Declaration
public static readonly DependencyProperty MapPointIconSizeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapPointMarginProperty
// Using a DependencyProperty as the backing store for MapPointMargin. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapPointMarginProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapPointPopupTemplateProperty
// Using a DependencyProperty as the backing store for MapPointPopupTemplate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapPointPopupTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapPointsProperty
// Using a DependencyProperty as the backing store for MapPoints. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapPointsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapPointTemplateProperty
// Using a DependencyProperty as the backing store for MapPointTemplate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapPointTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapPointVerticalAlignmentProperty
The depedency property of
Declaration
public static readonly DependencyProperty MapPointVerticalAlignmentProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapPopupObjectProperty
// Using a DependencyProperty as the backing store for PopupObject. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapPopupObjectProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapPopupVisibilityProperty
// Using a DependencyProperty as the backing store for MapPopupVisibility. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapPopupVisibilityProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MapShapesProperty
// Using a DependencyProperty as the backing store for MapShapes. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MapShapesProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MarkersProperty
Gets or sets the value for marker property
Declaration
public static readonly DependencyProperty MarkersProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MarkerTemplateProperty
Gets or sets the value for marker template property
Declaration
public static readonly DependencyProperty MarkerTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
PointDataProperty
// Using a DependencyProperty as the backing store for PointData. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty PointDataProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
PointsProperty
The DependencyProperty for Points property.
Declaration
public static readonly DependencyProperty PointsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
PopupCustomTemplateProperty
// Using a DependencyProperty as the backing store for PopupCustomTemplate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty PopupCustomTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SelectedMapShapesProperty
// Using a DependencyProperty as the backing store for SelectedMapShapes. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SelectedMapShapesProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SelectionRectStrokeProperty
// Using a DependencyProperty as the backing store for SelectionRectStroke. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SelectionRectStrokeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SelectionRectStrokeThicknessProperty
// Using a DependencyProperty as the backing store for SelectionRectStrokeThickness. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SelectionRectStrokeThicknessProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ShapeDataPathProperty
// Using a DependencyProperty as the backing store for ShapeDataPath.
Declaration
public static readonly DependencyProperty ShapeDataPathProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ShapeDataProperty
// Using a DependencyProperty as the backing store for ShapeDatasItem Source Collection. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ShapeDataProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ShapeFillProperty
Dependency registration of Syncfusion.UI.Xaml.Maps.ShapeFileLayer.ShapeFill property.
Declaration
public static readonly DependencyProperty ShapeFillProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ShapeIDPathProperty
// Using a DependencyProperty as the backing store for ShapeIDPath. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ShapeIDPathProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ShapeIDTableFieldProperty
// Using a DependencyProperty as the backing store for ShapeIDTableField. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ShapeIDTableFieldProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ShapeSettingsProperty
// Using a DependencyProperty as the backing store for ShapeSettings. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ShapeSettingsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ShapeStrokeProperty
Dependency registration of Syncfusion.UI.Xaml.Maps.ShapeFileLayer.ShapeStroke property.
Declaration
public static readonly DependencyProperty ShapeStrokeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ShapeTypeProperty
The DependencyProperty for ShapeType property.
Declaration
public static readonly DependencyProperty ShapeTypeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ShowDistanceScaleProperty
// Using a DependencyProperty as the backing store for IsDistanceScaleEnabled. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ShowDistanceScaleProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SubShapeFileLayersProperty
// Using a DependencyProperty as the backing store for SubShapeFileLayers. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty SubShapeFileLayersProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ToolTipSettingsProperty
Using a DependencyProperty as the backing store for ToolTipSettings. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ToolTipSettingsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
TranslateZoomLevelProperty
// Using a DependencyProperty as the backing store for TranslateZoomFactor. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty TranslateZoomLevelProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
UriProperty
// Using a DependencyProperty as the backing store for Uri. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty UriProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
VisibleShapesProperty
// Using a DependencyProperty as the backing store for VisibleShapes. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty VisibleShapesProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
ActualTemplate
Gets the actual template applied on the MapItems.
Declaration
public DataTemplate ActualTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
Remarks
This is read only property to read the Template of the MapItems.
Annotations
Gets or sets the Annotations for the ShapFileLayer.
Declaration
public ObservableCollection<MapAnnotations> Annotations { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<MapAnnotations> |
Remarks
Use this property to add the Annotations for the ShapeFileLayer.
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;
using Windows.UI.Xaml.Shapes;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
MapAnnotations annotation = new MapAnnotations();
annotation.AnnotationSymbol = new Ellipse { Height=20,Width=20, Fill=new SolidColorBrush(Colors.PaleTurquoise)};
layer.Annotations.Add(annotation);
layer.Uri = "MapApp.world.shp";
syncMap.Layers.Add(layer);
}
}
}
AnnotationTemplate
Gets or sets the Template for the MapAnnotations.
Declaration
public DataTemplate AnnotationTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
Remarks
Use the AnnotationTemplate property to re-define its Template. This will override the default Template of the MapAnnotations.
BoundingBox
Gets or Sets BoundingBox values
Declaration
public BoundingBox BoundingBox { get; }
Property Value
| Type |
|---|
| BoundingBox |
BubbleMarkerSetting
Gets or sets bubbles settings for the SfMap.
Declaration
public BubbleMarkerSetting BubbleMarkerSetting { get; set; }
Property Value
| Type | Description |
|---|---|
| BubbleMarkerSetting | Type : BubbleMarkerSetting |
Remarks
Use this property to set the maximum size,minimum size, fill, stroke and color mappings for the bubbles.
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 = true;
ShapeFileLayer layer = new ShapeFileLayer();
BubbleMarkerSetting bubbleSetting = new BubbleMarkerSetting();
bubbleSetting.Fill = new SolidColorBrush(Colors.Blue);
bubbleSetting.Stroke = new SolidColorBrush(Colors.Red);
bubbleSetting.MaxSize = 50;
bubbleSetting.MinSize = 10;
layer.BubbleMarkerSetting = bubbleSetting;
layer.Uri = "MapApp.world1.shp";
layer.MapItemsVisibility = Visibility.Visible;
syncMap.Layers.Add(layer);
this.mainGrid.Children.Add(syncMap);
}
}
}
Bubbles
Gets the bubbles of the ShapeFileLayer.
Declaration
public ObservableCollection<Bubble> Bubbles { get; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<Bubble> |
Remarks
This is read only property to read the bubbles of the ShapeFileLayer.
CrossCursorStroke
Gets or sets the Stroke of the CrossCusrsor.
Declaration
public Brush CrossCursorStroke { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.Brush | Type : System.Windows.Media.Brush |
Remarks
Use this property to set the Cross cursor's color.
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.EnableMultiSelection = true;
layer.CrossCursorStroke = new SolidColorBrush(Colors.OliveDrab);
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
}
}
}
CrossCursorStrokeThickness
Gets or Sets the thickness of the CrossCursor.
Declaration
public double CrossCursorStrokeThickness { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | Type : System.Double |
Remarks
Use this property to set the thickness of the CrossCursor.
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.EnableMultiSelection = true;
layer.CrossCursorStroke = new SolidColorBrush(Colors.OliveDrab);
layer.CrossCursorStrokeThickness = 1d;
layer.Uri = "MapApp.world.shp";
syncMap.Layers.Add(layer);
}
}
}
CrossCursorVisibility
Gets visibility of the CrossCursor shown when Selecting Multiple Shapes in the SfMap.
Declaration
public Visibility CrossCursorVisibility { get; }
Property Value
| Type |
|---|
| System.Windows.Visibility |
Remarks
This is the read only property to get the visibility of the CrossCursor, shown on MultiSelection of the SfMap.
CurrentColorPalette
Gets the collection of brushes that are applied on the shapes.
Declaration
public ObservableCollection<MapColorPalette> CurrentColorPalette { get; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<MapColorPalette> |
Remarks
CurrentColorPalette is the read only property to get the brushes that are currently applied on the shape.
CustomDataSource
Gets or Sets the CustomDataSource for ShapeFileLayer.
Declaration
[Obsolete("CustomDataSource is deprecated and use Markers")]
public IEnumerable CustomDataSource { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.IEnumerable | Type : System.Collections.IEnumerable |
Remarks
Use this property to bound the object to a point in the map based on Latitude and Longitude.
Examples
CustomDataSourceTemplate
Gets or sets the Template for the Items in the CustomDataSource.
Declaration
[Obsolete("CustomDataSourceTemplate is deprecated. Use MarkerTemplate")]
public DataTemplate CustomDataSourceTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.DataTemplate | Type :System.Windows.DataTemplate |
Remarks
Use this property to define the template for the Items which are defines in the CustomDataSource.
CustomDataSymbols
Gets the CustomDataSymbols of the ShapeFileLayer.
Declaration
public ObservableCollection<CustomDataSymbol> CustomDataSymbols { get; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<CustomDataSymbol> |
Remarks
CustomDataSymbols are generated when CustomDataSource is set. This property is used to get that data symbols.
Distance
Gets or Sets the Distance value on a Map.
Declaration
public string Distance { get; set; }
Property Value
| Type |
|---|
| System.String |
EnableMultiSelection
Enables or Disables the multiple shapes can be selected.
Declaration
public bool EnableMultiSelection { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type : System.Boolean
|
Remarks
Use this property to enable or disable the multi shape selection in the map.If value is True then MapShapes can be selected. Otherwise cannot.
EnableSelection
Enables or Disables the shapes to be selected.
Declaration
public bool EnableSelection { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type : System.Boolean
|
Remarks
Use this property to enable or disable the shape selection in the map.If value is True then MapShapes can be selected. Otherwise cannot.
HideIntersectLabels
Gets or sets a value indicating whether the intersected labels should be hidden.
Declaration
[Obsolete("HideIntersectLabels is obsolete as of version 17.4.0.01. Use ShapeLayer class MapItemSetting.IntersectionAction property to hide the intersected labels. e.g. shapeLayer.MapItemSetting.IntersectionAction = IntersectAction.Hide")]
public bool HideIntersectLabels { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsTileMap
Gets or sets a value indicating whether the control is Tiled.
Declaration
[Obsolete("IsTileMap is deprecated. Use LayoutType")]
public bool IsTileMap { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ItemsSource
Gets or sets the ItemsSource for the ShapeFileLayer.
Declaration
public object ItemsSource { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | Type : System.Object |
Remarks
Use this property to set the ItemsSource for the ShapeFileLayer. ItemsSource items will be bounded to the map shapes.
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 = true;
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapApp.world1.shp";
ViewModel viewModel = new ViewModel();
layer.ItemsSource = viewModel.Models;
syncMap.Layers.Add(layer);
this.mainGrid.Children.Add(syncMap);
}
}
public class Weather
{
public int CurrentTemperature { get; set; }
public int AverageHighTemperature { get; set; }
public int AverageLowTemperature { get; set; }
public string Country { get; set; }
public string Continent { get; set; }
public string City { get; set; }
public string WeatherDescription { get; set; }
public int Humidity { get; set; }
public string Longitude { get; set; }
public string Latitude { get; set; }
public static ListWeather GetWeatherData()
{
ListWeather weatherCollection = new ListWeather();
weatherCollection.Add(new Weather() { Humidity = 86, CurrentTemperature = 44, AverageHighTemperature = 63, AverageLowTemperature = 46, City = "Chicago", Continent = "North America", Country = "United States", WeatherDescription = "Partly Cloudy", Latitude = "41.8500N", Longitude = "87.6500W" });
weatherCollection.Add(new Weather() { Humidity = 94, CurrentTemperature = 77, AverageHighTemperature = 89, AverageLowTemperature = 75, City = "Chennai", Continent = "Asia", Country = "India", WeatherDescription = "Rainy", Latitude = "12.5810N", Longitude = "76.0740E" });
weatherCollection.Add(new Weather() { Humidity = 60, CurrentTemperature = 70, AverageHighTemperature = 70, AverageLowTemperature = 57, City = "Tokyo", Continent = "Asia", Country = "Japan", WeatherDescription = "Partly Cloudy", Latitude = "35.6833N", Longitude = "139.7667E" });
weatherCollection.Add(new Weather() { Humidity = 72, CurrentTemperature = 55, AverageHighTemperature = 47, AverageLowTemperature = 38, City = "Moscow", Continent = "Asia", Country = "Russia", WeatherDescription = "Clear", Latitude = "55.7517N", Longitude = "37.6178E" });
weatherCollection.Add(new Weather() { Humidity = 70, CurrentTemperature = 53, AverageHighTemperature = 69, AverageLowTemperature = 54, City = "Cape Town", Continent = "Africa", Country = "South Africa", WeatherDescription = "Partly Cloudy", Latitude = "33.9767S", Longitude = "18.4244E" });
weatherCollection.Add(new Weather() { Humidity = 77, CurrentTemperature = 64, AverageHighTemperature = 69, AverageLowTemperature = 56, City = "Anchorage", Continent = "North America", Country = "United States", WeatherDescription = "Mostly Cloudy", Latitude = "61.1919N", Longitude = "149.7621W" });
weatherCollection.Add(new Weather() { Humidity = 55, CurrentTemperature = 91, AverageHighTemperature = 95, AverageLowTemperature = 74, City = "Panama", Continent = "South America", Country = "Republic Of Panama", WeatherDescription = "Fair", Latitude = "8.7515N", Longitude = "79.8772W" });
weatherCollection.Add(new Weather() { Humidity = 88, CurrentTemperature = 61, AverageHighTemperature = 76, AverageLowTemperature = 59, City = "Sao Paulo", Continent = "South America", Country = "Brazil", WeatherDescription = "Fair", Latitude = "23.5000S", Longitude = "46.6167W" });
weatherCollection.Add(new Weather() { Humidity = 83, CurrentTemperature = 70, AverageHighTemperature = 85, AverageLowTemperature = 72, City = "Cairo", Continent = "Africa", Country = "Egypt", WeatherDescription = "Mostly Cloudy", Latitude = "31.2262E", Longitude = "30.0566N" });
weatherCollection.Add(new Weather() { Humidity = 78, CurrentTemperature = 70, AverageHighTemperature = 85, AverageLowTemperature = 72, City = "Melbourne", Continent = "Oceania", Country = "Australia", WeatherDescription = "Cloudy", Latitude = "35.0833S", Longitude = "142.0667E" });
return weatherCollection;
}
}
public class ViewModel
{
public ListtWeather Models
{
get;
set;
}
public ViewModel()
{
this.Models = new ListtWeather();
this.Models = Weather.GetWeatherData();
}
}
}
ItemsTemplate
Gets or Sets the Template for the MapItems.
Declaration
public DataTemplate ItemsTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.DataTemplate | Type System.Windows.DataTemplate |
Remarks
Use this property to define the Template for the MapItems, which are generated from the ItemsSource.
LabelOrientation
Gets or Sets LegendOrientation
Declaration
public LabelOrientation LabelOrientation { get; set; }
Property Value
| Type |
|---|
| LabelOrientation |
LabelPath
Gets ot Sets LabelPath for Shapefilelayer
Declaration
public string LabelPath { get; set; }
Property Value
| Type |
|---|
| System.String |
LayerHeight
Gets the Height of the Current Layer in the SfMap.
Declaration
public double LayerHeight { get; }
Property Value
| Type | Description |
|---|---|
| System.Double | Type : System.Double |
Remarks
This is read only property to get the height of the Layer.
LayerWidth
Gets the Width of the Current Layer in the SfMap.
Declaration
public double LayerWidth { get; }
Property Value
| Type | Description |
|---|---|
| System.Double | Type : System.Double |
Remarks
This is read only property to get the width of the Layer.
LayoutType
Gets or Sets LayoutType to the ShapeFileLayer.
Declaration
public LayoutType LayoutType { get; set; }
Property Value
| Type |
|---|
| LayoutType |
LegendColumnSplit
Gets or Sets LegendColumnSplit
Declaration
public int LegendColumnSplit { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
LegendEndLabel
Gets or Sets LegendEndLabel
Declaration
public string LegendEndLabel { get; set; }
Property Value
| Type |
|---|
| System.String |
LegendHeader
Gets or Sets LegendHeader
Declaration
public string LegendHeader { get; set; }
Property Value
| Type |
|---|
| System.String |
LegendIcon
Gets or Sets LegendIcon
Declaration
public LegendIcons LegendIcon { get; set; }
Property Value
| Type |
|---|
| LegendIcons |
LegendMode
Gets or Sets LegendMode
Declaration
public LegendMode LegendMode { get; set; }
Property Value
| Type |
|---|
| LegendMode |
LegendPosition
Gets or Sets LegendPosition
Declaration
public LegendPosition LegendPosition { get; set; }
Property Value
| Type |
|---|
| LegendPosition |
LegendPositionX
Gets or Sets LegendPositionX
Declaration
public double LegendPositionX { get; set; }
Property Value
| Type |
|---|
| System.Double |
LegendPositionY
Gets or Sets LegendPositionY
Declaration
public double LegendPositionY { get; set; }
Property Value
| Type |
|---|
| System.Double |
Legends
Defines Legends collection
Declaration
public ObservableCollection<Legend> Legends { get; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<Legend> |
LegendStartLabel
Gets or Sets LegendStartLabel
Declaration
public string LegendStartLabel { get; set; }
Property Value
| Type |
|---|
| System.String |
LegendTemplate
Gets or Sets LegendTemplate
Declaration
public DataTemplate LegendTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
LegendType
Gets or Sets LegendType
Declaration
public LegendType LegendType { get; set; }
Property Value
| Type |
|---|
| LegendType |
LegendVisibility
Gets or Sets LegendVisibility
Declaration
public Visibility LegendVisibility { get; set; }
Property Value
| Type |
|---|
| System.Windows.Visibility |
MapElements
Declaration
public ObservableCollection<MapElement> MapElements { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<MapElement> |
MapItems
Get the MapItems of the ShapeFileLayer.
Declaration
public ObservableCollection<MapItem> MapItems { get; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<MapItem> |
Remarks
This is read only property to get the MapItems elements.
MapItemSetting
Gets or Sets the appearance settings when Default Template applied on the MapItems.
Declaration
public MapItemSetting MapItemSetting { get; set; }
Property Value
| Type | Description |
|---|---|
| MapItemSetting | Type :MapItemSetting |
Remarks
Default template for the MapItems will show the under bound value of the Shape in a TextBlock. To set the appearance like Background,FontStyle and FontFamily, this property will be used.
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();
MapItemSetting mapItemSetting = new MapItemSetting();
mapItemSetting.MapItemFontFamily = new Windows.UI.Xaml.Media.FontFamily("Times New Roman");
mapItemSetting.MapItemFontSize = 10d;
mapItemSetting.MapItemForeground = new SolidColorBrush(Colors.OldLace);
ShapeFileLayer layer = new ShapeFileLayer();
layer.MapItemSetting = mapItemSetting;
layer.Uri = "MapApp.world.shp";
syncMap.Layers.Add(layer);
}
}
}
MapItemsVisibility
Gets or sets the Visibility for the MapItems.
Declaration
public Visibility MapItemsVisibility { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Visibility | Type System.Windows.Visibility |
Remarks
MapItems are shown the property value of under bound objects of the Shape. This property sets the Visibility of MapItems.
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 = true;
ShapeFileLayer layer = new ShapeFileLayer();
layer.Uri = "MapAPP.world.shp";
layer.MapItemsVisibility = Visibility.Visible;
syncMap.Layers.Add(layer);
}
}
}
MapPointHorizontalAlignment
Gets or sets the value for horizontal map point alignment
Declaration
public MarkerAlignment MapPointHorizontalAlignment { get; set; }
Property Value
| Type |
|---|
| MarkerAlignment |
MapPointIcon
Gets or Sets MapPointIcon to the MapPoints.
Declaration
public MapPointIcon MapPointIcon { get; set; }
Property Value
| Type |
|---|
| MapPointIcon |
MapPointIconSize
Gets or sets the value for map point icon size
Declaration
public double MapPointIconSize { get; set; }
Property Value
| Type |
|---|
| System.Double |
MapPointMargin
Gets or Sets MapPointMargin
Declaration
public Thickness MapPointMargin { get; set; }
Property Value
| Type |
|---|
| System.Windows.Thickness |
MapPointPopupTemplate
Gets or Sets MapPointPopupTemplate
Declaration
public DataTemplate MapPointPopupTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
MapPoints
Gets or Sets MapPoints
Declaration
public ObservableCollection<MapPoint> MapPoints { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<MapPoint> |
MapPointTemplate
Gets or Sets MapPointTemplate for Shapefilelayer
Declaration
public DataTemplate MapPointTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
MapPointVerticalAlignment
Get or sets the value for vertical map point alignment
Declaration
public MarkerAlignment MapPointVerticalAlignment { get; set; }
Property Value
| Type |
|---|
| MarkerAlignment |
MapPopupObject
Gets the Binded object of the MapPopup
Declaration
public object MapPopupObject { get; }
Property Value
| Type | Description |
|---|---|
| System.Object | Type :System.Object |
Remarks
This is read only property to get the Bounded object of the MapPopup.
MapPopupVisibility
Gets or Sets the Visibility of the MapPopup.
Declaration
public Visibility MapPopupVisibility { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Visibility | Type : System.Windows.Visibility |
Remarks
Use this property to set the Visibility of the MapPopup.
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.MapPopupVisibility = Visibility.Visible;
layer.Uri = "MapApp.world1.shp";
syncMap.Layers.Add(layer);
}
}
}
MapShapes
Gets the MapShapes of the ShapeFileLayer.
Declaration
public ObservableCollection<MapShape> MapShapes { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<MapShape> |
Remarks
This is the read only property to get the MapShapes of the ShapeFileLayer.
Markers
Gets or Sets the Markers for ShapeFileLayer.
Declaration
public IEnumerable Markers { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.IEnumerable | Type : System.Collections.IEnumerable |
Remarks
Use this property to bound the object to a point in the map based on Latitude and Longitude.
Examples
MarkerTemplate
Gets or sets the Template for the Items in the Marker.
Declaration
public DataTemplate MarkerTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.DataTemplate | Type :System.Windows.DataTemplate |
Remarks
Use this property to define the template for the Items which are defines in the Marker.
PointData
Gets or Sets PointData
Declaration
public object PointData { get; set; }
Property Value
| Type |
|---|
| System.Object |
Points
Gets or sets the collection of points. It is used to draw multi line over the map by using the points.
Declaration
public ObservableCollection<Point> Points { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<System.Windows.Point> |
PopupCustomTemplate
Gets or sets the Custom Template for the MapPopup.
Declaration
public DataTemplate PopupCustomTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.DataTemplate | Type :System.Windows.DataTemplate |
Remarks
Use this property to set the CustomTemplate for the MapPopup.
SelectedMapShapes
Gets the Selected shapes of the ShapeFileLayer
Declaration
public ObservableCollection<MapShape> SelectedMapShapes { get; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<MapShape> |
Remarks
This is read only property to get the selected shapes in the ShapeFileLayer.
SelectionRectStroke
Gets or Sets the Stroke Color of the Selection rectangle.
Declaration
public Brush SelectionRectStroke { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.Brush | Type :System.Windows.Media.Brush |
Remarks
Use this property to set the Stroke color of the Selection rect.
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;
using Windows.UI.Xaml.Shapes;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.EnableMultiSelection = true;
layer.SelectionRectStroke = new SolidColorBrush(Colors.PeachPuff);
layer.Uri = "MapApp.world.shp";
syncMap.Layers.Add(layer);
}
}
}
SelectionRectStrokeThickness
Gets or Sets the thickness of the Selection rectangle.
Declaration
public double SelectionRectStrokeThickness { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | Type :System.Windows.Media.Brush |
Remarks
Use this property to set the thickness of the Selection rectangel.
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;
using Windows.UI.Xaml.Shapes;
namespace MapApp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
SfMap syncMap = new SfMap();
ShapeFileLayer layer = new ShapeFileLayer();
layer.EnableMultiSelection = true;
layer.SelectionRectStrokeThickness = 2d;
layer.Uri = "MapApp.world.shp";
syncMap.Layers.Add(layer);
}
}
}
ShapeData
Gets or Sets ShapeData values.
Declaration
public object ShapeData { get; set; }
Property Value
| Type |
|---|
| System.Object |
ShapeDataPath
Gets or Sets ShapeDataPath
Declaration
public string ShapeDataPath { get; set; }
Property Value
| Type |
|---|
| System.String |
ShapeIDPath
Gets or set the Identification property name of the Shape.
Declaration
public string ShapeIDPath { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | Type :System.String
|
Remarks
Use this property to set the Property name from the ItemsSource's Item to identify the corresponding under bound shape.
ShapeIDTableField
Gets or sets dbf table field name to identify or map the value with shapes in the SfMap.
Declaration
public string ShapeIDTableField { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | Type : System.String |
Remarks
Use this property to set the Field name of the dbf file's table to map with items values. The associate dbf file must contain the field with this Property 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();
ShapeFileLayer layer = new ShapeFileLayer();
layer.ShapeIDTableField = "Country";
layer.Uri = "App2.world1.shp";
syncMap.Layers.Add(layer);
this.mainGrid.Children.Add(syncMap);
}
}
}
ShapeReader
ShapeReader
Declaration
public ShapeFileReader ShapeReader { get; }
Property Value
| Type |
|---|
| ShapeFileReader |
ShapeSettings
Gets or sets the values for a shape's appearance in the SfMap.
Declaration
public ShapeSetting ShapeSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| ShapeSetting | Type : ShapeSetting |
Remarks
Use this property to define the Stroke, Fill, StrokeThickness and the Under bound value of a shape.
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 = true;
ShapeFileLayer layer = new ShapeFileLayer();
ShapeSetting shapeSettings = new ShapeSetting();
shapeSettings.ShapeFill = new SolidColorBrush(Colors.Red);
shapeSettings.ShapeStroke = new SolidColorBrush(Colors.Black);
shapeSettings.ShapeStrokeThickness = 1d;
layer.ShapeSettings = shapeSettings;
layer.Uri = "MapApp.world.shp";
syncMap.Layers.Add(layer);
}
}
}
ShapeType
Gets or sets the type of Points. It is used to define the type of points in the collection.
Declaration
public ShapeType ShapeType { get; set; }
Property Value
| Type |
|---|
| ShapeType |
ShowDistanceScale
Gets or sets a value indicating whether the DistanceScale is shown.
Declaration
public bool ShowDistanceScale { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
SubShapeFileLayers
Defines the collection of SubShapeFileLayers
Declaration
public ObservableCollection<SubShapeFileLayer> SubShapeFileLayers { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<SubShapeFileLayer> |
ToolTipSettings
Gets or sets the tooltip settings for the ShapeFileLayer.
Declaration
public ToolTipSetting ToolTipSettings { get; set; }
Property Value
| Type |
|---|
| ToolTipSetting |
TranslateZoomLevel
Gets or Sets TranslateZoomLevel
Declaration
public int TranslateZoomLevel { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Uri
Gets or sets the embedded location of the Shape File.
Declaration
public string Uri { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | Type :System.String |
Remarks
Use this property to set the embedded resource location of the shape file.
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);
}
}
}
VisibleShapes
Gets the visible shapes of the ShapeFileLayer.
Declaration
public ObservableCollection<MapShape> VisibleShapes { get; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<MapShape> |
Remarks
This is read only property to get the shapes which are visible on the map.
Methods
Dispose()
Dispose
Declaration
public void Dispose()
LatLongToPixelXY(Double, Double, out Point)
Converts latitude and longitude to X and Y values.
Declaration
public void LatLongToPixelXY(double latitude, double longitude, out Point point)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | latitude | |
| System.Double | longitude | |
| System.Windows.Point | point |
LoadFromStream(Stream)
Loads shapes from stream
Declaration
public void LoadFromStream(Stream shpstream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | shpstream |
LoadFromStream(Stream, Stream)
Loads shapes and dbf as stream
Declaration
public void LoadFromStream(Stream shpstream, Stream dbfstream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | shpstream | |
| System.IO.Stream | dbfstream |
LoadKmlStream(Stream)
Loads shapes from Kml stream.
Declaration
public void LoadKmlStream(Stream kmlStream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | kmlStream |
OnApplyTemplate()
Declaration
public override void OnApplyTemplate()
OnMouseEnter(MouseEventArgs)
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | 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 |
OnMouseUp(MouseButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseUp(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The System.Windows.Input.MouseEventArgs that contains the event data. |
Refresh()
Clears and re-arranges all the elements in the ShapeFileLayer.
Declaration
public void Refresh()
Remarks
The Refresh function will clears all the elements in ShapeFileLayer. And re-creates and arranges them on 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";
layer.Refresh();
syncMap.Layers.Add(layer);
}
}
}
Reset()
Clears all elements from the ShapeFileLayer.
Declaration
public void Reset()
Remarks
This Reset function will clear all the elements from the ShapeFileLayer.
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";
layer.Reset();
syncMap.Layers.Add(layer);
}
}
}
SelectShape(MapShape)
SelectShape method to select any map shape dynamically
Declaration
public void SelectShape(MapShape shape)
Parameters
| Type | Name | Description |
|---|---|---|
| MapShape | shape |
Events
ShapesSelected
Occurs when Shapes in the Shape file layer is Selected.
Declaration
public event SelectionEventHandler ShapesSelected
Event Type
| Type |
|---|
| SelectionEventHandler |
Remarks
This event will triggered when a shape or shapes are selected in the ShapeFileLayer. The argument contains the List of selected shapes.
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";
layer.ShapesSelected += layer_ShapesSelected;
syncMap.Layers.Add(layer);
}
void layer_ShapesSelected(object sender, SelectionEventArgs args)
{
var selectedItems = args.Items;
}
}
}
ShapesUnSelected
Occurs when Shapes in the Shape file layer is Un Selected.
Declaration
public event SelectionEventHandler ShapesUnSelected
Event Type
| Type |
|---|
| SelectionEventHandler |
Remarks
This event will triggered when a shape or shapes are unselected in the ShapeFileLayer. The argument contains the List of unselected shapes.
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";
layer.ShapesUnSelected += layer_ShapesUnSelected;
syncMap.Layers.Add(layer);
}
void layer_ShapesUnSelected(object sender, SelectionEventArgs args)
{
var selectedItems = args.Items;
}
}
}