[OpenLayers-Users] SLD based selection on WMS layers - How to set the new style of clicked point?
Bart van den Eijnden
bartvde at opengeo.org
Mon May 6 01:46:19 PDT 2013
Do you mean that you want the selection to show up in something else than the default colour (i.e. red)?
See:
http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Control/SLDSelect-js.html#OpenLayers.Control.SLDSelect.selectionSymbolizer
e.g.:
selectionSymbolizer: {
'Polygon': {fillColor: '#FF0000', stroke: false},
'Line': {strokeColor: '#FF0000', strokeWidth: 2},
'Point': {graphicName: 'square', fillColor: '#FF0000', pointRadius: 5}
}
Best regards,
Bart
--
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.
On May 5, 2013, at 6:52 PM, Shadin <shadin__a at hotmail.com> wrote:
> I'm trying to follow this example:
> http://openlayers.org/dev/examples/SLDSelect.html
>
> When I click on the point, its color should be changed, here is a piece of
> my code:
>
> control = new OpenLayers.Control.SLDSelect(
> OpenLayers.Handler.Click,
> {
> //displayClass: 'olControlClick',
> layers: [city]
> }
> )
>
> map.addControl(control);
> control.activate();
>
>
> Still can't figure out what's the point of displayClass. and how to assign
> the new color.
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-based-selection-on-WMS-layers-How-to-set-the-new-style-of-clicked-point-tp5051426.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130506/3703b6cd/attachment-0001.html>
More information about the Users
mailing list