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 have a many polygons on my map serving through WMS from geoserver. I want to implement the task such that when the user clicks on a particular polygon , he should be directed to a html page about that polygon. Like if I click on my CSE Dept I should be directed to my cse dept home page.

Need help in achieving this...

I have followed as but when I try "http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=IITKanpur:halls&styles=iitk_halllinks&bbox=80.226,26.504,80.235,26.512&width=512&height=455&srs=EPSG:4326&format=text/html" I am not getting anything.

My iitk_halllinks sld is :

<Rule> <Name>href</Name> <PointSymbolizer><Graphic><Size>16</Size></Graphic></PointSymbolizer> <TextSymbolizer><Label><PropertyName>halls_link</PropertyName></Label></TextSymbolizer> </Rule>

share|improve this question
up vote 3 down vote accepted

You can install the imagemap extension and follow the the example which allows you to request the map using text/html. This will provide the ability to click on a polygon

share|improve this answer

Use this example:

But instead of doing this:

    eventListeners: {
        getfeatureinfo: function(event) {
            map.addPopup(new OpenLayers.Popup.FramedCloud(

replace the above for something like this:

eventListeners: {
    getfeatureinfo: function(event) {"" +, "window_name","location=1,status=1,scrollbars=1,resizable=no,width=650,height=650");
share|improve this answer
this works for a single polgon, but I have multiple polygons in my layer – Vikash Talanki Jun 4 '11 at 10:11
@user1795 > no, this works with one or N polygons. That's why the script is passing the id dynamically – simo Jun 6 '11 at 12:08
@user: like simo said, this will work with any amount of polygons. Just pass the polygon id in the URL on the click event ( and your polygoninfo.php page can query that ID for all of it's information. – CaptDragon Jun 6 '11 at 13:01

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.