LeafletForBlazor 4.0.8.88
dotnet add package LeafletForBlazor --version 4.0.8.88
NuGet\Install-Package LeafletForBlazor -Version 4.0.8.88
<PackageReference Include="LeafletForBlazor" Version="4.0.8.88" />
<PackageVersion Include="LeafletForBlazor" Version="4.0.8.88" />
<PackageReference Include="LeafletForBlazor" />
paket add LeafletForBlazor --version 4.0.8.88
#r "nuget: LeafletForBlazor, 4.0.8.88"
#:package LeafletForBlazor@4.0.8.88
#addin nuget:?package=LeafletForBlazor&version=4.0.8.88
#tool nuget:?package=LeafletForBlazor&version=4.0.8.88
Leaflet Map for Blazor
Leaflet for Blazor is a library that provides components for displaying map in Blazor applications.
π KEYWORDS: Pure C# - Write map logic entirely in .NET / no JavaScript interop boilerplate, LINQ Integration - Destructuring/Structuring LINQ expression, Fluent API - objects Hierarchical and Linguistic structure and Chain methods, Plugins Framework - allows you to extend LeafletForBlazor, Zero JavaScript Config - no script references and no css links etc
π§© Version 4.0 β»οΈrehydrates the Map control. The new control will inherit the minimalism of the Map control and the optimizations of the RealTimeMap control.
βοΈ Core Concepts
No JavaScript or HTML specific configurations required, no API script configurations, no CSS references, no HTML items etc.Optimized codethrough various solutions- minimizing the number of calls to JavaScript;
- collection searches by
destructuring and structuring LINQ expressions; - fluent API, a design pattern that allows code to be written in a readable way, similar to an English sentence
- reducing size of the JavaScript code by removing unused code.
- Memory Cache
Plugins framework- By writing simple wrapper code, the MapPlugins framework allows LeafletForBlazor to be extended with already developed Leaflet.js plugins (add-ons) - more about Leaflet.js Plugins.
π Quick Start
π§ Project setup
π΅ Add the Map component to your project in just 3 steps:
- Install the NuGet package:
From VS interface: Tools β NuGet Package Manager β Manage NuGet Packages for Solution...
Search for "LeafletForBlazor" and add the package to the project or solution.
From Package Manager Console: Tools β NuGet Package Manager β Package Manager Console
NuGet\Install-Package LeafletForBlazor
- Add the required namespaces in
_Imports.razor
To do this, add the following directives to the _Imports.razor file
@using LeafletForBlazor //working with package classes
@using static LeafletForBlazor.Map //working with Map class
@using static LeafletForBlazor.techs.maps.Leaflet //working with Leaflet API
- Use the
Mapcomponent
Razor
<Map height="100vh" width="100vw"/>
πΊοΈ Map and Default Configuration
Use the loadParameters property to set the initial map view:
Razor
<Map loadParameters="@loadParameters" height="100vh" width="100vw"/>
C# - Default Map Configuration
LoadParameters loadParameters = new()
{
location = new Location() //Default center of the Map View
{
latitude = 50.83112274500208,
longitude = 4.407353347319803
},
zoomLevel = 10 //Default zoom level
};
Additional default configurations are available, including attribution control visibility, map basemap layers, and map controls such as the scale control.
more about Map Configuration - Blazor WebAssembly Standalone App
more about Map Configuration - .NET MAUI Blazor Hybrid App
πΊοΈ More about Map component
β‘ Map Events
OnAfterMapLoaded
Fires after the Leaflet map instance has fully initialized on the client side. Use it to access the map's initial state or trigger post-load logic.
Razor
<Map height="100vh" width="100vw" OnAfterMapLoaded="@OnAfterMapLoaded" />
C# - Handler signature
private Task OnAfterMapLoaded(MapEventArgs args)
{
Console.WriteLine($"lat: {args.centerOfView.latitude} long: {args.centerOfView.longitude}");
return Task.CompletedTask;
}
more about Map Events - Blazor WebAssembly Standalone App
more about Map Events - .NET MAUI Blazor Hybrid App
ποΈ View class
View is the class that allows you to control the visible area of ββthe map.
For example, you can use the View class to get the map's center:
var center = await map!.View.getCenterAsync();
...setting the map center:
map!.View.SetCenter(40.24, 5.48);
βΉοΈ Attribution class
The Attribution class provides the methods needed to interact with the map's attributionControl:

For example, you can completely remove the attributionControl:
await map!.Attribution.Remove();
//strongly discouraged from an ethical standpoint (Leaflet.js BSD 2 license)
π Geometric class
The Geometric class contains classes that operate on geometries obtained from various sources.
π StreamPoint collection
StreamPoint collection provides real-time map synchronization - any property change (coordinates, appearance, timestamp) instantly updates the map visualization. Objects are cached for performance but remain fully dynamic.
The StreamPoint collection is hosted by @map.Geometric.Points and provides you methods for handling predefined but hierarchically extensible root data structure:
- Add(), Remove(), Update() for collection handling;
- Appearance() for point the aspect in the map;
- StreamPoint collection events;
more about StreamCollection - Blazor WebAssembly Standalone App
more about StreamCollection - .NET MAUI Blazor Hybrid App
π Working with Files
The @map.Geometric.From.Files class allows you to load data from files stored on a web service host (https://...). Full RFC 7946 Feature Support.
π Dashboard
StreamPoint collection can be used to monitor moving targets: vehicles, boats, aircraft, even fleets of vehicles, drones and so one. Both the map and the StreamPoint collection can be configured to create a Map Dashboard.

π Map plugins
However, extending the NuGet package can only be implemented by adding JavaScript code.
The Map component provides the MapPlugins slot (Plugin Framework), allowing you to extend LeafletForBlazor with additional Leaflet functionality. It enables the development of features in JavaScript and grants you access to the map (the Leaflet map instance) and the L object.
<Map>
<MapPlugins>
@* Custom Blazor Component - Leaflet.js Fullscreen plugin *@
<Fullscreen
Map="@context.map"
L="context.LeafletCore"
url="https://unpkg.com/leaflet.fullscreen/dist/Control.FullScreen.umd.js"
href="https://unpkg.com/leaflet.fullscreen/dist/Control.FullScreen.css" />
@* other plugins or custom functionality *@
</MapPlugins>
</Map>
By writing simple wrapper code, the MapPlugins framework allows LeafletForBlazor to be extended with already developed Leaflet.js add-ons.
more about MapPlugins and WASM
more about MapPlugins and MAUI
π¦ Map Components
The Map component provides the MapComponents slot, allowing you to extend the LeafletForBlazor map with graphical interface elements.
<Map>
<MapComponents>
<Toolbar/>
@* other MapComponents or html elements *@
</MapComponents>
</Map>
| Description | Image |
|---|---|
| The component displays a Legend on the map, allowing users to quickly understand the meaning of the symbols and colors applied to data layers. In the current version, the legend is only available for GeoJSON files and StreamPoint Collection. Legend can also be used in .NET MAUI projects. | ![]() |
| Contextual display driven by data source with MapPopup | ![]() |
| The Toolbar it is a map component that allows for expansion with various buttons and even tools. | ![]() |
| A Toggle is a check/uncheck component that can be hosted in a toolbar. | ![]() |
O-L I - αΆβ΄Λ‘α΅β·α΅β΅α΅αΆ Λ‘α΅β·βΈα΅βΏ π
Thank you for choosing this package!
Laurentiu Ichim
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 9.0.11)
- Microsoft.Extensions.Caching.Memory (>= 10.0.10)
- NetTopologySuite (>= 2.6.0)
- NetTopologySuite.IO.GeoJSON (>= 4.0.0)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.8.88 | 460 | 10/15/2026 |
| 4.0.8.86 | 223 | 10/14/2026 |
| 4.0.8.84 | 178 | 10/12/2026 |
| 4.0.8.82 | 119 | 10/11/2026 |
| 4.0.8.8 | 344 | 9/24/2026 |
| 4.0.8.6 | 213 | 9/21/2026 |
| 4.0.8.4 | 136 | 9/20/2026 |
| 4.0.8.2 | 642 | 9/16/2026 |
| 4.0.8 | 167 | 9/15/2026 |
| 4.0.6.8 | 235 | 9/14/2026 |
| 4.0.6.6 | 253 | 9/9/2026 |
| 4.0.6.4 | 210 | 9/8/2026 |
| 4.0.6.2 | 173 | 9/4/2026 |
| 4.0.6 | 251 | 9/1/2026 |
| 4.0.4.8 | 185 | 8/28/2026 |
| 4.0.4.4 | 152 | 8/27/2026 |
| 4.0.4.2 | 189 | 8/25/2026 |
| 4.0.4 | 162 | 8/24/2026 |
| 4.0.2.8 | 253 | 8/19/2026 |
| 4.0.2.6 | 202 | 8/15/2026 |
@map.Geometric.Points.Remove(new List<string>(){"00000000-0000-0000-0000-000000000001"});



