I'm submitting a ... (check one with "x")
[ ] question
[x ] any problem or bug report
[ ] feature request
If you choose 'problem or bug report', please select OS: (check one with "x")
[ ] Android
[x ] iOS
cordova information: (run $> cordova plugin list)
com.googlemaps.ios 2.5.0 "Google Maps SDK for iOS"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-facebook4 1.9.1 "Facebook Connect"
cordova-plugin-google-analytics 1.8.3 "Google Universal Analytics Plugin"
cordova-plugin-googlemaps 2.1.2-beta-20171122-1040 "cordova-plugin-googlemaps"
cordova-plugin-googleplus 5.1.1 "Google SignIn"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.3.0 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)
"@ionic-native/core": "^4.3.3",
"@ionic-native/google-maps": "^4.3.3",
Current behavior:
Hello, I have an error. when I use addMarkerCluster.
It draws markers but when I use a custom image for a marker at that time app crash with below error.
it happens only ios.
somebody can help this issue??
Expected behavior:
Screen capture or video record:
Related code, data or error log (please format your code or data):
*** 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/1E01FEE3-8DDB-4796-8CB6-196E881CA368/udc2.app/www/index.html#/menu/./assets/img/map/m1.png)'
It seems the image file is not readable.
Please share your project files on GitHub. I will check it.
If you contribute to me, I will he you.
(Otherwise, no contribution, no help)
Got the same error while updating this plugin:
I think it has something to do with the path.
http://xxxxxx:8101/#/main.component/map.component/./assets/icons/cluster_icons/blue.png
As you can see, it adds components of ionic to the url. While you probably want this part only:
./assets/icons/cluster_icons/blue.png
As I said above Please share your project files on GitHub. I will check it.
No contribution, no help. Easy rule.
Sorry, I can't share these files. Will try to find it myself...
installing this plugin caused it:
https://github.com/ionic-team/cordova-plugin-ionic-webview
I think it handles urls differently.
I'm so busy. I haven't enough time to support compatibility with other plugins.
At least you can create a demo project.
No contribution, no help.
You need to set url like this: www/assets/icons/cluster_icons/blue.png
http://xxxxxx:8101/#/main.component/map.component/./assets/icons/cluster_icons/blue.png
This URL means you should specify the pass as /assets/icons/cluster_icons/blue.png because your page is displayed on http://xxxxxx:8101/#/main.component/map.component/.
i'll try to test the WKWebView support of this plugin on my project to see if i can help you all.
@antoine92190 Thanks this works. But I still get undefined errors in file BaseClass.js on line 68:
You need to add a check to this while loop:
while (i--) {
if(typeof listeners[i] !== "undefined") {
listeners[i].apply(this, args);
}
}
Same in Cluster.js on line 112:
Cluster.prototype.remove = function() {
this.set("isRemoved", true);
this._markerOptsArray.forEach(function(markerOpts) {
if(typeof markerOpts._cluster !== "undefined") {
markerOpts._cluster.isAdded = false;
}
});
};
I have no problems combining this plugin with the WKWebView after making these changes (only checked iOS). @wf9a5m75
@minortom The meaning of you get the error is you write wrong code for addEventListener()/on().
You didn't specify the event listener function
@wf9a5m75 You are right! My bad, everything works (from what I checked) now with WKWebView. Thanks for your reply.
@antoine92190 Thanks for the tip, it works 馃憤
@wf9a5m75 FYI, cordova-plugin-ionic-webview is the official webview on Ionic 3+. So, if you officially support Ionic, I'm suggesting to either document that the absolute path is required on iOS (i.e www/asset instead of ./asset) or fix the issue with relative path. Anyway, thanks for this amazing plugin!
@sbatezat www/asset is not absolute path, that is relative path.
Indeed, you right but... what I was meaning is that, from a cordova point of view, it's a kind of absolute path 'cause everyhting is on the www/ folder so ./ should point to www.
No matter if it's relative or absolute, I've read some issues where you were telling to not use the 'www' (maybe it was for an older revision?) plus I've read a very nice powerpoint you made about @ ionic-native/google-maps and the sample path was "./assets/icon.png", which is confusing, because as a Cordova developer, I'm expecting to have this working from the www folder. Maybe I'm wrong and it's just about the WKWebView, it's the first time I'm using it...
Attaching www/ was a bug of older version. I implemented so that because I didn't familiar with cordova (around cordova v3.x).
But this let many people fall into lots of confuse.
So the current version handles relative path correctly. That's why do not use www/ anymore. You should specify the image path as normal HTML.
Just if it helps someone. You get the same behavior on ios if you don't specify the marker at all. i.e. if you leave our the icon property out all together. Just adding icon: 'red' fixed it for me.
@daniefvh Thanks for your tips sharing. Using the default marker saves tons of memory usage. I think your case is out of memory.
Most helpful comment
You need to set url like this:
www/assets/icons/cluster_icons/blue.png