Tempo.Blazor.Maps
2.8.24
dotnet add package Tempo.Blazor.Maps --version 2.8.24
NuGet\Install-Package Tempo.Blazor.Maps -Version 2.8.24
<PackageReference Include="Tempo.Blazor.Maps" Version="2.8.24" />
<PackageVersion Include="Tempo.Blazor.Maps" Version="2.8.24" />
<PackageReference Include="Tempo.Blazor.Maps" />
paket add Tempo.Blazor.Maps --version 2.8.24
#r "nuget: Tempo.Blazor.Maps, 2.8.24"
#:package Tempo.Blazor.Maps@2.8.24
#addin nuget:?package=Tempo.Blazor.Maps&version=2.8.24
#tool nuget:?package=Tempo.Blazor.Maps&version=2.8.24
Tempo.Blazor.Maps
Interactive Leaflet maps for Blazor (WebAssembly, Server, InteractiveAuto) with fully bundled assets — Leaflet 1.9.4 and leaflet.markercluster 1.5.3 ship inside the package, so there is no CDN dependency (offline/CSP-safe).
Features
TmMap— Leaflet map with OpenStreetMap tiles (attribution always visible), pan/zoom, and fractional zoom levels.- Canvas marker batches — thousands of points render through a shared
L.canvasrenderer, never as DOM markers. - Atomic data swaps — replacing markers or clusters happens in one synchronous JS pass; the map never double-renders or flashes empty.
- Client-side clustering —
UseClientClusteringgroups markers with leaflet.markercluster (zoom-to-bounds, spiderfy), or drive cluster groups imperatively viaAddClusterGroupAsync/AddMarkersToClusterAsync. - Server-side clusters — feed pre-aggregated
MapClusterPoints and get count bubbles with culture-formatted counts and localized aria labels; aCount == 1cluster renders as a plain marker. IMapDataProvider— optional data source called after the viewport settles (debounced, default 300 ms) with cancellation of superseded requests; hybrid clusters↔markers switching by zoom level is a one-interface implementation.- Events —
OnMarkerClick,OnClusterClick(with the server cluster key),OnZoomChanged,OnMapClick,OnDataError. - Design system — styling via
--tm-*tokens (dark mode included), localization viaITmLocalizer(en/cs/fr built in), WCAG-friendly markup.
Getting started
// Program.cs — Tempo.Blazor core services
builder.Services.AddTempoBlazor();
<link href="_content/Tempo.Blazor/css/tempo-blazor.css" rel="stylesheet" />
<link href="_content/Tempo.Blazor.Maps/css/tempo-blazor-maps.css" rel="stylesheet" />
@using Tempo.Blazor.Components.Maps
@using Tempo.Blazor.Abstractions.Models
<TmMap CenterLatitude="49.8175"
CenterLongitude="15.473"
Zoom="7.5"
Height="480px"
Markers="@markers"
OnMarkerClick="HandleMarkerClick" />
@code {
private readonly IReadOnlyList<MapMarker> markers =
[
new("praha", 50.0755, 14.4378, "Praha"),
new("brno", 49.1951, 16.6068, "Brno"),
];
private void HandleMarkerClick(MapMarker marker) { /* ... */ }
}
Client-side clustering
<TmMap Markers="@manyMarkers"
UseClientClustering="true"
OnClusterClick="HandleClusterClick" />
Hybrid provider (server-side aggregation)
public sealed class PriceMapProvider : IMapDataProvider
{
public async Task<MapDataResult> GetPointsAsync(MapViewport viewport, CancellationToken ct)
{
return viewport.Zoom >= 12
? new MapDataResult(Markers: await LoadMarkersAsync(viewport, ct))
: new MapDataResult(Clusters: await LoadGridClustersAsync(viewport, ct));
}
}
<TmMap DataProvider="@provider"
OnClusterClick="DrillDown"
OnDataError="ShowError" />
Imperative API
| Method | Purpose |
|---|---|
SetViewAsync(MapViewport) |
Move the map (no animation). |
GetViewportAsync() |
Read the current center + zoom. |
SetMarkersAsync / SetClusterPointsAsync |
Atomically replace the data set. |
AddMarkersAsync |
Add a Canvas marker batch on top. |
AddClusterGroupAsync / AddMarkerToClusterAsync / AddMarkersToClusterAsync |
Imperative client clustering. |
ClearMarkersAsync |
Remove all markers, clusters, and data layers. |
InvalidateSizeAsync |
Recalculate size after the container becomes visible (hidden tab). |
RefreshDataAsync |
Ask the provider for fresh data immediately. |
Theming
The marker color comes from the --tm-map-marker-color token (defaults to
--tm-color-danger); cluster bubbles use --tm-color-primary. Override per app or per map:
.my-page .tm-map {
--tm-map-marker-color: var(--tm-color-primary);
}
License
MIT — see the repository license. Map data © OpenStreetMap contributors.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.3)
- Tempo.Blazor (>= 2.8.24)
- Tempo.Blazor.Abstractions (>= 2.8.24)
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.12)
- Tempo.Blazor (>= 2.8.24)
- Tempo.Blazor.Abstractions (>= 2.8.24)
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 9.0.3)
- Tempo.Blazor (>= 2.8.24)
- Tempo.Blazor.Abstractions (>= 2.8.24)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Tempo.Blazor.Maps:
| Package | Downloads |
|---|---|
|
Tempo.Blazor.All
Compatibility package for Tempo.Blazor that references the core package and split feature packages for applications that want the full component suite. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.8.24 | 42 | 8/26/2026 |
| 2.8.23 | 47 | 8/26/2026 |
| 2.8.22 | 41 | 8/26/2026 |
| 2.8.21 | 78 | 8/23/2026 |
| 2.8.20 | 99 | 8/22/2026 |
| 2.8.19 | 105 | 8/19/2026 |
| 2.8.18 | 105 | 8/18/2026 |
| 2.8.16 | 109 | 8/12/2026 |
| 2.8.14 | 109 | 8/9/2026 |
| 2.8.13 | 105 | 8/9/2026 |
| 2.8.12 | 108 | 8/8/2026 |
| 2.8.11 | 111 | 8/8/2026 |
| 2.8.10 | 100 | 8/7/2026 |
| 2.8.9 | 112 | 8/7/2026 |
| 2.8.8 | 112 | 8/7/2026 |
| 2.8.7 | 102 | 8/7/2026 |
| 2.8.4 | 118 | 7/29/2026 |
| 2.8.3 | 170 | 7/26/2026 |
| 2.8.1 | 119 | 7/26/2026 |
| 2.8.0 | 123 | 7/25/2026 |