OpenLayers.Blazor 1.5.6
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/).
Major Changes
Starting fromn version 1.5, the coordinates are represented and defined according to EPSG. This means the input for a Coordinate object will be switched: Coordinate(1197650, 2604200) > Coordinate(2604200, 1197650) or new Coordinate(51, 0) > Coordinate(0, 51)
Demo/Examples
https://openlayers-blazor-demo.laurent-christen.ch/
Usage
Setup
install nuget package
dotnet add package OpenLayers.BlazorDownload 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.Title</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)" Title="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>
No packages depend on OpenLayers.Blazor.
.NET 6.0
- Microsoft.AspNetCore.Components (>= 6.0.27)
- Microsoft.AspNetCore.Components.Web (>= 6.0.27)
.NET 7.0
- Microsoft.AspNetCore.Components (>= 7.0.16)
- Microsoft.AspNetCore.Components.Web (>= 7.0.16)
.NET 8.0
- Microsoft.AspNetCore.Components (>= 8.0.0)
- Microsoft.AspNetCore.Components.Web (>= 8.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 2.6.0 | 4 | 09/18/2026 |
| 2.5.0 | 4 | 09/17/2026 |
| 2.4.1 | 6 | 09/11/2026 |
| 2.4.0 | 2 | 09/18/2026 |
| 2.3.1 | 2 | 09/18/2026 |
| 2.3.0 | 4 | 09/17/2026 |
| 2.2.3 | 3 | 09/17/2026 |
| 2.2.2 | 2 | 09/17/2026 |
| 2.2.1 | 3 | 09/18/2026 |
| 2.2.0 | 2 | 09/18/2026 |
| 2.1.0 | 3 | 09/18/2026 |
| 2.0.1 | 4 | 09/17/2026 |
| 2.0.0 | 3 | 09/17/2026 |
| 1.5.10 | 2 | 09/17/2026 |
| 1.5.9 | 3 | 09/18/2026 |
| 1.5.8 | 3 | 09/17/2026 |
| 1.5.7 | 4 | 09/18/2026 |
| 1.5.6 | 3 | 09/17/2026 |
| 1.5.5 | 3 | 09/17/2026 |
| 1.5.4 | 3 | 09/17/2026 |
| 1.5.3 | 3 | 09/17/2026 |
| 1.5.2 | 3 | 09/18/2026 |
| 1.5.1 | 3 | 09/17/2026 |
| 1.5.0 | 3 | 09/17/2026 |
| 1.4.1 | 3 | 09/17/2026 |
| 1.4.0 | 3 | 09/17/2026 |
| 1.3.1 | 3 | 09/17/2026 |
| 1.3.0 | 3 | 09/17/2026 |
| 1.1.0 | 3 | 09/18/2026 |
| 1.0.1 | 3 | 09/17/2026 |
| 1.0.0 | 5 | 09/17/2026 |
| 0.3.0-alpha | 5 | 09/17/2026 |
| 0.2.0-alpha | 3 | 09/17/2026 |
| 0.1.0-alpha | 1 | 09/18/2026 |
| 0.0.0-alpha.0 | 3 | 09/17/2026 |