[OpenLayers-Users] Adding multiple anchored popups
Eric Lemoine
eric.c2c at gmail.com
Fri Dec 21 00:38:34 EST 2007
On Dec 21, 2007 1:56 AM, Bradley McLain
<bradley_mclain at debortoliwines.com> wrote:
> Currently I have an array of location details that I am running through a
> simple while loop to populate my map with markers.
>
> This is working perfect and is as follows.
>
> var markers = new OpenLayers.Layer.Markers
> ( "Markers" );
> map.addLayer(markers);
>
> //Setting Size and Offset of Markers
> var size = new OpenLayers.Size(20,34);
> var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
>
> var site = 0;
>
>
> while (site < locationList.length)
> {
> var icon = new OpenLayers.Icon('../../img/gmarker.png',size,offset);
> markers.addMarker(
> new OpenLayers.Marker(new
> OpenLayers.LonLat(locationList[site].lon,locationList[site].lat),icon));
>
> site++;
>
> }
>
> What I want to do is add anchored popups to all of these markers, having
> each one work properly, I've tried hacking around with the example but I can
> only ever get one to add at a time.
>
>
> Any help with this would be much appreciated.
Hello
Could you share the code where you try to add and display popups?
Thanks,
--
Eric
More information about the Users
mailing list