That's what i'm trying to do... but if i were to ask you to give me
the ip address and login information to your internal servers, i'm
sure you would respond the same way.

Here's the function anyway, in case someone might be able to help. if
i replace the mymarkers.push(marker); call with map.addOverlay
(marker); , all my markers show up without problems.

function geo(){
  var start = new Date().getTime();
  var points = [];
  var bounds = new GLatLngBounds();
  var geocoder = new GClientGeocoder();
  var lines;
  var lineNumber;
  var len = 0;
  var bar = document.getElementById("bar");
  var scale = document.getElementById("scale");
  var c=document.getElementById("<%=Me.addresses.ClientID
%>").value.split("#$%");
  var g=document.getElementById("<%=Me.IDs.ClientID %>").value.split("#
$%");
  var prog = document.getElementById("progress");
  var centered=false;
  document.getElementById("legend").innerHTML="";

  var baseIcon = new GIcon(G_DEFAULT_ICON);
  baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";;
  baseIcon.iconSize = new GSize(20, 34);
  baseIcon.shadowSize = new GSize(37, 34);
  baseIcon.iconAnchor = new GPoint(9, 34);
  baseIcon.infoWindowAnchor = new GPoint(9, 2);

  document.getElementById("legend").innerHTML="Legend:<br />";

  scale.style.visibility = "visible";
  lines = document.getElementById("<%=Me.addresses.ClientID
%>").value.split("#$%");
  len = lines.length;
  lineNumber=0;
  //geocoder.setViewport(map.getBounds());
  function doIt(){
    var query = lines[lineNumber];
    geocoder.getLatLng(query,function(point){
      if(!point){
        lineNumber++;
        //alert(address + " not found");
        if(lineNumber<len){doIt()};
      }else{
        var a=c[lineNumber];
        var i=g[lineNumber];
        if(len<=25)
        {
        // Create a lettered icon for this point using our icon class
        var letter = String.fromCharCode("A".charCodeAt(0) +
lineNumber);
        //alert(letter);
        var letteredIcon = new GIcon(baseIcon);
        letteredIcon.image = "http://www.google.com/mapfiles/marker"; +
letter + ".png";


            var markerOptions={
                title:"Find a job in " + a.split(",")[0],
                clickable: true,
                draggable: false,
                icon:letteredIcon
            }

            document.getElementById("legend").innerHTML+="<br /><img
src='http://www.google.com/mapfiles/marker"; + letter + ".png'> <a
href=" + String.fromCharCode(34) + "JavaScript:LocationClicked('" + a
+ "','" + i + "');" + String.fromCharCode(34) + ">" + a.split(",")[0]
+ "</a>"
        }
        else
        {
            var markerOptions={
                title:"Find a job in " + a.split(",")[0],
                clickable: true,
                draggable: false
            }
            document.getElementById("legend").innerHTML+="<br /><img
src='http://www.google.com/mapfiles/marker.png'> <a href=" +
String.fromCharCode(34) + "JavaScript:LocationClicked('" + a + "','" +
i + "');" + String.fromCharCode(34) + ">" + a.split(",")[0] + "</a>"
        }

        var marker = new GMarker(point,markerOptions);

        GEvent.addListener(marker, "click", function() {
            LocationClicked(a,i);
        });

        GEvent.addListener(marker, "mouseover", function() {
            marker.openInfoWindowHtml("Click to find a job in " + a);
        });

        GEvent.addListener(marker, "mouseout", function() {
            marker.closeInfoWindow();
        });

        /*if(document.getElementById("<%=Me.lbls.ClientID
%>").value=="yes")
                  {
                        var label = new Label({
                                map: map,
                                text: a.split(",")[0]
                        });
                        label.bindTo('position', marker, 'position');
                   }*/

        mymarkers.push(marker);

        if(lineNumber==Math.round(len/2))
        {
            map.setCenter(point);
            centered=true;
        }
        else
        {
            if(lineNumber>Math.round(len/2))
            {
                if(centered==false)
                {
                    map.setCenter(point);
                    centered=true;
                }
            }
        }

        bounds.extend(point);
        point.address = query;
        points.push(point);//to be used
        memo(point); // intentionally slow function
        lineNumber++;

        if(lineNumber<len){doIt()};
        //map.fit(bounds);
        bar.style.width = parseInt(300*lineNumber/len)+"px";
        prog.innerHTML="Loading... " + parseInt(100*lineNumber/len)
+"%";
      }
      if(lineNumber>=len){
        var time = ((new Date().getTime() - start)/1000).toFixed(0);
        prog.innerHTML="Map loaded: " + time + " seconds";
        //alert("Map loaded\n"+time+"seconds");
      };
    });
  }
  doIt();
}

On Dec 17, 11:34 am, Andrew Leach <[email protected]>
wrote:
> On Dec 17, 4:31 pm, MaxOvrdrv <[email protected]> wrote:
>
>
>
> > if it's ok, i'd like to post the full geo() function to remove any
> > confusion regarding naming and calling procedures?
>
> Post it if you like, but I don't think it's ok and I won't read it.
> Others might perhaps. Or they might not.
>
> If you want help, at least make it easy to help you.
>
> Andrew

--

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