I decided to migrate the project to crosswalk for performance reasons (particularly animation). However after running
ionic browser add crosswalk
I found that none of the maps work anymore. I repeated the same steps using the ionic map sample app and had the same issue. After some investigation, the issue seems to be related to Contest Security Policies since the scripts are loaded externally and Google Maps runs eval() functions.
I added the Cordova whitelist plugin and with some tweaking managed to clear up the eval() issues, but it seems the only way to get everything running is to include a Content-Security-Policy meta tag and explicitly allow each and every google ajax url which feels really clumsy:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com/; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com/ https://mts1.googleapis.com">
Moreover, navigator.geolocation has stopped working completely.
Has anyone else had this many issues migrating to crosswalk with Maps and Geolocation? I’ve made the switch with previous projects seamlessly, but many hours of googling and attempts later here and I’m out of ideas.