GoogleMap control error

Console shows the following error when opening up a page with the GoogleMap control: google is not defined at Object.updateMap (Radzen.blazor.js:234:28). Reverted to 4.16.2 as a work around.

Hi @mrentier,

Does the online demo work for you? If yes then check your browser caching.

Clearing the cache doesn't resolve the problem. Can't reproduce it in the online demo, but 100% reproducible in my code. Following is what happens based upon debugging: about 1 week ago a change was made in the Radzen Google Map control to fit bounds to markers on update. Including the following code right at the top of the updateMap method:

let markerBounds = new google.maps.LatLngBounds();

In my application a first call to updateMap is triggered and that call fails with the 'google not defined' error. The markerBounds code above is where that occurs. The breaking change being that this is the first time google.maps is required to be defined when updateMap is called without markers.

A second call to updateMap is triggered through the OnMapClick listener and that call does succeed.

Why these two different calls are made to the same method ... not sure, didn't have time to go that deep into it. But the point is: it is possible to trigger calls to updateMap without 'google' being defined.

If I was to guess why: I have to determine which markers and center position to use on load through API calls. Setting the markers and center probably triggers an update of the Radzen Google Map before it has loaded the google maps API (which happens after the first render).

This error means that the Google API is not loaded for some reason. Check your browser developer tools network tab if the required Google JavaScript is loaded or not.

UPDATE: You should not have such errors in the latest official update Radzen.Blazor 4.17.0.