OpenLayers.Blazor
2.3.1
dotnet add package OpenLayers.Blazor --version 2.3.1
NuGet\Install-Package OpenLayers.Blazor -Version 2.3.1
<PackageReference Include="OpenLayers.Blazor" Version="2.3.1" />
paket add OpenLayers.Blazor --version 2.3.1
#r "nuget: OpenLayers.Blazor, 2.3.1"
// Install OpenLayers.Blazor as a Cake Addin #addin nuget:?package=OpenLayers.Blazor&version=2.3.1 // Install OpenLayers.Blazor as a Cake Tool #tool nuget:?package=OpenLayers.Blazor&version=2.3.1
OpenLayers.Blazor
This is a map component based on OpenLayers to show different types and layers of maps from sources like OpenStreet, Bing, SwissTopo ary WMTS/WMS compatible source with some features like markes or shape drawing. The component has implemented the swiss specific coordination projection (VL03/VL95) and therefore can project map content from swisstopo (https://map.geo.admin.ch/).
Release 2.0 changes and features
- Full support for vector layers including adding shapes per layer
- Capability to fully adjust vector styles
- Shape selection feature with events on layers
- Automatic update on a parameter change on layers and shapes (only when rendered as component)
- Internal shape/drawing and marker layers are added on demand and are part of the layers collection
- Fix when Map.InteractionsEnabled = false also no mouse events are handled
-
- many more small improvements and bug fixes
Demo/Examples
https://openlayers-blazor-demo.laurent-christen.ch/
Usage
Setup
install nuget package
dotnet add package OpenLayers.Blazor
Download the openlayers distribution js/css files https://github.com/openlayers/openlayers or from other sources and include them in the index.html file:
<head> ... <link href="https://cdnjs.cloudflare.com/ajax/libs/openlayers/8.1.0/ol.min.css" rel="stylesheet" /> <link href="_content/OpenLayers.Blazor/OpenLayers.Blazor.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/8.1.0/dist/ol.min.js"></script> ... </head>
Examples
<SwissMap Style="height:800px">
<Popup>
<div id="popup" class="ol-box">
@if (context is Marker marker)
{
<h3>@marker.Text</h3>
<p>@marker.Coordinate.X / @marker.Coordinate.Y</p>
}
</div>
</Popup>
<Features>
<Marker Type="MarkerType.MarkerPin" Coordinate="new Coordinate(2604200, 1197650)"></Marker>
<Marker Type="MarkerType.MarkerFlag" Coordinate="new Coordinate(2624200, 1177650)" Text="Hallo" BackgroundColor="#449933" Popup></Marker>
<Line Points="new []{new Coordinate(1197650, 2604200), new Coordinate(2624200, 1177650)}" BorderColor="cyan"></Line>
</Features>
</SwissMap>
<OpenStreetMap Style="height:480px; width:640px" Zoom="5" Center="new Coordinate(0, 51)">
<Layers>
<Layer SourceType="SourceType.TileWMS"
Url="https://sedac.ciesin.columbia.edu/geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=gpw-v3%3Agpw-v3-population-density_2000&LANG=en"
Opacity=".3"
CrossOrigin="anonymous"></Layer>
</Layers>
</OpenStreetMap>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. 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 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. |
-
net6.0
- Microsoft.AspNetCore.Components (>= 6.0.36)
- Microsoft.AspNetCore.Components.Web (>= 6.0.36)
-
net7.0
- Microsoft.AspNetCore.Components (>= 7.0.20)
- Microsoft.AspNetCore.Components.Web (>= 7.0.20)
-
net8.0
- Microsoft.AspNetCore.Components (>= 8.0.0)
- Microsoft.AspNetCore.Components.Web (>= 8.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on OpenLayers.Blazor:
Package | Downloads |
---|---|
OpenLayers.Blazor.Demo.Components
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
2.3.1 | 350 | 11/13/2024 | |
2.3.0 | 240 | 10/28/2024 | |
2.2.3 | 365 | 10/9/2024 | |
2.2.2 | 696 | 8/26/2024 | |
2.2.1 | 116 | 8/26/2024 | |
2.2.0 | 122 | 8/26/2024 | |
2.1.0 | 167 | 8/7/2024 | |
2.0.1 | 215 | 7/13/2024 | |
2.0.0 | 115 | 7/12/2024 | |
1.5.10 | 1,224 | 5/28/2024 | |
1.5.9 | 609 | 3/27/2024 | |
1.5.8 | 120 | 3/27/2024 | |
1.5.7 | 450 | 3/4/2024 | |
1.5.6 | 231 | 2/19/2024 | |
1.5.5 | 339 | 2/16/2024 | |
1.5.4 | 130 | 2/16/2024 | |
1.5.3 | 191 | 2/2/2024 | |
1.5.2 | 156 | 1/15/2024 | |
1.5.1 | 167 | 12/29/2023 | |
1.5.0 | 294 | 12/18/2023 | |
1.4.1 | 432 | 11/10/2023 | |
1.4.0 | 193 | 10/24/2023 | |
1.3.1 | 204 | 10/13/2023 | |
1.3.0 | 126 | 10/9/2023 | |
1.1.0 | 372 | 6/11/2023 | |
1.0.1 | 192 | 4/28/2023 | |
1.0.0 | 760 | 4/14/2023 | |
0.3.0-alpha | 127 | 4/13/2023 | |
0.2.0-alpha | 131 | 4/12/2023 | |
0.1.0-alpha | 148 | 4/12/2023 | |
0.0.0-alpha.0 | 94 | 4/12/2023 |