Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

we developing a project which contains a lot of data ,
using WMS layers for displaying the points,
Also we used WMS to return points information in a popup window ,
however to highlight selected point we used WFS layer.

The problem now is:
sometimes the popup displayed without highlighting the selected point and vice versa ..!

how could i combine between these tow features (highlight selected point and show the popup for it)?

i think one reason is the clicking event defined different,
WFS using:"featureselected", this, function(e) { select.addFeatures([e.feature]);}

and WMS using:
popupwindow1=new OpenLayers.Control.WMSGetFeatureInfo({
layers: [layer1],
autoActivate: true,
maxFeatures: 3,
infoFormat: "application/vnd.ogc.gml",
eventListeners: {....}

The second problem is :
how could i return features from WFS layer without adding the vector layer to the map?

share|improve this question
up vote 1 down vote accepted

For the first problem :

I can not see the whole code (so it is better you post it) but I assume in the code two handlers are registered so two events ("featureselected" and "gefeatureinfo") are listened. That can cause the issue you describe above since you do not have control over in which order trigerred events should be handled.

You can write only one handler and then only getfeatureinfo event could be listened. Once the event received by using the information it contains select.addFeatures([e.feature]) can be issued.

If you look at the api documentation getfeatureinfo event contains "a features property with an array of the parsed features". Therefore the operation I described above can be done by using this information. Then you can decide if you want the highlight first popup later or vice versa.

For the second problem :

You can use GetFeature operation of WFS. In openlayer for able to do so you can use this

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.