[Chameleon] maptipsClick

Alessandro Oggioni a.oggioni at ise.cnr.it
Tue Jan 23 10:13:16 EST 2007


Hi all,

I have a problem whit a maptipsClick.

The tag whit I use it's:

          <cwc2 type="MapTips" link="true" visible="false"
defaulttext="&nbsp;" tolerance="8" maptipsdiv="ttt" label="Map Tips"
styleresource="TextButtons" popupstyleresource="TextButtons"
popupwidth="200" popupheight="150" image="images/icon_maptips.png"
layer="Lake" onmouseover="maptipsOver" onmouseout="maptipsOut"
onclick="maptipsClick" attributes="ELEMENTI,LINK">

                            <image state="normal"/>

                            <image state="selected"/>

                            <image state="hover"/>

          </cwc2>

 

and the javascript

<script type="text/javascript">

 

// Detect if the browser is IE or not.

// If it is not IE, we assume that the browser is NS.

var IE = document.all?true:false

 

// Variables to hold mouse x-y

var mouseX = 0;

var mouseY = 0;

 

 

function getMouseXY(e) {

 

 if (IE) { // grab the x-y pos.s if browser is IE

   mouseX = event.clientX + document.body.scrollLeft;

   mouseY = event.clientY + document.body.scrollTop;

 } else {  // grab the x-y pos.s if browser is NS

   mouseX = e.pageX;

   mouseY = e.pageY;

 }

 // catch possible negative values in NS4

 if (mouseX < 0){mouseX = 0;}

 if (mouseY < 0){mouseY = 0;}

 

 // return

 return true;

}

 

function maptipsClick(e, att_values, att_names)

{

    // add code here to popup a window to show the link

            ( 'MapTipsLayer', '<a href="'+att_values[1]+'"
target="_blank">'+att_values[1]+'</a>');

}

 

 

function maptipsOver(e, att_values, att_names)

{

 

   // get the mouse xy

   getMouseXY(e);

 

   // position the map tip

   CWCDHTML_SetLayerZOrder( 'MapTipsLayer', 999 );

   CWCDHTML_SetLayerPos('MapTipsLayer', (mouseX + 10), (mouseY + 10));

 

   // set the contents

   CWCDHTML_ShowContents( 'MapTipsLayer',

                                                          '<div
style="background-color: #FF0000; font-family:verdana; font-size:10px;
width: 148; height: 1">'+

                          '<p ALIGN="center">'+

                                                          '<b>'+"Toponimo
Lago"+'</b>'+

                                                          '</p>'+

                                                          '</div>'+

                                                          '<div
style="font-family:verdana; font-size:10px; width: 148; height: 1">'+

                          '<p ALIGN="center">'+att_values[0]+'</p>'+

                                                          '</div>'

                                                          );

 

   // show the tip

   CWCDHTML_ShowLayer( 'MapTipsLayer');

}

 

function maptipsOut( e, att_values, att_names)

{

   // hide the tip

   CWCDHTML_HideLayer( 'MapTipsLayer' );

}

</script>

 

In particular maptipsClick.

 

function maptipsClick(e, att_values, att_names)

{

    // add code here to popup a window to show the link

            ( 'MapTipsLayer', '<a href="'+att_values[1]+'"
target="_blank">'+att_values[1]+'</a>');

}

 

Where is the problem? I hope that anyone can I help me.
 
Thank you
 
Alessandro Oggioni

 

Dr. Alessandro Oggioni - PhD (Ecology) 
CNR Institute of Ecosystem Study (ISE) 
L.go Tonolli 50-52 
I - 28922 Verbania Pallanza 
Tel.: +39 0323 518300 
Fax: +39 0323 556513 
e-mail:  <mailto:a.oggioni at ise.cnr.it> a.oggioni at ise.cnr.it

msm:  <mailto:aleoggi at libero.it> aleoggi at libero.it

skype: alessandro0974 
wwwISE:  <http://www.iii.to.cnr.it> http://www.iii.to.cnr.it

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20070123/60c7cf1f/attachment-0001.html


More information about the Chameleon mailing list