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

I'm trying to query a feature in OpenLayers, but it's returning just an image highlighted that is not possible to make zoom, pan and drag.

My intention is to query a feature on the map like street name, city and country. Is there any function in OpenLayers?

I'm using this code:

var query = new OpenLayers.Layer.WMS( "Utbs", 
    srs: 'EPSG:4326',
    width: '800',
    styles: '',
    height: '600',
    layers: 'layer_name',   
    mode: 'itemquerymap',
    qstring: "(value = '03')",
    qlayer: 'layer_name',
    mapxy: 'shape'  
    singleTile: true    

share|improve this question

Take a look at the Feature Info example for OpenLayers.

This uses the GetFeatureInfo requests for WMS layers to return attribute data. You may have to modify your WMS configuration in MapServer or GeoServer (or whatever is serving your WMS layers) to support this.

share|improve this answer
Actually a want to highlight and make a zoom in a feature that was typed in a field name. The method GetFeatureInfo just return information about this feature where you clicked hover, so this is not what i want to. Thanks! – Michel Andrade Jun 30 '11 at 11:54
The GetFeatureInfo requests can also return the geometry of a feature. With this you can zoom/highlight. – geographika Jun 30 '11 at 12:01
But i need to query by the name of a feature, not by a event click, is it possible? – Michel Andrade Jun 30 '11 at 12:03
You could try building a GeoExt search form to query your WMS or WFS – geographika Jun 30 '11 at 14:51

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.