BlazorLeafletInterop 3.3.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package BlazorLeafletInterop --version 3.3.9                
NuGet\Install-Package BlazorLeafletInterop -Version 3.3.9                
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="BlazorLeafletInterop" Version="3.3.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BlazorLeafletInterop --version 3.3.9                
#r "nuget: BlazorLeafletInterop, 3.3.9"                
#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.
// Install BlazorLeafletInterop as a Cake Addin
#addin nuget:?package=BlazorLeafletInterop&version=3.3.9

// Install BlazorLeafletInterop as a Cake Tool
#tool nuget:?package=BlazorLeafletInterop&version=3.3.9                

Blazor Leaflet Interop

It is a work in progress and only supports parts of the Leaflet API.
I have only tested this on Blazor WASM but should work with Blazor Server.

Implemented Features

  • Map
  • Events
  • Base Layers
    • GridLayer
    • Layer
    • InteractiveLayer
  • Raster Layers
    • TileLayer
  • UI Layers
    • Marker
    • Popup
    • Tooltip
    • DivOverlay
  • Basic
    • LatLng
    • LatLngBounds
    • Icon (Create this via the IconFactoryInterop service)
    • Point
  • Other Layers
    • GeoJSON
    • FeatureGroup
    • LayerGroup
  • Vector Layers
    • Path
    • Polyline

Events should work but are not tested yet.

Before you start

Add the latest leaflet version to your index.html

<script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.min.js"></script>

Add this service to your Program.cs

builder.Services.AddMapService();

Simple Usage

To make a simple map use the following code:

@page "/"

@using BlazorLeafletInterop.Components
@using BlazorLeafletInterop.Components.Base
@using BlazorLeafletInterop.Models
@using BlazorLeafletInterop.Models.Basics

<Map Class="map" MapOptions="Options">
    <TileLayer @ref="TileLayer" UrlTemplate="https://tile.openstreetmap.org/{z}/{x}/{y}.png" />
    <Marker LatLng="new LatLng(50, 9)">
        <Popup>
            Testing Popup Content
        </Popup>
        <Tooltip>
            Testing Tooltip Content
        </Tooltip>
    </Marker>
</Map>

@code {
    private MapOptions Options { get; set; } = new() { Center = new LatLng(50, 9), Zoom = 13 };
}

TODO

  • Add Controls
  • Add ImageOverlay, SVGOverlay, VideoOverlay
  • Add Renderers
  • Add Rectangle, Polygon, Circle, CircleMarker
  • Add Bounds, DivIcon
  • Plugin Support

Contributing

If you want to contribute to this project, feel free to do so. Just fork the project and create a pull request.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.3.2 470 1/19/2024
4.3.1 103 1/19/2024
4.3.0 197 12/15/2023
4.2.0 162 11/28/2023
4.1.2 149 11/13/2023
4.1.1 96 11/13/2023
4.1.0 111 11/13/2023
4.0.1 109 11/13/2023
4.0.0 102 11/12/2023
3.3.9 152 10/31/2023
3.3.8 139 10/31/2023
3.3.7 150 10/30/2023
3.3.6 138 10/29/2023
3.3.5 129 10/29/2023
3.3.4 133 10/29/2023
3.3.3 147 10/26/2023
3.3.2 134 10/26/2023
3.3.1 142 10/26/2023
3.2.0 125 10/25/2023
3.1.6 153 10/25/2023
3.1.5 128 10/25/2023
3.1.4 146 10/24/2023
3.1.3 138 10/24/2023
3.1.2 157 10/24/2023
3.1.1 139 10/24/2023
3.1.0 129 10/24/2023
3.0.3 144 10/20/2023
3.0.2 153 10/20/2023
3.0.1 132 10/19/2023
3.0.0 135 10/19/2023
2.1.0 148 10/18/2023
2.0.0 131 10/18/2023
1.0.6 146 10/17/2023
1.0.5 126 10/17/2023
1.0.4 146 10/17/2023
1.0.3 144 10/17/2023
1.0.2 137 10/16/2023