Hi all

First, I'm not experienced in Java Script, I work on a Lotus Domino
platform, and I'm trying to load in markets coming from a database on
the Domino server.

I've managed to "convert" in into XML (I think):

http://news.motorbiker.org/accommodation.nsf/XML.xml

After reading all the already posted questions on XML, tutorials, etc,
I still am not managing to get anywhere. After 3 days, I've decided to
cry for help.

The map that needs to display is here:

http://news.motorbiker.org/blogs.nsf/dx/france-biker-friendly-accommodation.htm

It centers properly on the country in question (France in this case),
and is supposed to load the xml file above and generate markers and
html text (for now I've just got the word "stuff" instead of html).

The js code looks like this (a merger of different codes I've found in
this forum). The script sits in the < head > portion:

<script type="text/javascript">
    //<![CDATA[

    var iconBlue = new GIcon();
    iconBlue.image = 'http://labs.google.com/ridefinder/images/
mm_20_blue.png';
    iconBlue.shadow = 'http://labs.google.com/ridefinder/images/
mm_20_shadow.png';
    iconBlue.iconSize = new GSize(12, 20);
    iconBlue.shadowSize = new GSize(22, 20);
    iconBlue.iconAnchor = new GPoint(6, 20);
    iconBlue.infoWindowAnchor = new GPoint(5, 1);

    var iconRed = new GIcon();
    iconRed.image = 'http://labs.google.com/ridefinder/images/
mm_20_red.png';
    iconRed.shadow = 'http://labs.google.com/ridefinder/images/
mm_20_shadow.png';
    iconRed.iconSize = new GSize(12, 20);
    iconRed.shadowSize = new GSize(22, 20);
    iconRed.iconAnchor = new GPoint(6, 20);
    iconRed.infoWindowAnchor = new GPoint(5, 1);

    var iconGreen = new GIcon();
    iconGreen.image = 'http://labs.google.com/ridefinder/images/
mm_20_green.png';
    iconGreen.shadow = 'http://labs.google.com/ridefinder/images/
mm_20_shadow.png';
    iconGreen.iconSize = new GSize(12, 20);
    iconGreen.shadowSize = new GSize(22, 20);
    iconGreen.iconAnchor = new GPoint(6, 20);
    iconGreen.infoWindowAnchor = new GPoint(5, 1);

    var customIcons = [];
    customIcons["allstuff"] = iconBlue;
    customIcons["camping"] = iconRed;
    customIcons["hotelonly"] = iconGreen;

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("biker_map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(46.227638,2.213749),5);

        GDownloadUrl("http://news.motorbiker.org/accommodation.nsf/
XML.xml", function(data) {
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName
("marker");
          for (var i = 0; i < markers.length; i++) {
              var address = GXml.value(markers[i].getElementsByTagName
("html")[0]);
              var icon = GXml.value(markers[i].getElementsByTagName
("icon")[0]);
              var lat = parseFloat(GXml.value(markers
[i].getElementsByTagName("lat")[0]));
              var lng = parseFloat(GXml.value(markers
[i].getElementsByTagName("lng")[0]));
              var point = new GLatLng(lat, lng);
            var marker = createMarker(point, address, icon);
            map.addOverlay(marker);
          }
        });
      }
    }

    function createMarker(point, address, icon) {
      var marker = new GMarker(point, customIcons[icon]);
      var html = address;
      GEvent.addListener(marker, 'click', function() {
        marker.openInfoWindowHtml(html);
      });
      return marker;
    }
    //]]>
  </script>

Can anyone please help, and tell me where I've gone wrong, and please
be gentle... I'm a JS newbie...

Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to