How to display multiple markers in Google Maps using KML file? |
| Written by kksou | ||
| Friday, 15 May 2009 | ||
|
By default, the googleMaps plugin allows you to place only one marker on the map. If you wish to place multiple markers on a googleMap, you can easily do so with the help of a KML (Keyhole Markup Language) file. In this article, I'll show you how easy it is to set up a KML file to place multiple markers on Google Maps. First, let us take a look at a real sample. DemoThe following map is produced with the tag: {googleMaps lat=37.4219720 long=-122.0841430 zoom=12 width=100% height=480
kml=http://www.kksou.com/gmap/test/kml_sample1.kml}
You can download a copy of the KML file here: http://www.kksou.com/gmap/test/kml_sample1.kml The Structure of a KML FileA sample KML file with only one marker looks like below:
<kml xmlns="http://www.google.com/earth/kml/2">
<Placemark>
<name>Google Inc.</name>
<description>1600 Amphitheatre Parkway, Mountain View, CA 94043</description>
<Point>
<coordinates>-122.0841430, 37.4219720, 0</coordinates>
</Point>
</Placemark>
</kml>
Multiple MarkersTo place multiple markers, we simply define three http://www.kksou.com/samples/kml_sample1.kml
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.google.com/earth/kml/2">
<Document>
<name>kml_sample1.kml</name>
<Placemark>
<name>Google Inc.</name>
<description><![CDATA[
Google Inc.<br />
1600 Amphitheatre Parkway<br />
Mountain View, CA 94043<br />
Phone: +1 650-253-0000<br />
Fax: +1 650-253-0001<br />
<p>Home page: <a href="http://www.google.com">www.google.com</a></p>
]]>
</description>
<Point>
<coordinates>-122.0841430, 37.4219720, 0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Yahoo! Inc.</name>
<description><![CDATA[
Yahoo! Inc.<br />
701 First Avenue<br />
Sunnyvale, CA 94089<br />
Tel: (408) 349-3300<br />
Fax: (408) 349-3301<br />
<p>Home page: <a href="http://yahoo.com">http://yahoo.com</a></p>
]]>
</description>
<Point>
<coordinates>-122.0250403,37.4163228</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Location 3</name>
<description>This is location 3</description>
<Point>
<coordinates>-122.063,37.4063228</coordinates>
</Point>
</Placemark>
</Document>
</kml>
References for KML filesHere are some references if you wish to learn more about the KML files: User reviews Average user ratings: 4.0 (from 1 user) Note: You have to be a registered member to leave a comment. Free registration here. |
||
| < Prev |
|---|
Joomla 1.0 Articles
- How to create a module with DirectPHP plugin?
- How to include modules in Content item?
- How to include modules in Section/Content Description
- How to include PHP commands in Section/Content Description
- How to make plugins process Section/Category descriptions
- Include Code Listing plugin - More Tips and Techniques
- How to have DirectPHP plugin process RSS feed?
- How to have the plugins processed when genrating PDF documents of content items?
- How to have DirectPHP commands processed in Joomla search?
Joomla 1.5 Articles
- How to create a module with DirectPHP plugin?
- How to include modules in Content item?
- How to include modules in Section/Content Description
- How to include PHP commands in Section/Content Description
- How to make plugins process Section/Category descriptions
- Include Code Listing plugin - More Tips and Techniques
- How to have DirectPHP plugin process RSS feed?
- How to have the plugins processed when genrating PDF documents of content items?
- How to have DirectPHP commands processed in Joomla search?
Joomla Plugins
Joomla Components
Joomla Gadgets
- Google Image Search
- Google News Search
- Wikipedia Search
- Google Book Search
- Google Video Search
- Google Currency Converter - AJAX version
- Yahoo Currency Converter - AJAX version
- Yahoo Stock Quote (AJAX module version)
- Yahoo Stock Quote (AJAX component/ module version)
- googleSearch_cse component
- googleSearch_cse module
- googleMaps plugin









May 24, 2010 8:31pm
I know this is a old post, but it seems not to be working, please let me know if theres a fix. my link is www.bbshoprd.com/sucursales