Reference: Reset GoogleMap and change location
So my google map has been working for quite some time, but it stopped working about a month ago. I finally had some time to sit and troubleshoot it, and it appears that updating the zoom and center values no longer updates the map.
Here is my map:
<RadzenGoogleMap @ref=Map
style="height: 700px; margin-bottom: 10px"
Center=@_center Zoom=@zoom ApiKey=@ApiKey
MarkerClick=@OnMarkerClick Data="_markers">
</RadzenGoogleMap>
Here are my declarations:
private List<RadzenGoogleMapMarker> _markers = new();
private GoogleMapPosition _center = new();
private int zoom { get; set; } = 8;
private RadzenGoogleMap? Map { get; set; }
Here is where I update the markers and zoom:
private void UpdatePins(GoogleMapPosition position)
{
_markers = new List<RadzenGoogleMapMarker>();
Permittees
.Where(x => x.LocLat != 0 && x.LocLon != 0)
.ToList()
.ForEach(x => {
var label = $"{x.ScReportId}: {x.NameLfm}";
_markers.Add(CreateMarker(label, x));
});
if (Map == null) return;
if (position.Lng == 0 || position.Lat == 0)
{
_center = new GoogleMapPosition { Lat = 3x.xxxxxxxxxxx487, Lng = -8x.xxxxxxxxxxx577 };
zoom = 10;
}
else
{
_center = position;
zoom = 8;
}
}
Here is where I select all Map Pins and reset the zoom to 10:
And here I have selected a single map pin and reset the zoom to 8:
Did something change with the API and I missed it?
Thanks,
Carthax