Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

In the ArcGIS Server JS API the Popup object may be defined against an array of features.

In that case the Popup contains Next/Previous buttons to allow the user to "page" through each feature in turn, as in this example where there are multiple coincident features at the chosen location:

enter image description here

Is this possible using OpenLayers? That is, given an array of features can I easily navigate the infoWindow forward/backward to display the relevant information for each feature?

Thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I don't think there is a default OpenLayers way of doing this (although I am happy to be proved wrong), but you could build one yourself within a standard 'single feature' popup. We've done something similar on our application Dorset Explorer 3.

We basically loop though all the results and build a list, each of them clickable with more information. Try it out and maybe you'll get some inspiration. Just go to the link, open the Layer Control (on the right, icon of two rectangles on top of each other) and turn on a couple of layers such as Rights of Way (In countryside folder), Counties, Districts (In Administrative Boundaries folder) etc. and then do an info search by clicking once at a point and it should return multiple results. You'll see they are grouped by Layer Name and list all features found at the point you clicked.

I know this isn't necessarily an answer but I hope it gives you some food for thought. It certainly wasn't going to fit in a comment!

share|improve this answer
    
Thanks Rob, that looks like a good approach. Very nice site, by the way! –  Stephen Lead Aug 12 '12 at 23:22
    
Thankyou! I can't take the credit for that one, I just took over from the original devs and started making it a bit slicker :) –  Rob Quincey Aug 13 '12 at 8:03

Your Answer

 
discard

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.