Can't get marker image assets within WKWebView
See original GitHub issueI’m submitting a … (check one with “x”)
- question
- any problem or bug report
- feature request
If you choose ‘problem or bug report’, please select OS: (check one with “x”)
- [] Android
- iOS
cordova information: (run $> cordova plugin list
)
cordova-plugin-background-mode 0.7.2 "BackgroundMode"
cordova-plugin-googlemaps 2.1.1 "cordova-plugin-googlemaps"
If you use @ionic-native/google-maps
, please tell the package.json (only @ionic-native/core
and @ionic-native/google-maps
are fine mostly)
Current behaviour: X-Code stops in an exception throwing the following message:
Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSCache setObject:forKey:cost:]: attempt to insert nil value (key: http:/localhost:8080/var/containers/Bundle/Application/XXXX-XXXXXX/AppName.app/www/index.html#/./assets/icon.png)’
This happens if we specify paths like: icon: ‘assets/icon.png’, icon: ‘./assets/icon.png’, icon: ‘/assets/icon.png’, icon: file:///assets/icon.png, etc etc.
Expected behavior:
Assets should be loaded the same way that every other element does, e.g.
Related code, data or error log (please format your code or data):
let markerConfig = {
icon: "assets/icon.png"
};
this.map.addMarker({
title: 'xxxx',
icon: markerConfig.icon,
position: {...}
};
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Apologize for the delay. I’ll try it in our next version, the current one is in production (using the UIWebView and the project is private, I would wish you to see the code and behaviour. I will keep in touch and answer you. Thanks!
Hi there,
This is my solution to get WkWebView (plugin v2) to work with custom marker images :
The path for iOS & Android is a bit different, as it has to include ‘www’ for iOS and starts with ‘./’ in both cases.
Hope it’d be useful.