[Chameleon] Chameleon Widgets and PostgisLayers

listserver server chameleon.listserver at gmail.com
Tue May 30 16:22:27 EDT 2006


Thank you very much for your answer.

i've made some test but i've always the same problem. I cannot see
Attributes in Maptips.

This is my layer

LAYER
  NAME "scuole"
  METADATA
    wms_title "scuole"
    wfs_title "scuole"
    gml_include_items "all"
  END
  STATUS ON
  DUMP TRUE
  TYPE POLYGON
  CONNECTIONTYPE POSTGIS
CONNECTION "user=postgres password=**** dbname=NEW host=localhost port=5432"
DATA "the_geom FROM (select comune, I02_97 as Elementari_Classi, I03_97 as
Medie_Classi, I04_98 as Superiori_classi, the_geom, gid from scuole) AS
scuole USING UNIQUE gid USING SRID=-1"
  PROJECTION "init=epsg:26591"
  END
LABELITEM comune
 CLASS
    NAME "comune"
   TEMPLATE "ttt_query.html"
   OUTLINECOLOR 0 0 0
  END
   END
END

this as widget definition:

<cwc2 type="MapTips" visible="true" layer="scuole"
attributes="comune" defaulttext="&nbsp;" tolerance="2"
maptipsdiv="ttt" label="Map Tips" styleresource="NavButtons"
popupstyleresource="NavButtons" popupwidth="550" popupheight="475"
image="images/icon_maptips.png" toolbar="false" status="false"
menubar="false" onmouseover="myMaptipsOver" onmouseout="myMaptipsOut">
              <image state="normal"/>
              <image state="selected"/>
              <image state="hover"/>
          </cwc2>

this ..
- Nascondi testo tra virgolette -

<!-- MAPTIPS -->
     <script type="text/javascript">
     var IE = document.all?true:false

     var mouseX = 0;
     var mouseY = 0;

     function getMouseXY(e)
     {
       if (IE)
       {
         mouseX = event.clientX + document.body.scrollLeft;
         mouseY = event.clientY + document.body.scrollTop;
       }
       else
       {
         mouseX = e.pageX;
         mouseY = e.pageY;
       }
       if (mouseX < 0){mouseX = 0;}
       if (mouseY < 0){mouseY = 0;}
       return true;
     }

     function myMaptipsOver(e, att_values, att_names)
     {
       getMouseXY(e);

       // position the map tip
       CWCDHTML_SetLayerZOrder( 'resultTips', 999 );
       CWCDHTML_SetLayerPos('resultTi
- Nascondi testo tra virgolette -
ps', (mouseX + 10), (mouseY + 10));

       // set the contents
       CWCDHTML_ShowContents( 'resultTips',
                         '<div style="border: 1px solid #cccccc;
background-color: #eeeeee; padding: 1px;">'+
                         '<p class="maptips">'+
                           att_names[0] + ': ' + att_values[0] + '<br>' +
                           att_names[1] + ': ' + att_values[1] + '<br>' +
                           att_names[2] + ': ' + att_values[2] +
                         '</p>'+
                         '</div>');

       // show the tip
       CWCDHTML_ShowLayer( 'resultTips' );
     }

     function myMaptipsOut(e, att_values, att_names)
     {
       CWCDHTML_HideLayer( 'resultTips' );
     }
     </script>

and this in html template
 <div id="resultTips"
style="position:absolute;visibility:hidden;"></div>
     <cwc2 type="KeepSessionAlive" TIMEOUT="1000" />
     <cwc2 type="SessionExpired" text="Uw sessie is verlopen, ververs
de pagina" />
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20060530/1cc9b442/attachment.html


More information about the Chameleon mailing list