[Chameleon] Chameleon Widgets and PostgisLayers
Bart van den Eijnden (OSGIS)
bartvde at xs4all.nl
Tue May 30 12:47:15 EDT 2006
This is the LAYER I use:
LAYER
NAME "kadperceel"
METADATA
wms_title "Percelen"
wfs_title "Percelen"
gml_include_items "all"
END
STATUS ON
DUMP TRUE
TYPE POLYGON
CONNECTIONTYPE POSTGIS
CONNECTION "user=postgres dbname=gisarts host=127.0.0.1 port=5432
password=*****"
DATA "wkb_geometry from percelen_region USING UNIQUE ogc_fid"
MINSCALE 0
MAXSCALE 10000
PROJECTION
"init=epsg:28992"
END
LABELITEM SECNUM
LABELANGLEITEM HOEK
CLASS
NAME "kadperceel"
STYLE
OUTLINECOLOR 150 150 150
SIZE 1
END
LABEL
TYPE truetype
FONT "sans"
SIZE 7
COLOR 0 0 200
POSITION auto
END
END
END
And this is the widget definition:
<cwc2 type="MapTips" visible="false" layer="kadperceel"
attributes="gemcod,aanduid,secnum" defaulttext=" " 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>
And this is the rest of the HTML template for MapTips:
...
<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" />
</form>
<!-- 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('resultTips', (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>
</body>
</html>
Best regards,
Bart
Bart van den Eijnden (OSGIS) wrote:
>I've got MapTips working with PostGIS layers. I'll try to look up my
>example at home and post it to the list tonight.
>
>Best regards,
>Bart
>
>
>
>>I've some problems with some widgets of chameleon and Postgis Layers.
>>
>>In maptips widgets and LabelLayer Widget:
>>
>>As i riported in chameleon list for Maptips:
>>http://lists.maptools.org/pipermail/chameleon/2006-May/004098.html
>>
>>and for Label Layer:
>>http://lists.maptools.org/pipermail/chameleon/2006-April/003928.html
>>
>>Problem is always the same i cannot see attributes of Layers!
>>
>>Thank you in advance for your help!
>>_______________________________________________
>>Chameleon mailing list
>>Chameleon at lists.maptools.org
>>http://lists.maptools.org/mailman/listinfo/chameleon
>>
>>
>>
>
>
>_______________________________________________
>Chameleon mailing list
>Chameleon at lists.maptools.org
>http://lists.maptools.org/mailman/listinfo/chameleon
>
>
>
>
--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl
More information about the Chameleon
mailing list