BlazorGoogleMaps
BlazorGoogleMaps copied to clipboard
Unhandled exception on some iOS devices
Some of our users are currently experiencing a issue where they cannot load the map. It seems to only be sometimes and its fixed after restarting the phone. Anyone know what the issue is?
The device in this case was a iPhone 13 running iOS 15.3.1
Unhandled exception rendering component: undefined is not an object (evaluating 'fn[arr[i]]')
stringToFunction@https://SITE.com/_content/BlazorGoogleMaps/js/objectManager.js:6:16
createObject@https://SITE.com/_content/BlazorGoogleMaps/js/objectManager.js:294:43
createObject@[native code]
@https://SITE.com/_framework/blazor.webassembly.js:1:3337
Promise@[native code]
beginInvokeJSFromDotNet@https://SITE.com/_framework/blazor.webassembly.js:1:3317
Rt@https://SITE.com/_framework/blazor.webassembly.js:1:59761
_mono_wasm_invoke_js_blazor@https://SITE.com/_framework/dotnet.6.0.4.cm31jmhl2g.js:1:195318
Maybe you have link to website/solution?
Well I can't really reproduce it, even with a similar device. It's probably not anything with this library to do but just wondering if anyone has experienced the same thing. It's caused when rendering the GoogleMap component. Which in turn passes google.maps.Map
to the StringToFunction method.
Not sure how to help. As far as i remember there was nothing related to ios. Probably it is some safari rendering issues. Lets leave open and maybe one day some great ideas will come to mind :).
Turn out this has to do with the Google Maps api not loading in time. They now require that you pass a callback function to loading the API. Not sure how we could handle this in the library but I will look into this soon.
Here are some links from their documentation. https://developers.google.com/maps/documentation/javascript/url-params#required_parameters https://developers.google.com/maps/documentation/javascript/overview#Inline
We have similar principle. Map OnAfterInit is trigered when map is rendered. Just not sure if functionality is same as callback
Closing due inactivity. Feel free to open.
Yes that is fine! I do know what the issue is and somewhat have a fix for it. Might implement it if I get some time in the future 😃