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 shapefile polygons. I'm using OpenLayers with OpenStreetMap tiles. Is it possible to create hover effect which will show up info window with some informations about that polygons? Is it the best to put it in some database maybe? Thank you.

share|improve this question
up vote 2 down vote accepted

SelectFeature popup. Example can be easily changed to Hover instead of Select

different way to do popups

Select with a hover (but no info box)

...all the reference are there, you'll just need to put the pieces together.

share|improve this answer
Ok, thank you. I have one more question. If I would need to add one more shapefile with roads on the top of the map (over layer with those shapefiles), would that selectfeature popup still be working? – againstflow Aug 13 '12 at 17:44
Shapefiles don't work on OL. You'll have to convert (e.g. KML) or publish somewhere (e.g. ArcGIS). The new select handlers accept an Array of layers. So as long as the features aren't stacked you can click multiple layers. If they are stacked - search for "clustering" here or online – Vadim Aug 13 '12 at 17:46
Ok, great, I have KMLs, too. No, roads shapefile would be line, and those shapefiles with popups would be polyongs. Polygons would be overlayed with lines. Is there a way to organize text in popups considering I have four informations for every polygon (name, address, url, etc)? That would need to be shown one under another so what is the best way to show it in popup? – againstflow Aug 13 '12 at 17:50
I thought popups used conventional html and css for layout and styling. – Michael Markieta Aug 13 '12 at 18: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.