<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt">Hi, first thanks for all information, this list is very important for new people, new developers.<br><br>I have a question:<br>Can i use overlay calling a xml file and add others objects with the myKaMap.addObjectGeo ?<br>I want to add points with the follow code. And add some polygon layers and line layers with overlay. It is possible? <br><br>ps: when i use them together the tooltip do not display onmouseover event. the rest of the page functions continuos the same. but i need the tooltips.<br><br><br>my code:<br><br>//my points array<br> var aPoints = new Array();<br> aPoints[0] = new Array(1000,1000,'Rabat','teste','outro');<br> aPoints[1] = new Array(2000,2000,'Barcelona','teste','outro');<br><br> //the function<br> var
canvas = null;<br> var toolTip = null;<br> <br> toolTip = new kaToolTip(myKaMap);<br> var offsetX=-6;//offset to move the image left-right<br> var offsetY=-19;//offset to move the image top-bottom<br> toolTip.setTipImage('images/tip-green.png',offsetX,offsetY);<br><br> function printMyTips () {<br> <br> var idx = 50;//canvas zindex<br> canvas = myKaMap.createDrawingCanvas(idx);<br> <br> <br> for(i=0;i<aPoints.length;i++){<br> var div = document.createElement('div');<br> <br>
var img = document.createElement('img');<br> img.src = 'images/tip-red.png';<br> <br> img.style.position='absolute';<br> img.style.left='-6px';<br> img.style.top='-19px';<br> <br> //set the event<br> img.onmouseover=myTipClicked;<br> <br> //set the label<br> img.mylabel = aPoints[i][2];<br>
<br> //append image the our div<br> div.appendChild(img);<br> <br> //add the object to our map<br> var lon = aPoints[i][0];<br> var lat = aPoints[i][1];<br> myKaMap.addObjectGeo(canvas,lat,lon,div);<br> }<br> <br> }<br> <br> <br> function myTipClicked(){<br> //alert(this.mylabel);<br>
for(i=0;i<aPoints.length;i++){<br> if(aPoints[i][2] == this.mylabel){<br> <br> var myurl = aPoints[i][3];<br> var myimg = aPoints[i][4];<br> var lon = aPoints[i][0];<br> var lat = aPoints[i][1];<br> <br> var textToShow = '';<br> textToShow += '<div style="position:absolute;width:10px;right:10px;top:10px;color:red;border:1px solid black;"><a href="javascript:void(0)"
onclick="toolTip.move()">X</a></div>';<br> textToShow += '<div style="position:absolute;width:200px;height:100px;background-color:#ffffff;">'+this.mylabel+' - <a href="javascript:void(0)" onmouseover="toolTip.move()">Fechar</a></div>';<br> //textToShow += '<a href="' + myurl + '" target="_blank"><img src="' + myimg + '" width="200px"></a>';<br> toolTip.setText( textToShow );<br> toolTip.moveGeo(lat,lon);<br> }<br> }<br> }<br><br><div> </div>[]s<br>Guilherme Pedrosa<br>(21) 8261-0270 |
24274319<br>guilherme.pedrosa@superig.com.br<div><br></div></div><br>
                <hr size=1>
O Yahoo! está de cara nova. Venha <a href="http://us.rd.yahoo.com/mail/br/tagline/spirit/*http://br.yahoo.com">conferir</a>!</body></html>