[OpenLayers-Users] Highlight Features from WMS Layer

Jerome A. Wendell jawendell at digitalmapping.com
Mon Mar 4 12:45:42 PST 2013


Gery,

 

Thanks for your reply.  I set both hover and box to false so that the event
only occurs on select.

 

Thanks.

 

 

From: Gery . [mailto:gamejihou at hotmail.com] 
Sent: Monday, March 04, 2013 3:36 PM
To: jawendell at digitalmapping.com; 'Imran Rajjad'
Cc: 'OpenLayers User List'
Subject: RE: [OpenLayers-Users] Highlight Features from WMS Layer

 

I don't work with Geoserver, but where do you call your features? and
definitely you need GetFeature for this. About the "0" problem, is it
perhaps you have hover and box as false? 


____________________________________________________________________________
______________
Piensa en el medio ambiente - mantenlo en la pantalla. NO lo imprimas si NO
es necesario.
Think green - keep it on the screen. Do NOT print if it is NOT necessary.
Denken Sie an die Umwelt - bewahren Sie es auf dem Bildschirm. Drucken Sie
es NICHT, wenn es NICHT notwendig ist.



  _____  

From: jawendell at digitalmapping.com
To: rajjad at gmail.com
CC: gamejihou at hotmail.com; openlayers-users at lists.osgeo.org
Subject: RE: [OpenLayers-Users] Highlight Features from WMS Layer
Date: Mon, 4 Mar 2013 14:23:14 -0500

Imran,

 

Thanks for the input.  I have added a GetFeature control and a highlight
layer based on http://openlayers.org/dev/examples/getfeature-wfs.html as
follows:

 

var highlightLayer = new OpenLayers.Layer.Vector("Highlighted Features", {

                                                styleMap: myStyles,

                                                displayInLayerSwitcher:
false,

                                                isBaseLayer: false

                                                }

                                );

 

var highlightControl = new OpenLayers.Control.GetFeature({

                                protocol:
OpenLayers.Protocol.WFS.fromWMSLayer(mylayer),

                                box: false,

                                hover: false,

                                maxFeatures: 20

                });

 

                highlightControl.events.register("featureselected", this,
function(e) {

                                highlightLayer.addFeatures([e.feature]);

                });

 

                highlightControl.events.register("featureunselected", this,
function(e) {

                                highlightLayer.removeFeatures([e.feature]);

                });

 

map.addControl(highlightControl);

highlightControl.activate();

 

The selected features are not being added to the highlightLayer layer.
According to Firebug, the numberOfFeatures="0".  Do you have any idea why
there are no features being returned?  I use geoserver and WFS is enabled.

 

Thanks,

 

Jerome

 

 

From: Imran Rajjad [mailto:rajjad at gmail.com] 
Sent: Monday, March 04, 2013 2:08 PM
To: jawendell at digitalmapping.com
Cc: Gery .; OpenLayers User List
Subject: Re: [OpenLayers-Users] Highlight Features from WMS Layer

 

hi,

 

to make highlighting work, you will need to put your features in a vector
layer anyway..

regards,

Imran

 

On Mon, Mar 4, 2013 at 11:32 PM, Jerome A. Wendell
<jawendell at digitalmapping.com> wrote:

Gery,

 

Thanks for your reply.  I have been searching a number of sites for the
answer, but did not really find a definite answer.  So, now I know I need to
add another control.

 

I appreciate your help.

 

Jerome

 

 

From: Gery . [mailto:gamejihou at hotmail.com] 
Sent: Monday, March 04, 2013 12:41 PM


To: jawendell at digitalmapping.com
Cc: OpenLayers User List
Subject: Re: [OpenLayers-Users] Highlight Features from WMS Layer

 

I think so, there are several posts about that in gisexchange.com

Sent from my iBath


On Mar 4, 2013, at 18:18, "Jerome A. Wendell" <jawendell at digitalmapping.com>
wrote:

I have a control using WMSGetFeatureInfo that displays attributes of the
selected features from a WMS layer in a popup.  I have tried unsuccessfully
to also highlight the features selected in that same control by adding them
to a highlight layer.  Do I need a separate control using GetFeature in
order to highlight the selected features?

 

Any help would be greatly appreciated.

 

Thanks.

 

_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users


_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users





 

-- 
I.R 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130304/f0e788ad/attachment-0001.html>


More information about the Users mailing list