From 9d691612e7164535094d7598e4069e2f8452dbbd Mon Sep 17 00:00:00 2001 From: euzuro Date: Sun, 21 May 2006 18:27:19 +0000 Subject: [PATCH] improved test code in popups.html git-svn-id: http://svn.openlayers.org/trunk/openlayers@237 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- popups.html | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/popups.html b/popups.html index 36974b7b08..6cd935a183 100644 --- a/popups.html +++ b/popups.html @@ -21,25 +21,29 @@ map.addLayer(layer); - popup = new OpenLayers.Popup("chicken"); - - map.addPopup(popup); - map.setCenter(new OpenLayers.LonLat(0, 0), 0); map.addControl(new OpenLayers.Control.LayerSwitcher()); } function changer() { popup.setBackgroundColor("red"); - popup.setSize(new OpenLayers.Size(20,200)); + popup.setSize(new OpenLayers.Size(200,20)); popup.setPx(new OpenLayers.Pixel(120,120)); popup.setOpacity(.9); popup.setBorder("2px solid"); popup.setContentHTML("High Chickens"); } + + function add() { + popup = new OpenLayers.Popup("chicken", + new OpenLayers.Pixel(400,200), + new OpenLayers.Size(200,200), + "example popup"); + + map.addPopup(popup); + } function destroy() { - alert(navigator.appName); popup.destroy(); } @@ -54,8 +58,9 @@

OpenLayers Example

-
changer
-
destroy
-
remove
+
click to add popup to map
+
click to modify popup's attributes
+
click to destroy the popup
+
click to remove the popup from map