rungwiroon / BlazorGoogleMaps

Blazor interop for GoogleMap library
MIT License
319 stars 102 forks source link

Loading the Google Maps JavaScript API without a callback is not supported #250

Closed MrYossu closed 1 year ago

MrYossu commented 1 year ago

I am trying to use the component in a new project, and copied the <script> tag from the <head> of another project where it's being used...

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=MyApiKey&v=3"></script>

However, when I load the page, the map doesn't appear and I get the following in the browser console...

_Loading the Google Maps JavaScript API without a callback is not supported: https://developers.google.com/maps/documentation/javascript/url-params#required_parameters_

Anyone any idea what I'm doing wrong? I don't set a callback, but then I didn't in the other project and that worked fine.

valentasm1 commented 1 year ago

https://stackoverflow.com/questions/75179573/how-to-fix-loading-the-google-maps-javascript-api-without-a-callback-is-not-supp Add &callback=Function.prototype

https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=Function.prototype