Page 1 of 1

Placing multiple pins on a map

Posted: Wed Aug 01, 2012 1:02 am
by JimKeating
Here is a technique for setting pins on a map using a KML (Keyhole Markup Language https://developers.google.com/kml/documentation) file, yet another variant of XML. This example assumes you have generated the KML file by some means not discussed here. The file contains the locations that you want to pin on the map. The file is then placed in a location that is accessible by web applications. I used the images folder of one of our servers as an example. Once you have the KML file and have placed it in an accessible loocation, you will need to define a Web View in LongRange whose URL is similar to this example:
"https://maps.google.com/maps?q=http://< ... stkml2.kml" where <yourserver> is the location of the kml file.

When the application is executed the attached map is an example of the results which may be a achieved.

Here is the KML file I used: testkml2.kml

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.google.com/earth/kml/2">
<Document>
<name>testkml2.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>

Jim Keating