Tempo.Blazor.Maps 2.7.1

dotnet add package Tempo.Blazor.Maps --version 2.7.1
                    
NuGet\Install-Package Tempo.Blazor.Maps -Version 2.7.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tempo.Blazor.Maps" Version="2.7.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tempo.Blazor.Maps" Version="2.7.1" />
                    
Directory.Packages.props
<PackageReference Include="Tempo.Blazor.Maps" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Tempo.Blazor.Maps --version 2.7.1
                    
#r "nuget: Tempo.Blazor.Maps, 2.7.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Tempo.Blazor.Maps@2.7.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Tempo.Blazor.Maps&version=2.7.1
                    
Install as a Cake Addin
#tool nuget:?package=Tempo.Blazor.Maps&version=2.7.1
                    
Install as a Cake Tool

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.canvas renderer, 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 clusteringUseClientClustering groups markers with leaflet.markercluster (zoom-to-bounds, spiderfy), or drive cluster groups imperatively via AddClusterGroupAsync / AddMarkersToClusterAsync.
  • Server-side clusters — feed pre-aggregated MapClusterPoints and get count bubbles with culture-formatted counts and localized aria labels; a Count == 1 cluster 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.
  • EventsOnMarkerClick, OnClusterClick (with the server cluster key), OnZoomChanged, OnMapClick, OnDataError.
  • Design system — styling via --tm-* tokens (dark mode included), localization via ITmLocalizer (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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.7.1 0 7/24/2026
2.7.0 37 7/24/2026
2.6.1 48 7/23/2026
2.6.0 49 7/23/2026
2.5.5 53 7/22/2026
2.5.4 54 7/22/2026
2.5.3 62 7/21/2026
2.5.3-ci-20260721185803 59 7/21/2026
2.5.2 95 7/21/2026
2.5.1 110 7/19/2026
2.4.0 106 7/19/2026
2.3.10-ci-20260719120426 109 7/19/2026
2.3.10-ci-20260719052650 109 7/19/2026
2.3.9-preview 107 7/17/2026
2.3.9-ci-20260719043811 114 7/19/2026
2.3.9-ci-20260717060118 111 7/17/2026
2.3.8 145 7/17/2026
2.3.8-ci-20260717035306 99 7/17/2026
2.3.8-ci-20260717034218 104 7/17/2026
2.3.7 123 7/17/2026
Loading failed