Class SfMaps
The Maps component is ideal for rendering maps from GeoJSON data or other map providers like OpenStreetMap, Google maps and Bing maps. Its rich feature set includes markers, labels, bubbles, navigation lines, legends, tooltips, zooming, panning, and much more.
Inherited Members
Namespace: Syncfusion.Blazor.Maps
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfMaps : SfBaseComponent
Constructors
SfMaps()
Declaration
public SfMaps()
Properties
AllowImageExport
Enables or disables the export to image functionality in map.
Declaration
public bool AllowImageExport { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
AllowPdfExport
Enables or disables the export to PDF functionality in map.
Declaration
public bool AllowPdfExport { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
AllowPrint
Enables or disables the print functionality in map.
Declaration
public bool AllowPrint { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Background
Sets and gets the background color of the maps container.
Declaration
public string Background { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value that specifies the background color of maps. |
BaseLayerIndex
Sets and gets the base map index of maps. It provides the option to select which layer to be visible in the maps.
Declaration
public int BaseLayerIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Accepts an integer value that represents the layer index for maps component. |
ChildContent
Sets and gets the content of the UI element.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment | Accepts a RenderFragment that defines the content of the UI element. |
Description
Sets and gets the description for maps.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
EnableGroupingSeparator
Enables or disables the visibility state of the separator for grouping.
Declaration
public bool EnableGroupingSeparator { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
EnablePersistence
Sets and gets the description for maps.
Declaration
public bool EnablePersistence { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Format
Sets and gets the format in which the text in the maps are to be rendered.
Declaration
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
Height
Sets and gets the height in which the maps is to be rendered.
Declaration
public string Height { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
ID
Set the ID string for the map component.
Declaration
public string ID { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
ProjectionType
Sets and gets the projection type for the maps.
Declaration
public ProjectionType ProjectionType { get; set; }
Property Value
Type | Description |
---|---|
ProjectionType | A value of the ProjectionType enumeration that specifies the type of projection for maps. The default value is Mercator. |
Theme
Set and gets the theme supported for the maps.
Declaration
public Theme Theme { get; set; }
Property Value
Type | Description |
---|---|
Theme | Accepts a value from the Theme enum. The default value is Material. |
TooltipDisplayMode
Sets and gets the mode in which the tooltip is to be displayed. The tooltip can be rendered on mouse move, click or double clicking on the element on the map.
Declaration
public TooltipGesture TooltipDisplayMode { get; set; }
Property Value
Type |
---|
TooltipGesture |
Width
Sets and gets the width in which the maps is to be rendered.
Declaration
public string Width { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
Dispose(Boolean)
Disposes the property values during the destroy of the component that is hold up for the execution of the component.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
ExportAsync(ExportType, String, Nullable<PdfPageOrientation>, Boolean)
This method handles the export functionality for the maps component.
Declaration
public Task<string> ExportAsync(ExportType type, string fileName, Nullable<PdfPageOrientation> orientation = null, bool allowDownload = true)
Parameters
Type | Name | Description |
---|---|---|
ExportType | type | Specifies the extension type of the exported map. |
System.String | fileName | Specifes the file name to be used for the exported map. |
System.Nullable<Syncfusion.PdfExport.PdfPageOrientation> | orientation | Specifies the ortientation of the PDF document. |
System.Boolean | allowDownload | Specifies whether to download or return base64 string of the exported document. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | System.Threading.Tasks.Task representing the asynchronous operation. |
GetBingUrlTemplate(String)
This method is used to get the bing maps url.
Declaration
public static Task<string> GetBingUrlTemplate(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | Specifies the url of the maps. |
Returns
Type |
---|
System.Threading.Tasks.Task<System.String> |
GetMinMaxLatitudeLongitude()
This method provides the minimum and maximum latitude and longitude values of the visible area in the Maps.
Declaration
public MinMaxLatitudeLongitude GetMinMaxLatitudeLongitude()
Returns
Type |
---|
MinMaxLatitudeLongitude |
OnAfterRenderAsync(Boolean)
OnAfterRenderAsync is a lifecycle method that is invoked each time the component is rendered in the application.
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender | represents the method hitting counts. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task representing the asynchronous operation. |
Overrides
OnComponentParametersSet()
OnParametersSetAsync is a lifecycle method that is invoked when the component has received parameters, and the incoming values have been assigned to the properties.
Declaration
protected Task OnComponentParametersSet()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task representing the asynchronous operation. |
OnInitializedAsync()
OnInitializedAsync method is called when the component has received its initial parameters.
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task representing the asynchronous operation. |
Overrides
OnParametersSetAsync()
OnParametersSetAsync is a lifecycle method that is invoked when the component has received parameters, and the incoming values have been assigned to the properties.
Declaration
protected override Task OnParametersSetAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task representing the asynchronous operation. |
PrintAsync()
This method handles the printing functionality for the maps component.
Declaration
public Task PrintAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task representing the asynchronous operation. |
Refresh()
The method is used to render the maps again.
Declaration
public void Refresh()
ShapeSelectionAsync(Int32, String, String, Boolean)
This method is used to select the geometric shape element in the maps component.
Declaration
public Task ShapeSelectionAsync(int layerIndex, string propertyName, string name, bool enable = true)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | layerIndex | Specifies the index number of layer. |
System.String | propertyName | Specifies the property path for map shape data to select the shape. |
System.String | name | Specifies the shape data path for the data source of the layer. |
System.Boolean | enable | Specifies whether to select or unselect the shape. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | System.Threading.Tasks.Task representing the asynchronous operation. |
ShouldRender()
Declaration
protected override bool ShouldRender()
Returns
Type |
---|
System.Boolean |
ZoomByPosition(MapsCenterPosition, Double)
This method is used to zoom the map by specifying the center position.
Declaration
public Task ZoomByPosition(MapsCenterPosition centerPosition, double zoomFactor)
Parameters
Type | Name | Description |
---|---|---|
MapsCenterPosition | centerPosition | Specifies the position of the maps. |
System.Double | zoomFactor | Specifies the zoom level of maps. |
Returns
Type |
---|
System.Threading.Tasks.Task |
ZoomToCoordinates(Double, Double, Double, Double)
This method is used to zoom the maps component based on the provided coordinates.
Declaration
public Task ZoomToCoordinates(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude)
Parameters
Type | Name | Description |
---|---|---|
System.Double | minLatitude | Specifies the minimum latitude of the coordinate for the zooming operation. |
System.Double | minLongitude | Specifies the minimum longitude of the coordinate for the zooming operation. |
System.Double | maxLatitude | Specifies the maximum latitude of the coordinate for the zooming operation. |
System.Double | maxLongitude | Specifies the maximum longitude of the coordinate for the zooming operation. |
Returns
Type |
---|
System.Threading.Tasks.Task |