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

Ok so I have a Openlayers App which is displaying few of the features and I now want to give the user the freedom to create a Box or polygon. All the features which are overlapped by this user defined box, I wish to export the data and then display it onto a table in the html.

  1. Is there any OL example to such application requirement?
  2. Which would be better to extract the feature info, WFS or WMS?

I know it can be done in GMaps but I have OSM and GMaps both as base maps so I require a OL functionality.

share|improve this question
up vote 1 down vote accepted

Custom Control

Hold Shift button to create the rectangle

You will get the bound box lat/lng response.

You can use this response to retrieve features.

Dynamic POIs via a Text Layer

In this example the data you see is retrieved from a text file but could be from a geojson,kml or database/api or geoserver

Get WFS from Geoserver (Web Feature Service)

This get the WFS service from Geoserver and displays in Openlayers

use the Shift key to add features to the selection,

You will want to combine the entire set of examples to do your 'select user defined polygon' map.

share|improve this answer
Thanks @Mapperz this is just what I needed – Sam007 Jun 7 '12 at 22:28

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.