BlazorGoogleMaps 4.13.8
See the version list below for details.
dotnet add package BlazorGoogleMaps --version 4.13.8
NuGet\Install-Package BlazorGoogleMaps -Version 4.13.8
<PackageReference Include="BlazorGoogleMaps" Version="4.13.8" />
<PackageVersion Include="BlazorGoogleMaps" Version="4.13.8" />
<PackageReference Include="BlazorGoogleMaps" />
paket add BlazorGoogleMaps --version 4.13.8
#r "nuget: BlazorGoogleMaps, 4.13.8"
#:package BlazorGoogleMaps@4.13.8
#addin nuget:?package=BlazorGoogleMaps&version=4.13.8
#tool nuget:?package=BlazorGoogleMaps&version=4.13.8
BlazorGoogleMaps
Blazor interop for GoogleMap library
Usage
- Provide your Google API key to BlazorGoogleMaps with one of the following methods. (You can get a key here: https://developers.google.com/maps/documentation/javascript/get-api-key)
Use the bootstrap loader with a key service (recommended):
services.AddBlazorGoogleMaps("YOUR_KEY_GOES_HERE");
OR specify google api libraries and/or version:
services.AddBlazorGoogleMaps(new GoogleMapsComponents.Maps.MapApiLoadOptions("YOUR_KEY_GOES_HERE")
{
Version = "beta",
Libraries = "places,visualization,drawing,marker",
});
OR to do something more complex (e.g. looking up keys asynchronously), implement a Scoped key service and add it with something like:
services.AddScoped<IBlazorGoogleMapsKeyService, YourServiceImplementation>();
OR (legacy - not recommended) Add google map script HEAD tag to wwwroot/index.html in Client side or _Host.cshtml in Server Side.
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_GOES_HERE&v=3"></script>
- Add path to project javascript functions file in wwwroot/index.html for Blazor WASM, or in _Host.cshtml or _HostLayout.cshtml for Blazor Server.
<script src="_content/BlazorGoogleMaps/js/objectManager.js"></script>
If you want to use marker clustering add this script as well:
<script src="https://unpkg.com/@googlemaps/markerclusterer/dist/index.min.js"></script>
- Using the component is the same for both Blazor WASM and Blazor Server
@page "/map"
@using GoogleMapsComponents
@using GoogleMapsComponents.Maps
<h1>Google Map</h1>
<div style="height:@Height">
<GoogleMap @ref="@_map1" Id="map1" Options="@mapOptions" Height="100%" OnAfterInit="AfterMapRender"></GoogleMap>
</div>
@functions {
private GoogleMap _map1;
private MapOptions mapOptions;
protected override void OnInitialized()
{
mapOptions = new MapOptions()
{
Zoom = 13,
Center = new LatLngLiteral()
{
Lat = 13.505892,
Lng = 100.8162
},
MapTypeId = MapTypeId.Roadmap
};
}
private async Task AfterMapRender()
{
_bounds = await LatLngBounds.CreateAsync(_map1.JsRuntime);
}
}
OR Render markers with Blazor (currently only with v=beta version of google-maps, and specify a MapId)
@page "/map"
@using GoogleMapsComponents
@using GoogleMapsComponents.Maps
<h1>Google Map</h1>
<AdvancedGoogleMap @ref="@_map1" Id="map1" Options="@mapOptions">
@foreach (var markerRef in Markers)
{
<MarkerComponent
@key="markerRef.Id"
Lat="@markerRef.Lat"
Lng="@markerRef.Lng"
Clickable="@markerRef.Clickable"
Draggable="@markerRef.Draggable"
OnClick="@(() => markerRef.Active = !markerRef.Active)"
OnMove="pos => markerRef.UpdatePosition(pos)">
<p>I am a blazor component</p>
</MarkerComponent>
}
</AdvancedGoogleMap>
@code {
private List<MarkerData> Markers =
[
new MarkerData { Id = 1, Lat = 13.505892, Lng = 100.8162 },
];
private AdvancedGoogleMap? _map1;
private MapOptions mapOptions =new MapOptions()
{
Zoom = 13,
Center = new LatLngLiteral()
{
Lat = 13.505892,
Lng = 100.8162
},
MapId = "DEMO_MAP_ID", //required for blazor markers
MapTypeId = MapTypeId.Roadmap
};
public class MarkerData
{
public int Id { get; set; }
public double Lat { get; set; }
public double Lng { get; set; }
public bool Clickable { get; set; } = true;
public bool Draggable { get; set; }
public bool Active { get; set; }
public void UpdatePosition(LatLngLiteral position)
{
Lat = position.Lat;
Lng = position.Lng;
}
}
}
Samples
Please check server side samples https://github.com/rungwiroon/BlazorGoogleMaps/tree/master/ServerSideDemo which are most to date
ClientSide demos online https://rungwiroon.github.io/BlazorGoogleMaps/mapEvents
Breaking change from 4.0.0 Migrate to .NET 8 #286.
Breaking change from 3.0.0 Migrate from Newtonsoft.Json to System.Text.Json.
Breaking change from 2.0.0 LatLngLiteral constructor's parameters order changed #173
| Product | Versions 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 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. |
-
net8.0
- Microsoft.AspNetCore.Components (>= 8.0.22)
- Microsoft.AspNetCore.Components.Web (>= 8.0.22)
- Microsoft.JSInterop (>= 8.0.22)
- OneOf (>= 3.0.271)
-
net9.0
- Microsoft.AspNetCore.Components (>= 9.0.11)
- Microsoft.AspNetCore.Components.Web (>= 9.0.11)
- Microsoft.JSInterop (>= 9.0.11)
- OneOf (>= 3.0.271)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on BlazorGoogleMaps:
| Package | Downloads |
|---|---|
|
templar-common-libary
Package Description |
|
|
Magiq.Blazor
Provides views and services to be used in Blazor Client and Server projects. |
|
|
AeroBlazor
A blazor library, extending MudBlazor |
|
|
Microfrontend.one
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.14.1 | 586 | 12/22/2025 |
| 4.14.0 | 1,945 | 11/27/2025 |
| 4.13.8 | 2,178 | 11/18/2025 |
| 4.13.7 | 3,987 | 10/27/2025 |
| 4.13.6 | 16,009 | 8/5/2025 |
| 4.13.5 | 1,018 | 7/30/2025 |
| 4.13.4 | 2,016 | 7/27/2025 |
| 4.13.3 | 338 | 7/26/2025 |
| 4.13.2 | 1,419 | 7/15/2025 |
| 4.13.1 | 2,080 | 7/5/2025 |
| 4.13.0 | 4,628 | 6/5/2025 |
| 4.12.2 | 2,471 | 6/2/2025 |
| 4.12.1 | 444 | 6/1/2025 |
| 4.12.0 | 551 | 5/28/2025 |
| 4.11.3 | 252 | 5/28/2025 |
| 4.11.2 | 2,085 | 5/13/2025 |
| 4.11.1 | 15,360 | 4/20/2025 |
| 4.11.0 | 804 | 4/14/2025 |
| 4.10.1 | 2,145 | 4/1/2025 |
| 4.10.0 | 754 | 3/30/2025 |
| 4.9.5 | 377 | 3/28/2025 |
| 4.9.4 | 265 | 3/27/2025 |
| 4.9.3 | 6,973 | 2/23/2025 |
| 4.9.2 | 15,099 | 12/14/2024 |
| 4.9.1 | 5,684 | 11/21/2024 |
| 4.9.0 | 2,111 | 11/17/2024 |
| 4.8.0 | 365 | 11/16/2024 |
| 4.7.15 | 237 | 11/16/2024 |
| 4.7.14 | 13,018 | 10/9/2024 |
| 4.7.13 | 11,220 | 10/3/2024 |
| 4.7.12 | 1,714 | 9/29/2024 |
| 4.7.11 | 11,717 | 8/29/2024 |
| 4.7.10 | 1,398 | 8/28/2024 |
| 4.7.9 | 201 | 8/28/2024 |
| 4.7.8 | 248 | 8/28/2024 |
| 4.7.7 | 2,062 | 8/25/2024 |
| 4.7.6 | 5,635 | 8/12/2024 |
| 4.7.5 | 267 | 8/11/2024 |
| 4.7.4 | 213 | 8/10/2024 |
| 4.7.3 | 2,643 | 7/29/2024 |
| 4.7.2 | 3,704 | 7/25/2024 |
| 4.7.1 | 8,000 | 7/8/2024 |
| 4.7.0 | 395 | 7/4/2024 |
| 4.6.2 | 439 | 7/2/2024 |
| 4.6.1 | 261 | 7/1/2024 |
| 4.6.0 | 1,319 | 6/26/2024 |
| 4.5.0 | 996 | 6/22/2024 |
| 4.4.2 | 5,138 | 6/12/2024 |
| 4.4.1 | 314 | 6/11/2024 |
| 4.4.0 | 322 | 6/10/2024 |
| 4.3.0 | 7,981 | 5/15/2024 |
| 4.2.0 | 6,863 | 4/25/2024 |
| 4.1.2 | 8,745 | 3/21/2024 |
| 4.1.1 | 580 | 3/20/2024 |
| 4.1.0 | 46,901 | 2/2/2024 |
| 4.0.3 | 1,027 | 1/18/2024 |
| 4.0.2 | 4,580 | 12/20/2023 |
| 4.0.1 | 1,953 | 12/17/2023 |
| 4.0.0 | 342 | 12/15/2023 |
| 3.3.2 | 32,223 | 12/15/2023 |
| 3.3.1 | 10,389 | 12/5/2023 |
| 3.2.5 | 2,750 | 11/23/2023 |
| 3.2.4 | 269 | 11/23/2023 |
| 3.2.3 | 9,183 | 10/30/2023 |
| 3.2.2 | 1,881 | 10/25/2023 |
| 3.2.1 | 325 | 10/25/2023 |
| 3.2.0 | 4,858 | 9/18/2023 |
| 3.1.4 | 3,960 | 9/9/2023 |
| 3.1.3 | 649 | 9/3/2023 |
| 3.1.2 | 9,194 | 8/1/2023 |
| 3.1.1 | 5,333 | 7/19/2023 |
| 3.1.0 | 2,184 | 7/10/2023 |
| 3.0.8 | 371 | 7/9/2023 |
| 3.0.7 | 12,213 | 6/9/2023 |
| 3.0.6 | 7,292 | 5/7/2023 |
| 3.0.5 | 3,976 | 4/13/2023 |
| 3.0.4 | 602 | 4/11/2023 |
| 3.0.3 | 1,510 | 4/6/2023 |
| 3.0.2 | 767 | 4/3/2023 |
| 3.0.1 | 479 | 4/1/2023 |
| 3.0.0 | 1,981 | 3/28/2023 |
| 2.5.7 | 13,157 | 3/14/2023 |
| 2.5.6 | 1,100 | 3/13/2023 |
| 2.5.5 | 4,101 | 2/24/2023 |
| 2.5.4 | 10,455 | 2/11/2023 |
| 2.5.3 | 1,085 | 2/6/2023 |
| 2.5.2 | 3,228 | 1/20/2023 |
| 2.5.1 | 1,358 | 1/17/2023 |
| 2.4.4 | 13,594 | 12/13/2022 |
| 2.4.3 | 7,485 | 11/29/2022 |
| 2.4.2 | 499 | 11/29/2022 |
| 2.4.1 | 1,660 | 11/25/2022 |
| 2.3.1 | 3,006 | 11/14/2022 |
| 2.2.6 | 27,272 | 9/5/2022 |
| 2.2.5 | 1,759 | 8/27/2022 |
| 2.2.4 | 588 | 8/27/2022 |
| 2.2.3 | 1,569 | 8/22/2022 |
| 2.2.2 | 727 | 8/19/2022 |
| 2.2.1 | 34,836 | 6/28/2022 |
| 2.2.0 | 3,131 | 6/20/2022 |
| 2.1.1 | 2,614 | 5/23/2022 |
| 2.1.0 | 2,378 | 5/3/2022 |
| 2.0.6 | 876 | 4/30/2022 |
| 2.0.5 | 1,886 | 4/21/2022 |
| 2.0.4 | 1,653 | 4/15/2022 |
| 2.0.3 | 1,309 | 4/1/2022 |
| 2.0.2 | 734 | 3/30/2022 |
| 2.0.1 | 667 | 3/30/2022 |
| 2.0.0 | 1,379 | 3/29/2022 |
| 1.5.5 | 11,876 | 2/24/2022 |
| 1.5.4 | 834 | 2/21/2022 |
| 1.5.3 | 2,157 | 2/16/2022 |
| 1.5.2 | 895 | 2/15/2022 |
| 1.5.1 | 4,314 | 2/7/2022 |
| 1.4.2 | 7,300 | 12/15/2021 |
| 1.4.1 | 8,499 | 12/8/2021 |
| 1.4.0 | 560 | 12/7/2021 |
| 1.3.0 | 699 | 12/2/2021 |
| 1.2.1 | 18,056 | 10/11/2021 |
| 1.1.8 | 1,510 | 9/27/2021 |
| 1.1.7 | 704 | 9/25/2021 |
| 1.1.6 | 589 | 9/23/2021 |
| 1.1.5 | 1,575 | 9/16/2021 |
| 1.1.4 | 1,460 | 9/12/2021 |
| 1.1.3 | 732 | 9/9/2021 |
| 1.1.2 | 937 | 9/7/2021 |
| 1.1.1 | 1,467 | 8/30/2021 |
| 1.0.17 | 2,471 | 7/27/2021 |
| 1.0.16 | 1,020 | 7/17/2021 |
| 1.0.15 | 9,167 | 4/29/2021 |
| 1.0.14 | 6,084 | 4/9/2021 |
| 1.0.13 | 34,864 | 3/18/2021 |
| 1.0.12 | 4,600 | 2/13/2021 |
| 1.0.11 | 748 | 2/10/2021 |
| 1.0.10 | 624 | 2/10/2021 |
| 1.0.9 | 591 | 2/10/2021 |
| 1.0.8 | 971 | 2/3/2021 |
| 1.0.7 | 4,345 | 1/30/2021 |
| 1.0.6 | 645 | 1/28/2021 |
| 1.0.5 | 1,176 | 1/18/2021 |
| 1.0.4 | 938 | 1/14/2021 |
| 1.0.3 | 631 | 1/13/2021 |
| 1.0.2 | 1,579 | 1/1/2021 |
| 1.0.1 | 1,020 | 12/25/2020 |
| 1.0.0 | 642 | 12/25/2020 |
| 0.9.3 | 645 | 12/25/2020 |
| 0.9.2 | 897 | 12/22/2020 |
| 0.9.1 | 1,348 | 12/4/2020 |
| 0.9.0 | 7,096 | 10/23/2020 |
| 0.8.1 | 1,275 | 10/4/2020 |
| 0.8.0 | 1,961 | 9/16/2020 |
| 0.7.1 | 1,839 | 8/9/2020 |
| 0.6.14 | 722 | 8/4/2020 |
| 0.6.13 | 889 | 8/2/2020 |
| 0.6.12 | 920 | 7/28/2020 |
| 0.6.11 | 687 | 7/27/2020 |
| 0.6.10 | 3,648 | 7/20/2020 |
| 0.6.9 | 811 | 7/14/2020 |
| 0.6.8 | 839 | 7/9/2020 |
| 0.6.7 | 800 | 7/7/2020 |
| 0.6.6 | 828 | 6/30/2020 |
| 0.6.5 | 1,254 | 6/4/2020 |
| 0.6.4 | 1,759 | 5/16/2020 |
| 0.6.3 | 1,216 | 5/5/2020 |
| 0.6.2 | 1,792 | 4/16/2020 |
| 0.6.1 | 901 | 3/27/2020 |
| 0.6.0 | 716 | 3/27/2020 |
| 0.5.9 | 738 | 3/26/2020 |
| 0.5.8 | 1,129 | 3/25/2020 |
| 0.5.7 | 720 | 3/25/2020 |
| 0.5.6 | 806 | 3/17/2020 |
| 0.5.5 | 1,739 | 3/7/2020 |
| 0.5.4 | 1,104 | 2/9/2020 |
| 0.5.3 | 822 | 2/8/2020 |
| 0.5.2 | 2,027 | 1/24/2020 |
| 0.5.1-alpha | 1,010 | 12/9/2019 |
| 0.4.8-alpha | 616 | 12/1/2019 |
| 0.4.7-alpha | 734 | 10/18/2019 |
| 0.4.6-alpha | 660 | 9/26/2019 |
| 0.4.5-alpha | 502 | 8/20/2019 |
| 0.4.0-alpha | 520 | 6/15/2019 |
| 0.3.0 | 1,071 | 6/1/2019 |
| 0.1.0 | 1,228 | 2/2/2019 |