Topic-icon Load KML from marker/item extrafield when a marker is clicked

  • pollmannsc
  • pollmannsc's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
15 Mar 2018 09:47 #41021 by pollmannsc
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.

Please Log in or Create an account to join the conversation.

  • pollmannsc
  • pollmannsc's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
20 Mar 2018 18:28 #41050 by pollmannsc
Ok, I did it. Have changed a lot in the k2.php and mod_geommunity3.php. If someone has the same problem, I can help.

Please Log in or Create an account to join the conversation.

More
20 Mar 2018 19:21 #41051 by nordmograph
Well done.
Maybe you could illustrate with the map url f it's public (or hide from guests here).

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.

Please Log in or Create an account to join the conversation.

  • pollmannsc
  • pollmannsc's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
22 Mar 2018 18:00 #41081 by pollmannsc
shure, i will post the url when the project is online.

Please Log in or Create an account to join the conversation.

  • pollmannsc
  • pollmannsc's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
26 Mar 2018 12:10 #41113 by pollmannsc
the site is live now: goo.gl/janjvc

If you check the category "Wanderwege" you will see the kml feature.
The following user(s) said Thank You: nordmograph

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.
Copyright © 2021 Nordmograph - Joomla extensions. All Rights Reserved.
Joomla! is Free Software released under the GNU General Public License.
Browser of the future