Closed Nickztar closed 4 months ago
I dont see how it is big change. IMO benefit that map will render faster. Other parts are just minor. Also i think if you dont explicitly load libraries, key then nothing should be done. We shouldnt change default behavious.
Overall good luck and thank you for effort
@Nickztar Have you been able to work on a PR for this feature? Google is calling out usage of the "legacy bootstrap tag" in the console (see below). Moving to the new loader will also benefit those of us responsible for improving Lighthouse performance scores. π
Google Maps JavaScript API has been loaded directly without loading=async. This can result in suboptimal performance. For best-practice loading patterns please see https://goo.gle/js-api-loading
Here is example.
Google has fundamentally changed the way the maps script is loaded, using a bootstrap loader (see https://developers.google.com/maps/documentation/javascript/overview#Loading_the_Maps_API). Simply changing the SRC attribute is not enough.
I mean not the google part, but how inject custom div into blazor with google maps script.
I played around with couple variations. Not sure which approach to take it. Maybe some of them wont work full, but at beginning all looks ok.
I think i will go with 2 option. Maybe there are more ways.
Made PR. Will merge at end of this week. https://github.com/rungwiroon/BlazorGoogleMaps/pull/324
Great stuff!!! Will check it out when I get some time but looks really good! π ππΌ
https://developers.google.com/maps/documentation/javascript/libraries#libraries-for-bootstrap-url-legacy
The current way of using this library is dependent on using the legacy way of loading extra libraries and also loading the api. I have thought a bit about this problem and I think it would/should be possible to use the new way, which allows loading more libraries and lazy-load the current ones. This is somewhat of a big change but could be very nice. This way we could abstract away parts of the required setup (adding maps to index.html etc). I will try to create a PR soon so just creating a issue to see if this is something that is of intrest?
Pros:
Cons:
Let me know if anyone has any thoughts/suggestions π