Compare commits

...

5 Commits

Author SHA1 Message Date
crschmidt
0560abf9b4 Tagging 2.2-RC2.
git-svn-id: http://svn.openlayers.org/tags/openlayers/release-2.2-rc2@1741 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-27 21:24:23 +00:00
euzuro
d9847bbb37 bringing up r1719 from trunk
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.2@1720 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-24 15:30:56 +00:00
euzuro
168f79482b brought up r1717 from trunk
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.2@1718 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-23 17:48:35 +00:00
euzuro
b8064015f6 pullup of 1713 from trunk
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.2@1714 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-22 17:15:12 +00:00
Schuyler Erle
d4d843e57f Branching OpenLayers 2.2 release.
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.2@1708 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-20 18:36:39 +00:00
61 changed files with 566 additions and 160 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
rm ../doc/reference.html rm ../doc/reference.html
CLASSES="Map Layer Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MousePosition Control.MouseToolbar Control.OverviewMap Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds Util Ajax" CLASSES="Map Layer Layer.Image Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MousePosition Control.MouseToolbar Control.OverviewMap Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds Util Ajax"
echo "<html> echo "<html>
<head> <head>
<title>OpenLayers Class Reference Documentation</title> <title>OpenLayers Class Reference Documentation</title>

View File

@@ -10,5 +10,4 @@ Rico/Corner.js
[include] [include]
[exclude] [exclude]
OpenLayers/Layer/Yahoo.js
OpenLayers/Control/KeyboardDefaults.js OpenLayers/Control/KeyboardDefaults.js

View File

@@ -2,8 +2,8 @@
OpenLayers.js -- OpenLayers Map Viewer Library OpenLayers.js -- OpenLayers Map Viewer Library
Copyright 2005-2006 MetaCarta, Inc., released under the BSD License. Copyright 2005-2006 MetaCarta, Inc., released under the BSD license.
Please see http://svn.openlayers.org/trunk/openlayers/license.txt Please see http://svn.openlayers.org/trunk/openlayers/release-license.txt
for the full text of the license. for the full text of the license.
Includes compressed code under the following licenses: Includes compressed code under the following licenses:

View File

@@ -13,7 +13,7 @@ A small control which displays the Longitude and Latitude of the current mouse p
separator -- html to separate the longitude and latitude values (default: '<br />') separator -- html to separate the longitude and latitude values (default: '<br />')
suffix -- html to follow the latitude value (default: '') suffix -- html to follow the latitude value (default: '')
numdigits -- number of digits to the right of the decimal (default: 5) numdigits -- number of digits to the right of the decimal (default: 5)
granularity -- a change of how many pixels is considered a mouse move (default: 1) granularity -- Don't refresh display if mouse has moved more than this (default: 10)
prefix, separator, and suffix are used to format the lon/lat values. prefix, separator, and suffix are used to format the lon/lat values.

9
doc/Layer.Image.txt Normal file
View File

@@ -0,0 +1,9 @@
OpenLayers.Layer.Image
The Image Layer allows you to load a single image and use it as a layer in your
map.
* Constructor
OpenLayers.Layer(name, url, {OpenLayers.Bounds|bounds}, {OpenLayers.Size|size}, {options}) -- Image Layer constructor requires a name, URL of the image, geographic bounds of the image, pixel size of the image, and an optional options parameter.

51
examples/image-layer.html Normal file
View File

@@ -0,0 +1,51 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
p {
width: 512px;
}
#map {
width: 512px;
height: 256px;
border: 1px solid gray;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
function init(){
var map = new OpenLayers.Map('map');
var options = {maxResolution: 'auto', numZoomLevels: 3};
var graphic = new OpenLayers.Layer.Image(
'City Lights',
'http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif',
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
new OpenLayers.Size(580, 288),
options);
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://wms.jpl.nasa.gov/wms.cgi",
{layers: "modis,global_mosaic"}, options);
map.addLayers([graphic, jpl_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Image Layer Example</h1>
<div id="map"></div>
<p>
The "City Lights" layer above is created from a single web accessible
image. If you construct it without any resolution related options,
the layer will be given a single resolution based on the extent/size.
Otherwise, it behaves much like a regular layer. This is primarily
intended to be used in an overview map - where another layer type
might not make a good overview.
</p>
</body>
</html>

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
//// ////
/// This blob sucks in all the files in uncompressed form for ease of use /// This blob sucks in all the files in uncompressed form for ease of use
/// ///
@@ -65,6 +66,7 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
"OpenLayers/Feature/WFS.js", "OpenLayers/Feature/WFS.js",
"OpenLayers/Tile/Image.js", "OpenLayers/Tile/Image.js",
"OpenLayers/Tile/WFS.js", "OpenLayers/Tile/WFS.js",
"OpenLayers/Layer/Image.js",
"OpenLayers/Layer/EventPane.js", "OpenLayers/Layer/EventPane.js",
"OpenLayers/Layer/FixedZoomLevels.js", "OpenLayers/Layer/FixedZoomLevels.js",
"OpenLayers/Layer/Google.js", "OpenLayers/Layer/Google.js",

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
OpenLayers.ProxyHost = ""; OpenLayers.ProxyHost = "";
//OpenLayers.ProxyHost = "examples/proxy.cgi?url="; //OpenLayers.ProxyHost = "examples/proxy.cgi?url=";

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/* OpenLayers.Class metaclass */ /* OpenLayers.Class metaclass */
OpenLayers.Class = { OpenLayers.Class = {

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,6 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class
@@ -27,7 +28,7 @@ OpenLayers.Control.MousePosition.prototype =
numdigits: 5, numdigits: 5,
/** @type int */ /** @type int */
granularity: 1, granularity: 10,
/** @type OpenLayers.LonLat */ /** @type OpenLayers.LonLat */
lastXy: null, lastXy: null,

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,3 +1,6 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* for the full text of the license. */
/** /**
* @fileoverview Locator Map Control * @fileoverview Locator Map Control
* @author Tim Schaub * @author Tim Schaub
@@ -11,7 +14,7 @@
OpenLayers.Control.OverviewMap = OpenLayers.Class.create(); OpenLayers.Control.OverviewMap = OpenLayers.Class.create();
OpenLayers.Control.OverviewMap.prototype = OpenLayers.Control.OverviewMap.prototype =
OpenLayers.Util.extend( new OpenLayers.Control(), { OpenLayers.Class.inherit( OpenLayers.Control, {
/** For div.id /** For div.id
* @type String */ * @type String */

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
OpenLayers.Event = { OpenLayers.Event = {
KEY_BACKSPACE: 8, KEY_BACKSPACE: 8,

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class
@@ -226,7 +227,7 @@ OpenLayers.Layer.Google.prototype =
html += " correct API key for your site.<br>"; html += " correct API key for your site.<br>";
html += "<br>"; html += "<br>";
html += "Developers: For help getting this working correctly, "; html += "Developers: For help getting this working correctly, ";
html += "<a href='http://trac.openlayers.org/wiki/GoogleMapsLayer' " html += "<a href='http://trac.openlayers.org/wiki/Google' "
html += "target='_blank'>"; html += "target='_blank'>";
html += "click here"; html += "click here";
html += "</a>"; html += "</a>";

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -0,0 +1,161 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* for the full text of the license. */
/**
* @fileoverview Image Layer
* @author Tim Schaub
*/
/**
* @class
*
* @requires OpenLayers/Layer.js
*/
OpenLayers.Layer.Image = OpenLayers.Class.create();
OpenLayers.Layer.Image.prototype =
OpenLayers.Class.inherit(OpenLayers.Layer, {
/** By default, Layer.Image will be a baselayer
*
* @type Boolean */
isBaseLayer: true,
/** @type String */
url: null,
/** @type OpenLayers.Bounds */
extent: null,
/** @type OpenLayers.Size */
size: null,
/** @type OpenLayers.Tile.Image */
tile: null,
/** The ratio of height/width represented by a single pixel in the graphic
*
* @type Float */
aspectRatio: null,
/**
* @constructor
*
* @param {String} name
* @param {String} url Relative or absolute path to the image
* @param {OpenLayers.Bounds} extent The extent represented by the image
* @param {OpenLayers.Size} size The size (in pixels) of the image
* @param {Object} options Hashtable of extra options to tag onto the layer
*/
initialize: function(name, url, extent, size, options) {
this.url = url;
this.extent = extent;
this.size = size;
OpenLayers.Layer.prototype.initialize.apply(this, [name, options]);
this.aspectRatio = (this.extent.getHeight() / this.size.h) /
(this.extent.getWidth() / this.size.w);
},
/**
*
*/
destroy: function() {
this.tile.destroy();
this.tile = null;
OpenLayers.Layer.prototype.destroy.apply(this, arguments);
},
/**
* @param {Object} obj
*
* @returns An exact clone of this OpenLayers.Layer.Image
* @type OpenLayers.Layer.Image
*/
clone: function(obj) {
if(obj == null) {
obj = new OpenLayers.Layer.Image(this.name,
this.url,
this.extent,
this.size,
this.options);
}
//get all additions from superclasses
obj = OpenLayers.Layer.prototype.clone.apply(this, [obj]);
// copy/set any non-init, non-simple values here
return obj;
},
/**
* @param {OpenLayers.Map} map
*/
setMap: function(map) {
// If nothing to do with resolutions has been set, assume a single
// resolution determined by extent/size
if( this.options.maxResolution == null ) {
this.options.maxResolution = this.extent.getWidth() / this.size.w;
}
OpenLayers.Layer.prototype.setMap.apply(this, arguments);
},
/** Create the tile for the image or resize it for the new resolution
*
* @param {OpenLayers.Bounds} bounds
* @param {Boolean} zoomChanged
* @param {Boolean} dragging
*/
moveTo:function(bounds, zoomChanged, dragging) {
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
var firstRendering = (this.tile == null);
if(zoomChanged || firstRendering) {
//determine new tile size
var tileWidth = this.extent.getWidth() / this.map.getResolution();
var tileHeight = this.extent.getHeight() /
(this.map.getResolution() * this.aspectRatio);
var tileSize = new OpenLayers.Size(tileWidth, tileHeight);
//determine new position (upper left corner of new bounds)
var ul = new OpenLayers.LonLat(this.extent.left, this.extent.top);
var ulPx = this.map.getLayerPxFromLonLat(ul);
if(firstRendering) {
//create the new tile
this.tile = new OpenLayers.Tile.Image(this, ulPx, this.extent,
this.url, tileSize);
} else {
//just resize the tile and set it's new position
this.tile.size = tileSize.clone();
this.tile.position = ulPx.clone();
}
this.tile.draw();
}
},
/**
* @param {String} newUrl
*/
setUrl: function(newUrl) {
this.url = newUrl;
this.draw();
},
/** The url we return is always the same (the image itself never changes)
* so we can ignore the bounds parameter (it will always be the same,
* anyways)
*
* @param {OpenLayers.Bounds} bounds
*/
getURL: function(bounds) {
return this.url;
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Layer.Image"
});

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,6 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
// @requires OpenLayers/Layer/Grid.js // @requires OpenLayers/Layer/Grid.js
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,6 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class
@@ -65,7 +65,7 @@ OpenLayers.Layer.MultiMap.prototype =
html += " script was either not correctly included.<br>"; html += " script was either not correctly included.<br>";
html += "<br>"; html += "<br>";
html += "Demmlopers: For help getting this working correctly, "; html += "Demmlopers: For help getting this working correctly, ";
html += "<a href='http://trac.openlayers.org/wiki/MultiMapLayer' " html += "<a href='http://trac.openlayers.org/wiki/MultiMap' "
html += "target='_blank'>"; html += "target='_blank'>";
html += "click here"; html += "click here";
html += "</a>"; html += "</a>";

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class
@@ -80,7 +81,7 @@ OpenLayers.Layer.VirtualEarth.prototype =
html += " script was either not correctly included.<br>"; html += " script was either not correctly included.<br>";
html += "<br>"; html += "<br>";
html += "Developers: For help getting this working correctly, "; html += "Developers: For help getting this working correctly, ";
html += "<a href='http://trac.openlayers.org/wiki/VirtualEarthLayer' " html += "<a href='http://trac.openlayers.org/wiki/VirtualEarth' "
html += "target='_blank'>"; html += "target='_blank'>";
html += "click here"; html += "click here";
html += "</a>"; html += "</a>";

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class
@@ -94,7 +95,7 @@ OpenLayers.Layer.Yahoo.prototype =
html += " script was either not correctly included.<br>"; html += " script was either not correctly included.<br>";
html += "<br>"; html += "<br>";
html += "Developers: For help getting this working correctly, "; html += "Developers: For help getting this working correctly, ";
html += "<a href='http://trac.openlayers.org/wiki/YahooLayer' " html += "<a href='http://trac.openlayers.org/wiki/Yahoo' "
html += "target='_blank'>"; html += "target='_blank'>";
html += "click here"; html += "click here";
html += "</a>"; html += "</a>";

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,5 +1,6 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
_OPENLAYERS_SFL_=true _OPENLAYERS_SFL_=true

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/* /*
* @class * @class
@@ -82,7 +83,7 @@ OpenLayers.Tile.prototype = {
redraw = true; redraw = true;
} }
OpenLayers.Util.clearArray(this); this.clear();
this.bounds = bounds.clone(); this.bounds = bounds.clone();
this.position = position.clone(); this.position = position.clone();
if (redraw) { if (redraw) {
@@ -120,3 +121,4 @@ OpenLayers.Tile.prototype = {
CLASS_NAME: "OpenLayers.Tile" CLASS_NAME: "OpenLayers.Tile"
}; };

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class
@@ -57,7 +58,7 @@ OpenLayers.Tile.WFS.prototype =
*/ */
draw:function() { draw:function() {
if (this.drawn) { if (this.drawn) {
OpenLayers.Util.clearArray(this); this.clear();
} }
OpenLayers.Tile.prototype.draw.apply(this, arguments); OpenLayers.Tile.prototype.draw.apply(this, arguments);
if (this.layer.displayOutsideMaxExtent || (this.layer.maxExtent && if (this.layer.displayOutsideMaxExtent || (this.layer.maxExtent &&
@@ -130,3 +131,4 @@ OpenLayers.Tile.WFS.prototype =
} }
); );

View File

@@ -1,6 +1,7 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. /* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* text of the license. */ * for the full text of the license. */
/** /**
* @class * @class

View File

@@ -1,3 +1,5 @@
This license applies to official code releases at www.openlayers.org:
Copyright (c) 2005-2006 MetaCarta, Inc. Copyright (c) 2005-2006 MetaCarta, Inc.
All rights reserved. All rights reserved.

35
repository-license.txt Normal file
View File

@@ -0,0 +1,35 @@
This license applies to all code and content in the OpenLayers code
repository at svn.openlayers.org:
Copyright (c) 2005-2006 MetaCarta, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of MetaCarta, Inc. nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
This license grants no rights to any components related to natural language
processing, free text querying, or unstructured information retrieval. This
license grants no rights to components that implement inventions on which
MetaCarta has patents or has filed applications for patents.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -11,6 +11,7 @@
<li>test_Events.html</li> <li>test_Events.html</li>
<li>test_Util.html</li> <li>test_Util.html</li>
<li>test_Layer.html</li> <li>test_Layer.html</li>
<li>test_Layer_Image.html</li>
<li>test_Layer_EventPane.html</li> <li>test_Layer_EventPane.html</li>
<li>test_Layer_FixedZoomLevels.html</li> <li>test_Layer_FixedZoomLevels.html</li>
<li>test_Layer_HTTPRequest.html</li> <li>test_Layer_HTTPRequest.html</li>

View File

@@ -0,0 +1,96 @@
<html>
<head>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript"><!--
var layer;
function test_01_Layer_Image_constructor (t) {
t.plan( 13 );
var options = { chicken: 151, foo: "bar", projection: "none" };
var layer = new OpenLayers.Layer.Image('Test Layer',
'http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif',
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
new OpenLayers.Size(580, 288), options);
t.ok( layer instanceof OpenLayers.Layer.Image, "new OpenLayers.Layer.Image returns object" );
t.eq( layer.CLASS_NAME, "OpenLayers.Layer.Image", "CLASS_NAME variable set correctly");
t.eq( layer.name, "Test Layer", "layer.name is correct" );
t.ok( layer.id != null, "Layer is given an id");
t.ok( layer.projection, "none", "default layer projection correctly set");
t.ok( ((layer.chicken == 151) && (layer.foo == "bar")), "layer.options correctly set to Layer Object" );
t.ok( ((layer.options["chicken"] == 151) && (layer.options["foo"] == "bar")), "layer.options correctly backed up" );
options.chicken = 552;
t.eq( layer.options["chicken"], 151 , "layer.options correctly made fresh copy" );
t.eq( layer.isBaseLayer, true, "Default img layer is base layer" );
layer = new OpenLayers.Layer.Image('Test Layer',
'http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif',
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
new OpenLayers.Size(580, 288));
t.ok( layer instanceof OpenLayers.Layer.Image, "new OpenLayers.Layer.Image returns object" );
t.eq( layer.name, "Test Layer", "layer.name is correct" );
t.ok( layer.projection == null, "default layer projection correctly set");
t.ok( layer.options instanceof Object, "layer.options correctly initialized as a non-null Object" );
}
function test_50_Layer_Image_tileTests (t) {
t.plan(4);
var map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.Image('Test Layer',
'http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif',
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
new OpenLayers.Size(580, 288));
map.addLayer(layer);
map.zoomToMaxExtent();
t.eq(layer.tile.position.x,-40, "Tile x positioned correctly at maxextent");
t.eq(layer.tile.position.y,107, "Tile y positioned correctly at maxextent");
t.eq(layer.tile.imgDiv.src, "http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif", "URL is correct");
map.zoomIn();
t.eq(layer.tile.imgDiv.src, "http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif", "URL is correct");
}
/******
*
*
* HERE IS WHERE SOME TESTS SHOULD BE PUT TO CHECK ON THE LONLAT-PX TRANSLATION
* FUNCTIONS AND RESOLUTION AND GETEXTENT GETZOOMLEVEL, ETC
*
*
*/
function test_99_Layer_Image_destroy (t) {
t.plan( 4 );
var map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.Image('Test Layer',
'http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif',
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
new OpenLayers.Size(580, 288));
map.addLayer(layer);
map.zoomToMaxExtent();
layer.destroy();
t.eq( layer.name, null, "layer.name is null after destroy" );
t.eq( layer.div, null, "layer.div is null after destroy" );
t.eq( layer.map, null, "layer.map is null after destroy" );
t.eq( layer.options, null, "layer.options is null after destroy" );
}
// -->
</script>
</head>
<body>
<div id="map" style="width:500px;height:500px"></div>
<div id="map2" style="width:100px;height:100px"></div>
</body>
</html>