[OpenLayers-Users] PopUp Boxes
Dash
jimlug at co.clackamas.or.us
Thu Dec 3 12:15:51 EST 2009
Yes, I'm replying to my own thread. I've finally figure it out. All the
examples are a bit overwhelming but with some persistance everything works
now. For those of you struggling, try the examples in the Popup Mayhem. 3
more hours and I'm off to the beer festival:drunk:
Dash wrote:
>
> Hey folks,
>
> I am struggling to understand why my popup boxes are not displaying. I've
> read multiple articles and browsed the Users area extensively without any
> success. My ultimate goal is to create a popup for a marker. The error
> I'm receiving is px is null. Here is my code:
>
> // Create new marker and add to map
> var markers = new OpenLayers.Layer.Markers("Markers");
> map.addLayer(markers);
> // Set properties for marker
> var size = new OpenLayers.Size(20,20);
> var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
> var icon = new
> OpenLayers.Icon("http://www.clackamas.us/jimlug/images/purple-pushpin.png",
> size, offset);
> markers.addMarker(new OpenLayers.Marker(new
> OpenLayers.LonLat(-13640608.09925, 5680799.94136), icon));
>
> // Create Popup for marker
> var testPopup = new OpenLayers.Popup.AnchoredBubble("test popup",
> new OpenLayers.LonLat(-13640608.09925, 5680799.94136),
> new OpenLayers.Size(200,200),
> "test popup",
> new
> OpenLayers.Icon("http://www.clackamas.us/jimlug/images/purple-pushpin.png",
> size, offset),
> true);
>
> map.addPopup(testPopup);
>
> Any suggestions would be greatly appreciated.
> Thanks.
>
--
View this message in context: http://n2.nabble.com/PopUp-Boxes-tp4097151p4107350.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list