[OpenLayers-Users] Markers with popup

Robert Buzink post at robertbuzink.nl
Mon Jan 8 10:26:25 EST 2007


hi Yves,

You already managed, so just for extra info:

I use the OpenLayers.Layer.Text() method. I get info from a sql-database and
make a csv 'file' of it on the fly with php, using echo statements and tabs
(\t) and linebreaks (\n). In addition, the script can take a category from
the url to enable different overlays ( markers.txt.php?overlay=houses,
markers.txt.php?overlay=trees, etc.).

There are some drawbacks though. Any linebreaks in the description-field
will mess up the csv, for example. Using xml (georss) will be more robust, I
guess, although one must escape html-tags properly, otherwise the xml-syntax
returns errors.

I chose for csv because it is supported in the current stable version of
openlayers. GeoRSS isn't, or is it?

Robert.

On 1/5/07, Yves Jacolin <yjacolin at free.fr> wrote:
>
> Le Vendredi 5 Janvier 2007 14:44, Nick Whitelegg a écrit:
> > 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
> Hi Nick,
>
> Thanks you for your answer. I didn't know that I could use geoRSS.
>
> Do you think it is possible to manage this using OpenLayers.Layer.Text()
> method ?
>
> i.e. retrieve xml, convert it to variable setup like a csv file and send
> it to
> the method above ?
>
> Thanks,
>
> Y.
> --
> Yves Jacolin
> ---
> HBS-Research
> 51 rue de Verdun
> 92 158 Suresnes CEDEX
> Tél. : 01 46 97 25 14
> Fax : 01 46 97 20 10
>
> --
> Yves Jacolin
> ---
> http://yjacolin.gloobe.org
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Robert Buzink, website ontwerp en ontwikkeling
Sint-Pietersaalststraat 123
9000 Gent
+32 (0)9 33 00 267
+32 (0)487 548 414
post at robertbuzink.nl
robertbuzink.nl/webdesign
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070108/00ab2c5a/attachment.html


More information about the Users mailing list