I'm trying to place markers on a map using xml data and xslt, and what
I'm doing works in Chrome and Safari, but produces an error in IE6,
IE7 and IE8, and in Firefox (3.5.5).

My simplified example can be seen at: http://whimsy.fastmail.fm/test/test.xml
The location of the xsl file: http://whimsy.fastmail.fm/test/test.xsl
or alternatively, I've pasted the script from the xsl file below.

Any thoughts on what could be causing the problem, or alternatively,
what is not causing the problem?

I'd really appreciate any input that anyone has!

      <xsl:element name="script">
        <xsl:attribute name="src">
        <![CDATA[
http://maps.google.com/maps/api/js?sensor=false
]]>
                </xsl:attribute>
        <xsl:attribute name="type">text/javascript</xsl:attribute>
        </xsl:element>
    <script type="text/javascript">

  function initialize() {
    var myLatLng = new google.maps.LatLng(49.9,-97.25);
    var myOptions = {
      zoom: 3,
      center: myLatLng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };

    var map = new google.maps.Map(document.getElementById
("map_canvas"), myOptions);

        <xsl:for-each select="test/country/city">

        var stnLatLng = new google.maps.LatLng(<xsl:value-of select="lat"/
>,<xsl:value-of select="long"/>);

        var marker = new google.maps.Marker({
                position: stnLatLng,
                map: map,
                title:"<xsl:value-of select="name"/>"
        });

        google.maps.event.addListener(marker, 'click', function() {
                var infowindow = new google.maps.InfoWindow({
                position: new google.maps.LatLng(<xsl:value-of select="lat"/
>,<xsl:value-of select="long"/>),
        content: "<xsl:value-of select="name"/>"
                });
          infowindow.open(map);
        });

</xsl:for-each>

  }
    </script>

--

You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.


Reply via email to