add member variables, constants, getters and setters, and tests for id, px, size, content html, background color, opacity, border
git-svn-id: http://svn.openlayers.org/trunk/openlayers@232 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
27
popups.html
27
popups.html
@@ -21,10 +21,7 @@
|
||||
|
||||
map.addLayer(layer);
|
||||
|
||||
popup = new OpenLayers.Popup("chicken",
|
||||
new OpenLayers.Pixel(20,240),
|
||||
new OpenLayers.Size(500,100)
|
||||
);
|
||||
popup = new OpenLayers.Popup("chicken");
|
||||
|
||||
map.addPopup(popup);
|
||||
|
||||
@@ -32,15 +29,33 @@
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
}
|
||||
|
||||
function away() {
|
||||
function changer() {
|
||||
popup.setBackgroundColor("red");
|
||||
popup.setSize(new OpenLayers.Size(20,200));
|
||||
popup.setPx(new OpenLayers.Pixel(120,120));
|
||||
popup.setOpacity(.9);
|
||||
popup.setBorder("2px solid");
|
||||
popup.setContentHTML("High Chickens");
|
||||
}
|
||||
|
||||
function destroy() {
|
||||
alert(navigator.appName);
|
||||
popup.destroy();
|
||||
}
|
||||
|
||||
function remove() {
|
||||
map.removePopup(popup);
|
||||
}
|
||||
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers Example</h1>
|
||||
<div id="map"></div>
|
||||
<div style="background-color:blue" onclick="away()"> hello</div>
|
||||
<div style="background-color:blue" onclick="changer()"> changer</div>
|
||||
<div style="background-color:red" onclick="destroy()"> destroy</div>
|
||||
<div style="background-color:green" onclick="remove()"> remove</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user