Compare commits
3 Commits
v5.3.1
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bc061f1c3 | ||
|
|
7232cfa3a0 | ||
|
|
2642f000fd |
@@ -14,12 +14,12 @@ if len(sys.argv) > 1:
|
|||||||
if len(sys.argv) > 2:
|
if len(sys.argv) > 2:
|
||||||
outputFilename = sys.argv[2]
|
outputFilename = sys.argv[2]
|
||||||
|
|
||||||
print "Adding license file."
|
|
||||||
merged = file("license.txt").read()
|
|
||||||
print "Merging libraries."
|
print "Merging libraries."
|
||||||
merged += mergejs.run(sourceDirectory, None, configFilename)
|
merged = mergejs.run(sourceDirectory, None, configFilename)
|
||||||
print "Compressing."
|
print "Compressing."
|
||||||
minimized = jsmin.jsmin(merged)
|
minimized = jsmin.jsmin(merged)
|
||||||
|
print "Adding license file."
|
||||||
|
minimized = file("license.txt").read() + minimized
|
||||||
|
|
||||||
print "Writing to %s." % outputFilename
|
print "Writing to %s." % outputFilename
|
||||||
file(outputFilename, "w").write(minimized)
|
file(outputFilename, "w").write(minimized)
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ OpenLayers.Control.OverviewMap.prototype =
|
|||||||
OpenLayers.Event.stop(e);
|
OpenLayers.Event.stop(e);
|
||||||
});
|
});
|
||||||
this.rectEvents = new OpenLayers.Events(this, this.extentRectangle);
|
this.rectEvents = new OpenLayers.Events(this, this.extentRectangle);
|
||||||
this.rectEvents.register('mouseover', this, this.rectMouseOver);
|
|
||||||
this.rectEvents.register('mouseout', this, this.rectMouseOut);
|
this.rectEvents.register('mouseout', this, this.rectMouseOut);
|
||||||
this.rectEvents.register('mousedown', this, this.rectMouseDown);
|
this.rectEvents.register('mousedown', this, this.rectMouseDown);
|
||||||
this.rectEvents.register('mousemove', this, this.rectMouseMove);
|
this.rectEvents.register('mousemove', this, this.rectMouseMove);
|
||||||
@@ -147,8 +146,7 @@ OpenLayers.Control.OverviewMap.prototype =
|
|||||||
|
|
||||||
// Optionally add min/max buttons if the control will go in the
|
// Optionally add min/max buttons if the control will go in the
|
||||||
// map viewport.
|
// map viewport.
|
||||||
if(!this.div.parentNode ||
|
if(!this.outsideViewport) {
|
||||||
(this.div.parentNode.className == 'olMapViewport')) {
|
|
||||||
this.div.className = 'olControlOverviewMapContainer';
|
this.div.className = 'olControlOverviewMapContainer';
|
||||||
var imgLocation = OpenLayers.Util.getImagesLocation();
|
var imgLocation = OpenLayers.Util.getImagesLocation();
|
||||||
// maximize button div
|
// maximize button div
|
||||||
@@ -187,7 +185,9 @@ OpenLayers.Control.OverviewMap.prototype =
|
|||||||
// show the overview map
|
// show the overview map
|
||||||
this.element.style.display = '';
|
this.element.style.display = '';
|
||||||
}
|
}
|
||||||
|
if(this.map.getExtent()) {
|
||||||
|
this.update();
|
||||||
|
}
|
||||||
return this.div;
|
return this.div;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -196,21 +196,23 @@ OpenLayers.Control.OverviewMap.prototype =
|
|||||||
this.map.events.unregister("changebaselayer", this, this.baseLayerDraw);
|
this.map.events.unregister("changebaselayer", this, this.baseLayerDraw);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {OpenLayers.Event} evt
|
|
||||||
*/
|
|
||||||
rectMouseOver: function (evt) {
|
|
||||||
this.extentRectangle.style.cursor = 'move';
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {OpenLayers.Event} evt
|
* @param {OpenLayers.Event} evt
|
||||||
*/
|
*/
|
||||||
rectMouseOut: function (evt) {
|
rectMouseOut: function (evt) {
|
||||||
this.extentRectangle.style.cursor = 'default';
|
|
||||||
if(this.rectDragStart != null) {
|
if(this.rectDragStart != null) {
|
||||||
if(this.performedRectDrag) {
|
if(this.performedRectDrag) {
|
||||||
|
this.rectMouseMove(evt);
|
||||||
|
var rectPxBounds = this.getRectPxBounds();
|
||||||
|
// if we're off of the overview map, update the main map
|
||||||
|
// otherwise, keep moving the rect
|
||||||
|
if((rectPxBounds.top <= 0) || (rectPxBounds.left <= 0) ||
|
||||||
|
(rectPxBounds.bottom >= this.size.h - this.hComp) ||
|
||||||
|
(rectPxBounds.right >= this.size.w - this.wComp)) {
|
||||||
this.updateMapToRect();
|
this.updateMapToRect();
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
document.onselectstart = null;
|
document.onselectstart = null;
|
||||||
this.rectDragStart = null;
|
this.rectDragStart = null;
|
||||||
|
|||||||
@@ -272,7 +272,10 @@ OpenLayers.Events.prototype = {
|
|||||||
evt.element = this.element;
|
evt.element = this.element;
|
||||||
|
|
||||||
// execute all callbacks registered for specified type
|
// execute all callbacks registered for specified type
|
||||||
var listeners = this.listeners[type];
|
// get a clone of the listeners array to
|
||||||
|
// allow for splicing during callbacks
|
||||||
|
var listeners = (this.listeners[type]) ?
|
||||||
|
this.listeners[type].slice() : null;
|
||||||
if ((listeners != null) && (listeners.length > 0)) {
|
if ((listeners != null) && (listeners.length > 0)) {
|
||||||
for (var i = 0; i < listeners.length; i++) {
|
for (var i = 0; i < listeners.length; i++) {
|
||||||
var callback = listeners[i];
|
var callback = listeners[i];
|
||||||
|
|||||||
@@ -431,16 +431,19 @@ OpenLayers.Map.prototype = {
|
|||||||
* @param {Boolean} noEvent
|
* @param {Boolean} noEvent
|
||||||
*/
|
*/
|
||||||
setBaseLayer: function(newBaseLayer, noEvent) {
|
setBaseLayer: function(newBaseLayer, noEvent) {
|
||||||
var oldBaseLayer = this.baseLayer;
|
var oldExtent = null;
|
||||||
|
if(this.baseLayer) {
|
||||||
|
oldExtent = this.baseLayer.getExtent();
|
||||||
|
}
|
||||||
|
|
||||||
if (newBaseLayer != oldBaseLayer) {
|
if (newBaseLayer != this.baseLayer) {
|
||||||
|
|
||||||
// is newBaseLayer an already loaded layer?
|
// is newBaseLayer an already loaded layer?
|
||||||
if (OpenLayers.Util.indexOf(this.layers, newBaseLayer) != -1) {
|
if (OpenLayers.Util.indexOf(this.layers, newBaseLayer) != -1) {
|
||||||
|
|
||||||
// make the old base layer invisible
|
// make the old base layer invisible
|
||||||
if (oldBaseLayer != null) {
|
if (this.baseLayer != null) {
|
||||||
oldBaseLayer.setVisibility(false, noEvent);
|
this.baseLayer.setVisibility(false, noEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set new baselayer and make it visible
|
// set new baselayer and make it visible
|
||||||
@@ -450,10 +453,10 @@ OpenLayers.Map.prototype = {
|
|||||||
//redraw all layers
|
//redraw all layers
|
||||||
var center = this.getCenter();
|
var center = this.getCenter();
|
||||||
if (center != null) {
|
if (center != null) {
|
||||||
if (oldBaseLayer == null) {
|
if (oldExtent == null) {
|
||||||
this.setCenter(center);
|
this.setCenter(center);
|
||||||
} else {
|
} else {
|
||||||
this.zoomToExtent(oldBaseLayer.getExtent());
|
this.zoomToExtent(oldExtent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,11 +483,13 @@ OpenLayers.Map.prototype = {
|
|||||||
* @param {OpenLayers.Pixel} px
|
* @param {OpenLayers.Pixel} px
|
||||||
*/
|
*/
|
||||||
addControlToMap: function (control, px) {
|
addControlToMap: function (control, px) {
|
||||||
|
// If a control doesn't have a div at this point, it belongs in the
|
||||||
|
// viewport.
|
||||||
|
control.outsideViewport = (control.div != null);
|
||||||
control.setMap(this);
|
control.setMap(this);
|
||||||
var div = control.draw(px);
|
var div = control.draw(px);
|
||||||
if (div) {
|
if (div) {
|
||||||
// only elements without parents should be appended to the viewport
|
if(!control.outsideViewport) {
|
||||||
if(!div.parentNode) {
|
|
||||||
div.style.zIndex = this.Z_INDEX_BASE['Control'] +
|
div.style.zIndex = this.Z_INDEX_BASE['Control'] +
|
||||||
this.controls.length;
|
this.controls.length;
|
||||||
this.viewPortDiv.appendChild( div );
|
this.viewPortDiv.appendChild( div );
|
||||||
|
|||||||
@@ -126,7 +126,11 @@ OpenLayers.Marker.prototype = {
|
|||||||
OpenLayers.Marker.defaultIcon = function() {
|
OpenLayers.Marker.defaultIcon = function() {
|
||||||
var url = OpenLayers.Util.getImagesLocation() + "marker.png";
|
var url = OpenLayers.Util.getImagesLocation() + "marker.png";
|
||||||
var size = new OpenLayers.Size(21, 25);
|
var size = new OpenLayers.Size(21, 25);
|
||||||
return new OpenLayers.Icon(url, size);
|
var calculateOffset = function(size) {
|
||||||
|
return new OpenLayers.Pixel(-(size.w/2), -size.h);
|
||||||
|
};
|
||||||
|
|
||||||
|
return new OpenLayers.Icon(url, size, null, calculateOffset);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -117,12 +117,14 @@ OpenLayers.Tile.Image.prototype =
|
|||||||
|
|
||||||
this.imgDiv.className = 'olTileImage';
|
this.imgDiv.className = 'olTileImage';
|
||||||
|
|
||||||
/* checkImgURL *should* pretty predictably get called after the
|
/* checkImgURL used to be used to called as a work around, but it
|
||||||
createImage / createAlphaImageDiv onLoad handler */
|
ended up hiding problems instead of solving them and broke things
|
||||||
|
like relative URLs. See discussion on the dev list:
|
||||||
|
http://openlayers.org/pipermail/dev/2007-January/000205.html
|
||||||
|
|
||||||
OpenLayers.Event.observe( this.imgDiv, "load",
|
OpenLayers.Event.observe( this.imgDiv, "load",
|
||||||
this.checkImgURL.bindAsEventListener(this) );
|
this.checkImgURL.bindAsEventListener(this) );
|
||||||
|
*/
|
||||||
this.layer.div.appendChild(this.imgDiv);
|
this.layer.div.appendChild(this.imgDiv);
|
||||||
if(this.layer.opacity != null) {
|
if(this.layer.opacity != null) {
|
||||||
|
|
||||||
@@ -140,6 +142,14 @@ OpenLayers.Tile.Image.prototype =
|
|||||||
* when the new URL loads in the image, or (b) we don't want to display
|
* when the new URL loads in the image, or (b) we don't want to display
|
||||||
* this tile after all because its new bounds are outside our maxExtent.
|
* this tile after all because its new bounds are outside our maxExtent.
|
||||||
*
|
*
|
||||||
|
* This function should no longer be neccesary with the improvements to
|
||||||
|
* Grid.js in OpenLayers 2.3. The lack of a good isEquivilantURL function
|
||||||
|
* caused problems in 2.2, but it's possible that with the improved
|
||||||
|
* isEquivilant URL function, this might be neccesary at some point.
|
||||||
|
*
|
||||||
|
* See discussion in the thread at
|
||||||
|
* http://openlayers.org/pipermail/dev/2007-January/000205.html
|
||||||
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
checkImgURL: function () {
|
checkImgURL: function () {
|
||||||
|
|||||||
@@ -568,11 +568,10 @@ OpenLayers.Util.distVincenty=function(p1, p2) {
|
|||||||
*/
|
*/
|
||||||
OpenLayers.Util.getArgs = function(url) {
|
OpenLayers.Util.getArgs = function(url) {
|
||||||
if(url == null) {
|
if(url == null) {
|
||||||
var query = window.location.search.substring(1);
|
url = window.location.href;
|
||||||
} else {
|
|
||||||
var query = (url.indexOf('?') == -1) ?
|
|
||||||
'' : url.substring(url.indexOf('?') + 1);
|
|
||||||
}
|
}
|
||||||
|
var query = (url.indexOf('?') != -1) ? url.substring(url.indexOf('?') + 1) : '';
|
||||||
|
|
||||||
var args = new Object();
|
var args = new Object();
|
||||||
pairs = query.split(/[&;]/);
|
pairs = query.split(/[&;]/);
|
||||||
for(var i = 0; i < pairs.length; ++i) {
|
for(var i = 0; i < pairs.length; ++i) {
|
||||||
@@ -747,11 +746,36 @@ OpenLayers.Util.isEquivalentUrl = function(url1, url2, options) {
|
|||||||
urlObj1 = OpenLayers.Util.createUrlObject(url1, options);
|
urlObj1 = OpenLayers.Util.createUrlObject(url1, options);
|
||||||
urlObj2 = OpenLayers.Util.createUrlObject(url2, options);
|
urlObj2 = OpenLayers.Util.createUrlObject(url2, options);
|
||||||
|
|
||||||
//compare keys (host, port, etc)
|
//compare all keys (host, port, etc)
|
||||||
for(var key in urlObj1) {
|
for(var key in urlObj1) {
|
||||||
|
if (options.test) {
|
||||||
|
alert(key + "\n1:" + urlObj1[key] + "\n2:" + urlObj2[key]);
|
||||||
|
}
|
||||||
|
var val1 = urlObj1[key];
|
||||||
|
var val2 = urlObj2[key];
|
||||||
|
|
||||||
|
switch(key) {
|
||||||
|
case "args":
|
||||||
|
//do nothing, they'll be treated below
|
||||||
|
break;
|
||||||
|
case "host":
|
||||||
|
case "port":
|
||||||
|
case "protocol":
|
||||||
|
if ((val1 == "") || (val2 == "")) {
|
||||||
|
//these will be blank for relative urls, so no need to
|
||||||
|
// compare them here -- call break.
|
||||||
|
//
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// otherwise continue with default compare
|
||||||
|
//
|
||||||
|
default:
|
||||||
if ( (key != "args") && (urlObj1[key] != urlObj2[key]) ) {
|
if ( (key != "args") && (urlObj1[key] != urlObj2[key]) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// compare search args - irrespective of order
|
// compare search args - irrespective of order
|
||||||
@@ -789,18 +813,8 @@ OpenLayers.Util.createUrlObject = function(url, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var a = document.createElement('a');
|
var a = document.createElement('a');
|
||||||
|
|
||||||
a.href = url;
|
a.href = url;
|
||||||
|
|
||||||
//protocol
|
|
||||||
urlObject.protocol = a.protocol;
|
|
||||||
|
|
||||||
//pathname (this part allows for relative <-> absolute comparison)
|
|
||||||
urlObject.pathname = a.pathname;
|
|
||||||
|
|
||||||
//hash
|
|
||||||
urlObject.hash = (options.ignoreHash) ? "" : a.hash;
|
|
||||||
|
|
||||||
//host (without port)
|
//host (without port)
|
||||||
urlObject.host = a.host;
|
urlObject.host = a.host;
|
||||||
var port = a.port;
|
var port = a.port;
|
||||||
@@ -809,12 +823,103 @@ OpenLayers.Util.createUrlObject = function(url, options) {
|
|||||||
urlObject.host = urlObject.host.substring(0, newHostLength);
|
urlObject.host = urlObject.host.substring(0, newHostLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//protocol
|
||||||
|
urlObject.protocol = a.protocol;
|
||||||
|
|
||||||
//port
|
//port
|
||||||
urlObject.port = ((port == "80") && (options.ignorePort80)) ? "" : port;
|
urlObject.port = ((port == "80") && (options.ignorePort80)) ? "" : port;
|
||||||
|
|
||||||
|
//hash
|
||||||
|
urlObject.hash = (options.ignoreHash) ? "" : a.hash;
|
||||||
|
|
||||||
//args
|
//args
|
||||||
urlObject.args = OpenLayers.Util.getArgs(a.search);
|
var queryString = a.search;
|
||||||
|
if (!queryString) {
|
||||||
|
var qMark = url.indexOf("?");
|
||||||
|
queryString = (qMark != -1) ? url.substr(qMark) : "";
|
||||||
|
}
|
||||||
|
urlObject.args = OpenLayers.Util.getArgs(queryString);
|
||||||
|
|
||||||
|
|
||||||
|
//pathname (this part allows for relative <-> absolute comparison)
|
||||||
|
if ( ((urlObject.protocol == "file:") && (url.indexOf("file:") != -1)) ||
|
||||||
|
((urlObject.protocol != "file:") && (urlObject.host != "")) ) {
|
||||||
|
|
||||||
|
urlObject.pathname = a.pathname;
|
||||||
|
|
||||||
|
//Test to see if the pathname includes the arguments (Opera)
|
||||||
|
var qIndex = urlObject.pathname.indexOf("?");
|
||||||
|
if (qIndex != -1) {
|
||||||
|
urlObject.pathname = urlObject.pathname.substring(0, qIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
var relStr = OpenLayers.Util.removeTail(url);
|
||||||
|
|
||||||
|
var backs = 0;
|
||||||
|
do {
|
||||||
|
var index = relStr.indexOf("../");
|
||||||
|
|
||||||
|
if (index == 0) {
|
||||||
|
backs++
|
||||||
|
relStr = relStr.substr(3);
|
||||||
|
} else if (index >= 0) {
|
||||||
|
var prevChunk = relStr.substr(0,index - 1);
|
||||||
|
|
||||||
|
var slash = prevChunk.indexOf("/");
|
||||||
|
prevChunk = (slash != -1) ? prevChunk.substr(0, slash +1)
|
||||||
|
: "";
|
||||||
|
|
||||||
|
var postChunk = relStr.substr(index + 3);
|
||||||
|
relStr = prevChunk + postChunk;
|
||||||
|
}
|
||||||
|
} while(index != -1)
|
||||||
|
|
||||||
|
var windowAnchor = document.createElement("a");
|
||||||
|
var windowUrl = window.location.href;
|
||||||
|
if (options.ignoreCase) {
|
||||||
|
windowUrl = windowUrl.toLowerCase();
|
||||||
|
}
|
||||||
|
windowAnchor.href = windowUrl;
|
||||||
|
|
||||||
|
//set protocol of window
|
||||||
|
urlObject.protocol = windowAnchor.protocol;
|
||||||
|
|
||||||
|
var splitter = (windowAnchor.pathname.indexOf("/") != -1) ? "/" : "\\";
|
||||||
|
var dirs = windowAnchor.pathname.split(splitter);
|
||||||
|
dirs.pop(); //remove filename
|
||||||
|
while ((backs > 0) && (dirs.length > 0)) {
|
||||||
|
dirs.pop();
|
||||||
|
backs--;
|
||||||
|
}
|
||||||
|
relStr = dirs.join("/") + "/"+ relStr;
|
||||||
|
urlObject.pathname = relStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((urlObject.protocol == "file:") || (urlObject.protocol == "")) {
|
||||||
|
urlObject.host = "localhost";
|
||||||
|
}
|
||||||
|
|
||||||
return urlObject;
|
return urlObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} url
|
||||||
|
*
|
||||||
|
* @returns The string with all queryString and Hash removed
|
||||||
|
* @type String
|
||||||
|
*/
|
||||||
|
OpenLayers.Util.removeTail = function(url) {
|
||||||
|
var head = null;
|
||||||
|
|
||||||
|
var qMark = url.indexOf("?");
|
||||||
|
var hashMark = url.indexOf("#");
|
||||||
|
|
||||||
|
if (qMark == -1) {
|
||||||
|
head = (hashMark != -1) ? url.substr(0,hashMark) : url;
|
||||||
|
} else {
|
||||||
|
head = (hashMark != -1) ? url.substr(0,Math.min(qMark, hashMark))
|
||||||
|
: url.substr(0, qMark);
|
||||||
|
}
|
||||||
|
return head;
|
||||||
|
};
|
||||||
@@ -24,16 +24,14 @@
|
|||||||
t.eq( cloned.url, "b", "cloned.url does change when edited" );
|
t.eq( cloned.url, "b", "cloned.url does change when edited" );
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_02_Marker_setOpacity(t) {
|
function test_03_Marker_setOpacity(t) {
|
||||||
t.plan( 2 );
|
t.plan( 2 );
|
||||||
|
|
||||||
icon = new OpenLayers.Icon("a",new OpenLayers.Size(5,6));
|
icon = new OpenLayers.Icon("a",new OpenLayers.Size(5,6));
|
||||||
|
|
||||||
t.ok(!icon.imageDiv.style.opacity, "default icon has no opacity");
|
t.ok(!icon.imageDiv.style.opacity, "default icon has no opacity");
|
||||||
|
|
||||||
icon.setOpacity(0.5);
|
icon.setOpacity(0.5);
|
||||||
|
t.eq(parseFloat(icon.imageDiv.style.opacity), 0.5, "icon.setOpacity() works");
|
||||||
t.eq(icon.imageDiv.style.opacity + "", "0.5", "icon.setOpacity() works");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -->
|
// -->
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
var isMozilla = (navigator.userAgent.indexOf("compatible") == -1);
|
var isMozilla = (navigator.userAgent.indexOf("compatible") == -1);
|
||||||
|
var isOpera = (navigator.userAgent.indexOf("Opera") != -1);
|
||||||
var layer;
|
var layer;
|
||||||
|
|
||||||
function test_01_Layer_EventPane_constructor (t) {
|
function test_01_Layer_EventPane_constructor (t) {
|
||||||
@@ -56,7 +57,7 @@
|
|||||||
// MOUSEMOVE test does not seem to work...
|
// MOUSEMOVE test does not seem to work...
|
||||||
// t.plan( 2 );
|
// t.plan( 2 );
|
||||||
|
|
||||||
if (document.createEventObject) {
|
if (!isMozilla || isOpera) {
|
||||||
t.plan(4);
|
t.plan(4);
|
||||||
} else {
|
} else {
|
||||||
t.plan(3);
|
t.plan(3);
|
||||||
|
|||||||
@@ -181,14 +181,14 @@
|
|||||||
map.addLayer(tLayer);
|
map.addLayer(tLayer);
|
||||||
map.zoomToMaxExtent();
|
map.zoomToMaxExtent();
|
||||||
t.eq(tLayer.opacity, "0.5", "Opacity is set correctly");
|
t.eq(tLayer.opacity, "0.5", "Opacity is set correctly");
|
||||||
t.eq(tLayer.div.firstChild.style.opacity, "0.5", "Opacity on tile is correct");
|
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.5, "Opacity on tile is correct");
|
||||||
tLayer.setOpacity("0.6");
|
tLayer.setOpacity("0.6");
|
||||||
t.eq(tLayer.opacity, "0.6", "setOpacity works properly");
|
t.eq(tLayer.opacity, "0.6", "setOpacity works properly");
|
||||||
t.eq(tLayer.div.firstChild.style.opacity, "0.6", "Opacity on tile is changed correctly");
|
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly");
|
||||||
var pixel = new OpenLayers.Pixel(5,6);
|
var pixel = new OpenLayers.Pixel(5,6);
|
||||||
var tile = tLayer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel);
|
var tile = tLayer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel);
|
||||||
tile.draw();
|
tile.draw();
|
||||||
t.eq(tile.imgDiv.style.opacity, "0.6", "Tile opacity is set correctly");
|
t.eq(parseFloat(tile.imgDiv.style.opacity), 0.6, "Tile opacity is set correctly");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_02_Marker_setOpacity(t) {
|
function test_03_Marker_setOpacity(t) {
|
||||||
t.plan( 2 );
|
t.plan( 2 );
|
||||||
|
|
||||||
var map = new OpenLayers.Map("map");
|
var map = new OpenLayers.Map("map");
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
marker.setOpacity(0.5);
|
marker.setOpacity(0.5);
|
||||||
|
|
||||||
t.eq(marker.icon.imageDiv.style.opacity + "", "0.5", "marker.setOpacity() works");
|
t.eq(parseFloat(marker.icon.imageDiv.style.opacity), 0.5, "marker.setOpacity() works");
|
||||||
}
|
}
|
||||||
|
|
||||||
// -->
|
// -->
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
var h = 400;
|
var h = 400;
|
||||||
var content = "charlie";
|
var content = "charlie";
|
||||||
var color = "red";
|
var color = "red";
|
||||||
|
var hexColor = "#ff0000";
|
||||||
var opacity = 0.5;
|
var opacity = 0.5;
|
||||||
var border = "1px solid";
|
var border = "1px solid";
|
||||||
|
|
||||||
@@ -89,7 +90,9 @@
|
|||||||
t.eq(contentDiv.style.overflow, "hidden", "correct content div overflow");
|
t.eq(contentDiv.style.overflow, "hidden", "correct content div overflow");
|
||||||
t.eq(contentDiv.innerHTML, content, "correct content div content");
|
t.eq(contentDiv.innerHTML, content, "correct content div content");
|
||||||
|
|
||||||
t.eq(popup.div.style.backgroundColor, color, "good default popup.backgroundColor");
|
var bColor = popup.div.style.backgroundColor;
|
||||||
|
var goodColor = ( (bColor == color) || (bColor == hexColor));
|
||||||
|
t.ok(goodColor, "good default popup.backgroundColor");
|
||||||
|
|
||||||
if (navigator.appName.indexOf("Microsoft") == -1) {
|
if (navigator.appName.indexOf("Microsoft") == -1) {
|
||||||
t.eq(parseFloat(popup.div.style.opacity), opacity, "good default popup.opacity");
|
t.eq(parseFloat(popup.div.style.opacity), opacity, "good default popup.opacity");
|
||||||
|
|||||||
@@ -67,12 +67,15 @@
|
|||||||
t.eq( div.style.width, sz.w + "px", "div.style.width set correctly");
|
t.eq( div.style.width, sz.w + "px", "div.style.width set correctly");
|
||||||
t.eq( div.style.height, sz.h + "px", "div.style.height set correctly");
|
t.eq( div.style.height, sz.h + "px", "div.style.height set correctly");
|
||||||
|
|
||||||
t.eq( div.style.backgroundImage, "url(" + img + ")", "div.style.backgroundImage correctly");
|
bImg = div.style.backgroundImage;
|
||||||
|
imgCorrect = ( (bImg == "url(" + img + ")") ||
|
||||||
|
(bImg == "url(\"" + img + "\")") );
|
||||||
|
t.ok(imgCorrect, "div.style.backgroundImage correctly");
|
||||||
|
|
||||||
t.eq( div.style.position, position, "div.style.positionset correctly");
|
t.eq( div.style.position, position, "div.style.positionset correctly");
|
||||||
t.ok( (div.style.border.indexOf(border) != -1), "div.style.border set correctly");
|
t.ok( (div.style.border.indexOf(border) != -1), "div.style.border set correctly");
|
||||||
t.eq( div.style.overflow, overflow, "div.style.overflow set correctly");
|
t.eq( div.style.overflow, overflow, "div.style.overflow set correctly");
|
||||||
t.eq( div.style.opacity + "", opacity + "", "elemnt.style.opacity set correctly");
|
t.eq( parseFloat(div.style.opacity), opacity, "element.style.opacity set correctly");
|
||||||
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
|
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
|
||||||
t.eq( div.style.filter, filterString, "element.style.filter set correctly");
|
t.eq( div.style.filter, filterString, "element.style.filter set correctly");
|
||||||
|
|
||||||
@@ -95,7 +98,7 @@
|
|||||||
t.eq( div.style.position, "absolute", "div.style.positionset correctly");
|
t.eq( div.style.position, "absolute", "div.style.positionset correctly");
|
||||||
t.eq( div.style.border, "", "div.style.border set correctly");
|
t.eq( div.style.border, "", "div.style.border set correctly");
|
||||||
t.eq(div.style.overflow, "", "div.style.overflow set correctly");
|
t.eq(div.style.overflow, "", "div.style.overflow set correctly");
|
||||||
t.ok( !div.style.opacity, "elemnt.style.opacity set correctly");
|
t.ok( !div.style.opacity, "element.style.opacity set correctly");
|
||||||
t.ok( !div.style.filter, "element.style.filter set correctly");
|
t.ok( !div.style.filter, "element.style.filter set correctly");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -116,7 +119,7 @@
|
|||||||
if (!isMozilla)
|
if (!isMozilla)
|
||||||
t.ok( true, "skipping element test outside of Mozilla");
|
t.ok( true, "skipping element test outside of Mozilla");
|
||||||
else
|
else
|
||||||
t.ok( image instanceof HTMLImageElement, "createImage creates a valid HTMLImageElement" );
|
t.ok( image.nodeName == "IMG", "createImage creates a valid HTMLImageElement" );
|
||||||
t.eq( image.id, id, "image.id set correctly");
|
t.eq( image.id, id, "image.id set correctly");
|
||||||
t.eq( image.style.left, xy.x + "px", "image.style.left set correctly");
|
t.eq( image.style.left, xy.x + "px", "image.style.left set correctly");
|
||||||
t.eq( image.style.top, xy.y + "px", "image.style.top set correctly");
|
t.eq( image.style.top, xy.y + "px", "image.style.top set correctly");
|
||||||
@@ -127,7 +130,7 @@
|
|||||||
t.ok( (image.style.border.indexOf(border) != -1), "image.style.border set correctly");
|
t.ok( (image.style.border.indexOf(border) != -1), "image.style.border set correctly");
|
||||||
t.eq( image.src, img, "image.style.backgroundImage correctly");
|
t.eq( image.src, img, "image.style.backgroundImage correctly");
|
||||||
t.eq( image.style.position, position, "image.style.position set correctly");
|
t.eq( image.style.position, position, "image.style.position set correctly");
|
||||||
t.eq( image.style.opacity+"", opacity + "", "image.style.opacity set correctly");
|
t.eq( parseFloat(image.style.opacity), opacity, "image.style.opacity set correctly");
|
||||||
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
|
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
|
||||||
t.eq( image.style.filter, filterString, "element.style.filter set correctly");
|
t.eq( image.style.filter, filterString, "element.style.filter set correctly");
|
||||||
|
|
||||||
@@ -137,7 +140,7 @@
|
|||||||
if (!isMozilla)
|
if (!isMozilla)
|
||||||
t.ok( true, "skipping element test outside of Mozilla");
|
t.ok( true, "skipping element test outside of Mozilla");
|
||||||
else
|
else
|
||||||
t.ok( image instanceof HTMLImageElement, "createDiv creates a valid HTMLDivElement" );
|
t.ok( image.nodeName == "IMG", "createDiv creates a valid HTMLDivElement" );
|
||||||
t.ok( (image.id != ""), "image.id set to something");
|
t.ok( (image.id != ""), "image.id set to something");
|
||||||
t.eq( image.style.left, "", "image.style.left set correctly");
|
t.eq( image.style.left, "", "image.style.left set correctly");
|
||||||
t.eq( image.style.top, "", "image.style.top set correctly");
|
t.eq( image.style.top, "", "image.style.top set correctly");
|
||||||
@@ -148,7 +151,7 @@
|
|||||||
t.ok((image.style.border == ""), "image.style.border set correctly");
|
t.ok((image.style.border == ""), "image.style.border set correctly");
|
||||||
t.eq(image.src, "", "image.style.backgroundImage correctly");
|
t.eq(image.src, "", "image.style.backgroundImage correctly");
|
||||||
t.eq( image.style.position, "relative", "image.style.positionset correctly");
|
t.eq( image.style.position, "relative", "image.style.positionset correctly");
|
||||||
t.ok( !image.style.opacity, "elemnt.style.opacity default unset");
|
t.ok( !image.style.opacity, "element.style.opacity default unset");
|
||||||
t.ok( !image.style.filter, "element.style.filter default unset");
|
t.ok( !image.style.filter, "element.style.filter default unset");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -211,7 +214,7 @@
|
|||||||
t.eq( imageDiv.style.height, sz.h + "px", "image.style.height set correctly");
|
t.eq( imageDiv.style.height, sz.h + "px", "image.style.height set correctly");
|
||||||
|
|
||||||
t.eq( imageDiv.style.position, position, "image.style.positionset correctly");
|
t.eq( imageDiv.style.position, position, "image.style.positionset correctly");
|
||||||
t.eq( imageDiv.style.opacity+"", opacity + "", "elemnt.style.opacity set correctly");
|
t.eq( parseFloat(imageDiv.style.opacity), opacity, "element.style.opacity set correctly");
|
||||||
|
|
||||||
var filterString;
|
var filterString;
|
||||||
if (OpenLayers.Util.alphaHack()) {
|
if (OpenLayers.Util.alphaHack()) {
|
||||||
@@ -223,11 +226,10 @@
|
|||||||
|
|
||||||
|
|
||||||
image = imageDiv.firstChild;
|
image = imageDiv.firstChild;
|
||||||
|
|
||||||
if (!isMozilla)
|
if (!isMozilla)
|
||||||
t.ok( true, "skipping element test outside of Mozilla");
|
t.ok( true, "skipping element test outside of Mozilla");
|
||||||
else
|
else
|
||||||
t.ok( image instanceof HTMLImageElement, "createImage creates a valid HTMLImageElement" );
|
t.ok( image.nodeName == "IMG", "createImage creates a valid HTMLImageElement" );
|
||||||
t.eq( image.id, id + "_innerImage", "image.id set correctly");
|
t.eq( image.id, id + "_innerImage", "image.id set correctly");
|
||||||
|
|
||||||
t.eq( image.style.width, sz.w + "px", "image.style.width set correctly");
|
t.eq( image.style.width, sz.w + "px", "image.style.width set correctly");
|
||||||
@@ -293,7 +295,7 @@
|
|||||||
t.eq( element.style.position, position, "element.style.position set correctly");
|
t.eq( element.style.position, position, "element.style.position set correctly");
|
||||||
t.ok( (element.style.border.indexOf(border) != -1), "element.style.border set correctly");
|
t.ok( (element.style.border.indexOf(border) != -1), "element.style.border set correctly");
|
||||||
t.eq( element.style.overflow, overflow, "element.style.overflow set correctly");
|
t.eq( element.style.overflow, overflow, "element.style.overflow set correctly");
|
||||||
t.eq( element.style.opacity+"", opacity + "", "elemnt.style.opacity set correctly");
|
t.eq( parseFloat(element.style.opacity), opacity, "element.style.opacity set correctly");
|
||||||
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
|
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
|
||||||
t.eq( element.style.filter, filterString, "element.style.filter set correctly");
|
t.eq( element.style.filter, filterString, "element.style.filter set correctly");
|
||||||
}
|
}
|
||||||
@@ -313,11 +315,10 @@
|
|||||||
var opacity = 0.5;
|
var opacity = 0.5;
|
||||||
|
|
||||||
OpenLayers.Util.modifyAlphaImageDiv(imageDiv, id, xy, sz, img, position, border, sizing, opacity);
|
OpenLayers.Util.modifyAlphaImageDiv(imageDiv, id, xy, sz, img, position, border, sizing, opacity);
|
||||||
|
|
||||||
if (OpenLayers.Util.alphaHack())
|
if (OpenLayers.Util.alphaHack())
|
||||||
t.ok( true, "skipping element test outside of Mozilla");
|
t.ok( true, "skipping element test outside of Mozilla");
|
||||||
else
|
else
|
||||||
t.ok( imageDiv instanceof HTMLDivElement, "createDiv creates a valid HTMLDivElement" );
|
t.ok( imageDiv.nodeName == "DIV", "createDiv creates a valid HTMLDivElement" );
|
||||||
|
|
||||||
t.eq( imageDiv.id, id, "image.id set correctly");
|
t.eq( imageDiv.id, id, "image.id set correctly");
|
||||||
t.eq( imageDiv.style.left, xy.x + "px", "image.style.left set correctly");
|
t.eq( imageDiv.style.left, xy.x + "px", "image.style.left set correctly");
|
||||||
@@ -327,7 +328,7 @@
|
|||||||
t.eq( imageDiv.style.height, sz.h + "px", "image.style.height set correctly");
|
t.eq( imageDiv.style.height, sz.h + "px", "image.style.height set correctly");
|
||||||
|
|
||||||
t.eq( imageDiv.style.position, position, "image.style.position set correctly");
|
t.eq( imageDiv.style.position, position, "image.style.position set correctly");
|
||||||
t.eq( imageDiv.style.opacity+"", opacity + "", "elemnt.style.opacity set correctly");
|
t.eq( parseFloat(imageDiv.style.opacity), opacity, "element.style.opacity set correctly");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -339,7 +340,7 @@
|
|||||||
t.ok( true, "skipping element test outside of Mozilla");
|
t.ok( true, "skipping element test outside of Mozilla");
|
||||||
} else {
|
} else {
|
||||||
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
|
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
|
||||||
t.ok( image instanceof HTMLImageElement, "createImage creates a valid HTMLImageElement" );
|
t.ok( image.nodeName == "IMG", "createImage creates a valid HTMLImageElement" );
|
||||||
}
|
}
|
||||||
t.eq( imageDiv.style.filter, filterString, "element.style.filter set correctly");
|
t.eq( imageDiv.style.filter, filterString, "element.style.filter set correctly");
|
||||||
t.eq( image.id, id + "_innerImage", "image.id set correctly");
|
t.eq( image.id, id + "_innerImage", "image.id set correctly");
|
||||||
@@ -516,14 +517,14 @@
|
|||||||
url2 = "http://www.openlayers.org";
|
url2 = "http://www.openlayers.org";
|
||||||
|
|
||||||
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "default ignorePort80 works");
|
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "default ignorePort80 works");
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
'ignorePort80': false
|
'ignorePort80': false
|
||||||
}
|
}
|
||||||
|
|
||||||
url1 = "http://www.openlayers.org:80";
|
url1 = "http://www.openlayers.org:80";
|
||||||
url2 = "http://www.openlayers.org:50";
|
url2 = "http://www.openlayers.org:50";
|
||||||
|
|
||||||
t.ok(!OpenLayers.Util.isEquivalentUrl(url1, url2), "port check works");
|
t.ok(!OpenLayers.Util.isEquivalentUrl(url1, url2, options), "port check works");
|
||||||
|
|
||||||
|
|
||||||
//HASH
|
//HASH
|
||||||
@@ -546,8 +547,8 @@
|
|||||||
|
|
||||||
|
|
||||||
//PATHNAME
|
//PATHNAME
|
||||||
url1 = "foo.html";
|
url1 = "foo.html?bar=now#go";
|
||||||
url2 = "../tests/foo.html";
|
url2 = "../tests/../tests/foo.html?bar=now#go";
|
||||||
|
|
||||||
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "relative vs. absolute paths works");
|
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "relative vs. absolute paths works");
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ div.olControlMousePosition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.olControlOverviewMapExtentRectangle {
|
.olControlOverviewMapExtentRectangle {
|
||||||
|
cursor: move;
|
||||||
border: 2px dotted red;
|
border: 2px dotted red;
|
||||||
}
|
}
|
||||||
.olLayerGeoRSSDescription {
|
.olLayerGeoRSSDescription {
|
||||||
|
|||||||
Reference in New Issue
Block a user