This is part 5 of a series of tutorial for the googleMaps plugin.
KML files allow you to do things such as displaying multiple markers or customized markers in your google maps.
KML Elements Supported in Google Maps
Not all KML elements are supported in Google Maps. Please refer to the following 2 documents for details:
Specifying KML files
To use kml files, use the following syntax:
{googleMaps lat=37.4319720 long=-122.0941430 zoom=12 width=100% height=480 kml=http://www.kksou.com/php-gtk2/gmap/samples/kml_sample1.kml}
Note that you still need to specify the latitude and longitude of the center of the map.
Sample 2
The above sample code is produced by using the following syntax:
{googleMaps lat=53.763325 long=-2.579041 zoom=8 width=100% height=480
kml=http://www.kksou.com/php-gtk2/gmap/test/KML_Samples12.kml}
Turning off the Marker
- By default, a red marker will appear at the point where you specify the center of the map
- You can turn off the red marker by using the parameter
marker=0
Default Red Marker | Marker Turned Off |
---|---|
{googleMaps lat=37.4219720 long=-122.0841430 width=100% height=480 zoom=11 kml=http://www.kksou.com/php-gtk2/gmap/samples/kml_sample1.kml} |
{googleMaps lat=37.4219720 long=-122.0841430 width=100% height=480 zoom=11 marker=0 kml=http://www.kksou.com/php-gtk2/gmap/samples/kml_sample1.kml} |
Specifying Zoom Level
You can specify the zoom level in displaying the KML file.
Zoom = 12 | Zoom = 10 |
---|---|
{googleMaps lat=37.4219720 long=-122.0841430 marker=0 width=100% height=480 zoom=12 kml=http://www.kksou.com/php-gtk2/gmap/samples/kml_sample1.kml} |
{googleMaps lat=37.4219720 long=-122.0841430 marker=0 width=100% height=480 zoom=10 kml=http://www.kksou.com/php-gtk2/gmap/samples/kml_sample1.kml} |
References for KML files
Here are some references if you wish to learn more about the KML files:
- Google's KML Tutorial
- KML Reference
- Wiki - Keyhole Markup Language
- Google Maps JavaScript API v3 Developer's Guide - KML and GeoRSS Layers
- Google Maps JavaScript API v3 Developer's Guide - Overlays
- Google Developer Codelabs - Creating KML
- Google Developer Codelabs - Maps API V3
Tutorials for the googleMaps plugin
- googleMaps plugin Tutorial 01: Getting Started
- googleMaps plugin Tutorial 02: Zoom Level
- googleMaps plugin Tutorial 03: Language
- googleMaps plugin Tutorial 04: Map Type
- googleMaps plugin Tutorial 05: KML Files
Tutorials for the googleDirections plugin
- googleDirections plugin Tutorial 01: Getting Started
- googleDirections plugin Tutorial 02: Specifying Stopover Points
- googleDirections plugin Tutorial 03: Travel Modes
- googleDirections plugin Tutorial 04: Unit Systems - miles or km
- googleDirections plugin Tutorial 05: Display Directions on the Left
- googleDirections plugin Tutorial 06: Display Directions below the Map
- googleDirections plugin Tutorial 07: Display Directions in your Local Language
- googleDirections plugin Tutorial 08: Specifying Stopover Points
Tutorials for the googleDirections_to_here plugin
- googleDirections - To Here - plugin Tutorial 01: Getting Started
- googleDirections - To Here - plugin Tutorial 02: Adding Label to Home Address
- googleDirections - To Here - plugin Tutorial 03: Travel Modes
- googleDirections - To Here - plugin Tutorial 04: Unit Systems - miles or km
- googleDirections - To Here - plugin Tutorial 05: Display Directions on the Left
- googleDirections - To Here - plugin Tutorial 06: Display Directions below the Map
- googleDirections - To Here - plugin Tutorial 07: Display Directions in your Local Language
- googleDirections - To Here - plugin Tutorial 08: Specifying Stopover Points
Comments
i have put the html code this {mosmap kml='http://..........kml'|overview='1'}
but the kml file with zoom is to 2 size..why?
Where's the mistake?
Thank you
Stefano
You are using a different plugin!
Please check the starting thttp://www.kksou.com/php-gtk2/#ag. Yours different from the one listed on this page, isn't it?
Regards,
/kksou
Well i am following your lessons, everything works except lesson 5 with KML
Everything loads markers, etc, except the maps. Where the maps should be just a white background appears.
Even if I try:
{googleMaps lat=37.4319720 long=-122.0941430 zoom=12 width=100% height=480 kml=http://www.kksou.com/gmap/samples/kml_sample1.kml}
It does not work.
If i take the kml out.. works normally.
Do you have any clue, anything i can be missing?
I used the same tag as you've written:
http://www.kksou.com/t1510/index.php?option=com_content&view=article&id=107:test-of-googlemaps-120916&catid=34:googlemaps&Itemid=54
Not sure why it didn't work on your site...
Regards,
/kksou
Please refer to: googleMaps plugin Tutorial 01: Getting Started
http://www.kksou.com/php-gtk2/Joomla-Tips-Techniques/googleMaps-plugin-Tutorial-01-Getting-Started.php
Item #2: Specifying Label for the Marker
I suppose you have specified the address using latitude and longitude. That's why you see lat and long being displayed. All you need to do is to add the tag "label".
Please give it a try and let me know if it works, ok?
Regards,
/kksou
I've tried your plugin and I say "excellent"
For display different markers, you need to use KML files as outlined in this tutorial.
You may want to refer to some of the references above: "References for KML files" for more details about KML.
You can also refer to the following article for a sample code: How to display multiple markers in different colors in Google Maps using KML file? http://www.kksou.com/php-gtk2/Joomla-Google-Maps-Samples/How-to-display-multiple-markers-in-different-colors-in-Google-Maps-using-KML-file.php
Regards,
/kksou
{googleMaps lat=10.273983 long=124.005428 width=870 height=700 maptype=SATELLITE zoom=13 kml=http://ruelluis.podserver.info/Evacenter.kml}
I'm trying this at localhost.
No, this plugin does not generate the KML file. But it can be used to display a KML file that you have generated somewhere else.
Regards,
/kksou
{googleMaps lat=52.766077 long=-1.214676 zoom=12 marker=0 kml=http://lfrs.nanagram.co.uk/maps/lfrs.kml}
Great plugins. We use it to display the location of our members. But since few weeks, the kml informations are not displayed anymore. Is there a problem with latest google maps kml files ?
Regards,
Paquy
Now I am afraid of changing other places if something brakes. Or can it be that Google needs to chache the kml-file?
I'm missing one feature at the moment: How to display more than one kml-file in single map? Reumer solved this by using kml[0]=.... kml[1]=.... kml[2]=..... and so on.
I tried different synthax but can't find out if or how it works.
Thanks for Help
Wolfgang
If you look at the article:googleMaps plugin Tutorial 05: KML Files
As you can see on this page, you can display multiple KML files, but it will be across multiple maps using multiple tags like this:
[googleMaps lat=37.4319720 long=-122.0941430
zoom=12 width=100% height=480
kml=http://www.kksou.com/php-gtk2/gmap/samples/kml_sample1.kml]
[googleMaps lat=53.763325 long=-2.579041 zoom=8 width=100% height=480
kml=http://www.kksou.com/php-gtk2/gmap/test/KML_Samples12.kml]
I believe what you want is multiple KML files into one map. For this, my plugin does not support this.
When I designed the plugin, I only wanted a very light-weight plugin for me to display maps on my website. I thought it might be useful, so I decided to share with others in Joomla! Extensions Directory. It's never intended as a replacement for the very powerful reumer's google plugin that I know support many advanced features.
KML files are just plain text file. One thing I can think of is to combine your multiple KML files into just one KML file.
You can google for: combining multiple KML files into one
I see many resources on how to do this.
Saw this
KML Merger: https://kmlmerger.com/
Not sure if it will work for you.
Once you have combined your multiple KML files into one, you can then display the KML file using googleMaps plugiin.
Hope this helps.
Warm Regards,
/kksou
link to page: http://www.mwanamaji.nl/index.php?option=com_joodb&view=catalog&Itemid=199
(click the divemap tab)
link to kml: http://www.mwanamaji.nl/kml/sites.kml
used plugin code: {googleMaps lat=10 long=0 zoom=2 width=100% height=480 kml=http://www.mwanamaji.nl/kml/sites.kml marker=0}
Thank you!
The googleMaps plugin does not cache anything.
But usually your Joomla backend does. Also the browser does. If you uses some other cache-related plugin (e.g. for fast loading), those plugins will also cache the page.
If you change the kml file, then you might need to clear the cache of all these to display the new kml file.
Warm Regards,
/CK
RSS feed for comments to this post