Merge branch '2.12'
This commit is contained in:
@@ -229,7 +229,8 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
|||||||
provider = providers[i];
|
provider = providers[i];
|
||||||
for (j=0,jj=provider.coverageAreas.length; j<jj; ++j) {
|
for (j=0,jj=provider.coverageAreas.length; j<jj; ++j) {
|
||||||
coverage = provider.coverageAreas[j];
|
coverage = provider.coverageAreas[j];
|
||||||
bbox = OpenLayers.Bounds.fromArray(coverage.bbox);
|
// axis order provided is Y,X
|
||||||
|
bbox = OpenLayers.Bounds.fromArray(coverage.bbox, true);
|
||||||
if (extent.intersectsBounds(bbox) &&
|
if (extent.intersectsBounds(bbox) &&
|
||||||
zoom <= coverage.zoomMax && zoom >= coverage.zoomMin) {
|
zoom <= coverage.zoomMax && zoom >= coverage.zoomMin) {
|
||||||
copyrights += provider.attribution + " ";
|
copyrights += provider.attribution + " ";
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ var OpenLayers = {
|
|||||||
* {String} Path to this script
|
* {String} Path to this script
|
||||||
*/
|
*/
|
||||||
_getScriptLocation: (function() {
|
_getScriptLocation: (function() {
|
||||||
var r = new RegExp("(^|(.*?\\/))(OpenLayers.*?\\.js)(\\?|$)"),
|
var r = new RegExp("(^|(.*?\\/))(OpenLayers[^\\/]*?\\.js)(\\?|$)"),
|
||||||
s = document.getElementsByTagName('script'),
|
s = document.getElementsByTagName('script'),
|
||||||
src, m, l = "";
|
src, m, l = "";
|
||||||
for(var i=0, len=s.length; i<len; i++) {
|
for(var i=0, len=s.length; i<len; i++) {
|
||||||
|
|||||||
@@ -98,6 +98,25 @@
|
|||||||
map.destroy();
|
map.destroy();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_attribution_notempty(t) {
|
||||||
|
t.plan(1);
|
||||||
|
|
||||||
|
var log = [];
|
||||||
|
var map = new OpenLayers.Map("map");
|
||||||
|
layer = new OpenLayers.Layer.Bing(OpenLayers.Util.applyDefaults({type: 'Road'}, options));
|
||||||
|
map.addLayer(layer);
|
||||||
|
var format = OpenLayers.String.format;
|
||||||
|
OpenLayers.String.format = function(tpl, options) {
|
||||||
|
log.push(options.copyrights);
|
||||||
|
}
|
||||||
|
map.zoomToExtent(new OpenLayers.Bounds(-14768652, 4492113, -12263964, 5744457));
|
||||||
|
t.delay_call(2, function() {
|
||||||
|
t.ok(log.join("") !== "", "Copyright not empty");
|
||||||
|
OpenLayers.String.format = format;
|
||||||
|
map.destroy();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function test_getXYZ(t) {
|
function test_getXYZ(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<script src="some/path/OpenLayers.js"></script>
|
<script src="some/OpenLayers/path/OpenLayers.js"></script>
|
||||||
<script src="../lib/OpenLayers/SingleFile.js"></script>
|
<script src="../lib/OpenLayers/SingleFile.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function test_OpenLayers(t) {
|
function test_OpenLayers(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
t.eq(OpenLayers._getScriptLocation(), "some/path/",
|
t.eq(OpenLayers._getScriptLocation(), "some/OpenLayers/path/",
|
||||||
"Script location correctly detected (OpenLayers.js).");
|
"Script location correctly detected (OpenLayers.js).");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<script src="some/path/OpenLayers.light.js"></script>
|
<script src="some/OpenLayers/path/OpenLayers.light.js"></script>
|
||||||
<script src="../lib/OpenLayers/SingleFile.js"></script>
|
<script src="../lib/OpenLayers/SingleFile.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function test_OpenLayers(t) {
|
function test_OpenLayers(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
t.eq(OpenLayers._getScriptLocation(), "some/path/",
|
t.eq(OpenLayers._getScriptLocation(), "some/OpenLayers/path/",
|
||||||
"Script location correctly detected (OpenLayers.light.js) .");
|
"Script location correctly detected (OpenLayers.light.js) .");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<script src="some/path/OpenLayers.light.debug.js"></script>
|
<script src="some/OpenLayers/path/OpenLayers.light.debug.js"></script>
|
||||||
<script src="../lib/OpenLayers/SingleFile.js"></script>
|
<script src="../lib/OpenLayers/SingleFile.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function test_OpenLayers(t) {
|
function test_OpenLayers(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
t.eq(OpenLayers._getScriptLocation(), "some/path/",
|
t.eq(OpenLayers._getScriptLocation(), "some/OpenLayers/path/",
|
||||||
"Script location correctly detected (OpenLayers.light.debug.js).");
|
"Script location correctly detected (OpenLayers.light.debug.js).");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user