Closed reynirf closed 5 years ago
It also doesn't work on a freshly installed ionic 4 project with nothing but the functionality to add a KML overlay on a map. Has anyone managed to get this to work?
Saw that you (@wf9a5m75) added a comment but then deleted it. Any update on this issue?
ping
There was some KML tag that didn't work with the plugin. I don't remember which tag it was.
Ah, I see. KML is really complicated, but this plugin supports only limited tags. https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.3.0/class/KmlOverlay#overview
Anyway, it seems you already solved this problem. Congrats.
I'm submitting a ... (check one with "x")
If you choose 'problem or bug report', please select OS: (check one with "x")
cordova information: (run
$> cordova plugin list
)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": "^5.2.0", (have also tried with 5.0.0) "@ionic-native/google-maps": "^5.0.0-beta.27",Current behavior: I get an unhandle promise rejection when trying to create a simple KmlOverlay. Other functions work as expected, creating the map etc.
Expected behavior: A KML overlay should be added to the map and I should not get an error.
Related code, data or error log (please format your code or data):
Code:
Error: zone.js:682 Unhandled Promise rejection: Cannot read property 'forEach' of undefined ; Zone: ; Task: Promise.then ; Value: TypeError: Cannot read property 'forEach' of undefined
at new KmlOverlay (KmlOverlay.js:249)
at ...
at ...
.......
Basically, when "kmlData.forEach(seekOverlays);" gets executed on line 249 in your KmlOverlay.js, "kmlData" is undefined.
Testing using my own KML file and a sample KML file from Google (https://developers.google.com/kml/documentation/KML_Samples.kml)