Compare commits
36 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5c43d6506 | ||
|
|
ba4a68d0e3 | ||
|
|
d289aa327e | ||
|
|
65cd2bcb88 | ||
|
|
2cd979d34c | ||
|
|
c34b111b38 | ||
|
|
1193e17266 | ||
|
|
95164d8cc0 | ||
|
|
ae89452936 | ||
|
|
120cc0680d | ||
|
|
92f04a7a42 | ||
|
|
f435a98a2a | ||
|
|
2624ea089e | ||
|
|
24b1fa1b08 | ||
|
|
af3615f1ee | ||
|
|
62bd06f465 | ||
|
|
adcf5bb20a | ||
|
|
44f9b81085 | ||
|
|
bca3e45940 | ||
|
|
4e42dec4ab | ||
|
|
359bd3d598 | ||
|
|
114541d0b7 | ||
|
|
05672deefa | ||
|
|
9ea3c2f121 | ||
|
|
44e526a0e8 | ||
|
|
72d1b54956 | ||
|
|
40b4cc49e0 | ||
|
|
9585341d9c | ||
|
|
293ad9b32a | ||
|
|
4ad6bacc5d | ||
|
|
98fb795f97 | ||
|
|
23d8057222 | ||
|
|
2608a0ebe7 | ||
|
|
ac3d361778 | ||
|
|
612401a644 | ||
|
|
5f1651a30f |
@@ -8,7 +8,7 @@
|
||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
||||
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script src="all-overlays-google.js"></script>
|
||||
</head>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
||||
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script src="google-v3-alloverlays.js"></script>
|
||||
</head>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
||||
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script src="google-v3.js"></script>
|
||||
</head>
|
||||
@@ -35,6 +35,17 @@
|
||||
location, you must include the extra theme/default/google.css
|
||||
stylesheet.
|
||||
</p>
|
||||
<p>
|
||||
<strong>Note on Google Maps API versioning:</strong>
|
||||
This example uses the "nightly" version of Google Maps
|
||||
API. This is specified by using <code>v=3</code> in the
|
||||
the Google Maps API URL. Production applications should use the
|
||||
"release" or "frozen" versions of Google Maps
|
||||
API. See the <code>OpenLayers.Layer.Google.v3</code> API
|
||||
docs, and the
|
||||
<a href="https://developers.google.com/maps/documentation/javascript/basics#Versioning">Versioning Section</a>
|
||||
of the Google Maps API docs, for more details.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -57,6 +57,7 @@ function init() {
|
||||
|
||||
// create the select feature control
|
||||
var selector = new OpenLayers.Control.SelectFeature(vector,{
|
||||
hover:true,
|
||||
autoActivate:true
|
||||
});
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
||||
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script src="osm-google.js"></script>
|
||||
</head>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
||||
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
</head>
|
||||
|
||||
@@ -414,4 +414,4 @@
|
||||
/**
|
||||
* Constant: VERSION_NUMBER
|
||||
*/
|
||||
OpenLayers.VERSION_NUMBER="Release 2.12-rc2";
|
||||
OpenLayers.VERSION_NUMBER="Release 2.12-rc5";
|
||||
|
||||
@@ -280,7 +280,8 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
this.externalProjection);
|
||||
}
|
||||
if (geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
|
||||
var wpt = this.buildWptNode(feature);
|
||||
var wpt = this.buildWptNode(geometry);
|
||||
this.appendAttributesNode(wpt, feature);
|
||||
return wpt;
|
||||
} else {
|
||||
var trkNode = this.createElementNSPlus("gpx:trk");
|
||||
@@ -348,16 +349,15 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
* Builds a wpt node given a point
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>}
|
||||
* geometry - {<OpenLayers.Geometry.Point>}
|
||||
*
|
||||
* Returns:
|
||||
* {DOMElement} A wpt node
|
||||
*/
|
||||
buildWptNode: function(feature) {
|
||||
buildWptNode: function(geometry) {
|
||||
var node = this.createElementNSPlus("gpx:wpt");
|
||||
node.setAttribute("lon", feature.geometry.x);
|
||||
node.setAttribute("lat", feature.geometry.y);
|
||||
this.appendAttributesNode(node, feature);
|
||||
node.setAttribute("lon", geometry.x);
|
||||
node.setAttribute("lat", geometry.y);
|
||||
return node;
|
||||
},
|
||||
|
||||
|
||||
@@ -1010,7 +1010,7 @@ OpenLayers.Layer = OpenLayers.Class({
|
||||
this.maxExtent != null) {
|
||||
// maxResolution for default grid sets assumes that at zoom
|
||||
// level zero, the whole world fits on one tile.
|
||||
var tileSize = this.tileSize || this.map.getTileSize();
|
||||
var tileSize = this.map.getTileSize();
|
||||
maxResolution = Math.max(
|
||||
this.maxExtent.getWidth() / tileSize.w,
|
||||
this.maxExtent.getHeight() / tileSize.h
|
||||
|
||||
@@ -224,7 +224,8 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
||||
new OpenLayers.Projection("EPSG:4326")
|
||||
);
|
||||
var providers = res.imageryProviders,
|
||||
zoom = this.serverResolutions.indexOf(this.getServerResolution()),
|
||||
zoom = OpenLayers.Util.indexOf(this.serverResolutions,
|
||||
this.getServerResolution()),
|
||||
copyrights = "", provider, i, ii, j, jj, bbox, coverage;
|
||||
for (i=0,ii=providers.length; i<ii; ++i) {
|
||||
provider = providers[i];
|
||||
|
||||
@@ -11,7 +11,13 @@
|
||||
|
||||
/**
|
||||
* Class: OpenLayers.Layer.EventPane
|
||||
* Base class for 3rd party layers. Create a new event pane layer with the
|
||||
* Base class for 3rd party layers, providing a DOM element which isolates
|
||||
* the 3rd-party layer from mouse events.
|
||||
* Only used by Google layers.
|
||||
*
|
||||
* Automatically instantiated by the Google constructor, and not usually instantiated directly.
|
||||
*
|
||||
* Create a new event pane layer with the
|
||||
* <OpenLayers.Layer.EventPane> constructor.
|
||||
*
|
||||
* Inherits from:
|
||||
|
||||
@@ -14,6 +14,11 @@
|
||||
/**
|
||||
* Class: OpenLayers.Layer.Google
|
||||
*
|
||||
* Provides a wrapper for Google's Maps API
|
||||
* Normally the Terms of Use for this API do not allow wrapping, but Google
|
||||
* have provided written consent to OpenLayers for this - see email in
|
||||
* http://osgeo-org.1560.n6.nabble.com/Google-Maps-API-Terms-of-Use-changes-tp4910013p4911981.html
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Layer.SphericalMercator>
|
||||
* - <OpenLayers.Layer.EventPane>
|
||||
@@ -462,6 +467,10 @@ OpenLayers.Layer.Google.cache = {};
|
||||
* Constant: OpenLayers.Layer.Google.v2
|
||||
*
|
||||
* Mixin providing functionality specific to the Google Maps API v2.
|
||||
*
|
||||
* This API has been deprecated by Google.
|
||||
* Developers are encouraged to migrate to v3 of the API; support for this
|
||||
* is provided by <OpenLayers.Layer.Google.v3>
|
||||
*/
|
||||
OpenLayers.Layer.Google.v2 = {
|
||||
|
||||
|
||||
@@ -11,15 +11,42 @@
|
||||
/**
|
||||
* Constant: OpenLayers.Layer.Google.v3
|
||||
*
|
||||
* Mixin providing functionality specific to the Google Maps API v3 <= v3.6.
|
||||
* Note that this layer configures the google.maps.map object with the
|
||||
* "disableDefaultUI" option set to true. Using UI controls that the Google
|
||||
* Maps API provides is not supported by the OpenLayers API. To use this layer,
|
||||
* you must include the GMaps API (<= v3.6) in your html:
|
||||
* Mixin providing functionality specific to the Google Maps API v3.
|
||||
*
|
||||
* To use this layer, you must include the GMaps v3 API in your html.
|
||||
*
|
||||
* Because OpenLayers needs to control mouse events, it isolates the GMaps mapObject
|
||||
* (the DOM elements provided by Google) using the EventPane.
|
||||
* However, because the Terms of Use require some of those elements,
|
||||
* such as the links to Google's terms, to be clickable, these elements have
|
||||
* to be moved up to OpenLayers' container div. There is however no easy way
|
||||
* to identify these, and the logic (see the repositionMapElements function
|
||||
* in the source) may need to be changed if Google changes them.
|
||||
* These elements are not part of the published API and can be changed at any time,
|
||||
* so a given OpenLayers release can only guarantee support for the 'frozen'
|
||||
* Google release at the time of the OpenLayers release. See
|
||||
* https://developers.google.com/maps/documentation/javascript/basics#Versioning
|
||||
* for Google's current release cycle.
|
||||
*
|
||||
* For this reason, it's recommended that production code specifically loads
|
||||
* the current frozen version, for example:
|
||||
*
|
||||
* (code)
|
||||
* <script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
||||
* <script src="http://maps.google.com/maps/api/js?v=3.7&sensor=false"></script>
|
||||
* (end)
|
||||
*
|
||||
* but that development code should use the latest 'nightly' version, so that any
|
||||
* problems can be dealt with as soon as they arise, and before they affect the production, 'frozen', code.
|
||||
*
|
||||
* Note, however, that frozen versions are retired as part of Google's release
|
||||
* cycle, and once this happens, you will get the next version, in the example above, 3.8 once 3.7 is retired.
|
||||
*
|
||||
* This version supports 3.7.
|
||||
*
|
||||
*
|
||||
* Note that this layer configures the google.maps.map object with the
|
||||
* "disableDefaultUI" option set to true. Using UI controls that the Google
|
||||
* Maps API provides is not supported by the OpenLayers API.
|
||||
*/
|
||||
OpenLayers.Layer.Google.v3 = {
|
||||
|
||||
@@ -137,27 +164,31 @@ OpenLayers.Layer.Google.v3 = {
|
||||
var cache = OpenLayers.Layer.Google.cache[this.map.id];
|
||||
var container = this.map.viewPortDiv;
|
||||
|
||||
// move the Map Data popup to the container, if any
|
||||
while (div.lastChild.style.display == "none") {
|
||||
container.appendChild(div.lastChild);
|
||||
}
|
||||
|
||||
// move the ToS and branding stuff up to the container div
|
||||
var termsOfUse = div.lastChild;
|
||||
container.appendChild(termsOfUse);
|
||||
termsOfUse.style.zIndex = "1100";
|
||||
termsOfUse.style.bottom = "";
|
||||
termsOfUse.className = "olLayerGoogleCopyright olLayerGoogleV3";
|
||||
termsOfUse.style.display = "";
|
||||
cache.termsOfUse = termsOfUse;
|
||||
|
||||
var poweredBy = div.lastChild;
|
||||
container.appendChild(poweredBy);
|
||||
poweredBy.style.zIndex = "1100";
|
||||
poweredBy.style.bottom = "";
|
||||
poweredBy.className = "olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint";
|
||||
poweredBy.style.display = "";
|
||||
cache.poweredBy = poweredBy;
|
||||
// depends on value of zIndex, which is not robust
|
||||
for (var i=div.children.length-1; i>=0; --i) {
|
||||
if (div.children[i].style.zIndex == 1000001) {
|
||||
var termsOfUse = div.children[i];
|
||||
container.appendChild(termsOfUse);
|
||||
termsOfUse.style.zIndex = "1100";
|
||||
termsOfUse.style.bottom = "";
|
||||
termsOfUse.className = "olLayerGoogleCopyright olLayerGoogleV3";
|
||||
termsOfUse.style.display = "";
|
||||
cache.termsOfUse = termsOfUse;
|
||||
}
|
||||
if (div.children[i].style.zIndex == 1000000) {
|
||||
var poweredBy = div.children[i];
|
||||
container.appendChild(poweredBy);
|
||||
poweredBy.style.zIndex = "1100";
|
||||
poweredBy.style.bottom = "";
|
||||
poweredBy.className = "olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint";
|
||||
poweredBy.style.display = "";
|
||||
cache.poweredBy = poweredBy;
|
||||
}
|
||||
if (div.children[i].style.zIndex == 10000002) {
|
||||
container.appendChild(div.children[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setGMapVisibility(this.visibility);
|
||||
|
||||
|
||||
@@ -651,14 +651,18 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
|
||||
/**
|
||||
* Method: getServerZoom
|
||||
* Return the zoom value corresponding to the best zoom supported by the server
|
||||
* resolution.
|
||||
* Return the zoom value corresponding to the best matching server
|
||||
* resolution, taking into account <serverResolutions> and <zoomOffset>.
|
||||
*
|
||||
* Returns:
|
||||
* {Number} The closest server supported zoom.
|
||||
* {Number} The closest server supported zoom. This is not the map zoom
|
||||
* level, but an index of the server's resolutions array.
|
||||
*/
|
||||
getServerZoom: function() {
|
||||
return this.map.getZoomForResolution(this.getServerResolution());
|
||||
var resolution = this.getServerResolution();
|
||||
return this.serverResolutions ?
|
||||
OpenLayers.Util.indexOf(this.serverResolutions, resolution) :
|
||||
this.map.getZoomForResolution(resolution) + (this.zoomOffset || 0);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1298,19 +1302,20 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
* columns - {Integer} Maximum number of columns we want our grid to have.
|
||||
*/
|
||||
removeExcessTiles: function(rows, columns) {
|
||||
var i, l;
|
||||
|
||||
// remove extra rows
|
||||
while (this.grid.length > rows) {
|
||||
var row = this.grid.pop();
|
||||
for (var i=0, l=row.length; i<l; i++) {
|
||||
for (i=0, l=row.length; i<l; i++) {
|
||||
var tile = row[i];
|
||||
this.destroyTile(tile);
|
||||
}
|
||||
}
|
||||
|
||||
// remove extra columns
|
||||
while (this.grid[0].length > columns) {
|
||||
for (var i=0, l=this.grid.length; i<l; i++) {
|
||||
for (i=0, l=this.grid.length; i<l; i++) {
|
||||
while (this.grid[i].length > columns) {
|
||||
var row = this.grid[i];
|
||||
var tile = row.pop();
|
||||
this.destroyTile(tile);
|
||||
|
||||
@@ -173,9 +173,7 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
var res = this.getServerResolution();
|
||||
var x = Math.round((bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w));
|
||||
var y = Math.round((bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h));
|
||||
var z = this.serverResolutions != null ?
|
||||
OpenLayers.Util.indexOf(this.serverResolutions, res) :
|
||||
this.getServerZoom() + this.zoomOffset;
|
||||
var z = this.getServerZoom();
|
||||
var path = this.serviceVersion + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type;
|
||||
var url = this.url;
|
||||
if (OpenLayers.Util.isArray(url)) {
|
||||
|
||||
@@ -332,10 +332,7 @@ OpenLayers.Layer.WMTS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
* Get the current index in the matrixIds array.
|
||||
*/
|
||||
getIdentifier: function() {
|
||||
return this.serverResolutions != null ?
|
||||
OpenLayers.Util.indexOf(this.serverResolutions,
|
||||
this.getServerResolution()) :
|
||||
this.getServerZoom() + this.zoomOffset;
|
||||
return this.getServerZoom();
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -143,10 +143,7 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
(res * this.tileSize.w));
|
||||
var y = Math.round((this.maxExtent.top - bounds.top) /
|
||||
(res * this.tileSize.h));
|
||||
var resolutions = this.serverResolutions || this.resolutions;
|
||||
var z = this.zoomOffset == 0 ?
|
||||
OpenLayers.Util.indexOf(resolutions, res) :
|
||||
this.getServerZoom() + this.zoomOffset;
|
||||
var z = this.getServerZoom();
|
||||
|
||||
if (this.wrapDateLine) {
|
||||
var limit = Math.pow(2, z);
|
||||
|
||||
@@ -580,8 +580,8 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
|
||||
// Because Mozilla does not support the "resize" event for elements
|
||||
// other than "window", we need to put a hack here.
|
||||
if (OpenLayers.String.contains(navigator.appName, "Microsoft")) {
|
||||
// If IE, register the resize on the div
|
||||
if (parseFloat(navigator.appVersion.split("MSIE")[1]) < 9) {
|
||||
// If IE < 9, register the resize on the div
|
||||
this.events.register("resize", this, this.updateSize);
|
||||
} else {
|
||||
// Else updateSize on catching the window's resize
|
||||
|
||||
@@ -446,7 +446,9 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
||||
* {DOMElement} The specific render engine's root element
|
||||
*/
|
||||
createRenderRoot: function() {
|
||||
return this.nodeFactory(this.container.id + "_svgRoot", "svg");
|
||||
var svg = this.nodeFactory(this.container.id + "_svgRoot", "svg");
|
||||
svg.style.display = "block";
|
||||
return svg;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ var OpenLayers = {
|
||||
/**
|
||||
* Constant: VERSION_NUMBER
|
||||
*/
|
||||
VERSION_NUMBER: "Release 2.12-rc2",
|
||||
VERSION_NUMBER: "Release 2.12-rc5",
|
||||
|
||||
/**
|
||||
* Constant: singleFile
|
||||
|
||||
@@ -81,20 +81,11 @@ OpenLayers.Strategy.BBOX = OpenLayers.Class(OpenLayers.Strategy, {
|
||||
if(activated) {
|
||||
this.layer.events.on({
|
||||
"moveend": this.update,
|
||||
scope: this
|
||||
});
|
||||
this.layer.events.on({
|
||||
"refresh": this.update,
|
||||
"visibilitychanged": this.update,
|
||||
scope: this
|
||||
});
|
||||
if(this.layer.visibility === true && this.layer.inRange === true) {
|
||||
this.update();
|
||||
} else {
|
||||
this.layer.events.on({
|
||||
"visibilitychanged": this.update,
|
||||
scope: this
|
||||
});
|
||||
}
|
||||
this.update();
|
||||
}
|
||||
return activated;
|
||||
},
|
||||
@@ -134,7 +125,7 @@ OpenLayers.Strategy.BBOX = OpenLayers.Class(OpenLayers.Strategy, {
|
||||
update: function(options) {
|
||||
var mapBounds = this.getMapBounds();
|
||||
if (mapBounds !== null && ((options && options.force) ||
|
||||
this.invalidBounds(mapBounds))) {
|
||||
(this.layer.visibility && this.layer.calculateInRange() && this.invalidBounds(mapBounds)))) {
|
||||
this.calculateBounds(mapBounds);
|
||||
this.resolution = this.layer.map.getResolution();
|
||||
this.triggerRead(options);
|
||||
|
||||
@@ -211,7 +211,8 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
*/
|
||||
positionTile: function() {
|
||||
var style = this.getTile().style,
|
||||
size = this.layer.getImageSize(this.bounds);
|
||||
size = this.frame ? this.size :
|
||||
this.layer.getImageSize(this.bounds);
|
||||
style.left = this.position.x + "%";
|
||||
style.top = this.position.y + "%";
|
||||
style.width = size.w + "%";
|
||||
@@ -254,11 +255,16 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
this.imgDiv.galleryImg = "no";
|
||||
|
||||
var style = this.imgDiv.style;
|
||||
if (this.layer.gutter) {
|
||||
var left = this.layer.gutter / this.layer.tileSize.w * 100;
|
||||
var top = this.layer.gutter / this.layer.tileSize.h * 100;
|
||||
if (this.frame) {
|
||||
var left = 0, top = 0;
|
||||
if (this.layer.gutter) {
|
||||
left = this.layer.gutter / this.layer.tileSize.w * 100;
|
||||
top = this.layer.gutter / this.layer.tileSize.h * 100;
|
||||
}
|
||||
style.left = -left + "%";
|
||||
style.top = -top + "%";
|
||||
style.width = (2 * left + 100) + "%";
|
||||
style.height = (2 * top + 100) + "%";
|
||||
}
|
||||
style.visibility = "hidden";
|
||||
style.opacity = 0;
|
||||
@@ -275,8 +281,6 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
style.width = "100%";
|
||||
}
|
||||
if (this.frame) {
|
||||
style.width = "100%";
|
||||
style.height = "100%";
|
||||
this.frame.appendChild(this.imgDiv);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,6 +152,8 @@ Corresponding issues/pull requests:
|
||||
|
||||
The `gpxns` API property has been removed. The GPX namespace is now defined in the `namespaces` property but is not intended to be overriden.
|
||||
|
||||
GPX also now has a basic write function.
|
||||
|
||||
Corresponding issues/pull requests:
|
||||
|
||||
* https://github.com/openlayers/openlayers/pull/221
|
||||
@@ -217,6 +219,20 @@ Corresponding issues/pull requests:
|
||||
|
||||
* https://github.com/openlayers/openlayers/pull/101
|
||||
|
||||
## Google v3 Layer
|
||||
|
||||
This release fixes a problem with the clickable elements supplied by Google. `OpenLayers.Layer.Google.v3` is now compatible with the current frozen version of Google's API (3.7) and also with the current release and nightly versions (3.8 and 3.9), but be aware that Google may change these elements in their release and nightly versions at any time, and an interim fix OpenLayers release may be needed.
|
||||
|
||||
It's recommended that production servers always load the frozen version of Google's API, but it would help find potential problems if development pages used the latest nightly version.
|
||||
|
||||
See the class description in the API docs for `OpenLayers.Layer.Google.v3` for more details.
|
||||
|
||||
Good ideas on how to improve this unsatisfactory situation welcome!
|
||||
|
||||
Corresponding issues/pull requests:
|
||||
|
||||
* https://github.com/openlayers/openlayers/pull/472
|
||||
|
||||
## OSM and Bing Layers
|
||||
|
||||
`Layer.OSM` is now defined in its own script file, namely `OpenLayers/Layer/OSM.js`. So people using `Layer.OSM` should now include `OpenLayers/Layer/OSM.js`, as opposed to `OpenLayers/Layer/XYZ.js`, in their OpenLayers builds.
|
||||
|
||||
@@ -19,13 +19,48 @@
|
||||
"default external projection is EPSG:4326");
|
||||
}
|
||||
function test_Format_GPX_read(t) {
|
||||
t.plan(4);
|
||||
t.plan(7);
|
||||
var expected,
|
||||
P = OpenLayers.Geometry.Point,
|
||||
LS = OpenLayers.Geometry.LineString;
|
||||
var f = new OpenLayers.Format.GPX();
|
||||
var features = f.read(gpx_data);
|
||||
t.eq(features.length, 3, "Number of features read is correct");
|
||||
t.eq(features[2].geometry.toString(), "POINT(-0.1853562259 51.3697845627)", "waypoint feature correctly created");
|
||||
t.eq(features[0].geometry.toString(), "LINESTRING(-0.1721292044 51.3768216433,-0.1649230916 51.370833767,-0.1736741378 51.3644368725,-0.166259525 51.3576354272)", "track feature correctly created");
|
||||
t.eq(features[1].geometry.toString(), "LINESTRING(-0.1829991904 51.3761803674,-0.1758887005 51.3697894659,-0.1833202965 51.3639790884,-0.1751119509 51.3567607069)", "route feature correctly created");
|
||||
expected = new P(-0.1853562259, 51.3697845627);
|
||||
t.geom_eq(features[2].geometry, expected, "waypoint feature correctly created");
|
||||
expected = new LS([
|
||||
new P(-0.1721292044, 51.3768216433),
|
||||
new P(-0.1649230916, 51.370833767),
|
||||
new P(-0.1736741378, 51.3644368725),
|
||||
new P(-0.166259525, 51.3576354272)
|
||||
]);
|
||||
t.geom_eq(features[0].geometry, expected, "track feature correctly created");
|
||||
expected = new LS([
|
||||
new P(-0.1829991904, 51.3761803674),
|
||||
new P(-0.1758887005, 51.3697894659),
|
||||
new P(-0.1833202965, 51.3639790884),
|
||||
new P(-0.1751119509, 51.3567607069)
|
||||
]);
|
||||
t.geom_eq(features[1].geometry, expected, "route feature correctly created");
|
||||
|
||||
f.internalProjection = new OpenLayers.Projection("EPSG:3857");
|
||||
features = f.read(gpx_data);
|
||||
expected = new P(-20633.760679678744, 6686966.841929403);
|
||||
t.geom_eq(features[2].geometry, expected, "transformed waypoint feature correctly created");
|
||||
expected = new LS([
|
||||
new P(-19161.33538179203, 6688221.743275255),
|
||||
new P(-18359.1545744088, 6687153.931130851),
|
||||
new P(-19333.316581165607, 6686013.33343931),
|
||||
new P(-18507.925659955214, 6684800.777090962)
|
||||
]);
|
||||
t.geom_eq(features[0].geometry, expected, "transformed track feature correctly created");
|
||||
expected = new LS([
|
||||
new P(-20371.3766880736, 6688107.378491073),
|
||||
new P(-19579.84057322507, 6686967.716235109),
|
||||
new P(-20407.12205561124, 6685931.714395953),
|
||||
new P(-19493.373203291227, 6684644.845706556)
|
||||
]);
|
||||
t.geom_eq(features[1].geometry, expected, "transformed route feature correctly created");
|
||||
}
|
||||
function test_format_GPX_read_attributes(t) {
|
||||
t.plan(2);
|
||||
@@ -35,7 +70,7 @@
|
||||
t.eq(features[2].attributes['sym'], "Flag", "CDATA attribute node read correctly.");
|
||||
}
|
||||
function test_Format_GPX_serialize_points(t) {
|
||||
t.plan(1);
|
||||
t.plan(2);
|
||||
|
||||
var parser = new OpenLayers.Format.GPX();
|
||||
|
||||
@@ -47,9 +82,19 @@
|
||||
];
|
||||
var data = parser.write(features);
|
||||
t.xml_eq(data, '<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="OpenLayers" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wpt lon="-111.04" lat="45.68"><name>foo</name><desc>bar</desc></wpt><wpt lon="-112.04" lat="45.68"><name>foo</name><desc>bar</desc></wpt></gpx>', 'GPX serializes points correctly');
|
||||
|
||||
parser.internalProjection = new OpenLayers.Projection("EPSG:3857");
|
||||
point = new OpenLayers.Geometry.Point(-12367595.42541111, 5621521.485409545);
|
||||
point2 = new OpenLayers.Geometry.Point(-12472235.746742222, 5621521.485409545);
|
||||
features = [
|
||||
new OpenLayers.Feature.Vector(point, {name: 'foo', description: 'bar'}),
|
||||
new OpenLayers.Feature.Vector(point2, {name: 'foo', description: 'bar'})
|
||||
];
|
||||
data = parser.write(features);
|
||||
t.xml_eq(data, '<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="OpenLayers" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wpt lon="-111.1" lat="45"><name>foo</name><desc>bar</desc></wpt><wpt lon="-112.04" lat="45"><name>foo</name><desc>bar</desc></wpt></gpx>', 'GPX serializes transformed points correctly');
|
||||
}
|
||||
function test_Format_GPX_serialize_line(t) {
|
||||
t.plan(1);
|
||||
t.plan(2);
|
||||
|
||||
var parser = new OpenLayers.Format.GPX();
|
||||
|
||||
@@ -59,6 +104,14 @@
|
||||
var f = new OpenLayers.Feature.Vector(line, {name: 'foo', description: 'bar'});
|
||||
var data = parser.write(f);
|
||||
t.xml_eq(data, '<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="OpenLayers" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><trk><name>foo</name><desc>bar</desc><trkseg><trkpt lon="-111.04" lat="45.68"/><trkpt lon="-112.04" lat="45.68"/></trkseg></trk></gpx>', 'GPX serializes line correctly');
|
||||
|
||||
parser.internalProjection = new OpenLayers.Projection("EPSG:3857");
|
||||
point = new OpenLayers.Geometry.Point(-12367595.42541111, 5621521.485409545);
|
||||
point2 = new OpenLayers.Geometry.Point(-12472235.746742222, 5621521.485409545);
|
||||
line = new OpenLayers.Geometry.LineString([point, point2]);
|
||||
f = new OpenLayers.Feature.Vector(line, {name: 'foo', description: 'bar'});
|
||||
data = parser.write(f);
|
||||
t.xml_eq(data, '<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="OpenLayers" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><trk><name>foo</name><desc>bar</desc><trkseg><trkpt lon="-111.1" lat="45"/><trkpt lon="-112.04" lat="45"/></trkseg></trk></gpx>', 'GPX serializes transformed line correctly');
|
||||
}
|
||||
function test_Format_GPX_serialize_lines(t) {
|
||||
t.plan(1);
|
||||
|
||||
@@ -837,12 +837,12 @@
|
||||
layer.serverResolutions = [2, 1];
|
||||
resolution = 1;
|
||||
zoom = layer.getServerZoom();
|
||||
t.eq(zoom, 3, '[3] getServerZoom return value is correct');
|
||||
t.eq(zoom, 1, '[3] getServerZoom return value is correct');
|
||||
|
||||
layer.serverResolutions = [2];
|
||||
resolution = 0.5;
|
||||
zoom = layer.getServerZoom();
|
||||
t.eq(zoom, 2, '[4] getServerZoom return value is correct');
|
||||
t.eq(zoom, 0, '[4] getServerZoom return value is correct');
|
||||
|
||||
var exc;
|
||||
layer.serverResolutions = [0.5];
|
||||
@@ -1523,6 +1523,70 @@
|
||||
map.destroy();
|
||||
|
||||
}
|
||||
|
||||
function test_removeExcessTiles(t) {
|
||||
t.plan(15);
|
||||
|
||||
/*
|
||||
* Set up
|
||||
*/
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.Grid('name', '/url',
|
||||
{}, {isBaseLayer: true});
|
||||
map.addLayer(layer);
|
||||
|
||||
function newTile(id) {
|
||||
var t = new OpenLayers.Tile(layer,
|
||||
new OpenLayers.Pixel(1, 1),
|
||||
new OpenLayers.Bounds(1, 1, 1, 1));
|
||||
t._id = id;
|
||||
return t;
|
||||
}
|
||||
|
||||
layer.grid = [
|
||||
[newTile(1), newTile(2), newTile(3)],
|
||||
[newTile(4), newTile(5)],
|
||||
[newTile(6), newTile(7), newTile(8)]
|
||||
];
|
||||
|
||||
// create a clone to be able to test whether
|
||||
// tiles have been destroyed or not
|
||||
var grid = [
|
||||
layer.grid[0].slice(),
|
||||
layer.grid[1].slice(),
|
||||
layer.grid[2].slice()
|
||||
];
|
||||
|
||||
/*
|
||||
* Test
|
||||
*/
|
||||
|
||||
layer.removeExcessTiles(2, 2);
|
||||
|
||||
t.eq(layer.grid.length, 2, 'grid has two rows');
|
||||
t.eq(layer.grid[0].length, 2, 'row #1 has two columns');
|
||||
t.eq(layer.grid[0][0]._id, 1, 'row #1 col #1 includes expected tile');
|
||||
t.eq(layer.grid[0][1]._id, 2, 'row #1 col #2 includes expected tile');
|
||||
t.eq(layer.grid[1].length, 2, 'row #2 has two columns');
|
||||
t.eq(layer.grid[1][0]._id, 4, 'row #2 col #1 includes expected tile');
|
||||
t.eq(layer.grid[1][1]._id, 5, 'row #2 col #2 includes expected tile');
|
||||
|
||||
t.ok(grid[0][0].events != null, 'tile 0,0 not destroyed');
|
||||
t.ok(grid[0][1].events != null, 'tile 0,1 not destroyed');
|
||||
t.ok(grid[0][2].events == null, 'tile 0,2 destroyed');
|
||||
t.ok(grid[1][0].events != null, 'tile 1,0 not destroyed');
|
||||
t.ok(grid[1][1].events != null, 'tile 1,1 not destroyed');
|
||||
t.ok(grid[2][0].events == null, 'tile 2,0 destroyed');
|
||||
t.ok(grid[2][1].events == null, 'tile 2,1 destroyed');
|
||||
t.ok(grid[2][2].events == null, 'tile 2,2 destroyed');
|
||||
|
||||
/*
|
||||
* Tear down
|
||||
*/
|
||||
|
||||
map.destroy();
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
@@ -305,7 +305,7 @@
|
||||
|
||||
// Test fix for Ticket #3142
|
||||
function test_layerLoadedAfterBeingAdded(t) {
|
||||
t.plan(2);
|
||||
t.plan(3);
|
||||
|
||||
var dummy = new OpenLayers.Layer(null, {isBaseLayer: true});
|
||||
|
||||
@@ -341,6 +341,11 @@
|
||||
// test that the strategy bounds were set
|
||||
t.ok(map.getExtent().equals(strategy.bounds), "[set center] bounds set to map extent");
|
||||
t.eq(layerOutOfRange.strategies[0].bounds, null, "Data not requested if layer is out of range");
|
||||
|
||||
layerOutOfRange.setVisibility(false);
|
||||
layerOutOfRange.setVisibility(true);
|
||||
t.eq(layerOutOfRange.strategies[0].bounds, null, "Data not requested if layer is out of range when switching visibility");
|
||||
|
||||
map.destroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -399,6 +399,97 @@
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A series of tests to verify the dimensions and positions
|
||||
* of the tile frame and img after draw.
|
||||
|
||||
* Written for https://github.com/openlayers/openlayers/issues/441
|
||||
*/
|
||||
function test_draw_without_gutter_without_frame(t) {
|
||||
t.plan(5);
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.WMS('blank',
|
||||
'../../img/blank.gif',
|
||||
{layers: 'fake'},
|
||||
{isBaseLayer: true});
|
||||
map.addLayer(layer);
|
||||
var tile = new OpenLayers.Tile.Image(
|
||||
layer,
|
||||
new OpenLayers.Pixel(6, 6),
|
||||
new OpenLayers.Bounds(5, 45, 6, 46),
|
||||
null,
|
||||
new OpenLayers.Size(256, 256));
|
||||
|
||||
tile.draw();
|
||||
t.eq(tile.frame, null, 'no frame');
|
||||
t.eq(parseInt(tile.imgDiv.style.left, 10), 6, 'correct tile img left');
|
||||
t.eq(parseInt(tile.imgDiv.style.top, 10), 6, 'correct tile img top');
|
||||
t.eq(parseInt(tile.imgDiv.style.width, 10), 256, 'correct tile img width');
|
||||
t.eq(parseInt(tile.imgDiv.style.height, 10), 256, 'correct tile img height');
|
||||
|
||||
map.destroy();
|
||||
}
|
||||
function test_draw_without_gutter_with_frame(t) {
|
||||
t.plan(8);
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.WMS('blank',
|
||||
'../../img/blank.gif',
|
||||
{layers: 'fake'},
|
||||
{isBaseLayer: true});
|
||||
map.addLayer(layer);
|
||||
layer.gutter = 1; // this is just for a frame to be created for
|
||||
// the tile
|
||||
var tile = new OpenLayers.Tile.Image(
|
||||
layer,
|
||||
new OpenLayers.Pixel(6, 6),
|
||||
new OpenLayers.Bounds(5, 45, 6, 46),
|
||||
null,
|
||||
new OpenLayers.Size(256, 256));
|
||||
layer.gutter = null;
|
||||
|
||||
tile.draw();
|
||||
t.eq(parseInt(tile.frame.style.left, 10), 6, 'correct tile frame left');
|
||||
t.eq(parseInt(tile.frame.style.top, 10), 6, 'correct tile frame top');
|
||||
t.eq(parseInt(tile.frame.style.width, 10), 256, 'correct tile frame width');
|
||||
t.eq(parseInt(tile.frame.style.height, 10), 256, 'correct tile frame height');
|
||||
t.eq(parseInt(tile.imgDiv.style.left, 10), 0, 'correct tile img left');
|
||||
t.eq(parseInt(tile.imgDiv.style.top, 10), 0, 'correct tile img top');
|
||||
t.eq(parseInt(tile.imgDiv.style.width, 10), 100, 'correct tile img width');
|
||||
t.eq(parseInt(tile.imgDiv.style.height, 10), 100, 'correct tile img height');
|
||||
|
||||
map.destroy();
|
||||
}
|
||||
function test_draw_with_gutter(t) {
|
||||
t.plan(8);
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.WMS('blank',
|
||||
'../../img/blank.gif',
|
||||
{layers: 'fake'},
|
||||
{isBaseLayer: true, gutter: 15});
|
||||
map.addLayer(layer);
|
||||
var tile = new OpenLayers.Tile.Image(
|
||||
layer,
|
||||
new OpenLayers.Pixel(6, 6),
|
||||
new OpenLayers.Bounds(5, 45, 6, 46),
|
||||
null,
|
||||
new OpenLayers.Size(256, 256));
|
||||
|
||||
tile.draw();
|
||||
t.eq(parseInt(tile.frame.style.left, 10), 6, 'correct tile frame left');
|
||||
t.eq(parseInt(tile.frame.style.top, 10), 6, 'correct tile frame top');
|
||||
t.eq(parseInt(tile.frame.style.width, 10), 256, 'correct tile frame width');
|
||||
t.eq(parseInt(tile.frame.style.height, 10), 256, 'correct tile frame height');
|
||||
t.eq(parseInt(tile.imgDiv.style.left, 10), -5, 'correct tile img left');
|
||||
t.eq(parseInt(tile.imgDiv.style.top, 10), -5, 'correct tile img top');
|
||||
t.eq(parseInt(tile.imgDiv.style.width, 10), 111, 'correct tile img width');
|
||||
t.eq(parseInt(tile.imgDiv.style.height, 10), 111, 'correct tile img height');
|
||||
|
||||
map.destroy();
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user