I would like it so that if only one marker is shown on a particular
map the info window open automatically on page load. Is this possible?

This is my current code....

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

    var mmap=new GMap2(document.getElementById("map_canvas"));
    mmap.setCenter(new GLatLng(0,0),2);
    mmap.addControl(new GMapTypeControl());

    mmap.enableGoogleBar();
    mmap.setMapType(G_HYBRID_MAP);

    function side(myvar,name,type,i,graphic) {

        if (type == "marker") {
          return '<li><a href="javascript:GEvent.trigger('
            + myvar+ '.gmarkers['+i+'],\'click\')">' + name + '</a></
li>';
        }
        return "";
      }


      //  ======== Add a map overview ==========
      mmap.addControl(new GOverviewMapControl(new GSize(200,130)));

      //  ======== A function to adjust the positioning of the
overview ========
      function positionOverview(x,y) {
        var omap=document.getElementById("map_overview");
        omap.style.left = x+"px";
        omap.style.top = y+"px";

        // == restyling ==
        omap.firstChild.style.border = "1px solid gray";

        omap.firstChild.firstChild.style.left="4px";
        omap.firstChild.firstChild.style.top="4px";
        omap.firstChild.firstChild.style.width="190px";
        omap.firstChild.firstChild.style.height="120px";
      }

      //  ======== Cause the overview to be positioned AFTER IE sets
its initial position ========
      setTimeout("positionOverview(558,254)",1);
    var exml = new GeoXml("exml", mmap, "/kml/{segment_2}/
{segment_3}", {directions:true, nozoom:false, preloadimages:true,
icontype:"style",iwwidth:300, allfoldersopen:true,
iconFromDesciption:true, messagestyle:{opacity:
0.8 ,backgroundColor:"#a0c0fE", borderWidth:"1px"}});
    exml.parse();



    //]]>
    </script>

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