Allrighty... Tryied this but then all my markers disapeared...

function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
                map.setMapType(G_HYBRID_MAP);
        map.addControl(new GSmallMapControl());
                map.setCenter(new GLatLng(<? echo $lat; ?>, <? echo $lng; ?>), 
<?
echo $zoom; ?>);

                var zoomlevel = map.getZoom();

                var iconBlue = new GIcon();

                iconBlue.image = "images/icons/googlemaps/course3.png";
                iconBlue.iconSize = new GSize(12, 12);
                iconBlue.shadow = "images/icons/googlemaps/course3_shadow.png";
                iconBlue.shadowSize = new GSize(26, 12);
                iconBlue.iconAnchor = new GPoint(6, 12);
                iconBlue.infoWindowAnchor = new GPoint(10, 14);

                var customIcons = [];
                customIcons["course"] = iconBlue;
                customIcons["bar"] = iconRed;

        GDownloadUrl("modules/googlemaps/getclub.php", function(data)
{
                //GDownloadUrl("TEST_xml.xml", function(data) {
          var xml = GXml.parse(data);
          var markers =
xml.documentElement.getElementsByTagName("marker");
          for (var i = 0; i < markers.length; i++) {
            var name = markers[i].getAttribute("name");
                        //var name = markers[i].getZoom();
            var address = markers[i].getAttribute("address");
                        var zipcity = markers[i].getAttribute("zipcity");
                        var clinkurl = markers[i].getAttribute("clinkurl");
                        var clink = markers[i].getAttribute("clink");
            var type = markers[i].getAttribute("type");
            var point = new
GLatLng(parseFloat(markers[i].getAttribute("lat")),
 
parseFloat(markers[i].getAttribute("lng")));
            var marker = createMarker(point, name, address, zipcity,
clinkurl, clink, type);
            map.addOverlay(marker);
          }
        });
      }
    }

Where do I go wrong?

On 21 Jun., 14:36, Rossko <[email protected]> wrote:
> > Well... Looked through the different topics, but it might be my lack
> > of experince, but cant figure out what to do... Please help :-|
>
> Well, no-one said it was easy.
>
> If you want to tackle the easy case - set a persistent icon whose
> image source is selected based on initial mapzoom:
> Don't try to "getZoom out of the load function", go the other way -
> put the icon selector into the load function.  Move your icon-image-
> selecting code to just after you have determined the mapzoom, but
> before you run themarkercreation.

-- 
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