[OpenLayers-Users] Highlighting a feature?

bradleyspencer brad at cubewerx.com.au
Sat Dec 1 02:14:04 EST 2007


I have used both techniques as they may be used in different situations.

For example:

I use a WFS GetFeature filtered request to get the geometry of a polygon and
use it to set up the map centre and the zoom level. Then I build an SLD
'mask' to highlight the requested polygon boundary and apply a mask to all
other polygons in that layer. So you get an irregular porthole effect draped
over the map.

I build the OGC GetFeature request in my application and send it to a
server-side php script to get the info I need:
http://cubeserv.terrapages.com/psma/cubeserv.cgi?datastore=PSMA-ROSD&service
=wfs&request=GetFeature&typename=AUS_LGA0403&filter=<Filter><PropertyIsEqual
To><PropertyName>NAME</PropertyName><Literal>BANKSTOWN</Literal></PropertyIs
EqualTo></Filter>&outputformat=BXFS

The GFI brings back the BBox of the polygon as they calculated it at load
time saving me the bother of doing the same at runtime.

The php built masking SLD is as follows:
http://demo.cubewerx.com.au/inc/sld/lg/newSld.xml

Another option that I have used is based on WMS (CubeWerx only) which can
return GML on a map click containing both the geometry and attributes of any
objects within distance of the mouse click. That can then be used to draw
the polygons into an OL feature layer styled any way you wish.

Have a look at the following example for this option:
http://demo.cubewerx.com.au/aamhatchOl.html  - just doubleclick on the
corner of a couple of properties.

Maybe this will help you?

Cheers,

Brad Spencer



-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]On
Behalf Of Gregor Mosheh
Sent: Saturday, 1 December 2007 5:15 AM
To: Tim Schaub
Cc: openlayers user list
Subject: Re: [OpenLayers-Users] Highlighting a feature?

Hi, Tim. Nice to hear from you. :)

I don't know SLDs with WMS, and your other option does sound a lot
easier, since we'll only be dealing with a few small features, so the
client could handle the geometry just fine. I'll check out the
select-feature demo.

Thanks for all the info.

--
Gregor Mosheh / Greg Allensworth
System Administrator, HostGIS cartographic development & hosting services
http://www.HostGIS.com/

"Remember that no one cares if you can back up,
  only if you can restore." - AMANDA
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list