Currently utilizing Ionic with ng-map for displaying KML files on a map. I need to switch between different KMLs, loading them one at a time upon user request. The remote KMLs load successfully, as evidenced by the following code:
<div style="height: 100%">
<ng-map center="41.876,-87.624" zoom="15" map-type-id="HYBRID" style="display:block; width: 100%; height:100%;">
<kml-layer url="http://googlemaps.github.io/js-v2-samples/ggeoxml/cta.kml"></kml-layer>
</ng-map>
</div>
The local KMLs are stored in a kml
folder within the www
directory of my Ionic application.
https://i.sstatic.net/XtcIX.png
When attempting to load a local KML file using the same syntax as the remote file, like so:
<div style="height: 100%">
<ng-map center="41.876,-87.624" zoom="15" map-type-id="HYBRID" style="display:block; width: 100%; height:100%;">
<kml-layer url="./kml/cta.kml"></kml-layer>
</ng-map>
</div>
The lines from the KML do not appear on the map unlike with the remote file. The map loads without any errors but the specified line details are missing.
It raises the question of whether ng-map necessitates a remote KML for full functionality or if this issue lies within Ionic's directories.
No error messages are displayed, indicating that everything is functioning properly besides the fact that the local KML cannot be read properly resulting in the absence of the specified elements on the map compared to the remote KML file.