[OpenLayers-Users] Markers with popup

Nick Whitelegg nick at hogweed.org
Fri Jan 5 08:44:43 EST 2007


On Friday 05 Jan 2007 13:25, Yves Jacolin wrote:
> Hi,
>
> I am trying to work with OpenLayers. I am a beginer in javascript, sorry
> for basic questions.
>
> I want to display a different popup for each points. My points come from a
> postgresql DB that I retrieve using AJAX. All informations (lon, lat, icon,
> html for popup) are in a variable. I am using the code from the popups.html
> examples.
>
> My problem is I can't manage the HTML content for each marker. In the
> popups.html example, there are one marker and so one content.
>
> Thanks for your answer.
>
> Y.

Hello Yves,

This sounds kind of similar to what I'm doing. If you make your points 
available as a GeoRSS feed, you can use the "GeoRSS2" layer available at

http://www.free-map.org.uk/test/GeoRSS2.js

which creates markers from a GeoRSS feed.
There is a load() method which takes a bounding box and loads all markers in 
that box.

There is a full example at

http://www.free-map.org.uk/test/fmap.html

You might want to look at the code for that.

Part of the code is a generic "GeoRSSClient" class which allows the user to 
add and remove markers. This is at

http://www.free-map.org.uk/test/GeoRSSClient.js

Let me know if you need more details on any of this. 

Nick





More information about the Users mailing list