Merge pull request #99 from elemoine/deprecate-rico
Deprecate Popup.AnchoredBubble and Rico
This commit is contained in:
@@ -8,6 +8,16 @@
|
||||
|
||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
|
||||
<style>
|
||||
/* round corners of layer switcher, and make it transparent */
|
||||
.olControlLayerSwitcher .layersDiv {
|
||||
border-radius: 10px 0 0 10px;
|
||||
opacity: 0.75;
|
||||
filter: alpha(opacity=75);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
var map;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 37 KiB |
@@ -44,22 +44,6 @@
|
||||
'maxSize': new OpenLayers.Size(100,100)
|
||||
});
|
||||
|
||||
//anchoredbubble
|
||||
|
||||
AutoSizeAnchoredBubble = OpenLayers.Class(OpenLayers.Popup.AnchoredBubble, {
|
||||
'autoSize': true
|
||||
});
|
||||
|
||||
AutoSizeAnchoredBubbleMinSize = OpenLayers.Class(OpenLayers.Popup.AnchoredBubble, {
|
||||
'autoSize': true,
|
||||
'minSize': new OpenLayers.Size(400,400)
|
||||
});
|
||||
|
||||
AutoSizeAnchoredBubbleMaxSize = OpenLayers.Class(OpenLayers.Popup.AnchoredBubble, {
|
||||
'autoSize': true,
|
||||
'maxSize': new OpenLayers.Size(100,100)
|
||||
});
|
||||
|
||||
//framed
|
||||
|
||||
//disable the autosize for the purpose of our matrix
|
||||
@@ -342,247 +326,6 @@
|
||||
popupContentHTML = '<img src="img/widelong.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true, true);
|
||||
|
||||
|
||||
//
|
||||
//Bubble NO OVERFLOW
|
||||
//
|
||||
|
||||
//anchored bubble popup small contents no autosize
|
||||
var ll = new OpenLayers.LonLat(-55,5);
|
||||
popupClass = OpenLayers.Popup.AnchoredBubble;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false);
|
||||
|
||||
//anchored bubble popup small contents no autosize closebox
|
||||
var ll = new OpenLayers.LonLat(-50,5);
|
||||
popupClass = OpenLayers.Popup.AnchoredBubble;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true);
|
||||
|
||||
|
||||
//anchored bubble popup small contents autosize
|
||||
ll = new OpenLayers.LonLat(-40,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false);
|
||||
|
||||
//anchored bubble popup small contents autosize closebox
|
||||
ll = new OpenLayers.LonLat(-35,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true);
|
||||
|
||||
|
||||
//anchored bubble popup small contents autosize minsize
|
||||
ll = new OpenLayers.LonLat(-25,5);
|
||||
popupClass = AutoSizeAnchoredBubbleMinSize;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false);
|
||||
|
||||
//anchored bubble popup small contents autosize minsize closebox
|
||||
ll = new OpenLayers.LonLat(-20,5);
|
||||
popupClass = AutoSizeAnchoredBubbleMinSize;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true);
|
||||
|
||||
|
||||
//anchored bubble popup small contents autosize maxsize
|
||||
ll = new OpenLayers.LonLat(-10,5);
|
||||
popupClass = AutoSizeAnchoredBubbleMaxSize;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false);
|
||||
|
||||
//anchored bubble popup small contents autosize maxsize closebox
|
||||
ll = new OpenLayers.LonLat(-5,5);
|
||||
popupClass = AutoSizeAnchoredBubbleMaxSize;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true);
|
||||
|
||||
|
||||
//anchored bubble popup bigger contents autosize closebox
|
||||
ll = new OpenLayers.LonLat(5,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>' + samplePopupContentsHTML + '</div>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false);
|
||||
|
||||
//anchored bubble popup bigger contents autosize closebox
|
||||
ll = new OpenLayers.LonLat(10,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>closebox<br>' + samplePopupContentsHTML + '</div>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true);
|
||||
|
||||
|
||||
//anchored bubble popup wide short text contents autosize
|
||||
ll = new OpenLayers.LonLat(20,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize - wide short text<br>' + samplePopupContentsHTML_WideShort + '</div>';
|
||||
addMarker(ll, popupClass, popupContentHTML);
|
||||
|
||||
//anchored bubble popup wide short text contents autosize closebox
|
||||
ll = new OpenLayers.LonLat(25,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize - wide short text<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true);
|
||||
|
||||
|
||||
//anchored bubble popup wide short fixed contents autosize
|
||||
ll = new OpenLayers.LonLat(35,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML);
|
||||
|
||||
//anchored bubble popup wide short fixed contents autosize closebox
|
||||
ll = new OpenLayers.LonLat(40,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true);
|
||||
|
||||
|
||||
//anchored bubble popup thin long fixed contents autosize
|
||||
ll = new OpenLayers.LonLat(50,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML);
|
||||
|
||||
//anchored bubble popup thin long fixed contents autosize closebox
|
||||
ll = new OpenLayers.LonLat(55,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true);
|
||||
|
||||
|
||||
//anchored bubble popup wide long fixed contents autosize
|
||||
ll = new OpenLayers.LonLat(65,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/widelong.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML);
|
||||
|
||||
//anchored bubble popup wide long fixed contents autosize closebox
|
||||
ll = new OpenLayers.LonLat(70,5);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/widelong.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true);
|
||||
|
||||
//
|
||||
//Bubble OVERFLOW
|
||||
//
|
||||
|
||||
//anchored bubble popup small contents no autosize
|
||||
var ll = new OpenLayers.LonLat(-55,0);
|
||||
popupClass = OpenLayers.Popup.AnchoredBubble;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false, true);
|
||||
|
||||
//anchored bubble popup small contents no autosize closebox
|
||||
var ll = new OpenLayers.LonLat(-50,0);
|
||||
popupClass = OpenLayers.Popup.AnchoredBubble;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true, true);
|
||||
|
||||
|
||||
//anchored bubble popup small contents autosize
|
||||
ll = new OpenLayers.LonLat(-40,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false, true);
|
||||
|
||||
//anchored bubble popup small contents autosize closebox
|
||||
ll = new OpenLayers.LonLat(-35,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true, true);
|
||||
|
||||
|
||||
//anchored bubble popup small contents autosize minsize
|
||||
ll = new OpenLayers.LonLat(-25,0);
|
||||
popupClass = AutoSizeAnchoredBubbleMinSize;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false, true);
|
||||
|
||||
//anchored bubble popup small contents autosize minsize closebox
|
||||
ll = new OpenLayers.LonLat(-20,0);
|
||||
popupClass = AutoSizeAnchoredBubbleMinSize;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true, true);
|
||||
|
||||
|
||||
//anchored bubble popup small contents autosize maxsize
|
||||
ll = new OpenLayers.LonLat(-10,0);
|
||||
popupClass = AutoSizeAnchoredBubbleMaxSize;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false, true);
|
||||
|
||||
//anchored bubble popup small contents autosize maxsize closebox
|
||||
ll = new OpenLayers.LonLat(-5,0);
|
||||
popupClass = AutoSizeAnchoredBubbleMaxSize;
|
||||
popupContentHTML = '<img src="img/small.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true, true);
|
||||
|
||||
|
||||
//anchored bubble popup bigger contents autosize closebox
|
||||
ll = new OpenLayers.LonLat(5,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>overflow<br>' + samplePopupContentsHTML + '</div>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false, true);
|
||||
|
||||
//anchored bubble popup bigger contents autosize closebox
|
||||
ll = new OpenLayers.LonLat(10,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>closebox<br>overflow<br>' + samplePopupContentsHTML + '</div>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true, true);
|
||||
|
||||
|
||||
//anchored bubble popup wide short contents autosize overflow
|
||||
ll = new OpenLayers.LonLat(20,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>overflow<br>' + samplePopupContentsHTML_WideShort + '</div>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false, true);
|
||||
|
||||
//anchored bubble popup wide short contents autosize closebox overflow
|
||||
ll = new OpenLayers.LonLat(25,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>overflow<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true, true);
|
||||
|
||||
|
||||
//anchored bubble popup wide short fixed contents autosize overflow
|
||||
ll = new OpenLayers.LonLat(35,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false, true);
|
||||
|
||||
//anchored bubble popup wide short fixed contents autosize closebox overflow
|
||||
ll = new OpenLayers.LonLat(40,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true, true);
|
||||
|
||||
|
||||
//anchored bubble popup thin long fixed contents autosize overflow
|
||||
ll = new OpenLayers.LonLat(50,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false, true);
|
||||
|
||||
//anchored bubble popup thin long fixed contents autosize closebox overflow
|
||||
ll = new OpenLayers.LonLat(55,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true, true);
|
||||
|
||||
|
||||
//anchored bubble popup wide long fixed contents autosize overflow
|
||||
ll = new OpenLayers.LonLat(65,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/widelong.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, false, true);
|
||||
|
||||
//anchored bubble popup wide long fixed contents autosize closebox overflow
|
||||
ll = new OpenLayers.LonLat(70,0);
|
||||
popupClass = AutoSizeAnchoredBubble;
|
||||
popupContentHTML = '<img src="img/widelong.jpg"></img>';
|
||||
addMarker(ll, popupClass, popupContentHTML, true, true);
|
||||
|
||||
//FRAMED
|
||||
|
||||
//
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
var map, layer, popup;
|
||||
var markers, feature, marker;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map('map');
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
layer = new OpenLayers.Layer.Google( "Google" );
|
||||
map.addLayer(layer);
|
||||
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.zoomToMaxExtent();
|
||||
|
||||
}
|
||||
|
||||
function changer() {
|
||||
popup.setBackgroundColor("red");
|
||||
popup.setSize(new OpenLayers.Size(100,600));
|
||||
// popup.moveTo(new OpenLayers.Pixel(120,120));
|
||||
// popup.setOpacity(.5);
|
||||
popup.setBorder("2px solid");
|
||||
popup.setContentHTML("High Chickens");
|
||||
}
|
||||
|
||||
function add() {
|
||||
popup = new OpenLayers.Popup("chicken",
|
||||
new OpenLayers.LonLat(5,40),
|
||||
new OpenLayers.Size(200,200),
|
||||
"example popup",
|
||||
true);
|
||||
popup.closeOnMove = true;
|
||||
|
||||
map.addPopup(popup);
|
||||
}
|
||||
|
||||
function addAnchor() {
|
||||
popup = new OpenLayers.Popup.Anchored("chicken",
|
||||
new OpenLayers.LonLat(5,40),
|
||||
new OpenLayers.Size(200,200),
|
||||
"example popup", true);
|
||||
|
||||
map.addPopup(popup);
|
||||
}
|
||||
|
||||
function addMarker() {
|
||||
|
||||
markers = new OpenLayers.Layer.Markers("zibo");
|
||||
map.addLayer(markers);
|
||||
|
||||
feature = new OpenLayers.Feature(layer,
|
||||
new OpenLayers.LonLat(0,0));
|
||||
|
||||
|
||||
marker = feature.createMarker();
|
||||
|
||||
markers.addMarker(marker);
|
||||
marker.events.register("mousedown", marker, mousedown);
|
||||
|
||||
}
|
||||
|
||||
function mousedown(evt) {
|
||||
if (popup == null) {
|
||||
popup = feature.createPopup(true);
|
||||
popup.setContentHTML("<div style='background-color:red; width:150;height:100'><a href='http://www.somethingconstructive.net' target='_blank'>click me</a></div>");
|
||||
popup.setBackgroundColor("yellow");
|
||||
popup.setOpacity(0.7);
|
||||
markers.map.addPopup(popup);
|
||||
} else {
|
||||
popup.toggle();
|
||||
}
|
||||
OpenLayers.Event.stop(evt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
function onPopupMouseDown(evt) {
|
||||
markers.map.removePopup(popup);
|
||||
popup.destroy();
|
||||
popup = null;
|
||||
OpenLayers.Event.stop(evt);
|
||||
}
|
||||
|
||||
|
||||
function destroy() {
|
||||
popup.destroy();
|
||||
}
|
||||
|
||||
function remove() {
|
||||
markers.removeMarker(marker);
|
||||
}
|
||||
|
||||
function removelayer() {
|
||||
layer.destroy();
|
||||
// map.removeLayer(markers);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1 id="title">Popup Mayhem</h1>
|
||||
|
||||
<div id="tags">
|
||||
popup, popups
|
||||
</div>
|
||||
<p id="shortdesc">
|
||||
All kinds of ways to create and interact with Popups.
|
||||
</p>
|
||||
|
||||
<div id="map" class="smallmap"></div>
|
||||
<p>If you open an anchoredbubble and switch to google, it shouldn't crash. If it does, don't release OpenLayers.</p>
|
||||
<div style="background-color:purple" onclick="add()"> click to add Popup to map</div>
|
||||
<div style="background-color:green" onclick="addMarker()"> click to add a Marker with an AnchoredBubble popup</div>
|
||||
<div style="background-color:blue" onclick="changer()"> click to modify popup's attributes</div>
|
||||
<div style="background-color:red" onclick="remove()"> click to remove the popup from map</div>
|
||||
<div style="background-color:gray" onclick="removelayer()"> click to remove the markers layer</div>
|
||||
<div style="background-color:orange" onclick="alert(marker.onScreen())"> marker.onscreen()?</div>
|
||||
<div style="background-color:yellow" onclick="destroy()"> click to destroy the popup from map</div>
|
||||
<div id="docs">
|
||||
Detailed description of this example needs to be written.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,7 +6,7 @@
|
||||
/**
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Lang.js
|
||||
* @requires Rico/Corner.js
|
||||
* @requires OpenLayers/Console.js
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -28,9 +28,13 @@ OpenLayers.Control.LayerSwitcher =
|
||||
/**
|
||||
* APIProperty: roundedCorner
|
||||
* {Boolean} If true the Rico library is used for rounding the corners
|
||||
* of the layer switcher div, defaults to true.
|
||||
* of the layer switcher div, defaults to false. *Deprecated*. Use
|
||||
* CSS3's border-radius instead. If this option is set to true the
|
||||
* Rico/Corner.js script must be loaded in the page, and therefore
|
||||
* listed in the build profile.
|
||||
*
|
||||
*/
|
||||
roundedCorner: true,
|
||||
roundedCorner: false,
|
||||
|
||||
/**
|
||||
* APIProperty: roundedCornerColor
|
||||
@@ -115,6 +119,10 @@ OpenLayers.Control.LayerSwitcher =
|
||||
initialize: function(options) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
this.layerStates = [];
|
||||
|
||||
if(this.roundedCorner) {
|
||||
OpenLayers.Console.warn('roundedCorner option is deprecated');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,7 @@ OpenLayers.Feature = OpenLayers.Class({
|
||||
/**
|
||||
* APIProperty: popupClass
|
||||
* {<OpenLayers.Class>} The class which will be used to instantiate
|
||||
* a new Popup. Default is <OpenLayers.Popup.AnchoredBubble>.
|
||||
* a new Popup. Default is <OpenLayers.Popup.Anchored>.
|
||||
*/
|
||||
popupClass: null,
|
||||
|
||||
@@ -188,7 +188,7 @@ OpenLayers.Feature = OpenLayers.Class({
|
||||
if (!this.popup) {
|
||||
var anchor = (this.marker) ? this.marker.icon : null;
|
||||
var popupClass = this.popupClass ?
|
||||
this.popupClass : OpenLayers.Popup.AnchoredBubble;
|
||||
this.popupClass : OpenLayers.Popup.Anchored;
|
||||
this.popup = new popupClass(this.id + "_popup",
|
||||
this.lonlat,
|
||||
this.data.popupSize,
|
||||
|
||||
@@ -162,8 +162,8 @@ OpenLayers.Popup.Anchored =
|
||||
*
|
||||
* Note that in the classic Anchored popup, there is nothing to do
|
||||
* here, since the popup looks exactly the same in all four positions.
|
||||
* Subclasses such as the AnchoredBubble and Framed, however, will
|
||||
* want to do something special here.
|
||||
* Subclasses such as Framed, however, will want to do something
|
||||
* special here.
|
||||
*/
|
||||
updateRelativePosition: function() {
|
||||
//to be overridden by subclasses
|
||||
|
||||
@@ -6,11 +6,14 @@
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Popup/Anchored.js
|
||||
* @requires OpenLayers/Console.js
|
||||
* @requires Rico/Corner.js
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class: OpenLayers.Popup.AnchoredBubble
|
||||
* This class is *deprecated*. Use {<OpenLayers.Popup.Anchored>} and
|
||||
* round corners using CSS3's border-radius property.
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Popup.Anchored>
|
||||
@@ -40,6 +43,8 @@ OpenLayers.Popup.AnchoredBubble =
|
||||
*/
|
||||
initialize:function(id, lonlat, contentSize, contentHTML, anchor, closeBox,
|
||||
closeBoxCallback) {
|
||||
|
||||
OpenLayers.Console.warn('AnchoredBubble is deprecated');
|
||||
|
||||
this.padding = new OpenLayers.Bounds(
|
||||
0, OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @requires OpenLayers/Console.js
|
||||
* @requires OpenLayers/BaseTypes/Class.js
|
||||
* @requires OpenLayers/BaseTypes/Element.js
|
||||
*/
|
||||
@@ -10,6 +11,9 @@
|
||||
*
|
||||
* This file is licensed under the Apache License, Version 2.0.
|
||||
*/
|
||||
|
||||
OpenLayers.Console.warn("OpenLayers.Rico is deprecated");
|
||||
|
||||
OpenLayers.Rico = OpenLayers.Rico || {};
|
||||
OpenLayers.Rico.Color = OpenLayers.Class({
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @requires OpenLayers/Console.js
|
||||
* @requires Rico/Color.js
|
||||
*/
|
||||
|
||||
@@ -22,6 +23,9 @@
|
||||
* permissions * and limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
OpenLayers.Console.warn("OpenLayers.Rico is deprecated");
|
||||
|
||||
OpenLayers.Rico = OpenLayers.Rico || {};
|
||||
OpenLayers.Rico.Corner = {
|
||||
|
||||
@@ -332,4 +336,4 @@ OpenLayers.Rico.Corner = {
|
||||
_isTopRounded: function() { return this._hasString(this.options.corners, "all", "top", "tl", "tr"); },
|
||||
_isBottomRounded: function() { return this._hasString(this.options.corners, "all", "bottom", "bl", "br"); },
|
||||
_hasSingleTextChild: function(el) { return el.childNodes.length == 1 && el.childNodes[0].nodeType == 3; }
|
||||
};
|
||||
};
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
function test_Control_LayerSwitcher_ascendingw (t) {
|
||||
function test_Control_LayerSwitcher_ascending (t) {
|
||||
|
||||
t.plan( 4 );
|
||||
|
||||
@@ -158,10 +158,10 @@
|
||||
map.addControl(control);
|
||||
control2 = new OpenLayers.Control.LayerSwitcher({'ascending':false});
|
||||
map.addControl(control2);
|
||||
t.ok(control.div.childNodes[1].childNodes[0].innerHTML.match("Base Layer"), "Base Layers first in LayerSwitcher with ascending true");
|
||||
t.ok(control.div.childNodes[1].childNodes[2].innerHTML.match("Overlays"), "Overlays in LayerSwitcher with ascending true");
|
||||
t.ok(control2.div.childNodes[1].childNodes[2].innerHTML.match("Base Layer"), "Base Layers last in LayerSwitcher with ascending false");
|
||||
t.ok(control2.div.childNodes[1].childNodes[0].innerHTML.match("Overlays"), "Base Layers last in LayerSwitcher with ascending false");
|
||||
t.ok(control.div.childNodes[0].childNodes[0].innerHTML.match("Base Layer"), "Base Layers first in LayerSwitcher with ascending true");
|
||||
t.ok(control.div.childNodes[0].childNodes[2].innerHTML.match("Overlays"), "Overlays in LayerSwitcher with ascending true");
|
||||
t.ok(control2.div.childNodes[0].childNodes[2].innerHTML.match("Base Layer"), "Base Layers last in LayerSwitcher with ascending false");
|
||||
t.ok(control2.div.childNodes[0].childNodes[0].innerHTML.match("Overlays"), "Base Layers last in LayerSwitcher with ascending false");
|
||||
}
|
||||
|
||||
function test_Control_LayerSwitcher_displayInLayerSwitcher (t) {
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
control = new OpenLayers.Control.LayerSwitcher();
|
||||
map.addControl(control);
|
||||
t.eq(control.div.childNodes[1].childNodes[0].style.display, "none" , "Base layer display off when no visble base layer");
|
||||
t.eq(control.div.childNodes[0].childNodes[0].style.display, "none" , "Base layer display off when no visble base layer");
|
||||
|
||||
map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.WMS("WMS",
|
||||
@@ -186,7 +186,7 @@
|
||||
|
||||
control = new OpenLayers.Control.LayerSwitcher();
|
||||
map.addControl(control);
|
||||
t.eq(control.div.childNodes[1].childNodes[0].style.display, "" , "Base layer display on when visble base layer");
|
||||
t.eq(control.div.childNodes[0].childNodes[0].style.display, "" , "Base layer display on when visble base layer");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
//Safari 3 separates style overflow into overflow-x and overflow-y
|
||||
var prop = (OpenLayers.BROWSER_NAME == 'safari') ? 'overflowX' : 'overflow';
|
||||
t.eq(popup.contentDiv.style[prop], "auto", 'overflow on popup is correct');
|
||||
t.ok( popup instanceof OpenLayers.Popup.AnchoredBubble, "popup is an AnchoredBubble by defaults");
|
||||
t.ok( popup instanceof OpenLayers.Popup.Anchored, "popup is a Popup.Anchored by default");
|
||||
feature.destroyPopup();
|
||||
|
||||
feature.popupClass = OpenLayers.Popup.FramedCloud;
|
||||
|
||||
@@ -318,10 +318,8 @@ div.olControlSaveFeaturesItemInactive {
|
||||
padding-top: 5px;
|
||||
padding-left: 10px;
|
||||
padding-bottom: 5px;
|
||||
padding-right: 75px;
|
||||
padding-right: 10px;
|
||||
background-color: darkblue;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.olControlLayerSwitcher .layersDiv .baseLbl,
|
||||
|
||||
Reference in New Issue
Block a user