Markers from XML using Google Maps JavaScript API V3This application imports marker information from an XML file and draws markers on the map. A copy of the XML file content is shown below. There is no API in V3 to import and read XML, like there is in V2. But code has been developed and assembled in a util.js. The util.js is mentioned in gmaps-api-issues in a feature/enhancement request for a V3 equivalent of GDownloadUrl(). here (opens in new window) With the tags and their attributes in an XML file like this, you are in control of dynamic presentations. Associative array for custom icon image from Mike Williams Associative arrays and Custom Icons |
<?xml version="1.0" encoding="UTF-8" ?>
<markers>
<marker name="Pan Africa Market"
address="1521 1st Ave, Seattle, WA"
image="http://searcharoo.net/searcharoov6/testfiles/parkavenue.jpg" width="150" height="100"
lat="47.608940" lng="-122.340141"
type="Restaurant" label="Restaurant, with photo" />
<marker name="Buddha Thai"
address="2222 2nd Ave, Seattle, WA Unit 2"
image="" width="" height=""
lat="47.613590" lng="-122.344391"
type="Bar" label="Bar" />
<marker name="Buddha Bar"
address="2222 2nd Ave, Seattle, WA Unit 2"
image="" width="" height=""
lat="47.613590" lng="-122.344391"
type="Bar" label="Bar" />
<marker name="The Melting Pot"
address="14 Mercer St, Seattle, WA"
image="" width="" height=""
lat="47.624561" lng="-122.356445"
type="Restaurant" label="Restaurant" />
<marker name="Ipanema Grill"
address="1225 1st Ave, Seattle, WA"
image="" width="" height=""
lat="47.606365" lng="-122.337654"
type="Restaurant" label="Restaurant" />
<marker name="Sake House"
address="2230 1st Ave, Seattle, WA"
image="" width="" height=""
lat="47.612823" lng="-122.345673"
type="Bar" label="Bar" />
<marker name="Sake PUB"
address="2230 1st Ave, Seattle, WA"
image="" width="" height=""
lat="47.612823" lng="-122.345673"
type="Bar" label="Bar" />
<marker name="Crab Pot"
address="1301 Alaskan Way, Seattle, WA"
image="" width="" height=""
lat="47.605961" lng="-122.340363"
type="Restaurant" label="Restaurant" />
<marker name="Mama's Mexican Kitchen"
address="2234 2nd Ave, Seattle, WA"
image="" width="" height=""
lat="47.613976" lng="-122.345467"
type="Bar" label="Bar" />
<marker name="Wingdome"
address="1416 E Olive Way, Seattle, WA"
image="" width="" height=""
lat="47.617214" lng="-122.326584"
type="Bar" label="Bar" />
<marker name="Piroshky Piroshky"
address="1908 Pike pl, Seattle, WA"
image="" width="" height=""
lat="47.610126" lng="-122.342834"
type="Restaurant" label="Restaurant" />
</markers>
width="31" height="31" border="0" alt="Home"> | Contact: Kjell Scharning |