[OpenLayers-Users] Adding multiple anchored popups

Bradley McLain bradley_mclain at debortoliwines.com
Thu Dec 20 19:56:25 EST 2007


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.

Brad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071221/5008c5c3/attachment.html


More information about the Users mailing list