Blazorise Maps API
Explore the Blazorise Maps API reference for parameters, events, methods, and related types.
For examples and usage guidance, see the Maps documentation.
API
Parameters
Map
| Parameter | Description | Type | Default |
|---|---|---|---|
ChildContent |
Defines tile layers, markers, shapes, and other map content rendered inside the map. |
RenderFragment | null |
Options |
Configures map interaction, provider, zoom limits, and controls. |
MapOptions | new() |
View |
Specifies the map center, zoom level, and optional bounds. Updating the value after render moves the displayed map view. |
MapView | new() |
MapTileLayer
| Parameter | Description | Type | Default |
|---|---|---|---|
Attribution |
Provides attribution text required by the tile provider. |
string | |
Id |
Identifies this layer for updates, events, and removal. Changing the value after initialization removes the previous provider layer and registers a new one. |
string | |
Interactive |
Enables pointer interaction for this layer when supported by the provider. |
bool | true |
MaxZoom |
Limits this tile layer to the specified maximum zoom level. |
double? | null |
MinZoom |
Limits this tile layer to the specified minimum zoom level. |
double? | null |
Name |
Provides an optional display name for UI or diagnostics. |
string | |
Opacity |
Applies layer opacity to tile, marker, and shape rendering, where 1 is fully opaque and 0 is fully transparent. |
double | 1d |
Source |
Specifies the raster tile source URL, typically using {z}, {x}, and {y} placeholders. |
string | |
Subdomains |
Specifies optional tile subdomains used by the source URL. |
string[] | null |
TileSize |
Specifies the tile size in pixels. |
int | 256 |
Visible |
Controls whether this layer is rendered on the map. |
bool | true |
ZIndex |
Controls the layer ordering relative to other layers when supported by the provider. |
int? | null |
MapMarker
| Parameter | Description | Type | Default |
|---|---|---|---|
Coordinate |
Specifies the marker coordinate. |
MapCoordinate | null |
Draggable |
Allows the marker to be moved by dragging. |
bool | false |
Icon |
Specifies a custom marker icon. |
MapMarkerIcon | null |
Id |
Identifies this layer for updates, events, and removal. Changing the value after initialization removes the previous provider layer and registers a new one. |
string | |
Interactive |
Enables pointer interaction for this layer when supported by the provider. |
bool | true |
Name |
Provides an optional display name for UI or diagnostics. |
string | |
Opacity |
Applies layer opacity to tile, marker, and shape rendering, where 1 is fully opaque and 0 is fully transparent. |
double | 1d |
PopupText |
Provides popup text opened by the marker. |
string | |
Title |
Provides browser title text for the marker. |
string | |
TooltipText |
Provides tooltip text displayed near the marker. |
string | |
Visible |
Controls whether this layer is rendered on the map. |
bool | true |
ZIndex |
Controls the layer ordering relative to other layers when supported by the provider. |
int? | null |
MapMarkerLayer
| Parameter | Description | Type | Default |
|---|---|---|---|
Data |
Provides the data items used to create markers. |
IEnumerable<TItem> | null |
Id |
Identifies this layer for updates, events, and removal. Changing the value after initialization removes the previous provider layer and registers a new one. |
string | |
Interactive |
Enables pointer interaction for this layer when supported by the provider. |
bool | true |
Name |
Provides an optional display name for UI or diagnostics. |
string | |
Opacity |
Applies layer opacity to tile, marker, and shape rendering, where 1 is fully opaque and 0 is fully transparent. |
double | 1d |
Visible |
Controls whether this layer is rendered on the map. |
bool | true |
ZIndex |
Controls the layer ordering relative to other layers when supported by the provider. |
int? | null |
MapCircle
| Parameter | Description | Type | Default |
|---|---|---|---|
Center |
Specifies the circle center coordinate. |
MapCoordinate | null |
Id |
Identifies this layer for updates, events, and removal. Changing the value after initialization removes the previous provider layer and registers a new one. |
string | |
Interactive |
Enables pointer interaction for this layer when supported by the provider. |
bool | true |
Name |
Provides an optional display name for UI or diagnostics. |
string | |
Opacity |
Applies layer opacity to tile, marker, and shape rendering, where 1 is fully opaque and 0 is fully transparent. |
double | 1d |
Radius |
Specifies the circle radius in meters. |
double | 0 |
Style |
Controls the circle stroke and fill styling. |
MapShapeStyle | new() |
Visible |
Controls whether this layer is rendered on the map. |
bool | true |
ZIndex |
Controls the layer ordering relative to other layers when supported by the provider. |
int? | null |
MapPolyline
| Parameter | Description | Type | Default |
|---|---|---|---|
Coordinates |
Specifies the ordered coordinates connected by the polyline. |
IReadOnlyList<MapCoordinate> | null |
Id |
Identifies this layer for updates, events, and removal. Changing the value after initialization removes the previous provider layer and registers a new one. |
string | |
Interactive |
Enables pointer interaction for this layer when supported by the provider. |
bool | true |
Name |
Provides an optional display name for UI or diagnostics. |
string | |
Opacity |
Applies layer opacity to tile, marker, and shape rendering, where 1 is fully opaque and 0 is fully transparent. |
double | 1d |
Style |
Controls the polyline stroke styling. |
MapShapeStyle | new() |
Visible |
Controls whether this layer is rendered on the map. |
bool | true |
ZIndex |
Controls the layer ordering relative to other layers when supported by the provider. |
int? | null |
MapPolygon
| Parameter | Description | Type | Default |
|---|---|---|---|
Id |
Identifies this layer for updates, events, and removal. Changing the value after initialization removes the previous provider layer and registers a new one. |
string | |
Interactive |
Enables pointer interaction for this layer when supported by the provider. |
bool | true |
Name |
Provides an optional display name for UI or diagnostics. |
string | |
Opacity |
Applies layer opacity to tile, marker, and shape rendering, where 1 is fully opaque and 0 is fully transparent. |
double | 1d |
Rings |
Specifies the polygon rings. The first ring is the outer boundary; additional rings can represent holes. |
IReadOnlyList<IReadOnlyList<MapCoordinate>> | null |
Style |
Controls the polygon stroke and fill styling. |
MapShapeStyle | new() |
Visible |
Controls whether this layer is rendered on the map. |
bool | true |
ZIndex |
Controls the layer ordering relative to other layers when supported by the provider. |
int? | null |
Events
Map
| Event | Description | Type |
|---|---|---|
Clicked |
Handles single-click interaction on the map surface. |
EventCallback<MapMouseEventArgs> |
ContextMenu |
Handles context-menu interaction on the map surface. |
EventCallback<MapMouseEventArgs> |
DoubleClicked |
Handles double-click interaction on the map surface. |
EventCallback<MapMouseEventArgs> |
Ready |
Runs after the map provider has initialized the rendered map. |
EventCallback<MapReadyEventArgs> |
ViewChanged |
Notifies when the bound map view changes. |
EventCallback<MapView> |
ViewUpdated |
Reports view changes with bounds and the reason for the change. |
EventCallback<MapViewUpdatedEventArgs> |
MapMarker
| Event | Description | Type |
|---|---|---|
Clicked |
Handles clicks on this marker. |
EventCallback<MapMarkerEventArgs> |
Dragged |
Handles completed drag operations for this marker. |
EventCallback<MapMarkerDraggedEventArgs> |
MapMarkerLayer
| Event | Description | Type |
|---|---|---|
CoordinateSelector |
Selects the marker coordinate from each data item. |
Func<TItem, MapCoordinate> |
DraggableSelector |
Determines whether each marker can be dragged. |
Func<TItem, bool> |
IconSelector |
Selects a custom icon for each marker. |
Func<TItem, MapMarkerIcon> |
IdSelector |
Selects a stable marker identifier from each data item. |
Func<TItem, string> |
MarkerClicked |
Handles clicks on data-bound markers. |
EventCallback<MapMarkerClickedEventArgs<TItem>> |
MarkerDragged |
Handles completed drag operations for data-bound markers. |
EventCallback<MapMarkerDraggedEventArgs<TItem>> |
PopupTextSelector |
Selects popup text for each marker. |
Func<TItem, string> |
TitleSelector |
Selects the browser title text for each marker. |
Func<TItem, string> |
TooltipTextSelector |
Selects tooltip text for each marker. |
Func<TItem, string> |
Methods
Map
| Method | Description | Return | Parameters |
|---|---|---|---|
FitBounds |
Fits the map view to the specified bounds. | ValueTask | MapBounds bounds, MapFitBoundsOptions options |
GetBounds |
Reads the currently visible geographic bounds from the rendered map. | ValueTask<MapBounds> | |
GetView |
Reads the current center, zoom level, and visible bounds from the rendered map. | ValueTask<MapView> | |
InvalidateSize |
Invalidates the map size after its container size changes. | ValueTask | |
PanTo |
Pans the map to the specified center coordinate. | ValueTask | MapCoordinate center, MapAnimationOptions options |
SetView |
Sets the map view to the specified center and zoom. | ValueTask | MapCoordinate center, double zoom, MapAnimationOptions options |
ZoomIn |
Increases the current zoom level. | ValueTask | |
ZoomOut |
Decreases the current zoom level. | ValueTask |