I have k2-items, which are displayed on the map with a marker.
Now I want to load a KML file when the marker is clicked. The URL to the KML file is stored in an extrafield of the k2 item.
Background:
The k2 item is f.e. a hiking trail. The marker shows the position from the start.
If you click on the marker and the info window opens with the information from k2-item (image,text), the KML file should be loaded and show the course of the trail on the map. If the info-windows is closed, the kml-file should be unloaded.
The same should happen even with a mouseover at a marker.
In the documentation for google maps api, I have already read some information on how to include KML files in a map in general.
I also know, how to get the extrafield-value with the url to the kml-file from each item.
However, I currently have some difficulty finding an approach.
Do you or someone else have any ideas on where in the plugin, I would have to start?
f.e. in which file would I best install my code, which loads the KML file from the marker (k2item extrafield), which was clicked or where the mouse moves over .
I hope you can understand what I mean.