[OpenLayers-Users] PopUp Boxes
Dash
jimlug at co.clackamas.or.us
Tue Dec 1 18:59:40 EST 2009
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-tp4097151p4097151.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list