diff --git a/apidoc_config/Menu.txt b/apidoc_config/Menu.txt index 425c7ebdcd..baf9502c65 100644 --- a/apidoc_config/Menu.txt +++ b/apidoc_config/Menu.txt @@ -379,7 +379,6 @@ Group: OpenLayers { File: Popup (no auto-title, OpenLayers/Popup.js) File: Anchored (no auto-title, OpenLayers/Popup/Anchored.js) - File: AnchoredBubble (no auto-title, OpenLayers/Popup/AnchoredBubble.js) File: Framed (no auto-title, OpenLayers/Popup/Framed.js) File: FramedCloud (no auto-title, OpenLayers/Popup/FramedCloud.js) } # Group: Popup diff --git a/build/build.py b/build/build.py index da539a29ab..fd0f6e9bb1 100755 --- a/build/build.py +++ b/build/build.py @@ -32,6 +32,13 @@ def build(config_file = None, output_file = None, options = None): except ImportError: print "No minimize" + try: + import uglify_js + uglify_js.check_available() + have_compressor.append("uglify-js") + except Exception, E: + print "No uglify-js (%s)" % E + use_compressor = None if options.compressor and options.compressor in have_compressor: use_compressor = options.compressor @@ -52,7 +59,7 @@ def build(config_file = None, output_file = None, options = None): print "Merging libraries." try: - if use_compressor == "closure": + if use_compressor == "closure" or use_compressor == 'uglify-js': sourceFiles = mergejs.getNames(sourceDirectory, configFilename) else: merged = mergejs.run(sourceDirectory, None, configFilename) @@ -107,6 +114,14 @@ def build(config_file = None, output_file = None, options = None): print "\nAbnormal termination due to compilation errors." sys.exit("ERROR: Closure Compilation failed! See compilation errors.") print "Closure Compilation has completed successfully." + elif use_compressor == "uglify-js": + minimized = uglify_js.compile(sourceFiles) + if minimized is None: + print "\nAbnormal termination due to compilation errors." + sys.exit("ERROR: Uglify JS compilation failed! See compilation errors.") + + print "Uglify JS compilation has completed successfully." + else: # fallback minimized = merged diff --git a/build/mobile.cfg b/build/mobile.cfg index bfe4543412..b41f0bd04c 100644 --- a/build/mobile.cfg +++ b/build/mobile.cfg @@ -29,6 +29,7 @@ OpenLayers/Protocol/HTTP.js OpenLayers/Protocol/WFS.js OpenLayers/Protocol/WFS/v1_0_0.js OpenLayers/Strategy/Fixed.js +OpenLayers/TileManager.js [exclude] diff --git a/doc_config/Menu.txt b/doc_config/Menu.txt index 14845eac23..f389877761 100644 --- a/doc_config/Menu.txt +++ b/doc_config/Menu.txt @@ -379,7 +379,6 @@ Group: OpenLayers { File: Popup (no auto-title, OpenLayers/Popup.js) File: Anchored (no auto-title, OpenLayers/Popup/Anchored.js) - File: AnchoredBubble (no auto-title, OpenLayers/Popup/AnchoredBubble.js) File: Framed (no auto-title, OpenLayers/Popup/Framed.js) File: FramedCloud (no auto-title, OpenLayers/Popup/FramedCloud.js) } # Group: Popup diff --git a/examples/mapbox.js b/examples/mapbox.js index 134d0d865e..f5679dcf63 100644 --- a/examples/mapbox.js +++ b/examples/mapbox.js @@ -1,35 +1,21 @@ -var streets = new OpenLayers.Layer.XYZ( - "MapBox Streets", +var earth = new OpenLayers.Layer.XYZ( + "Natural Earth", [ - "http://a.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png", - "http://b.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png", - "http://c.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png", - "http://d.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png" + "http://a.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy/${z}/${x}/${y}.png", + "http://b.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy/${z}/${x}/${y}.png", + "http://c.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy/${z}/${x}/${y}.png", + "http://d.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy/${z}/${x}/${y}.png" ], { - attribution: "Tiles © MapBox | " + - "Data © OpenStreetMap " + - "and contributors, CC-BY-SA", + attribution: "Tiles © MapBox", sphericalMercator: true, wrapDateLine: true, - transitionEffect: "resize", - buffer: 1, - numZoomLevels: 17 + numZoomLevels: 5 } ); var map = new OpenLayers.Map({ div: "map", - layers: [streets], - controls: [ - new OpenLayers.Control.Attribution(), - new OpenLayers.Control.Navigation({ - dragPanOptions: { - enableKinetic: true - } - }), - new OpenLayers.Control.Zoom(), - new OpenLayers.Control.Permalink({anchor: true}) - ], + layers: [earth], center: [0, 0], zoom: 1 }); diff --git a/examples/mapquest.js b/examples/mapquest.js index 9761e897b3..5a45d1c3ed 100644 --- a/examples/mapquest.js +++ b/examples/mapquest.js @@ -5,10 +5,10 @@ var map = new OpenLayers.Map({ new OpenLayers.Layer.XYZ( "OpenStreetMap", [ - "http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", - "http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", - "http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", - "http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png" + "http://otile1.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png", + "http://otile2.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png", + "http://otile3.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png", + "http://otile4.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png" ], { attribution: "Data, imagery and map information provided by MapQuest, Open Street Map and contributors, CC-BY-SA ", @@ -18,10 +18,10 @@ var map = new OpenLayers.Map({ new OpenLayers.Layer.XYZ( "Imagery", [ - "http://oatile1.mqcdn.com/naip/${z}/${x}/${y}.png", - "http://oatile2.mqcdn.com/naip/${z}/${x}/${y}.png", - "http://oatile3.mqcdn.com/naip/${z}/${x}/${y}.png", - "http://oatile4.mqcdn.com/naip/${z}/${x}/${y}.png" + "http://otile1.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png", + "http://otile2.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png", + "http://otile3.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png", + "http://otile4.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png" ], { attribution: "Tiles Courtesy of MapQuest. Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency. ", diff --git a/examples/mobile-drawing.js b/examples/mobile-drawing.js index 869880e30d..bac903c667 100644 --- a/examples/mobile-drawing.js +++ b/examples/mobile-drawing.js @@ -5,7 +5,15 @@ function init() { styleMap: new OpenLayers.StyleMap({ temporary: OpenLayers.Util.applyDefaults({ pointRadius: 16 - }, OpenLayers.Feature.Vector.style.temporary) + }, OpenLayers.Feature.Vector.style.temporary), + 'default': OpenLayers.Util.applyDefaults({ + pointRadius: 16, + strokeWidth: 3, + }, OpenLayers.Feature.Vector.style['default']), + select: OpenLayers.Util.applyDefaults({ + pointRadius: 16, + strokeWidth: 3 + }, OpenLayers.Feature.Vector.style.select) }) }); diff --git a/examples/mobile-wmts-vienna.css b/examples/mobile-wmts-vienna.css index a8ccc14a97..605932a424 100644 --- a/examples/mobile-wmts-vienna.css +++ b/examples/mobile-wmts-vienna.css @@ -12,14 +12,48 @@ html, body, #map { #title, #tags, #shortdesc { display: none; } +div.olMapViewport { + -ms-touch-action: none; +} + +/* Turn on GPU support where available */ +.olTileImage { + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -o-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000; + -moz-perspective: 1000; + -ms-perspective: 1000; + perspective: 1000; +} + +/* Tile fade animation */ .olLayerGrid .olTileImage { -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; transition: opacity 0.2s linear; - /* workaround for strange border tile squeezing on Android 4.x */ - -webkit-transform: scale(1.001); } + +/* Zoom Box */ +.olHandlerBoxZoomBox { + border: 2px solid red; + position: absolute; + background-color: white; + opacity: 0.50; + font-size: 1px; + filter: alpha(opacity=50); +} +.olDrawBox { + cursor: crosshair; +} + div.olControlAttribution { position: absolute; font-size: 10px; @@ -168,4 +202,4 @@ div.layerPanel div.mapButtonItemActive:after { div.layerPanel div.mapButtonItemInactive, div.layerPanel div.mapButtonItemActive { margin-left: 1px; -} \ No newline at end of file +} diff --git a/examples/mobile-wmts-vienna.js b/examples/mobile-wmts-vienna.js index ab593e04ce..ea38c3c186 100644 --- a/examples/mobile-wmts-vienna.js +++ b/examples/mobile-wmts-vienna.js @@ -46,49 +46,53 @@ var map; // Geolocate control for the Locate button - the locationupdated handler // draws a cross at the location and a circle showing the accuracy radius. - zoomPanel.addControls([ - new OpenLayers.Control.Geolocate({ - type: OpenLayers.Control.TYPE_TOGGLE, - geolocationOptions: { - enableHighAccuracy: false, - maximumAge: 0, - timeout: 7000 + var geolocate = new OpenLayers.Control.Geolocate({ + type: OpenLayers.Control.TYPE_TOGGLE, + bind: false, + watch: true, + geolocationOptions: { + enableHighAccuracy: false, + maximumAge: 0, + timeout: 7000 + }, + eventListeners: { + activate: function() { + map.addLayer(vector); }, - eventListeners: { - activate: function() { - map.addLayer(vector); - }, - deactivate: function() { - map.removeLayer(vector); - vector.removeAllFeatures(); - }, - locationupdated: function(e) { - vector.removeAllFeatures(); - vector.addFeatures([ - new OpenLayers.Feature.Vector(e.point, null, { - graphicName: 'cross', + deactivate: function() { + map.removeLayer(vector); + vector.removeAllFeatures(); + }, + locationupdated: function(e) { + vector.removeAllFeatures(); + vector.addFeatures([ + new OpenLayers.Feature.Vector(e.point, null, { + graphicName: 'cross', + strokeColor: '#f00', + strokeWidth: 2, + fillOpacity: 0, + pointRadius: 10 + }), + new OpenLayers.Feature.Vector( + OpenLayers.Geometry.Polygon.createRegularPolygon( + new OpenLayers.Geometry.Point(e.point.x, e.point.y), + e.position.coords.accuracy / 2, 50, 0 + ), null, { + fillOpacity: 0.1, + fillColor: '#000', strokeColor: '#f00', - strokeWidth: 2, - fillOpacity: 0, - pointRadius: 10 - }), - new OpenLayers.Feature.Vector( - OpenLayers.Geometry.Polygon.createRegularPolygon( - new OpenLayers.Geometry.Point(e.point.x, e.point.y), - e.position.coords.accuracy / 2, 50, 0 - ), null, { - fillOpacity: 0.1, - fillColor: '#000', - strokeColor: '#f00', - strokeOpacity: 0.6 - } - ) - ]); - map.zoomToExtent(vector.getDataExtent()); - } + strokeOpacity: 0.6 + } + ) + ]); + map.zoomToExtent(vector.getDataExtent()); } - }) - ]); + } + }); + zoomPanel.addControls([geolocate]); + + // Fallback layer when outside Vienna + var osm = new OpenLayers.Layer.OSM(); // Map with navigation controls optimized for touch devices map = new OpenLayers.Map({ @@ -96,23 +100,11 @@ var map; theme: null, projection: "EPSG:3857", units: "m", - maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34], - maxResolution: 156543.0339, - numZoomLevels: 20, + maxResolution: 38.21851413574219, + numZoomLevels: 8, tileManager: new OpenLayers.TileManager(), controls: [ - new OpenLayers.Control.Navigation({ - mouseWheelOptions: { - cumulative: false, - interval: 20 - }, - dragPanOptions: { - enableKinetic: { - deceleration: 0.02 - } - }, - zoomBoxEnabled: false - }), + new OpenLayers.Control.Navigation(), new OpenLayers.Control.Attribution(), zoomPanel, layerPanel @@ -122,6 +114,15 @@ var map; // update anchor for permalinks var ctr = map.getCenter(); window.location.hash = "x="+ctr.lon+"&y="+ctr.lat+"&z="+map.getZoom(); + // switch to OSM when outside Vienna + if (!map.getExtent().intersectsBounds(fmzk.tileFullExtent)) { + if (map.baseLayer !== osm) { + map.addLayer(osm); + map.setBaseLayer(osm); + } + } else if (map.baseLayer === osm) { + map.removeLayer(osm); + } } } }); @@ -133,6 +134,7 @@ var map; // Defaults for the WMTS layers var defaults = { + zoomOffset: 12, requestEncoding: "REST", matrixSet: "google3857", attribution: 'Datenquelle: Stadt Wien - data.wien.gv.at' @@ -160,13 +162,13 @@ var map; var doc = request.responseText, caps = format.read(doc); fmzk = format.createLayer(caps, OpenLayers.Util.applyDefaults( - {layer:"fmzk", transitionEffect:"resize"}, defaults + {layer:"fmzk"}, defaults )); aerial = format.createLayer(caps, OpenLayers.Util.applyDefaults( - {layer:"lb", transitionEffect:"resize"}, defaults + {layer:"lb"}, defaults )); labels = format.createLayer(caps, OpenLayers.Util.applyDefaults( - {layer:"beschriftung", isBaseLayer: false}, + {layer:"beschriftung", isBaseLayer: false, transitionEffect: 'map-resize'}, defaults )); map.addLayers([fmzk, aerial, labels]); @@ -182,25 +184,41 @@ var map; var extent = new OpenLayers.Bounds(1799448.394855, 6124949.74777, 1848250.442089, 6162571.828177); defaults.tileFullExtent = extent; fmzk = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({ - url: "http://maps.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg", + url: [ + "http://maps.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg", + "http://maps1.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg", + "http://maps2.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg", + "http://maps3.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg", + "http://maps4.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" + ], layer: "fmzk", - style: "pastell", - transitionEffect: "resize" + style: "pastell" }, defaults)); aerial = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({ - url: "http://maps.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg", + url: [ + "http://maps.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg", + "http://maps1.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg", + "http://maps2.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg", + "http://maps3.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg", + "http://maps4.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" + ], layer: "lb", - style: "farbe", - transitionEffect: "resize" + style: "farbe" }, defaults)); labels = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({ - url: "http://maps.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png", + url: [ + "http://maps.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png", + "http://maps1.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png", + "http://maps2.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png", + "http://maps3.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png", + "http://maps4.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" + ], layer: "beschriftung", style: "normal", - transitionEffect: null, - isBaseLayer: false + isBaseLayer: false, + transitionEffect: 'map-resize' }, defaults)); map.addLayers([fmzk, aerial, labels]); diff --git a/examples/polar-projections.html b/examples/polar-projections.html new file mode 100644 index 0000000000..de51cb003e --- /dev/null +++ b/examples/polar-projections.html @@ -0,0 +1,41 @@ + + + + + + + Switch between polar projections + + + + + + + + + + + +

Polar Projections WMS Example

+ +
+ switch projections polar +
+ +
Switch between different projections
+ +
+ + + + + +
+

This example shows how to switch between different projections, + maintaining the center and resolution.

+

Click the buttons above to try it, and see + polar-projections.js for the + source code.

+
+ + diff --git a/examples/polar-projections.js b/examples/polar-projections.js new file mode 100644 index 0000000000..ac717fbd97 --- /dev/null +++ b/examples/polar-projections.js @@ -0,0 +1,84 @@ +var map, layer, overlay; + +var projectionOptions = { + 'EPSG:3574': { + projection: new OpenLayers.Projection('EPSG:3574'), + units: 'm', + maxExtent: new OpenLayers.Bounds(-5505054, -5505054, 5505054, 5505054), + maxResolution: 5505054 / 128, + numZoomLevels: 18 + }, + 'EPSG:3576': { + projection: new OpenLayers.Projection('EPSG:3576'), + units: 'm', + maxExtent: new OpenLayers.Bounds(-5505054, -5505054, 5505054, 5505054), + maxResolution: 5505054 / 128, + numZoomLevels: 18 + }, + 'EPSG:3571': { + projection: new OpenLayers.Projection('EPSG:3571'), + units: 'm', + maxExtent: new OpenLayers.Bounds(-5505054, -5505054, 5505054, 5505054), + maxResolution: 5505054 / 128, + numZoomLevels: 18 + }, + 'EPSG:3573': { + projection: new OpenLayers.Projection('EPSG:3573'), + units: 'm', + maxExtent: new OpenLayers.Bounds(-5505054, -5505054, 5505054, 5505054), + maxResolution: 5505054 / 128, + numZoomLevels: 18 + } +}; + +function setProjection() { + projCode = this.innerHTML; + var oldExtent = map.getExtent(); + var oldCenter = map.getCenter(); + var oldProjection = map.getProjectionObject(); + + // map projection is controlled by the base layer + map.baseLayer.addOptions(projectionOptions[projCode]); + + // with the base layer updated, the map has the new projection now + var newProjection = map.getProjectionObject(); + + // transform the center of the old projection, not the extent + map.setCenter( + oldCenter.transform(oldProjection, newProjection, + map.getZoomForExtent(oldExtent.transform(oldProjection, newProjection)) + )); + + for (var i=map.layers.length-1; i>=0; --i) { + // update grid settings + map.layers[i].addOptions(projectionOptions[projCode]); + // redraw layer - just in case center and zoom are the same in old and + // new projection + map.layers[i].redraw(); + } +} + +function init() { + map = new OpenLayers.Map('map'); + layer = new OpenLayers.Layer.WMS( + 'world', + 'http://v2.suite.opengeo.org/geoserver/wms', + {layers: 'world', version: '1.1.1'}, + projectionOptions['EPSG:3574'] + ); + overlay = new OpenLayers.Layer.WMS( + 'world', + 'http://v2.suite.opengeo.org/geoserver/wms', + {transparent: 'true', layers: 'world:borders', styles: 'line'}, + projectionOptions['EPSG:3574'] + ); + overlay.isBaseLayer = false; + map.addLayers([layer, overlay]); + map.zoomToMaxExtent(); + + // add behaviour to dom elements + document.getElementById('epsg3574').onclick = setProjection; + document.getElementById('epsg3576').onclick = setProjection; + document.getElementById('epsg3571').onclick = setProjection; + document.getElementById('epsg3573').onclick = setProjection; +} diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index 05dc3fa7fb..11176dd459 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -144,8 +144,6 @@ "OpenLayers/Console.js", "OpenLayers/Tween.js", "OpenLayers/Kinetic.js", - "Rico/Corner.js", - "Rico/Color.js", "OpenLayers/Events.js", "OpenLayers/Events/buttonclick.js", "OpenLayers/Request.js", @@ -191,7 +189,6 @@ "OpenLayers/Layer/Zoomify.js", "OpenLayers/Layer/ArcGISCache.js", "OpenLayers/Popup/Anchored.js", - "OpenLayers/Popup/AnchoredBubble.js", "OpenLayers/Popup/Framed.js", "OpenLayers/Popup/FramedCloud.js", "OpenLayers/Feature.js", diff --git a/lib/OpenLayers/Animation.js b/lib/OpenLayers/Animation.js index 7123d6549b..7b47a088a2 100644 --- a/lib/OpenLayers/Animation.js +++ b/lib/OpenLayers/Animation.js @@ -1,9 +1,9 @@ -/** - * Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the - * full text of the license. - * + * full text of the license. */ + +/** * @requires OpenLayers/SingleFile.js * @requires OpenLayers/Util/vendorPrefix.js */ diff --git a/lib/OpenLayers/BaseTypes.js b/lib/OpenLayers/BaseTypes.js index ce664dfa0b..d416b8fdea 100644 --- a/lib/OpenLayers/BaseTypes.js +++ b/lib/OpenLayers/BaseTypes.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -127,7 +127,9 @@ OpenLayers.String = { if (i == 0) { replacement = context; } - + if (replacement === undefined) { + break; + } replacement = replacement[subs[i]]; } @@ -295,7 +297,25 @@ OpenLayers.Number = { str = integer + dsep + rem; } return str; - } + }, + + /** + * Method: zeroPad + * Create a zero padded string optionally with a radix for casting numbers. + * + * Parameters: + * num - {Number} The number to be zero padded. + * len - {Number} The length of the string to be returned. + * radix - {Number} An integer between 2 and 36 specifying the base to use + * for representing numeric values. + */ + zeroPad: function(num, len, radix) { + var str = num.toString(radix || 10); + while (str.length < len) { + str = "0" + str; + } + return str; + } }; /** diff --git a/lib/OpenLayers/BaseTypes/Bounds.js b/lib/OpenLayers/BaseTypes/Bounds.js index cb83a3922d..a828eb0cc2 100644 --- a/lib/OpenLayers/BaseTypes/Bounds.js +++ b/lib/OpenLayers/BaseTypes/Bounds.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -63,7 +63,7 @@ OpenLayers.Bounds = OpenLayers.Class({ * left - {Number} The left bounds of the box. Note that for width * calculations, this is assumed to be less than the right value. * bottom - {Number} The bottom bounds of the box. Note that for height - * calculations, this is assumed to be more than the top value. + * calculations, this is assumed to be less than the top value. * right - {Number} The right bounds. * top - {Number} The top bounds. * @@ -355,39 +355,59 @@ OpenLayers.Bounds = OpenLayers.Class({ * object. */ extend:function(object) { - var bounds = null; if (object) { - // clear cached center location switch(object.CLASS_NAME) { - case "OpenLayers.LonLat": - bounds = new OpenLayers.Bounds(object.lon, object.lat, - object.lon, object.lat); + case "OpenLayers.LonLat": + this.extendXY(object.lon, object.lat); break; case "OpenLayers.Geometry.Point": - bounds = new OpenLayers.Bounds(object.x, object.y, - object.x, object.y); + this.extendXY(object.x, object.y); break; - - case "OpenLayers.Bounds": - bounds = object; + + case "OpenLayers.Bounds": + // clear cached center location + this.centerLonLat = null; + + if ( (this.left == null) || (object.left < this.left)) { + this.left = object.left; + } + if ( (this.bottom == null) || (object.bottom < this.bottom) ) { + this.bottom = object.bottom; + } + if ( (this.right == null) || (object.right > this.right) ) { + this.right = object.right; + } + if ( (this.top == null) || (object.top > this.top) ) { + this.top = object.top; + } break; } - - if (bounds) { - this.centerLonLat = null; - if ( (this.left == null) || (bounds.left < this.left)) { - this.left = bounds.left; - } - if ( (this.bottom == null) || (bounds.bottom < this.bottom) ) { - this.bottom = bounds.bottom; - } - if ( (this.right == null) || (bounds.right > this.right) ) { - this.right = bounds.right; - } - if ( (this.top == null) || (bounds.top > this.top) ) { - this.top = bounds.top; - } - } + } + }, + + /** + * APIMethod: extendXY + * Extend the bounds to include the XY coordinate specified. + * + * Parameters: + * x - {number} The X part of the the coordinate. + * y - {number} The Y part of the the coordinate. + */ + extendXY:function(x, y) { + // clear cached center location + this.centerLonLat = null; + + if ((this.left == null) || (x < this.left)) { + this.left = x; + } + if ((this.bottom == null) || (y < this.bottom)) { + this.bottom = y; + } + if ((this.right == null) || (x > this.right)) { + this.right = x; + } + if ((this.top == null) || (y > this.top)) { + this.top = y; } }, diff --git a/lib/OpenLayers/BaseTypes/Class.js b/lib/OpenLayers/BaseTypes/Class.js index 1bbceeaef8..2be7212994 100644 --- a/lib/OpenLayers/BaseTypes/Class.js +++ b/lib/OpenLayers/BaseTypes/Class.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/BaseTypes/Date.js b/lib/OpenLayers/BaseTypes/Date.js index 30fcf20337..2646f2472f 100644 --- a/lib/OpenLayers/BaseTypes/Date.js +++ b/lib/OpenLayers/BaseTypes/Date.js @@ -49,13 +49,6 @@ OpenLayers.Date = { return date.toISOString(); }; } else { - function pad(num, len) { - var str = num + ""; - while (str.length < len) { - str = "0" + str; - } - return str; - } return function(date) { var str; if (isNaN(date.getTime())) { @@ -65,12 +58,12 @@ OpenLayers.Date = { } else { str = date.getUTCFullYear() + "-" + - pad(date.getUTCMonth() + 1, 2) + "-" + - pad(date.getUTCDate(), 2) + "T" + - pad(date.getUTCHours(), 2) + ":" + - pad(date.getUTCMinutes(), 2) + ":" + - pad(date.getUTCSeconds(), 2) + "." + - pad(date.getUTCMilliseconds(), 3) + "Z"; + OpenLayers.Number.zeroPad(date.getUTCMonth() + 1, 2) + "-" + + OpenLayers.Number.zeroPad(date.getUTCDate(), 2) + "T" + + OpenLayers.Number.zeroPad(date.getUTCHours(), 2) + ":" + + OpenLayers.Number.zeroPad(date.getUTCMinutes(), 2) + ":" + + OpenLayers.Number.zeroPad(date.getUTCSeconds(), 2) + "." + + OpenLayers.Number.zeroPad(date.getUTCMilliseconds(), 3) + "Z"; } return str; }; diff --git a/lib/OpenLayers/BaseTypes/Element.js b/lib/OpenLayers/BaseTypes/Element.js index ccb9976a27..dc71b5c8ef 100644 --- a/lib/OpenLayers/BaseTypes/Element.js +++ b/lib/OpenLayers/BaseTypes/Element.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/BaseTypes/LonLat.js b/lib/OpenLayers/BaseTypes/LonLat.js index f06a88f8b5..0780dc339d 100644 --- a/lib/OpenLayers/BaseTypes/LonLat.js +++ b/lib/OpenLayers/BaseTypes/LonLat.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/BaseTypes/Pixel.js b/lib/OpenLayers/BaseTypes/Pixel.js index 08753090f4..d6ac60abff 100644 --- a/lib/OpenLayers/BaseTypes/Pixel.js +++ b/lib/OpenLayers/BaseTypes/Pixel.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/BaseTypes/Size.js b/lib/OpenLayers/BaseTypes/Size.js index ef5ae2740e..34c7a6c80b 100644 --- a/lib/OpenLayers/BaseTypes/Size.js +++ b/lib/OpenLayers/BaseTypes/Size.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Console.js b/lib/OpenLayers/Console.js index c0be882b16..ef5029aa40 100644 --- a/lib/OpenLayers/Console.js +++ b/lib/OpenLayers/Console.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control.js b/lib/OpenLayers/Control.js index 9fd154ad59..472a4e6e44 100644 --- a/lib/OpenLayers/Control.js +++ b/lib/OpenLayers/Control.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/ArgParser.js b/lib/OpenLayers/Control/ArgParser.js index 3008532089..6b076f5736 100644 --- a/lib/OpenLayers/Control/ArgParser.js +++ b/lib/OpenLayers/Control/ArgParser.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Attribution.js b/lib/OpenLayers/Control/Attribution.js index 713e00680b..e5ea1ce6fb 100644 --- a/lib/OpenLayers/Control/Attribution.js +++ b/lib/OpenLayers/Control/Attribution.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Button.js b/lib/OpenLayers/Control/Button.js index 3d1536388c..830df6d69f 100644 --- a/lib/OpenLayers/Control/Button.js +++ b/lib/OpenLayers/Control/Button.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/CacheRead.js b/lib/OpenLayers/Control/CacheRead.js index 6b639f81f8..7768bce2db 100644 --- a/lib/OpenLayers/Control/CacheRead.js +++ b/lib/OpenLayers/Control/CacheRead.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/CacheWrite.js b/lib/OpenLayers/Control/CacheWrite.js index c937520baf..3d4ecf5156 100644 --- a/lib/OpenLayers/Control/CacheWrite.js +++ b/lib/OpenLayers/Control/CacheWrite.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/DragFeature.js b/lib/OpenLayers/Control/DragFeature.js index c634cde82e..d8fb15f9ea 100644 --- a/lib/OpenLayers/Control/DragFeature.js +++ b/lib/OpenLayers/Control/DragFeature.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/DragPan.js b/lib/OpenLayers/Control/DragPan.js index 62d6059e3c..2e2146f2cd 100644 --- a/lib/OpenLayers/Control/DragPan.js +++ b/lib/OpenLayers/Control/DragPan.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -56,11 +56,11 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, { * {Boolean} Set this option to enable "kinetic dragging". Can be * set to true or to an object. If set to an object this * object will be passed to the {} - * constructor. Defaults to false. - * If you set this property, you should ensure that - * OpenLayers/Kinetic.js is included in your build config + * constructor. Defaults to true. + * To get kinetic dragging, ensure that OpenLayers/Kinetic.js is + * included in your build config. */ - enableKinetic: false, + enableKinetic: true, /** * APIProperty: kineticInterval @@ -77,7 +77,7 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, { * as callbacks. */ draw: function() { - if(this.enableKinetic) { + if (this.enableKinetic && OpenLayers.Kinetic) { var config = {interval: this.kineticInterval}; if(typeof this.enableKinetic === "object") { config = OpenLayers.Util.extend(config, this.enableKinetic); diff --git a/lib/OpenLayers/Control/DrawFeature.js b/lib/OpenLayers/Control/DrawFeature.js index 5afe2f8e13..b0afc71ac4 100644 --- a/lib/OpenLayers/Control/DrawFeature.js +++ b/lib/OpenLayers/Control/DrawFeature.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/EditingToolbar.js b/lib/OpenLayers/Control/EditingToolbar.js index 89575e3fb7..ba7ca40109 100644 --- a/lib/OpenLayers/Control/EditingToolbar.js +++ b/lib/OpenLayers/Control/EditingToolbar.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Geolocate.js b/lib/OpenLayers/Control/Geolocate.js index f2fcb91910..4b5b43958e 100644 --- a/lib/OpenLayers/Control/Geolocate.js +++ b/lib/OpenLayers/Control/Geolocate.js @@ -45,8 +45,15 @@ OpenLayers.Control.Geolocate = OpenLayers.Class(OpenLayers.Control, { /** * Property: geolocation * {Object} The geolocation engine, as a property to be possibly mocked. + * This is set lazily to avoid a memory leak in IE9. */ - geolocation: navigator.geolocation, + geolocation: null, + + /** + * Property: available + * {Boolean} The navigator.geolocation object is available. + */ + available: ('geolocation' in navigator), /** * APIProperty: bind @@ -90,6 +97,10 @@ OpenLayers.Control.Geolocate = OpenLayers.Class(OpenLayers.Control, { * {Boolean} The control was effectively activated. */ activate: function () { + if (this.available && !this.geolocation) { + // set lazily to avoid IE9 memory leak + this.geolocation = navigator.geolocation; + } if (!this.geolocation) { this.events.triggerEvent("locationuncapable"); return false; diff --git a/lib/OpenLayers/Control/GetFeature.js b/lib/OpenLayers/Control/GetFeature.js index eea7a65512..144e87fc80 100644 --- a/lib/OpenLayers/Control/GetFeature.js +++ b/lib/OpenLayers/Control/GetFeature.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Graticule.js b/lib/OpenLayers/Control/Graticule.js index a5a908a803..2fce50d4e7 100644 --- a/lib/OpenLayers/Control/Graticule.js +++ b/lib/OpenLayers/Control/Graticule.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/KeyboardDefaults.js b/lib/OpenLayers/Control/KeyboardDefaults.js index aab664e9e9..3af88317f0 100644 --- a/lib/OpenLayers/Control/KeyboardDefaults.js +++ b/lib/OpenLayers/Control/KeyboardDefaults.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/LayerSwitcher.js b/lib/OpenLayers/Control/LayerSwitcher.js index 6f5ab78ed6..668f5c349b 100644 --- a/lib/OpenLayers/Control/LayerSwitcher.js +++ b/lib/OpenLayers/Control/LayerSwitcher.js @@ -1,49 +1,30 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ -/** +/** * @requires OpenLayers/Control.js * @requires OpenLayers/Lang.js - * @requires OpenLayers/Console.js + * @requires OpenLayers/Util.js * @requires OpenLayers/Events/buttonclick.js */ /** * Class: OpenLayers.Control.LayerSwitcher - * The LayerSwitcher control displays a table of contents for the map. This + * The LayerSwitcher control displays a table of contents for the map. This * allows the user interface to switch between BaseLasyers and to show or hide - * Overlays. By default the switcher is shown minimized on the right edge of + * Overlays. By default the switcher is shown minimized on the right edge of * the map, the user may expand it by clicking on the handle. * - * To create the LayerSwitcher outside of the map, pass the Id of a html div + * To create the LayerSwitcher outside of the map, pass the Id of a html div * as the first argument to the constructor. - * + * * Inherits from: * - */ -OpenLayers.Control.LayerSwitcher = - OpenLayers.Class(OpenLayers.Control, { +OpenLayers.Control.LayerSwitcher = OpenLayers.Class(OpenLayers.Control, { - /** - * APIProperty: roundedCorner - * {Boolean} If true the Rico library is used for rounding the corners - * of the layer switcher div, defaults to false. *Deprecated*. Use - * CSS3's border-radius instead. If this option is set to true the - * Rico/Corner.js script must be loaded in the page, and therefore - * listed in the build profile. - * - */ - roundedCorner: false, - - /** - * APIProperty: roundedCornerColor - * {String} The color of the rounded corners, only applies if roundedCorner - * is true, defaults to "darkblue". - */ - roundedCornerColor: "darkblue", - /** * Property: layerStates * {Array(Object)} Basically a copy of the "state" of the map's layers @@ -51,90 +32,85 @@ OpenLayers.Control.LayerSwitcher = * unnecessarily redrawing the control. */ layerStates: null, - // DOM Elements - + /** * Property: layersDiv - * {DOMElement} + * {DOMElement} */ layersDiv: null, - - /** + + /** * Property: baseLayersDiv * {DOMElement} */ baseLayersDiv: null, - /** + /** * Property: baseLayers * {Array(Object)} */ baseLayers: null, - - - /** + + + /** * Property: dataLbl - * {DOMElement} + * {DOMElement} */ dataLbl: null, - - /** + + /** * Property: dataLayersDiv - * {DOMElement} + * {DOMElement} */ dataLayersDiv: null, - /** + /** * Property: dataLayers - * {Array(Object)} + * {Array(Object)} */ dataLayers: null, - /** + /** * Property: minimizeDiv - * {DOMElement} + * {DOMElement} */ minimizeDiv: null, - /** + /** * Property: maximizeDiv - * {DOMElement} + * {DOMElement} */ maximizeDiv: null, - + /** * APIProperty: ascending - * {Boolean} + * {Boolean} */ ascending: true, - + /** * Constructor: OpenLayers.Control.LayerSwitcher - * + * * Parameters: * options - {Object} */ initialize: function(options) { OpenLayers.Control.prototype.initialize.apply(this, arguments); this.layerStates = []; - - if(this.roundedCorner) { - OpenLayers.Console.warn('roundedCorner option is deprecated'); - } }, /** - * APIMethod: destroy - */ + * APIMethod: destroy + */ destroy: function() { - - //clear out layers info and unregister their events + + //clear out layers info and unregister their events this.clearLayersArray("base"); this.clearLayersArray("data"); - + this.map.events.un({ buttonclick: this.onButtonClick, addlayer: this.redraw, @@ -144,15 +120,15 @@ OpenLayers.Control.LayerSwitcher = scope: this }); this.events.unregister("buttonclick", this, this.onButtonClick); - + OpenLayers.Control.prototype.destroy.apply(this, arguments); }, - /** + /** * Method: setMap * * Properties: - * map - {} + * map - {} */ setMap: function(map) { OpenLayers.Control.prototype.setMap.apply(this, arguments); @@ -176,9 +152,9 @@ OpenLayers.Control.LayerSwitcher = * Method: draw * * Returns: - * {DOMElement} A reference to the DIV DOMElement containing the + * {DOMElement} A reference to the DIV DOMElement containing the * switcher tabs. - */ + */ draw: function() { OpenLayers.Control.prototype.draw.apply(this); @@ -191,7 +167,7 @@ OpenLayers.Control.LayerSwitcher = } // populate div with current info - this.redraw(); + this.redraw(); return this.div; }, @@ -224,13 +200,13 @@ OpenLayers.Control.LayerSwitcher = } }, - /** + /** * Method: clearLayersArray * User specifies either "base" or "data". we then clear all the * corresponding listeners, the div, and reinitialize a new array. - * + * * Parameters: - * layersType - {String} + * layersType - {String} */ clearLayersArray: function(layersType) { this[layersType + "LayersDiv"].innerHTML = ""; @@ -241,54 +217,53 @@ OpenLayers.Control.LayerSwitcher = /** * Method: checkRedraw * Checks if the layer state has changed since the last redraw() call. - * + * * Returns: - * {Boolean} The layer state changed since the last redraw() call. + * {Boolean} The layer state changed since the last redraw() call. */ checkRedraw: function() { - var redraw = false; if ( !this.layerStates.length || (this.map.layers.length != this.layerStates.length) ) { - redraw = true; - } else { - for (var i=0, len=this.layerStates.length; i labelSpan["for"] = inputElem.id; OpenLayers.Element.addClass(labelSpan, "labelSpan olButton"); labelSpan._layer = layer.id; @@ -350,12 +333,12 @@ OpenLayers.Control.LayerSwitcher = labelSpan.style.color = "gray"; } labelSpan.innerHTML = layer.name; - labelSpan.style.verticalAlign = (baseLayer) ? "bottom" + labelSpan.style.verticalAlign = (baseLayer) ? "bottom" : "baseline"; // create line break var br = document.createElement("br"); - - + + var groupArray = (baseLayer) ? this.baseLayers : this.dataLayers; groupArray.push({ @@ -363,8 +346,8 @@ OpenLayers.Control.LayerSwitcher = 'inputElem': inputElem, 'labelSpan': labelSpan }); - - + + var groupDiv = (baseLayer) ? this.baseLayersDiv : this.dataLayersDiv; groupDiv.appendChild(inputElem); @@ -374,24 +357,24 @@ OpenLayers.Control.LayerSwitcher = } // if no overlays, dont display the overlay label - this.dataLbl.style.display = (containsOverlays) ? "" : "none"; - + this.dataLbl.style.display = (containsOverlays) ? "" : "none"; + // if no baselayers, dont display the baselayer label - this.baseLbl.style.display = (containsBaseLayers) ? "" : "none"; + this.baseLbl.style.display = (containsBaseLayers) ? "" : "none"; return this.div; }, - /** + /** * Method: updateMap * Cycles through the loaded data and base layer input arrays and makes - * the necessary calls to the Map object such that that the map's - * visual state corresponds to what the user has selected in + * the necessary calls to the Map object such that that the map's + * visual state corresponds to what the user has selected in * the control. */ updateMap: function() { - // set the newly selected base layer + // set the newly selected base layer for(var i=0, len=this.baseLayers.length; i} Events instance for listeners and triggering * control specific events. @@ -41,28 +41,28 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { * APIProperty: handlerOptions * {Object} Used to set non-default properties on the control's handler */ - + /** * Property: callbacks * {Object} The functions that are sent to the handler for callback */ callbacks: null, - + /** - * Property: displaySystem + * APIProperty: displaySystem * {String} Display system for output measurements. Supported values * are 'english', 'metric', and 'geographic'. Default is 'metric'. */ displaySystem: 'metric', - + /** - * Property: geodesic + * APIProperty: geodesic * {Boolean} Calculate geodesic metrics instead of planar metrics. This * requires that geometries can be transformed into Geographic/WGS84 * (if that is not already the map projection). Default is false. */ geodesic: false, - + /** * Property: displaySystemUnits * {Object} Units for various measurement systems. Values are arrays @@ -111,10 +111,10 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { /** * Constructor: OpenLayers.Control.Measure - * + * * Parameters: - * handler - {} - * options - {Object} + * handler - {} + * options - {Object} */ initialize: function(handler, options) { OpenLayers.Control.prototype.initialize.apply(this, [options]); @@ -125,14 +125,14 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { } this.callbacks = OpenLayers.Util.extend(callbacks, this.callbacks); - // let the handler options override, so old code that passes 'persist' + // let the handler options override, so old code that passes 'persist' // directly to the handler does not need an update this.handlerOptions = OpenLayers.Util.extend( {persist: this.persist}, this.handlerOptions ); this.handler = new handler(this, this.callbacks, this.handlerOptions); }, - + /** * APIMethod: deactivate */ @@ -164,7 +164,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { delete this.callbacks.modify; } }, - + /** * Method: updateHandler * @@ -194,7 +194,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { this.cancelDelay(); this.measure(geometry, "measure"); }, - + /** * Method: measurePartial * Called each time a new point is added to the measurement sketch. @@ -225,9 +225,11 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { /** * Method: measureImmediate * Called each time the measurement sketch is modified. - * - * Parameters: point - {} The point at the - * mouseposition. feature - {} The sketch feature. + * + * Parameters: + * point - {} The point at the mouse position. + * feature - {} The sketch feature. + * drawing - {Boolean} Indicates whether we're currently drawing. */ measureImmediate : function(point, feature, drawing) { if (drawing && !this.handler.freehandMode(this.handler.evt)) { @@ -270,7 +272,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { geometry: geometry }); }, - + /** * Method: getBestArea * Based on the returns the area of a geometry. @@ -294,7 +296,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { } return [area, unit]; }, - + /** * Method: getArea * @@ -321,7 +323,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, { } return area; }, - + /** * Method: getBestLength * Based on the returns the length of a geometry. diff --git a/lib/OpenLayers/Control/ModifyFeature.js b/lib/OpenLayers/Control/ModifyFeature.js index ecda73a088..1f619a3918 100644 --- a/lib/OpenLayers/Control/ModifyFeature.js +++ b/lib/OpenLayers/Control/ModifyFeature.js @@ -1,11 +1,10 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ /** - * @requires OpenLayers/Control/DragFeature.js - * @requires OpenLayers/Control/SelectFeature.js + * @requires OpenLayers/Handler/Drag.js * @requires OpenLayers/Handler/Keyboard.js */ @@ -50,7 +49,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { * Default is true. */ toggle: true, - + /** * APIProperty: standalone * {Boolean} Set to true to create a control without SelectFeature @@ -67,20 +66,26 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { * {} */ layer: null, - + /** * Property: feature * {} Feature currently available for modification. */ feature: null, - + + /** + * Property: vertex + * {} Vertex currently being modified. + */ + vertex: null, + /** * Property: vertices * {Array()} Verticies currently available * for dragging. */ vertices: null, - + /** * Property: virtualVertices * {Array()} Virtual vertices in the middle @@ -88,24 +93,12 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { */ virtualVertices: null, - /** - * Property: selectControl - * {} - */ - selectControl: null, - - /** - * Property: dragControl - * {} - */ - dragControl: null, - /** * Property: handlers * {Object} */ handlers: null, - + /** * APIProperty: deleteCodes * {Array(Integer)} Keycodes for deleting verticies. Set to null to disable @@ -120,7 +113,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { * {Object} A symbolizer to be used for virtual vertices. */ virtualStyle: null, - + /** * APIProperty: vertexRenderIntent * {String} The renderIntent to use for vertices. If no is @@ -232,64 +225,50 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { if(!(OpenLayers.Util.isArray(this.deleteCodes))) { this.deleteCodes = [this.deleteCodes]; } - var control = this; - - // configure the select control - var selectOptions = { - geometryTypes: this.geometryTypes, - clickout: this.clickout, - toggle: this.toggle, - onBeforeSelect: this.beforeSelectFeature, - onSelect: this.selectFeature, - onUnselect: this.unselectFeature, - scope: this - }; - if(this.standalone === false) { - this.selectControl = new OpenLayers.Control.SelectFeature( - layer, selectOptions - ); - } - - // configure the drag control - var dragOptions = { - documentDrag: this.documentDrag, - geometryTypes: ["OpenLayers.Geometry.Point"], - onStart: function(feature, pixel) { - control.dragStart.apply(control, [feature, pixel]); + + // configure the drag handler + var dragCallbacks = { + down: function(pixel) { + this.vertex = null; + var feature = this.layer.getFeatureFromEvent( + this.handlers.drag.evt); + if (feature) { + this.dragStart(feature); + } else if (this.feature && this.clickout) { + this.unselectFeature(this.feature); + } }, - onDrag: function(feature, pixel) { - control.dragVertex.apply(control, [feature, pixel]); + move: function(pixel) { + delete this._unselect; + if (this.vertex) { + this.dragVertex(this.vertex, pixel); + } }, - onComplete: function(feature) { - control.dragComplete.apply(control, [feature]); + up: function() { + this.handlers.drag.stopDown = false; + if (this._unselect) { + this.unselectFeature(this._unselect); + delete this._unselect; + } }, - featureCallbacks: { - over: function(feature) { - /** - * In normal mode, the feature handler is set up to allow - * dragging of all points. In standalone mode, we only - * want to allow dragging of sketch vertices and virtual - * vertices - or, in the case of a modifiable point, the - * point itself. - */ - if(control.standalone !== true || feature._sketch || - control.feature === feature) { - control.dragControl.overFeature.apply( - control.dragControl, [feature]); - } + done: function(pixel) { + if (this.vertex) { + this.dragComplete(this.vertex); } } }; - this.dragControl = new OpenLayers.Control.DragFeature( - layer, dragOptions - ); + var dragOptions = { + documentDrag: this.documentDrag, + stopDown: false + }; // configure the keyboard handler var keyboardOptions = { keydown: this.handleKeypress }; this.handlers = { - keyboard: new OpenLayers.Handler.Keyboard(this, keyboardOptions) + keyboard: new OpenLayers.Handler.Keyboard(this, keyboardOptions), + drag: new OpenLayers.Handler.Drag(this, dragCallbacks, dragOptions) }; }, @@ -298,9 +277,14 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { * Take care of things that are not handled in superclass. */ destroy: function() { + if (this.map) { + this.map.events.un({ + "removelayer": this.handleMapEvents, + "changelayer": this.handleMapEvents, + scope: this + }); + } this.layer = null; - this.standalone || this.selectControl.destroy(); - this.dragControl.destroy(); OpenLayers.Control.prototype.destroy.apply(this, []); }, @@ -312,8 +296,14 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { * {Boolean} Successfully activated the control. */ activate: function() { - return ((this.standalone || this.selectControl.activate()) && - this.handlers.keyboard.activate() && + this.moveLayerToTop(); + this.map.events.on({ + "removelayer": this.handleMapEvents, + "changelayer": this.handleMapEvents, + scope: this + }); + return (this.handlers.keyboard.activate() && + this.handlers.drag.activate() && OpenLayers.Control.prototype.activate.apply(this, arguments)); }, @@ -328,29 +318,26 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { var deactivated = false; // the return from the controls is unimportant in this case if(OpenLayers.Control.prototype.deactivate.apply(this, arguments)) { + this.moveLayerBack(); + this.map.events.un({ + "removelayer": this.handleMapEvents, + "changelayer": this.handleMapEvents, + scope: this + }); this.layer.removeFeatures(this.vertices, {silent: true}); this.layer.removeFeatures(this.virtualVertices, {silent: true}); this.vertices = []; - this.dragControl.deactivate(); - var feature = this.feature; - var valid = feature && feature.geometry && feature.layer; - if(this.standalone === false) { - if(valid) { - this.selectControl.unselect.apply(this.selectControl, - [feature]); - } - this.selectControl.deactivate(); - } else { - if(valid) { - this.unselectFeature(feature); - } - } + this.handlers.drag.deactivate(); this.handlers.keyboard.deactivate(); + var feature = this.feature; + if (feature && feature.geometry && feature.layer) { + this.unselectFeature(feature); + } deactivated = true; } return deactivated; }, - + /** * Method: beforeSelectFeature * Called before a feature is selected. @@ -367,19 +354,27 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { /** * APIMethod: selectFeature * Select a feature for modification in standalone mode. In non-standalone - * mode, this method is called when the select feature control selects a - * feature. Register a listener to the beforefeaturemodified event and - * return false to prevent feature modification. + * mode, this method is called when a feature is selected by clicking. + * Register a listener to the beforefeaturemodified event and return false + * to prevent feature modification. * * Parameters: * feature - {} the selected feature. */ selectFeature: function(feature) { - if (!this.standalone || this.beforeSelectFeature(feature) !== false) { + if (this.geometryTypes && OpenLayers.Util.indexOf(this.geometryTypes, + feature.geometry.CLASS_NAME) == -1) { + return; + } + if (this.beforeSelectFeature(feature) !== false) { + if (this.feature) { + this.unselectFeature(this.feature); + } this.feature = feature; + this.layer.selectedFeatures.push(feature); + this.layer.drawFeature(feature, 'select'); this.modified = false; this.resetVertices(); - this.dragControl.activate(); this.onModificationStart(this.feature); } // keep track of geometry modifications @@ -409,8 +404,9 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { this.layer.destroyFeatures([this.radiusHandle], {silent: true}); delete this.radiusHandle; } + this.layer.drawFeature(this.feature, 'default'); this.feature = null; - this.dragControl.deactivate(); + OpenLayers.Util.removeItem(this.layer.selectedFeatures, feature); this.onModificationEnd(feature); this.layer.events.triggerEvent("afterfeaturemodified", { feature: feature, @@ -418,64 +414,48 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { }); this.modified = false; }, - + + /** * Method: dragStart - * Called by the drag feature control with before a feature is dragged. - * This method is used to differentiate between points and vertices - * of higher order geometries. This respects the - * property and forces a select of points when the drag control is - * already active (and stops events from propagating to the select - * control). + * Called by the drag handler before a feature is dragged. This method is + * used to differentiate between points and vertices + * of higher order geometries. * * Parameters: * feature - {} The point or vertex about to be * dragged. - * pixel - {} Pixel location of the mouse event. */ - dragStart: function(feature, pixel) { - // only change behavior if the feature is not in the vertices array - if(feature != this.feature && !feature.geometry.parent && - feature != this.dragHandle && feature != this.radiusHandle) { - if(this.standalone === false && this.feature) { - // unselect the currently selected feature - this.selectControl.clickFeature.apply(this.selectControl, - [this.feature]); - } - // check any constraints on the geometry type - if(this.geometryTypes == null || - OpenLayers.Util.indexOf(this.geometryTypes, - feature.geometry.CLASS_NAME) != -1) { - // select the point - this.standalone || this.selectControl.clickFeature.apply( - this.selectControl, [feature]); - /** - * TBD: These lines improve workflow by letting the user - * immediately start dragging after the mouse down. - * However, it is very ugly to be messing with controls - * and their handlers in this way. I'd like a better - * solution if the workflow change is necessary. - */ - // prepare the point for dragging - this.dragControl.overFeature.apply(this.dragControl, - [feature]); - this.dragControl.lastPixel = pixel; - this.dragControl.handlers.drag.started = true; - this.dragControl.handlers.drag.start = pixel; - this.dragControl.handlers.drag.last = pixel; + dragStart: function(feature) { + var isPoint = feature.geometry.CLASS_NAME == + 'OpenLayers.Geometry.Point'; + if (!this.standalone && + ((!feature._sketch && isPoint) || !feature._sketch)) { + if (this.toggle && this.feature === feature) { + // mark feature for unselection + this._unselect = feature; } + this.selectFeature(feature); + } + if (feature._sketch || isPoint) { + // feature is a drag or virtual handle or point + this.vertex = feature; + this.handlers.drag.stopDown = true; } }, - + /** * Method: dragVertex - * Called by the drag feature control with each drag move of a vertex. + * Called by the drag handler with each drag move of a vertex. * * Parameters: * vertex - {} The vertex being dragged. * pixel - {} Pixel location of the mouse event. */ dragVertex: function(vertex, pixel) { + var pos = this.map.getLonLatFromViewPortPx(pixel); + var geom = vertex.geometry; + geom.move(pos.lon - geom.x, pos.lat - geom.y); this.modified = true; /** * Five cases: @@ -487,9 +467,6 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { */ if(this.feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") { // dragging a simple point - if(this.feature != vertex) { - this.feature = vertex; - } this.layer.events.triggerEvent("vertexmodified", { vertex: vertex.geometry, feature: this.feature, @@ -526,7 +503,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { this.virtualVertices = []; } this.layer.drawFeature(this.feature, this.standalone ? undefined : - this.selectControl.renderIntent); + 'select'); } // keep the vertex on top so it gets the mouseout after dragging // this should be removed in favor of an option to draw under or @@ -536,7 +513,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { /** * Method: dragComplete - * Called by the drag feature control when the feature dragging is complete. + * Called by the drag handler when the feature dragging is complete. * * Parameters: * vertex - {} The vertex being dragged. @@ -572,16 +549,6 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { * Method: resetVertices */ resetVertices: function() { - // if coming from a drag complete we're about to destroy the vertex - // that was just dragged. For that reason, the drag feature control - // will never detect a mouse-out on that vertex, meaning that the drag - // handler won't be deactivated. This can cause errors because the drag - // feature control still has a feature to drag but that feature is - // destroyed. To prevent this, we call outFeature on the drag feature - // control if the control actually has a feature to drag. - if(this.dragControl.feature) { - this.dragControl.outFeature(this.dragControl.feature); - } if(this.vertices.length > 0) { this.layer.removeFeatures(this.vertices, {silent: true}); this.vertices = []; @@ -632,11 +599,10 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { // check for delete key if(this.feature && OpenLayers.Util.indexOf(this.deleteCodes, code) != -1) { - var vertex = this.dragControl.feature; - if(vertex && - OpenLayers.Util.indexOf(this.vertices, vertex) != -1 && - !this.dragControl.handlers.drag.dragging && - vertex.geometry.parent) { + var vertex = this.layer.getFeatureFromEvent(this.handlers.drag.evt); + if (vertex && + OpenLayers.Util.indexOf(this.vertices, vertex) != -1 && + !this.handlers.drag.dragging && vertex.geometry.parent) { // remove the vertex vertex.geometry.parent.removeComponent(vertex.geometry); this.layer.events.triggerEvent("vertexremoved", { @@ -645,8 +611,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { pixel: evt.xy }); this.layer.drawFeature(this.feature, this.standalone ? - undefined : - this.selectControl.renderIntent); + undefined : 'select'); this.modified = true; this.resetVertices(); this.setFeatureState(); @@ -800,11 +765,49 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { * map - {} The control's map. */ setMap: function(map) { - this.standalone || this.selectControl.setMap(map); - this.dragControl.setMap(map); + this.handlers.drag.setMap(map); OpenLayers.Control.prototype.setMap.apply(this, arguments); }, + /** + * Method: handleMapEvents + * + * Parameters: + * evt - {Object} + */ + handleMapEvents: function(evt) { + if (evt.type == "removelayer" || evt.property == "order") { + this.moveLayerToTop(); + } + }, + + /** + * Method: moveLayerToTop + * Moves the layer for this handler to the top, so mouse events can reach + * it. + */ + moveLayerToTop: function() { + var index = Math.max(this.map.Z_INDEX_BASE['Feature'] - 1, + this.layer.getZIndex()) + 1; + this.layer.setZIndex(index); + + }, + + /** + * Method: moveLayerBack + * Moves the layer back to the position determined by the map's layers + * array. + */ + moveLayerBack: function() { + var index = this.layer.getZIndex() - 1; + if (index >= this.map.Z_INDEX_BASE['Feature']) { + this.layer.setZIndex(index); + } else { + this.map.setLayerZIndex(this.layer, + this.map.getLayerIndex(this.layer)); + } + }, + CLASS_NAME: "OpenLayers.Control.ModifyFeature" }); diff --git a/lib/OpenLayers/Control/NavToolbar.js b/lib/OpenLayers/Control/NavToolbar.js index 626b616476..b6bc2aa464 100644 --- a/lib/OpenLayers/Control/NavToolbar.js +++ b/lib/OpenLayers/Control/NavToolbar.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Navigation.js b/lib/OpenLayers/Control/Navigation.js index 8c838dddb9..d50e131204 100644 --- a/lib/OpenLayers/Control/Navigation.js +++ b/lib/OpenLayers/Control/Navigation.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -77,7 +77,9 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, { /** * Property: mouseWheelOptions * {Object} Options passed to the MouseWheel control (only useful if - * is set to true) + * is set to true). Default is no options for maps + * with fractionalZoom set to true, otherwise + * {cumulative: false, interval: 50, maxDelta: 6} */ mouseWheelOptions: null, @@ -208,10 +210,15 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, { {map: this.map, keyMask: this.zoomBoxKeyMask}); this.dragPan.draw(); this.zoomBox.draw(); + var wheelOptions = this.map.fractionalZoom ? {} : { + cumulative: false, + interval: 50, + maxDelta: 6 + }; this.handlers.wheel = new OpenLayers.Handler.MouseWheel( - this, {"up" : this.wheelUp, - "down": this.wheelDown}, - this.mouseWheelOptions ); + this, {up : this.wheelUp, down: this.wheelDown}, + OpenLayers.Util.extend(wheelOptions, this.mouseWheelOptions) + ); if (OpenLayers.Control.PinchZoom) { this.pinchZoom = new OpenLayers.Control.PinchZoom( OpenLayers.Util.extend( @@ -238,8 +245,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, { * evt - {Event} */ defaultDblClick: function (evt) { - var newCenter = this.map.getLonLatFromViewPortPx( evt.xy ); - this.map.setCenter(newCenter, this.map.zoom + 1); + this.map.zoomTo(this.map.zoom + 1, evt.xy); }, /** @@ -249,8 +255,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, { * evt - {Event} */ defaultDblRightClick: function (evt) { - var newCenter = this.map.getLonLatFromViewPortPx( evt.xy ); - this.map.setCenter(newCenter, this.map.zoom - 1); + this.map.zoomTo(this.map.zoom - 1, evt.xy); }, /** @@ -264,22 +269,14 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, { if (!this.map.fractionalZoom) { deltaZ = Math.round(deltaZ); } - var currentZoom = this.map.getZoom(); - var newZoom = this.map.getZoom() + deltaZ; + var currentZoom = this.map.getZoom(), + newZoom = currentZoom + deltaZ; newZoom = Math.max(newZoom, 0); newZoom = Math.min(newZoom, this.map.getNumZoomLevels()); if (newZoom === currentZoom) { return; } - var size = this.map.getSize(); - var deltaX = size.w/2 - evt.xy.x; - var deltaY = evt.xy.y - size.h/2; - var newRes = this.map.baseLayer.getResolutionForZoom(newZoom); - var zoomPoint = this.map.getLonLatFromPixel(evt.xy); - var newCenter = new OpenLayers.LonLat( - zoomPoint.lon + deltaX * newRes, - zoomPoint.lat + deltaY * newRes ); - this.map.setCenter( newCenter, newZoom ); + this.map.zoomTo(newZoom, evt.xy); }, /** diff --git a/lib/OpenLayers/Control/NavigationHistory.js b/lib/OpenLayers/Control/NavigationHistory.js index 22aa72168d..bf2f95afa3 100644 --- a/lib/OpenLayers/Control/NavigationHistory.js +++ b/lib/OpenLayers/Control/NavigationHistory.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/OverviewMap.js b/lib/OpenLayers/Control/OverviewMap.js index 142cfaaae1..50b9300f05 100644 --- a/lib/OpenLayers/Control/OverviewMap.js +++ b/lib/OpenLayers/Control/OverviewMap.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Pan.js b/lib/OpenLayers/Control/Pan.js index bc3d5759ed..d7fcc07c01 100644 --- a/lib/OpenLayers/Control/Pan.js +++ b/lib/OpenLayers/Control/Pan.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/PanPanel.js b/lib/OpenLayers/Control/PanPanel.js index b79f472c64..eeedbd0bce 100644 --- a/lib/OpenLayers/Control/PanPanel.js +++ b/lib/OpenLayers/Control/PanPanel.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/PanZoom.js b/lib/OpenLayers/Control/PanZoom.js index 4635384b56..dd007cf43b 100644 --- a/lib/OpenLayers/Control/PanZoom.js +++ b/lib/OpenLayers/Control/PanZoom.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/PanZoomBar.js b/lib/OpenLayers/Control/PanZoomBar.js index 86ed201bf0..ebf29647b6 100644 --- a/lib/OpenLayers/Control/PanZoomBar.js +++ b/lib/OpenLayers/Control/PanZoomBar.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Panel.js b/lib/OpenLayers/Control/Panel.js index 51b47b3905..150afa7063 100644 --- a/lib/OpenLayers/Control/Panel.js +++ b/lib/OpenLayers/Control/Panel.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Permalink.js b/lib/OpenLayers/Control/Permalink.js index 7ef003a81e..3d5d7a284d 100644 --- a/lib/OpenLayers/Control/Permalink.js +++ b/lib/OpenLayers/Control/Permalink.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/PinchZoom.js b/lib/OpenLayers/Control/PinchZoom.js index c510834527..13c1104958 100644 --- a/lib/OpenLayers/Control/PinchZoom.js +++ b/lib/OpenLayers/Control/PinchZoom.js @@ -4,7 +4,6 @@ * full text of the license. */ /** - * @requires OpenLayers/Util/vendorPrefix.js * @requires OpenLayers/Handler/Pinch.js */ @@ -105,27 +104,13 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, { var current = (this.preserveCenter) ? this.map.getPixelFromLonLat(this.map.getCenter()) : evt.xy; - var dx = Math.round((current.x - pinchOrigin.x) + (scale - 1) * (containerOrigin.x - pinchOrigin.x)); - var dy = Math.round((current.y - pinchOrigin.y) + (scale - 1) * (containerOrigin.y - pinchOrigin.y)); + var dx = Math.round((containerOrigin.x + current.x - pinchOrigin.x) + (scale - 1) * (containerOrigin.x - pinchOrigin.x)); + var dy = Math.round((containerOrigin.y + current.y - pinchOrigin.y) + (scale - 1) * (containerOrigin.y - pinchOrigin.y)); - this.applyTransform( - "translate(" + dx + "px, " + dy + "px) scale(" + scale + ")" - ); + this.map.applyTransform(dx, dy, scale); this.currentCenter = current; }, - - /** - * Method: applyTransform - * Applies the given transform to layers. - */ - applyTransform: function(transform) { - var style = this.map.layerContainerDiv.style; - var transformProperty = OpenLayers.Util.vendorPrefix.style("transform"); - if (transformProperty) { - style[transformProperty] = transform; - } - }, - + /** * Method: pinchDone * @@ -137,7 +122,7 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, { * of the pinch gesture. This give us the final scale of the pinch. */ pinchDone: function(evt, start, last) { - this.applyTransform(""); + this.map.applyTransform(); var zoom = this.map.getZoomForResolution(this.map.getResolution() / last.scale, true); if (zoom !== this.map.getZoom() || !this.currentCenter.equals(this.pinchOrigin)) { var resolution = this.map.getResolutionForZoom(zoom); diff --git a/lib/OpenLayers/Control/SLDSelect.js b/lib/OpenLayers/Control/SLDSelect.js index 56f5d3892a..cd348a79f9 100644 --- a/lib/OpenLayers/Control/SLDSelect.js +++ b/lib/OpenLayers/Control/SLDSelect.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Scale.js b/lib/OpenLayers/Control/Scale.js index 7e83075c93..c9f2d2b9f4 100644 --- a/lib/OpenLayers/Control/Scale.js +++ b/lib/OpenLayers/Control/Scale.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/ScaleLine.js b/lib/OpenLayers/Control/ScaleLine.js index 984be3ec9f..926241425e 100644 --- a/lib/OpenLayers/Control/ScaleLine.js +++ b/lib/OpenLayers/Control/ScaleLine.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/SelectFeature.js b/lib/OpenLayers/Control/SelectFeature.js index b2d8f60594..5467267174 100644 --- a/lib/OpenLayers/Control/SelectFeature.js +++ b/lib/OpenLayers/Control/SelectFeature.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Snapping.js b/lib/OpenLayers/Control/Snapping.js index 2abec96ef3..217311479e 100644 --- a/lib/OpenLayers/Control/Snapping.js +++ b/lib/OpenLayers/Control/Snapping.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Split.js b/lib/OpenLayers/Control/Split.js index e32b144db0..de19eb7ce6 100644 --- a/lib/OpenLayers/Control/Split.js +++ b/lib/OpenLayers/Control/Split.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/TouchNavigation.js b/lib/OpenLayers/Control/TouchNavigation.js index c436694b1e..cd5f9264b7 100644 --- a/lib/OpenLayers/Control/TouchNavigation.js +++ b/lib/OpenLayers/Control/TouchNavigation.js @@ -175,8 +175,7 @@ OpenLayers.Control.TouchNavigation = OpenLayers.Class(OpenLayers.Control, { * evt - {Event} */ defaultDblClick: function (evt) { - var newCenter = this.map.getLonLatFromViewPortPx(evt.xy); - this.map.setCenter(newCenter, this.map.zoom + 1); + this.map.zoomTo(this.map.zoom + 1, evt.xy); }, CLASS_NAME: "OpenLayers.Control.TouchNavigation" diff --git a/lib/OpenLayers/Control/TransformFeature.js b/lib/OpenLayers/Control/TransformFeature.js index 52d18be8fa..8c2145649e 100644 --- a/lib/OpenLayers/Control/TransformFeature.js +++ b/lib/OpenLayers/Control/TransformFeature.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/UTFGrid.js b/lib/OpenLayers/Control/UTFGrid.js index b5ec004d5a..799320110f 100644 --- a/lib/OpenLayers/Control/UTFGrid.js +++ b/lib/OpenLayers/Control/UTFGrid.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/WMSGetFeatureInfo.js b/lib/OpenLayers/Control/WMSGetFeatureInfo.js index acdce6a459..c9242f65f2 100644 --- a/lib/OpenLayers/Control/WMSGetFeatureInfo.js +++ b/lib/OpenLayers/Control/WMSGetFeatureInfo.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -15,10 +15,10 @@ /** * Class: OpenLayers.Control.WMSGetFeatureInfo * The WMSGetFeatureInfo control uses a WMS query to get information about a point on the map. The - * information may be in a display-friendly format such as HTML, or a machine-friendly format such - * as GML, depending on the server's capabilities and the client's configuration. This control - * handles click or hover events, attempts to parse the results using an OpenLayers.Format, and - * fires a 'getfeatureinfo' event with the click position, the raw body of the response, and an + * information may be in a display-friendly format such as HTML, or a machine-friendly format such + * as GML, depending on the server's capabilities and the client's configuration. This control + * handles click or hover events, attempts to parse the results using an OpenLayers.Format, and + * fires a 'getfeatureinfo' event with the click position, the raw body of the response, and an * array of features if it successfully read the response. * * Inherits from: @@ -49,23 +49,25 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { */ maxFeatures: 10, - /** APIProperty: clickCallback - * {String} The click callback to register in the - * {} object created when the hover - * option is set to false. Default is "click". + /** + * APIProperty: clickCallback + * {String} The click callback to register in the + * {} object created when the hover + * option is set to false. Default is "click". */ clickCallback: "click", - - /** APIProperty: output - * {String} Either "features" or "object". When triggering a - * getfeatureinfo request should we pass on an array of features - * or an object with with a "features" property and other properties - * (such as the url of the WMS). Default is "features". + + /** + * APIProperty: output + * {String} Either "features" or "object". When triggering a getfeatureinfo + * request should we pass on an array of features or an object with with + * a "features" property and other properties (such as the url of the + * WMS). Default is "features". */ output: "features", - + /** - * Property: layers + * APIProperty: layers * {Array()} The layers to query for feature info. * If omitted, all map WMS layers with a url that matches this or * will be considered. @@ -73,21 +75,21 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { layers: null, /** - * Property: queryVisible + * APIProperty: queryVisible * {Boolean} If true, filter out hidden layers when searching the map for * layers to query. Default is false. */ queryVisible: false, /** - * Property: url + * APIProperty: url * {String} The URL of the WMS service to use. If not provided, the url * of the first eligible layer will be used. */ url: null, - + /** - * Property: layerUrls + * APIProperty: layerUrls * {Array(String)} Optional list of urls for layers that should be queried. * This can be used when the layer url differs from the url used for * making GetFeatureInfo requests (in the case of a layer using cached @@ -96,18 +98,18 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { layerUrls: null, /** - * Property: infoFormat - * {String} The mimetype to request from the server. If you are using - * drillDown mode and have multiple servers that do not share a common - * infoFormat, you can override the control's infoFormat by providing an - * INFO_FORMAT parameter in your instance(s). + * APIProperty: infoFormat + * {String} The mimetype to request from the server. If you are using + * drillDown mode and have multiple servers that do not share a common + * infoFormat, you can override the control's infoFormat by providing an + * INFO_FORMAT parameter in your instance(s). */ infoFormat: 'text/html', - + /** - * Property: vendorParams + * APIProperty: vendorParams * {Object} Additional parameters that will be added to the request, for - * WMS implementations that support them. This could e.g. look like + * WMS implementations that support them. This could e.g. look like * (start code) * { * radius: 5 @@ -115,16 +117,16 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { * (end) */ vendorParams: {}, - + /** - * Property: format + * APIProperty: format * {} A format for parsing GetFeatureInfo responses. * Default is . */ format: null, - + /** - * Property: formatOptions + * APIProperty: formatOptions * {Object} Optional properties to set on the format (if one is not provided * in the property. */ @@ -140,21 +142,21 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { * } * (end) */ - + /** * Property: handler * {Object} Reference to the for this control */ handler: null, - + /** * Property: hoverRequest * {} contains the currently running hover request * (if any). */ hoverRequest: null, - - /** + + /** * APIProperty: events * {} Events instance for listeners and triggering * control specific events. @@ -166,7 +168,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { * * Supported event types (in addition to those from ): * beforegetfeatureinfo - Triggered before the request is sent. - * The event object has an *xy* property with the position of the + * The event object has an *xy* property with the position of the * mouse click or hover event that triggers the request. * nogetfeatureinfo - no queryable layers were found. * getfeatureinfo - Triggered when a GetFeatureInfo response is received. @@ -184,20 +186,20 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { * Constructor: * * Parameters: - * options - {Object} + * options - {Object} */ initialize: function(options) { options = options || {}; options.handlerOptions = options.handlerOptions || {}; OpenLayers.Control.prototype.initialize.apply(this, [options]); - + if(!this.format) { this.format = new OpenLayers.Format.WMSGetFeatureInfo( options.formatOptions ); } - + if(this.drillDown === true) { this.hover = false; } @@ -220,11 +222,11 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { }, /** - * Method: getInfoForClick + * Method: getInfoForClick * Called on click * * Parameters: - * evt - {} + * evt - {} */ getInfoForClick: function(evt) { this.events.triggerEvent("beforegetfeatureinfo", {xy: evt.xy}); @@ -233,7 +235,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { OpenLayers.Element.addClass(this.map.viewPortDiv, "olCursorWait"); this.request(evt.xy, {}); }, - + /** * Method: getInfoForHover * Pause callback for the hover handler @@ -284,7 +286,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { } return layers; }, - + /** * Method: urlMatches * Test to see if the provided url matches either the control or one @@ -383,7 +385,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { * Method: getStyleNames * Gets the STYLES parameter for the layer. Make sure the STYLES parameter * matches the LAYERS parameter - * + * * Parameters: * layer - {} * @@ -411,12 +413,12 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { /** * Method: request * Sends a GetFeatureInfo request to the WMS - * + * * Parameters: * clickPosition - {} The position on the map where the * mouse event occurred. * options - {Object} additional options for this method. - * + * * Valid options: * - *hover* {Boolean} true if we do the request for the hover handler */ @@ -428,13 +430,13 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait"); return; } - + options = options || {}; if(this.drillDown === false) { var wmsOptions = this.buildWMSOptions(this.url, layers, - clickPosition, layers[0].params.FORMAT); + clickPosition, layers[0].params.FORMAT); var request = OpenLayers.Request.GET(wmsOptions); - + if (options.hover === true) { this.hoverRequest = request; } @@ -458,9 +460,9 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { var layers; for (var url in services) { layers = services[url]; - var wmsOptions = this.buildWMSOptions(url, layers, + var wmsOptions = this.buildWMSOptions(url, layers, clickPosition, layers[0].params.FORMAT); - OpenLayers.Request.GET(wmsOptions); + OpenLayers.Request.GET(wmsOptions); } } }, @@ -488,11 +490,11 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { // Reset the cursor. OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait"); }, - + /** * Method: handleResponse * Handler for the GetFeatureInfo response. - * + * * Parameters: * xy - {} The position on the map where the * mouse event occurred. @@ -500,7 +502,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { * url - {String} The url which was used for this request. */ handleResponse: function(xy, request, url) { - + var doc = request.responseXML; if(!doc || !doc.documentElement) { doc = request.responseText; @@ -518,7 +520,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { this._features = (this._features || []).concat(features); } if (this._requestCount === this._numRequests) { - this.triggerGetFeatureInfo(request, xy, this._features.concat()); + this.triggerGetFeatureInfo(request, xy, this._features.concat()); delete this._features; delete this._requestCount; delete this._numRequests; diff --git a/lib/OpenLayers/Control/WMTSGetFeatureInfo.js b/lib/OpenLayers/Control/WMTSGetFeatureInfo.js index cd73342319..c26f8f36ba 100644 --- a/lib/OpenLayers/Control/WMTSGetFeatureInfo.js +++ b/lib/OpenLayers/Control/WMTSGetFeatureInfo.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/Zoom.js b/lib/OpenLayers/Control/Zoom.js index 9680f0a398..70140f46de 100644 --- a/lib/OpenLayers/Control/Zoom.js +++ b/lib/OpenLayers/Control/Zoom.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/ZoomBox.js b/lib/OpenLayers/Control/ZoomBox.js index ff4db5c5ad..f8cea39bed 100644 --- a/lib/OpenLayers/Control/ZoomBox.js +++ b/lib/OpenLayers/Control/ZoomBox.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -69,7 +69,8 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, { */ zoomBox: function (position) { if (position instanceof OpenLayers.Bounds) { - var bounds; + var bounds, + targetCenterPx = position.getCenterPixel(); if (!this.out) { var minXY = this.map.getLonLatFromPixel({ x: position.left, @@ -82,13 +83,12 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, { bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat, maxXY.lon, maxXY.lat); } else { - var pixWidth = Math.abs(position.right-position.left); - var pixHeight = Math.abs(position.top-position.bottom); + var pixWidth = position.right - position.left; + var pixHeight = position.bottom - position.top; var zoomFactor = Math.min((this.map.size.h / pixHeight), (this.map.size.w / pixWidth)); var extent = this.map.getExtent(); - var center = this.map.getLonLatFromPixel( - position.getCenterPixel()); + var center = this.map.getLonLatFromPixel(targetCenterPx); var xmin = center.lon - (extent.getWidth()/2)*zoomFactor; var xmax = center.lon + (extent.getWidth()/2)*zoomFactor; var ymin = center.lat - (extent.getHeight()/2)*zoomFactor; @@ -96,18 +96,27 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, { bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax); } // always zoom in/out - var lastZoom = this.map.getZoom(); - this.map.zoomToExtent(bounds); + var lastZoom = this.map.getZoom(), + size = this.map.getSize(), + centerPx = {x: size.w / 2, y: size.h / 2}, + zoom = this.map.getZoomForExtent(bounds), + oldRes = this.map.getResolution(), + newRes = this.map.getResolutionForZoom(zoom), + zoomOriginPx = { + x: (oldRes * targetCenterPx.x - newRes * centerPx.x) / + (oldRes - newRes), + y: (oldRes * targetCenterPx.y - newRes * centerPx.y) / + (oldRes - newRes) + }; + this.map.zoomTo(zoom, zoomOriginPx); if (lastZoom == this.map.getZoom() && this.alwaysZoom == true){ this.map.zoomTo(lastZoom + (this.out ? -1 : 1)); } } else if (this.zoomOnClick) { // it's a pixel if (!this.out) { - this.map.setCenter(this.map.getLonLatFromPixel(position), - this.map.getZoom() + 1); + this.map.zoomTo(this.map.getZoom() + 1, position); } else { - this.map.setCenter(this.map.getLonLatFromPixel(position), - this.map.getZoom() - 1); + this.map.zoomTo(this.map.getZoom() - 1, position); } } }, diff --git a/lib/OpenLayers/Control/ZoomIn.js b/lib/OpenLayers/Control/ZoomIn.js index 735367d61f..8da1e1cf21 100644 --- a/lib/OpenLayers/Control/ZoomIn.js +++ b/lib/OpenLayers/Control/ZoomIn.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/ZoomOut.js b/lib/OpenLayers/Control/ZoomOut.js index d0a570a90a..72a657b335 100644 --- a/lib/OpenLayers/Control/ZoomOut.js +++ b/lib/OpenLayers/Control/ZoomOut.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/ZoomPanel.js b/lib/OpenLayers/Control/ZoomPanel.js index 22f7756ea2..147f6cb188 100644 --- a/lib/OpenLayers/Control/ZoomPanel.js +++ b/lib/OpenLayers/Control/ZoomPanel.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Control/ZoomToMaxExtent.js b/lib/OpenLayers/Control/ZoomToMaxExtent.js index 5553060969..bc2e75464a 100644 --- a/lib/OpenLayers/Control/ZoomToMaxExtent.js +++ b/lib/OpenLayers/Control/ZoomToMaxExtent.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Events.js b/lib/OpenLayers/Events.js index 74692a8775..6a4a129c11 100644 --- a/lib/OpenLayers/Events.js +++ b/lib/OpenLayers/Events.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -566,6 +566,7 @@ OpenLayers.Events = OpenLayers.Class({ this.listeners = {}; this.extensions = {}; this.extensionCount = {}; + this._msTouches = []; // if a dom element is specified, add a listeners list // for browser events on the element and register them @@ -632,11 +633,16 @@ OpenLayers.Events = OpenLayers.Class({ ); } this.element = element; + var msTouch = !!window.navigator.msMaxTouchPoints; + var type; for (var i = 0, len = this.BROWSER_EVENTS.length; i < len; i++) { + type = this.BROWSER_EVENTS[i]; // register the event cross-browser - OpenLayers.Event.observe( - element, this.BROWSER_EVENTS[i], this.eventHandler + OpenLayers.Event.observe(element, type, this.eventHandler ); + if (msTouch && type.indexOf('touch') === 0) { + this.addMsTouchListener(element, type, this.eventHandler); + } } // disable dragstart in IE so that mousedown/move/up works normally OpenLayers.Event.observe(element, "dragstart", OpenLayers.Event.stop); @@ -1014,5 +1020,151 @@ OpenLayers.Events = OpenLayers.Class({ ); }, + /** + * Method: addMsTouchListener + * + * Parameters: + * element - {DOMElement} The DOM element to register the listener on + * type - {String} The event type + * handler - {Function} the handler + */ + addMsTouchListener: function (element, type, handler) { + var eventHandler = this.eventHandler; + var touches = this._msTouches; + + function msHandler(evt) { + handler(OpenLayers.Util.applyDefaults({ + stopPropagation: function() { + for (var i=touches.length-1; i>=0; --i) { + touches[i].stopPropagation(); + } + }, + preventDefault: function() { + for (var i=touches.length-1; i>=0; --i) { + touches[i].preventDefault(); + } + }, + type: type + }, evt)); + } + + switch (type) { + case 'touchstart': + return this.addMsTouchListenerStart(element, type, msHandler); + case 'touchend': + return this.addMsTouchListenerEnd(element, type, msHandler); + case 'touchmove': + return this.addMsTouchListenerMove(element, type, msHandler); + default: + throw 'Unknown touch event type'; + } + }, + + /** + * Method: addMsTouchListenerStart + * + * Parameters: + * element - {DOMElement} The DOM element to register the listener on + * type - {String} The event type + * handler - {Function} the handler + */ + addMsTouchListenerStart: function(element, type, handler) { + var touches = this._msTouches; + + var cb = function(e) { + + var alreadyInArray = false; + for (var i=0, ii=touches.length; i= 0x20); - - point[dim] += ((result & 1) ? ~(result >> 1) : (result >> 1)); + point.push(flatPoints[i++]) } - points.push(point.slice(0)); + points.push(point); } return points; @@ -163,16 +153,16 @@ OpenLayers.Format.EncodedPolyline = OpenLayers.Class(OpenLayers.Format, { else return null; - var points = new Array(); - for (var i in pointGeometries) { + var flatPoints = []; + + var pointGeometriesLength = pointGeometries.length; + for (var i = 0; i < pointGeometriesLength; ++i) { var pointGeometry = pointGeometries[i]; - var point = [Math.round(pointGeometry.y * 1e5), - Math.round(pointGeometry.x * 1e5)]; - points.push(point); + flatPoints.push(pointGeometry.y); + flatPoints.push(pointGeometry.x); } - var result = this.encode(points, 2); - return result; + return this.encodeDeltas(flatPoints, 2); }, /** @@ -188,66 +178,377 @@ OpenLayers.Format.EncodedPolyline = OpenLayers.Class(OpenLayers.Format, { * {String} An encoded string */ encode: function (points, dims) { - var encoded_points = ""; + var flatPoints = []; - var lastPoint = new Array(dims); - for (var i = 0; i < lastPoint.length; ++i) - lastPoint[i] = 0; - - for (var i = 0; i < points.length; i++) { + var pointsLength = points.length; + for (var i = 0; i < pointsLength; ++i) { var point = points[i]; - for (var dim = 0; dim < lastPoint.length; ++dim) { - var delta = point[dim] - lastPoint[dim]; - encoded_points += this.encodeSignedNumber(delta); + for (var dim = 0; dim < dims; ++dim) { + flatPoints.push(point[dim]); } - - lastPoint = point; } - return encoded_points; + + return this.encodeDeltas(flatPoints, dims, 1); }, /** - * Method: encodeSignedNumber + * APIMethod: encodeDeltas + * Encode a list of n-dimensional points and return an encoded string + * + * Attention: This function will modify the passed array! + * + * Parameters: + * numbers - {Array.} A list of n-dimensional points. + * dimension - {number} The dimension of the points in the list. + * opt_factor - {number=} The factor by which the numbers will be + * multiplied. The remaining decimal places will get rounded away. + * + * Returns: + * {string} The encoded string. + */ + encodeDeltas: function(numbers, dimension, opt_factor) { + var factor = opt_factor || 1e5; + var d; + + var lastNumbers = new Array(dimension); + for (d = 0; d < dimension; ++d) { + lastNumbers[d] = 0; + } + + var numbersLength = numbers.length; + for (var i = 0; i < numbersLength;) { + for (d = 0; d < dimension; ++d, ++i) { + var num = numbers[i]; + var delta = num - lastNumbers[d]; + lastNumbers[d] = num; + + numbers[i] = delta; + } + } + + return this.encodeFloats(numbers, factor); + }, + + + /** + * APIMethod: decodeDeltas + * Decode a list of n-dimensional points from an encoded string + * + * Parameters: + * encoded - {string} An encoded string. + * dimension - {number} The dimension of the points in the encoded string. + * opt_factor - {number=} The factor by which the resulting numbers will + * be divided. + * + * Returns: + * {Array.} A list of n-dimensional points. + */ + decodeDeltas: function(encoded, dimension, opt_factor) { + var factor = opt_factor || 1e5; + var d; + + var lastNumbers = new Array(dimension); + for (d = 0; d < dimension; ++d) { + lastNumbers[d] = 0; + } + + var numbers = this.decodeFloats(encoded, factor); + + var numbersLength = numbers.length; + for (var i = 0; i < numbersLength;) { + for (d = 0; d < dimension; ++d, ++i) { + lastNumbers[d] += numbers[i]; + + numbers[i] = lastNumbers[d]; + } + } + + return numbers; + }, + + + /** + * APIMethod: encodeFloats + * Encode a list of floating point numbers and return an encoded string + * + * Attention: This function will modify the passed array! + * + * Parameters: + * numbers - {Array.} A list of floating point numbers. + * opt_factor - {number=} The factor by which the numbers will be + * multiplied. The remaining decimal places will get rounded away. + * + * Returns: + * {string} The encoded string. + */ + encodeFloats: function(numbers, opt_factor) { + var factor = opt_factor || 1e5; + + var numbersLength = numbers.length; + for (var i = 0; i < numbersLength; ++i) { + numbers[i] = Math.round(numbers[i] * factor); + } + + return this.encodeSignedIntegers(numbers); + }, + + + /** + * APIMethod: decodeFloats + * Decode a list of floating point numbers from an encoded string + * + * Parameters: + * encoded - {string} An encoded string. + * opt_factor - {number=} The factor by which the result will be divided. + * + * Returns: + * {Array.} A list of floating point numbers. + */ + decodeFloats: function(encoded, opt_factor) { + var factor = opt_factor || 1e5; + + var numbers = this.decodeSignedIntegers(encoded); + + var numbersLength = numbers.length; + for (var i = 0; i < numbersLength; ++i) { + numbers[i] /= factor; + } + + return numbers; + }, + + + /** + * APIMethod: encodeSignedIntegers + * Encode a list of signed integers and return an encoded string + * + * Attention: This function will modify the passed array! + * + * Parameters: + * numbers - {Array.} A list of signed integers. + * + * Returns: + * {string} The encoded string. + */ + encodeSignedIntegers: function(numbers) { + var numbersLength = numbers.length; + for (var i = 0; i < numbersLength; ++i) { + var num = numbers[i]; + + var signedNum = num << 1; + if (num < 0) { + signedNum = ~(signedNum); + } + + numbers[i] = signedNum; + } + + return this.encodeUnsignedIntegers(numbers); + }, + + + /** + * APIMethod: decodeSignedIntegers + * Decode a list of signed integers from an encoded string + * + * Parameters: + * encoded - {string} An encoded string. + * + * Returns: + * {Array.} A list of signed integers. + */ + decodeSignedIntegers: function(encoded) { + var numbers = this.decodeUnsignedIntegers(encoded); + + var numbersLength = numbers.length; + for (var i = 0; i < numbersLength; ++i) { + var num = numbers[i]; + numbers[i] = (num & 1) ? ~(num >> 1) : (num >> 1); + } + + return numbers; + }, + + + /** + * APIMethod: encodeUnsignedIntegers + * Encode a list of unsigned integers and return an encoded string + * + * Parameters: + * numbers - {Array.} A list of unsigned integers. + * + * Returns: + * {string} The encoded string. + */ + encodeUnsignedIntegers: function(numbers) { + var encoded = ''; + + var numbersLength = numbers.length; + for (var i = 0; i < numbersLength; ++i) { + encoded += this.encodeUnsignedInteger(numbers[i]); + } + + return encoded; + }, + + + /** + * APIMethod: decodeUnsignedIntegers + * Decode a list of unsigned integers from an encoded string + * + * Parameters: + * encoded - {string} An encoded string. + * + * Returns: + * {Array.} A list of unsigned integers. + */ + decodeUnsignedIntegers: function(encoded) { + var numbers = []; + + var current = 0; + var shift = 0; + + var encodedLength = encoded.length; + for (var i = 0; i < encodedLength; ++i) { + var b = encoded.charCodeAt(i) - 63; + + current |= (b & 0x1f) << shift; + + if (b < 0x20) { + numbers.push(current); + current = 0; + shift = 0; + } else { + shift += 5; + } + } + + return numbers; + }, + + + /** + * Method: encodeFloat + * Encode one single floating point number and return an encoded string + * + * Parameters: + * num - {number} Floating point number that should be encoded. + * opt_factor - {number=} The factor by which num will be multiplied. + * The remaining decimal places will get rounded away. + * + * Returns: + * {string} The encoded string. + */ + encodeFloat: function(num, opt_factor) { + num = Math.round(num * (opt_factor || 1e5)); + return this.encodeSignedInteger(num); + }, + + + /** + * Method: decodeFloat + * Decode one single floating point number from an encoded string + * + * Parameters: + * encoded - {string} An encoded string. + * opt_factor - {number=} The factor by which the result will be divided. + * + * Returns: + * {number} The decoded floating point number. + */ + decodeFloat: function(encoded, opt_factor) { + var result = this.decodeSignedInteger(encoded); + return result / (opt_factor || 1e5); + }, + + + /** + * Method: encodeSignedInteger * Encode one single signed integer and return an encoded string * * Parameters: - * num - {int} A signed integer that should be encoded + * num - {number} Signed integer that should be encoded. * * Returns: - * {String} An encoded string + * {string} The encoded string. */ - encodeSignedNumber: function (num) { - var sgn_num = num << 1; - if (num < 0) - sgn_num = ~(sgn_num); + encodeSignedInteger: function(num) { + var signedNum = num << 1; + if (num < 0) { + signedNum = ~(signedNum); + } - return this.encodeNumber(sgn_num); + return this.encodeUnsignedInteger(signedNum); }, + /** - * Method: encodeNumber - * Encode one single unsigned integer and return an encoded string - * - * encodeSignedNumber should be used instead of using this method directly! + * Method: decodeSignedInteger + * Decode one single signed integer from an encoded string * * Parameters: - * num - {int} An unsigned integer that should be encoded + * encoded - {string} An encoded string. * * Returns: - * {String} An encoded string + * {number} The decoded signed integer. */ - encodeNumber: function (num) { - var encodeString = ""; - var value; - while (num >= 0x20) { - value = (0x20 | (num & 0x1f)) + 63; - encodeString += (String.fromCharCode(value)); - num >>= 5; - } - value = num + 63; - encodeString += (String.fromCharCode(value)); - return encodeString; + decodeSignedInteger: function(encoded) { + var result = this.decodeUnsignedInteger(encoded); + return ((result & 1) ? ~(result >> 1) : (result >> 1)); + }, + + + /** + * Method: encodeUnsignedInteger + * Encode one single unsigned integer and return an encoded string + * + * Parameters: + * num - {number} Unsigned integer that should be encoded. + * + * Returns: + * {string} The encoded string. + */ + encodeUnsignedInteger: function(num) { + var value, encoded = ''; + while (num >= 0x20) { + value = (0x20 | (num & 0x1f)) + 63; + encoded += (String.fromCharCode(value)); + num >>= 5; + } + value = num + 63; + encoded += (String.fromCharCode(value)); + return encoded; + }, + + + /** + * Method: decodeUnsignedInteger + * Decode one single unsigned integer from an encoded string + * + * Parameters: + * encoded - {string} An encoded string. + * + * Returns: + * {number} The decoded unsigned integer. + */ + decodeUnsignedInteger: function(encoded) { + var result = 0; + var shift = 0; + + var encodedLength = encoded.length; + for (var i = 0; i < encodedLength; ++i) { + var b = encoded.charCodeAt(i) - 63; + + result |= (b & 0x1f) << shift; + + if (b < 0x20) + break; + + shift += 5; + } + + return result; }, CLASS_NAME: "OpenLayers.Format.EncodedPolyline" diff --git a/lib/OpenLayers/Format/Filter.js b/lib/OpenLayers/Format/Filter.js index f3fc0b343b..59c06a8ed0 100644 --- a/lib/OpenLayers/Format/Filter.js +++ b/lib/OpenLayers/Format/Filter.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/Filter/v1.js b/lib/OpenLayers/Format/Filter/v1.js index 9cb89c847e..539ec0f488 100644 --- a/lib/OpenLayers/Format/Filter/v1.js +++ b/lib/OpenLayers/Format/Filter/v1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/Filter/v1_0_0.js b/lib/OpenLayers/Format/Filter/v1_0_0.js index 5cf105e964..52e650e4b4 100644 --- a/lib/OpenLayers/Format/Filter/v1_0_0.js +++ b/lib/OpenLayers/Format/Filter/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/Filter/v1_1_0.js b/lib/OpenLayers/Format/Filter/v1_1_0.js index 64a902b959..628c4890fd 100644 --- a/lib/OpenLayers/Format/Filter/v1_1_0.js +++ b/lib/OpenLayers/Format/Filter/v1_1_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/GML.js b/lib/OpenLayers/Format/GML.js index e26e01e44a..467f8758c0 100644 --- a/lib/OpenLayers/Format/GML.js +++ b/lib/OpenLayers/Format/GML.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/GML/Base.js b/lib/OpenLayers/Format/GML/Base.js index 1e6d5316b9..6c499694aa 100644 --- a/lib/OpenLayers/Format/GML/Base.js +++ b/lib/OpenLayers/Format/GML/Base.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/GML/v2.js b/lib/OpenLayers/Format/GML/v2.js index 8a489a045a..bd26b99995 100644 --- a/lib/OpenLayers/Format/GML/v2.js +++ b/lib/OpenLayers/Format/GML/v2.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/GML/v3.js b/lib/OpenLayers/Format/GML/v3.js index 16b141cece..82c7b1e498 100644 --- a/lib/OpenLayers/Format/GML/v3.js +++ b/lib/OpenLayers/Format/GML/v3.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/GPX.js b/lib/OpenLayers/Format/GPX.js index d6c3ffb058..16a8056bf9 100644 --- a/lib/OpenLayers/Format/GPX.js +++ b/lib/OpenLayers/Format/GPX.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -250,11 +250,11 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, { */ buildMetadataNode: function(metadata) { var types = ['name', 'desc', 'author'], - node = this.createElementNSPlus('gpx:metadata'); + node = this.createElementNS(this.namespaces.gpx, 'metadata'); for (var i=0; i < types.length; i++) { var type = types[i]; if (metadata[type]) { - var n = this.createElementNSPlus("gpx:" + type); + var n = this.createElementNS(this.namespaces.gpx, type); n.appendChild(this.createTextNode(metadata[type])); node.appendChild(n); } @@ -284,7 +284,7 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, { this.appendAttributesNode(wpt, feature); return wpt; } else { - var trkNode = this.createElementNSPlus("gpx:trk"); + var trkNode = this.createElementNS(this.namespaces.gpx, "trk"); this.appendAttributesNode(trkNode, feature); var trkSegNodes = this.buildTrkSegNode(geometry); trkSegNodes = OpenLayers.Util.isArray(trkSegNodes) ? @@ -312,7 +312,7 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, { nodes; if (geometry.CLASS_NAME == "OpenLayers.Geometry.LineString" || geometry.CLASS_NAME == "OpenLayers.Geometry.LinearRing") { - node = this.createElementNSPlus("gpx:trkseg"); + node = this.createElementNS(this.namespaces.gpx, "trkseg"); for (i = 0, len=geometry.components.length; i < len; i++) { point = geometry.components[i]; node.appendChild(this.buildTrkPtNode(point)); @@ -338,7 +338,7 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, { * {DOMElement} A trkpt node */ buildTrkPtNode: function(point) { - var node = this.createElementNSPlus("gpx:trkpt"); + var node = this.createElementNS(this.namespaces.gpx, "trkpt"); node.setAttribute("lon", point.x); node.setAttribute("lat", point.y); return node; @@ -355,7 +355,7 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, { * {DOMElement} A wpt node */ buildWptNode: function(geometry) { - var node = this.createElementNSPlus("gpx:wpt"); + var node = this.createElementNS(this.namespaces.gpx, "wpt"); node.setAttribute("lon", geometry.x); node.setAttribute("lat", geometry.y); return node; @@ -370,11 +370,11 @@ OpenLayers.Format.GPX = OpenLayers.Class(OpenLayers.Format.XML, { * feature - {} */ appendAttributesNode: function(node, feature) { - var name = this.createElementNSPlus('gpx:name'); + var name = this.createElementNS(this.namespaces.gpx, 'name'); name.appendChild(this.createTextNode( feature.attributes.name || feature.id)); node.appendChild(name); - var desc = this.createElementNSPlus('gpx:desc'); + var desc = this.createElementNS(this.namespaces.gpx, 'desc'); desc.appendChild(this.createTextNode( feature.attributes.description || this.defaultDesc)); node.appendChild(desc); diff --git a/lib/OpenLayers/Format/GeoJSON.js b/lib/OpenLayers/Format/GeoJSON.js index 962b3991d6..0e02377bd2 100644 --- a/lib/OpenLayers/Format/GeoJSON.js +++ b/lib/OpenLayers/Format/GeoJSON.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/GeoRSS.js b/lib/OpenLayers/Format/GeoRSS.js index 1bc782f614..cbbb4d897f 100644 --- a/lib/OpenLayers/Format/GeoRSS.js +++ b/lib/OpenLayers/Format/GeoRSS.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/JSON.js b/lib/OpenLayers/Format/JSON.js index f4ebff5b5e..5b25e6af67 100644 --- a/lib/OpenLayers/Format/JSON.js +++ b/lib/OpenLayers/Format/JSON.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/KML.js b/lib/OpenLayers/Format/KML.js index fa15c5806d..e10bce7b03 100644 --- a/lib/OpenLayers/Format/KML.js +++ b/lib/OpenLayers/Format/KML.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/OGCExceptionReport.js b/lib/OpenLayers/Format/OGCExceptionReport.js index 9fa293accd..61a9da5457 100644 --- a/lib/OpenLayers/Format/OGCExceptionReport.js +++ b/lib/OpenLayers/Format/OGCExceptionReport.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/OSM.js b/lib/OpenLayers/Format/OSM.js index 75a4f89418..7283348f1c 100644 --- a/lib/OpenLayers/Format/OSM.js +++ b/lib/OpenLayers/Format/OSM.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/OWSCommon.js b/lib/OpenLayers/Format/OWSCommon.js index 7decbf0f2b..fd71820659 100644 --- a/lib/OpenLayers/Format/OWSCommon.js +++ b/lib/OpenLayers/Format/OWSCommon.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/OWSCommon/v1.js b/lib/OpenLayers/Format/OWSCommon/v1.js index db317e6a00..57ae9d2576 100644 --- a/lib/OpenLayers/Format/OWSCommon/v1.js +++ b/lib/OpenLayers/Format/OWSCommon/v1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/OWSCommon/v1_0_0.js b/lib/OpenLayers/Format/OWSCommon/v1_0_0.js index 0ba511a5a5..bc9852d76b 100644 --- a/lib/OpenLayers/Format/OWSCommon/v1_0_0.js +++ b/lib/OpenLayers/Format/OWSCommon/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/OWSCommon/v1_1_0.js b/lib/OpenLayers/Format/OWSCommon/v1_1_0.js index aca42e8fcb..9da216c8e5 100644 --- a/lib/OpenLayers/Format/OWSCommon/v1_1_0.js +++ b/lib/OpenLayers/Format/OWSCommon/v1_1_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/OWSContext.js b/lib/OpenLayers/Format/OWSContext.js index 459ed14d45..ab38734fbd 100644 --- a/lib/OpenLayers/Format/OWSContext.js +++ b/lib/OpenLayers/Format/OWSContext.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/OWSContext/v0_3_1.js b/lib/OpenLayers/Format/OWSContext/v0_3_1.js index d7a38c39b5..d6487e8434 100644 --- a/lib/OpenLayers/Format/OWSContext/v0_3_1.js +++ b/lib/OpenLayers/Format/OWSContext/v0_3_1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/QueryStringFilter.js b/lib/OpenLayers/Format/QueryStringFilter.js index dbef01930a..e33f7226ae 100644 --- a/lib/OpenLayers/Format/QueryStringFilter.js +++ b/lib/OpenLayers/Format/QueryStringFilter.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/SLD.js b/lib/OpenLayers/Format/SLD.js index 8bb1dc8c70..56e59d087d 100644 --- a/lib/OpenLayers/Format/SLD.js +++ b/lib/OpenLayers/Format/SLD.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/SLD/v1.js b/lib/OpenLayers/Format/SLD/v1.js index 7e765abd1e..c43bac4fe8 100644 --- a/lib/OpenLayers/Format/SLD/v1.js +++ b/lib/OpenLayers/Format/SLD/v1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/SLD/v1_0_0.js b/lib/OpenLayers/Format/SLD/v1_0_0.js index f0ad738784..e920b502a3 100644 --- a/lib/OpenLayers/Format/SLD/v1_0_0.js +++ b/lib/OpenLayers/Format/SLD/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/SLD/v1_0_0_GeoServer.js b/lib/OpenLayers/Format/SLD/v1_0_0_GeoServer.js index a579784eb8..902da67a14 100644 --- a/lib/OpenLayers/Format/SLD/v1_0_0_GeoServer.js +++ b/lib/OpenLayers/Format/SLD/v1_0_0_GeoServer.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/SOSCapabilities.js b/lib/OpenLayers/Format/SOSCapabilities.js index f4a2d7318e..1abb1c81db 100644 --- a/lib/OpenLayers/Format/SOSCapabilities.js +++ b/lib/OpenLayers/Format/SOSCapabilities.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js index 18d138d01c..89c0e914a7 100644 --- a/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js +++ b/lib/OpenLayers/Format/SOSCapabilities/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js b/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js index be8d162b00..aac2030d4c 100644 --- a/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js +++ b/lib/OpenLayers/Format/SOSGetFeatureOfInterest.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/SOSGetObservation.js b/lib/OpenLayers/Format/SOSGetObservation.js index 9748b5a087..9a6e2d7383 100644 --- a/lib/OpenLayers/Format/SOSGetObservation.js +++ b/lib/OpenLayers/Format/SOSGetObservation.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/Text.js b/lib/OpenLayers/Format/Text.js index e4ec0f4225..bf9bcd557b 100644 --- a/lib/OpenLayers/Format/Text.js +++ b/lib/OpenLayers/Format/Text.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WCSCapabilities.js b/lib/OpenLayers/Format/WCSCapabilities.js index f73ee1b7d5..934aaa5d49 100644 --- a/lib/OpenLayers/Format/WCSCapabilities.js +++ b/lib/OpenLayers/Format/WCSCapabilities.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WCSCapabilities/v1.js b/lib/OpenLayers/Format/WCSCapabilities/v1.js index b4e433dc1f..bf8da3b181 100644 --- a/lib/OpenLayers/Format/WCSCapabilities/v1.js +++ b/lib/OpenLayers/Format/WCSCapabilities/v1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js index 571e3fc1b9..4dfa0b8bde 100644 --- a/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js +++ b/lib/OpenLayers/Format/WCSCapabilities/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js b/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js index 6efe1b1294..1753c51e83 100644 --- a/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js +++ b/lib/OpenLayers/Format/WCSCapabilities/v1_1_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WCSGetCoverage.js b/lib/OpenLayers/Format/WCSGetCoverage.js index e84af0674d..2817f2894a 100644 --- a/lib/OpenLayers/Format/WCSGetCoverage.js +++ b/lib/OpenLayers/Format/WCSGetCoverage.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WFS.js b/lib/OpenLayers/Format/WFS.js index 18628615ea..44b03a3af0 100644 --- a/lib/OpenLayers/Format/WFS.js +++ b/lib/OpenLayers/Format/WFS.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WFSCapabilities.js b/lib/OpenLayers/Format/WFSCapabilities.js index 690de3d536..61af08563a 100644 --- a/lib/OpenLayers/Format/WFSCapabilities.js +++ b/lib/OpenLayers/Format/WFSCapabilities.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WFSCapabilities/v1.js b/lib/OpenLayers/Format/WFSCapabilities/v1.js index 9f63c98e43..c4ec517042 100644 --- a/lib/OpenLayers/Format/WFSCapabilities/v1.js +++ b/lib/OpenLayers/Format/WFSCapabilities/v1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WFSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/WFSCapabilities/v1_0_0.js index 36457e67de..6b202c743f 100644 --- a/lib/OpenLayers/Format/WFSCapabilities/v1_0_0.js +++ b/lib/OpenLayers/Format/WFSCapabilities/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WFSCapabilities/v1_1_0.js b/lib/OpenLayers/Format/WFSCapabilities/v1_1_0.js index 0f691cb90a..84f6b4bfcd 100644 --- a/lib/OpenLayers/Format/WFSCapabilities/v1_1_0.js +++ b/lib/OpenLayers/Format/WFSCapabilities/v1_1_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WFSDescribeFeatureType.js b/lib/OpenLayers/Format/WFSDescribeFeatureType.js index 44a5c1c936..416e845e24 100644 --- a/lib/OpenLayers/Format/WFSDescribeFeatureType.js +++ b/lib/OpenLayers/Format/WFSDescribeFeatureType.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WFST.js b/lib/OpenLayers/Format/WFST.js index ed101c3afc..eb3d9d9c77 100644 --- a/lib/OpenLayers/Format/WFST.js +++ b/lib/OpenLayers/Format/WFST.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WFST/v1.js b/lib/OpenLayers/Format/WFST/v1.js index d853ce7609..306ba6ff74 100644 --- a/lib/OpenLayers/Format/WFST/v1.js +++ b/lib/OpenLayers/Format/WFST/v1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WFST/v1_0_0.js b/lib/OpenLayers/Format/WFST/v1_0_0.js index abdbc664b5..ed81a2d292 100644 --- a/lib/OpenLayers/Format/WFST/v1_0_0.js +++ b/lib/OpenLayers/Format/WFST/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WFST/v1_1_0.js b/lib/OpenLayers/Format/WFST/v1_1_0.js index c145700f0b..ff2a88d3e0 100644 --- a/lib/OpenLayers/Format/WFST/v1_1_0.js +++ b/lib/OpenLayers/Format/WFST/v1_1_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WKT.js b/lib/OpenLayers/Format/WKT.js index d7dfbfaa51..a7a7b2ea1d 100644 --- a/lib/OpenLayers/Format/WKT.js +++ b/lib/OpenLayers/Format/WKT.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -6,6 +6,12 @@ /** * @requires OpenLayers/Format.js * @requires OpenLayers/Feature/Vector.js + * @requires OpenLayers/Geometry/Point.js + * @requires OpenLayers/Geometry/MultiPoint.js + * @requires OpenLayers/Geometry/LineString.js + * @requires OpenLayers/Geometry/MultiLineString.js + * @requires OpenLayers/Geometry/Polygon.js + * @requires OpenLayers/Geometry/MultiPolygon.js */ /** diff --git a/lib/OpenLayers/Format/WMC.js b/lib/OpenLayers/Format/WMC.js index 185326a5c8..ded1b3a00e 100644 --- a/lib/OpenLayers/Format/WMC.js +++ b/lib/OpenLayers/Format/WMC.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMC/v1.js b/lib/OpenLayers/Format/WMC/v1.js index 84ab222286..6c9a5c3d52 100644 --- a/lib/OpenLayers/Format/WMC/v1.js +++ b/lib/OpenLayers/Format/WMC/v1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMC/v1_0_0.js b/lib/OpenLayers/Format/WMC/v1_0_0.js index bacf64a794..ace0d95c7e 100644 --- a/lib/OpenLayers/Format/WMC/v1_0_0.js +++ b/lib/OpenLayers/Format/WMC/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMC/v1_1_0.js b/lib/OpenLayers/Format/WMC/v1_1_0.js index ffbd01c109..e5efc3e2fa 100644 --- a/lib/OpenLayers/Format/WMC/v1_1_0.js +++ b/lib/OpenLayers/Format/WMC/v1_1_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSCapabilities.js b/lib/OpenLayers/Format/WMSCapabilities.js index da3918464e..2bf3cef0c7 100644 --- a/lib/OpenLayers/Format/WMSCapabilities.js +++ b/lib/OpenLayers/Format/WMSCapabilities.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1.js b/lib/OpenLayers/Format/WMSCapabilities/v1.js index c6f0db14ff..ef5c133e2d 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_1.js b/lib/OpenLayers/Format/WMSCapabilities/v1_1.js index 469a0f751a..0e15d38088 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1_1.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1_1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_1_0.js b/lib/OpenLayers/Format/WMSCapabilities/v1_1_0.js index c7c9793a0c..a1c6279136 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1_1_0.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1_1_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_1_1.js b/lib/OpenLayers/Format/WMSCapabilities/v1_1_1.js index 8e76b1842c..459572b6f4 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1_1_1.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1_1_1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js b/lib/OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js index e824114661..e58e4f755a 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_3.js b/lib/OpenLayers/Format/WMSCapabilities/v1_3.js index 46631de8b2..57aee1a0b8 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1_3.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1_3.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1_3_0.js b/lib/OpenLayers/Format/WMSCapabilities/v1_3_0.js index 867a80377d..c2c4ca48b6 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1_3_0.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1_3_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSDescribeLayer.js b/lib/OpenLayers/Format/WMSDescribeLayer.js index 397c2301fa..296262c42d 100644 --- a/lib/OpenLayers/Format/WMSDescribeLayer.js +++ b/lib/OpenLayers/Format/WMSDescribeLayer.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSDescribeLayer/v1_1.js b/lib/OpenLayers/Format/WMSDescribeLayer/v1_1.js index adda347467..3929d4b278 100644 --- a/lib/OpenLayers/Format/WMSDescribeLayer/v1_1.js +++ b/lib/OpenLayers/Format/WMSDescribeLayer/v1_1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMSGetFeatureInfo.js b/lib/OpenLayers/Format/WMSGetFeatureInfo.js index 97be9ba213..57eb219837 100644 --- a/lib/OpenLayers/Format/WMSGetFeatureInfo.js +++ b/lib/OpenLayers/Format/WMSGetFeatureInfo.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMTSCapabilities.js b/lib/OpenLayers/Format/WMTSCapabilities.js index 985591202e..9cff69c80b 100644 --- a/lib/OpenLayers/Format/WMTSCapabilities.js +++ b/lib/OpenLayers/Format/WMTSCapabilities.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WMTSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/WMTSCapabilities/v1_0_0.js index 3a201448eb..fda2584b6a 100644 --- a/lib/OpenLayers/Format/WMTSCapabilities/v1_0_0.js +++ b/lib/OpenLayers/Format/WMTSCapabilities/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WPSCapabilities.js b/lib/OpenLayers/Format/WPSCapabilities.js index 96593d9ed4..f0d74dbd41 100644 --- a/lib/OpenLayers/Format/WPSCapabilities.js +++ b/lib/OpenLayers/Format/WPSCapabilities.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js b/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js index 7f6e872af9..e6762a9b32 100644 --- a/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js +++ b/lib/OpenLayers/Format/WPSCapabilities/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WPSDescribeProcess.js b/lib/OpenLayers/Format/WPSDescribeProcess.js index e6cc47ae03..e8f96bb248 100644 --- a/lib/OpenLayers/Format/WPSDescribeProcess.js +++ b/lib/OpenLayers/Format/WPSDescribeProcess.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/WPSExecute.js b/lib/OpenLayers/Format/WPSExecute.js index f7dda5444d..0795b0d180 100644 --- a/lib/OpenLayers/Format/WPSExecute.js +++ b/lib/OpenLayers/Format/WPSExecute.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/XLS.js b/lib/OpenLayers/Format/XLS.js index c90dcd48d7..76f3f10ad5 100644 --- a/lib/OpenLayers/Format/XLS.js +++ b/lib/OpenLayers/Format/XLS.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/XLS/v1.js b/lib/OpenLayers/Format/XLS/v1.js index 413a74e2db..642474f0dd 100644 --- a/lib/OpenLayers/Format/XLS/v1.js +++ b/lib/OpenLayers/Format/XLS/v1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/XLS/v1_1_0.js b/lib/OpenLayers/Format/XLS/v1_1_0.js index 89e9103b2f..7ffca26156 100644 --- a/lib/OpenLayers/Format/XLS/v1_1_0.js +++ b/lib/OpenLayers/Format/XLS/v1_1_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/XML.js b/lib/OpenLayers/Format/XML.js index 76341ca11e..56f587131b 100644 --- a/lib/OpenLayers/Format/XML.js +++ b/lib/OpenLayers/Format/XML.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Format/XML/VersionedOGC.js b/lib/OpenLayers/Format/XML/VersionedOGC.js index 381b9d6805..e68d9686d6 100644 --- a/lib/OpenLayers/Format/XML/VersionedOGC.js +++ b/lib/OpenLayers/Format/XML/VersionedOGC.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Geometry.js b/lib/OpenLayers/Geometry.js index 7737c261d5..e7b8e59dcf 100644 --- a/lib/OpenLayers/Geometry.js +++ b/lib/OpenLayers/Geometry.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -438,12 +438,39 @@ OpenLayers.Geometry.segmentsIntersect = function(seg1, seg2, options) { * representing endpoint coordinates. * * Returns: - * {Object} An object with distance, x, and y properties. The distance + * {Object} An object with distance, along, x, and y properties. The distance * will be the shortest distance between the input point and segment. * The x and y properties represent the coordinates along the segment - * where the shortest distance meets the segment. + * where the shortest distance meets the segment. The along attribute + * describes how far between the two segment points the given point is. */ OpenLayers.Geometry.distanceToSegment = function(point, segment) { + var result = OpenLayers.Geometry.distanceSquaredToSegment(point, segment); + result.distance = Math.sqrt(result.distance); + return result; +}; + +/** + * Function: OpenLayers.Geometry.distanceSquaredToSegment + * + * Usually the distanceToSegment function should be used. This variant however + * can be used for comparisons where the exact distance is not important. + * + * Parameters: + * point - {Object} An object with x and y properties representing the + * point coordinates. + * segment - {Object} An object with x1, y1, x2, and y2 properties + * representing endpoint coordinates. + * + * Returns: + * {Object} An object with squared distance, along, x, and y properties. + * The distance will be the shortest distance between the input point and + * segment. The x and y properties represent the coordinates along the + * segment where the shortest distance meets the segment. The along + * attribute describes how far between the two segment points the given + * point is. + */ +OpenLayers.Geometry.distanceSquaredToSegment = function(point, segment) { var x0 = point.x; var y0 = point.y; var x1 = segment.x1; @@ -466,7 +493,8 @@ OpenLayers.Geometry.distanceToSegment = function(point, segment) { y = y1 + along * dy; } return { - distance: Math.sqrt(Math.pow(x - x0, 2) + Math.pow(y - y0, 2)), - x: x, y: y + distance: Math.pow(x - x0, 2) + Math.pow(y - y0, 2), + x: x, y: y, + along: along }; }; diff --git a/lib/OpenLayers/Geometry/Collection.js b/lib/OpenLayers/Geometry/Collection.js index 9d1793454d..f76cc85374 100644 --- a/lib/OpenLayers/Geometry/Collection.js +++ b/lib/OpenLayers/Geometry/Collection.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Geometry/Curve.js b/lib/OpenLayers/Geometry/Curve.js index 288367bf28..e663e0b57c 100644 --- a/lib/OpenLayers/Geometry/Curve.js +++ b/lib/OpenLayers/Geometry/Curve.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Geometry/LineString.js b/lib/OpenLayers/Geometry/LineString.js index e0db1e7d42..b7d7dac3a0 100644 --- a/lib/OpenLayers/Geometry/LineString.js +++ b/lib/OpenLayers/Geometry/LineString.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Geometry/LinearRing.js b/lib/OpenLayers/Geometry/LinearRing.js index b502572671..b0a694cb0d 100644 --- a/lib/OpenLayers/Geometry/LinearRing.js +++ b/lib/OpenLayers/Geometry/LinearRing.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Geometry/MultiLineString.js b/lib/OpenLayers/Geometry/MultiLineString.js index 2917fb6ce3..4e330b0e83 100644 --- a/lib/OpenLayers/Geometry/MultiLineString.js +++ b/lib/OpenLayers/Geometry/MultiLineString.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Geometry/MultiPoint.js b/lib/OpenLayers/Geometry/MultiPoint.js index a19f2aa766..ed8ff67f05 100644 --- a/lib/OpenLayers/Geometry/MultiPoint.js +++ b/lib/OpenLayers/Geometry/MultiPoint.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Geometry/MultiPolygon.js b/lib/OpenLayers/Geometry/MultiPolygon.js index aa94f965a9..d1e59dc020 100644 --- a/lib/OpenLayers/Geometry/MultiPolygon.js +++ b/lib/OpenLayers/Geometry/MultiPolygon.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Geometry/Point.js b/lib/OpenLayers/Geometry/Point.js index c2f6f55b13..456956f61a 100644 --- a/lib/OpenLayers/Geometry/Point.js +++ b/lib/OpenLayers/Geometry/Point.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Geometry/Polygon.js b/lib/OpenLayers/Geometry/Polygon.js index 7b9732a05a..6aaff1fb2d 100644 --- a/lib/OpenLayers/Geometry/Polygon.js +++ b/lib/OpenLayers/Geometry/Polygon.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Handler.js b/lib/OpenLayers/Handler.js index f929fe51c7..0fef88e537 100644 --- a/lib/OpenLayers/Handler.js +++ b/lib/OpenLayers/Handler.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -85,6 +85,14 @@ OpenLayers.Handler = OpenLayers.Class({ * the OpenLayers code. */ evt: null, + + /** + * Property: touch + * {Boolean} Indicates the support of touch events. When touch events are + * started touch will be true and all mouse related listeners will do + * nothing. + */ + touch: false, /** * Constructor: OpenLayers.Handler @@ -187,10 +195,32 @@ OpenLayers.Handler = OpenLayers.Class({ this.unregister(events[i], this[events[i]]); } } + this.touch = false; this.active = false; return true; }, + /** + * Method: startTouch + * Start touch events, this method must be called by subclasses in + * "touchstart" method. When touch events are started will be + * true and all mouse related listeners will do nothing. + */ + startTouch: function() { + if (!this.touch) { + this.touch = true; + var events = [ + "mousedown", "mouseup", "mousemove", "click", "dblclick", + "mouseout" + ]; + for (var i=0, len=events.length; i. */ timerId: null, - - /** - * Property: touch - * {Boolean} When a touchstart event is fired, touch will be true and all - * mouse related listeners will do nothing. - */ - touch: false, /** * Property: down @@ -155,10 +148,7 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, { * {Boolean} Continue propagating this event. */ touchstart: function(evt) { - if (!this.touch) { - this.unregisterMouseListeners(); - this.touch = true; - } + this.startTouch(); this.down = this.getEventInfo(evt); this.last = this.getEventInfo(evt); return true; @@ -195,20 +185,6 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, { } return true; }, - - /** - * Method: unregisterMouseListeners - * In a touch environment, we don't want to handle mouse events. - */ - unregisterMouseListeners: function() { - this.map.events.un({ - mousedown: this.mousedown, - mouseup: this.mouseup, - click: this.click, - dblclick: this.dblclick, - scope: this - }); - }, /** * Method: mousedown @@ -352,7 +328,7 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, { // touch device, no dblclick event - this may be a double if (this["double"]) { // on Android don't let the browser zoom on the page - OpenLayers.Event.stop(evt); + OpenLayers.Event.preventDefault(evt); } this.handleDouble(evt); } @@ -520,7 +496,6 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, { this.down = null; this.first = null; this.last = null; - this.touch = false; deactivated = true; } return deactivated; diff --git a/lib/OpenLayers/Handler/Drag.js b/lib/OpenLayers/Handler/Drag.js index e3218d2181..8c3cb5587e 100644 --- a/lib/OpenLayers/Handler/Drag.js +++ b/lib/OpenLayers/Handler/Drag.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -50,13 +50,6 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, { */ dragging: false, - /** - * Property: touch - * {Boolean} When a touchstart event is fired, touch will be true and all - * mouse related listeners will do nothing. - */ - touch: false, - /** * Property: last * {} The last pixel location of the drag. @@ -345,17 +338,7 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, { * {Boolean} Let the event propagate. */ touchstart: function(evt) { - if (!this.touch) { - this.touch = true; - // unregister mouse listeners - this.map.events.un({ - mousedown: this.mousedown, - mouseup: this.mouseup, - mousemove: this.mousemove, - click: this.click, - scope: this - }); - } + this.startTouch(); return this.dragstart(evt); }, @@ -509,7 +492,6 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, { deactivate: function() { var deactivated = false; if(OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) { - this.touch = false; this.started = false; this.dragging = false; this.start = null; diff --git a/lib/OpenLayers/Handler/Feature.js b/lib/OpenLayers/Handler/Feature.js index 373debb27c..d18b248dd1 100644 --- a/lib/OpenLayers/Handler/Feature.js +++ b/lib/OpenLayers/Handler/Feature.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -59,13 +59,6 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, { * {} The location of the last mouseup. */ up: null, - - /** - * Property: touch - * {Boolean} When a touchstart event is fired, touch will be true and all - * mouse related listeners will do nothing. - */ - touch: false, /** * Property: clickTolerance @@ -139,17 +132,7 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, { * {Boolean} Let the event propagate. */ touchstart: function(evt) { - if(!this.touch) { - this.touch = true; - this.map.events.un({ - mousedown: this.mousedown, - mouseup: this.mouseup, - mousemove: this.mousemove, - click: this.click, - dblclick: this.dblclick, - scope: this - }); - } + this.startTouch(); return OpenLayers.Event.isMultiTouch(evt) ? true : this.mousedown(evt); }, @@ -351,6 +334,11 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, { if(dpx <= this.clickTolerance) { this.callback(key, args); } + // we're done with this set of events now: clear the cached + // positions so we can't trip over them later (this can occur + // if one of the up/down events gets eaten before it gets to us + // but we still get the click) + this.up = this.down = null; } else { this.callback(key, args); } @@ -393,7 +381,6 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, { this.lastFeature = null; this.down = null; this.up = null; - this.touch = false; this.map.events.un({ "removelayer": this.handleMapEvents, "changelayer": this.handleMapEvents, diff --git a/lib/OpenLayers/Handler/Hover.js b/lib/OpenLayers/Handler/Hover.js index e0988ecab1..18b81f4145 100644 --- a/lib/OpenLayers/Handler/Hover.js +++ b/lib/OpenLayers/Handler/Hover.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Handler/Keyboard.js b/lib/OpenLayers/Handler/Keyboard.js index 2cbb4c1f1c..de7a464853 100644 --- a/lib/OpenLayers/Handler/Keyboard.js +++ b/lib/OpenLayers/Handler/Keyboard.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Handler/MouseWheel.js b/lib/OpenLayers/Handler/MouseWheel.js index ce73d08ef3..c69dff3480 100644 --- a/lib/OpenLayers/Handler/MouseWheel.js +++ b/lib/OpenLayers/Handler/MouseWheel.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -31,6 +31,14 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, { */ interval: 0, + /** + * Property: maxDelta + * {Integer} Maximum delta to collect before breaking from the current + * interval. In cumulative mode, this also limits the maximum delta + * returned from the handler. Default is Number.POSITIVE_INFINITY. + */ + maxDelta: Number.POSITIVE_INFINITY, + /** * Property: delta * {Integer} When interval is set, delta collects the mousewheel z-deltas @@ -176,10 +184,10 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, { // so force delta 1 / -1 delta = - (e.detail / Math.abs(e.detail)); } - this.delta = this.delta + delta; + this.delta += delta; - if(this.interval) { - window.clearTimeout(this._timeoutId); + window.clearTimeout(this._timeoutId); + if(this.interval && Math.abs(this.delta) < this.maxDelta) { // store e because window.event might change during delay var evt = OpenLayers.Util.extend({}, e); this._timeoutId = window.setTimeout( @@ -211,9 +219,11 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, { if (delta) { e.xy = this.map.events.getMousePosition(e); if (delta < 0) { - this.callback("down", [e, this.cumulative ? delta : -1]); + this.callback("down", + [e, this.cumulative ? Math.max(-this.maxDelta, delta) : -1]); } else { - this.callback("up", [e, this.cumulative ? delta : 1]); + this.callback("up", + [e, this.cumulative ? Math.min(this.maxDelta, delta) : 1]); } } }, diff --git a/lib/OpenLayers/Handler/Path.js b/lib/OpenLayers/Handler/Path.js index 7bf254801e..28512a152e 100644 --- a/lib/OpenLayers/Handler/Path.js +++ b/lib/OpenLayers/Handler/Path.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -271,6 +271,16 @@ OpenLayers.Handler.Path = OpenLayers.Class(OpenLayers.Handler.Point, { var target = components[index]; var undone = geometry.removeComponent(target); if (undone) { + // On touch devices, set the current ("mouse location") point to + // match the last digitized point. + if (this.touch && index > 0) { + components = geometry.components; // safety + var lastpt = components[index - 1]; + var curptidx = this.getCurrentPointIndex(); + var curpt = components[curptidx]; + curpt.x = lastpt.x; + curpt.y = lastpt.y; + } if (!this.redoStack) { this.redoStack = []; } diff --git a/lib/OpenLayers/Handler/Point.js b/lib/OpenLayers/Handler/Point.js index a32e02af1f..b4bb17c503 100644 --- a/lib/OpenLayers/Handler/Point.js +++ b/lib/OpenLayers/Handler/Point.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -113,12 +113,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, { */ pixelTolerance: 5, - /** - * Property: touch - * {Boolean} Indcates the support of touch events. - */ - touch: false, - /** * Property: lastTouchPx * {} The last pixel used to know the distance between @@ -216,7 +210,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, { this.layer.destroy(false); } this.layer = null; - this.touch = false; return true; }, @@ -383,18 +376,7 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, { * {Boolean} Allow event propagation */ touchstart: function(evt) { - if (!this.touch) { - this.touch = true; - // unregister mouse listeners - this.map.events.un({ - mousedown: this.mousedown, - mouseup: this.mouseup, - mousemove: this.mousemove, - click: this.click, - dblclick: this.dblclick, - scope: this - }); - } + this.startTouch(); this.lastTouchPx = evt.xy; return this.down(evt); }, diff --git a/lib/OpenLayers/Handler/Polygon.js b/lib/OpenLayers/Handler/Polygon.js index c9f8825ced..4f6dfd2888 100644 --- a/lib/OpenLayers/Handler/Polygon.js +++ b/lib/OpenLayers/Handler/Polygon.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Handler/RegularPolygon.js b/lib/OpenLayers/Handler/RegularPolygon.js index 556a57b020..bf4e2db973 100644 --- a/lib/OpenLayers/Handler/RegularPolygon.js +++ b/lib/OpenLayers/Handler/RegularPolygon.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Icon.js b/lib/OpenLayers/Icon.js index 65e93c99bb..2d8f967398 100644 --- a/lib/OpenLayers/Icon.js +++ b/lib/OpenLayers/Icon.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Kinetic.js b/lib/OpenLayers/Kinetic.js index 46b54d7cf1..1cd7886403 100644 --- a/lib/OpenLayers/Kinetic.js +++ b/lib/OpenLayers/Kinetic.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Lang.js b/lib/OpenLayers/Lang.js index bc2d9f9c0f..068562d341 100644 --- a/lib/OpenLayers/Lang.js +++ b/lib/OpenLayers/Lang.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Lang/pt-BR.js b/lib/OpenLayers/Lang/pt-BR.js index e7e75110eb..60e6779c81 100644 --- a/lib/OpenLayers/Lang/pt-BR.js +++ b/lib/OpenLayers/Lang/pt-BR.js @@ -13,7 +13,7 @@ * . Entry bodies are normal strings or * strings formatted for use with calls. */ -OpenLayers.Lang["pt-br"] = OpenLayers.Util.applyDefaults({ +OpenLayers.Lang["pt-BR"] = OpenLayers.Util.applyDefaults({ 'unhandledRequest': "A requisição retornou um erro não tratado: ${statusText}", diff --git a/lib/OpenLayers/Lang/ro.js b/lib/OpenLayers/Lang/ro.js new file mode 100644 index 0000000000..6e8a04f003 --- /dev/null +++ b/lib/OpenLayers/Lang/ro.js @@ -0,0 +1,69 @@ +/** + * @requires OpenLayers/Lang.js + */ +/** + * Namespace: OpenLayers.Lang["ro"] + * Dictionary for Romanian. Keys for entries are used in calls to + * . Entry bodies are normal strings or + * strings formatted for use with calls. +*/ +OpenLayers.Lang.ro = { + 'unhandledRequest': "Cerere nesoluționată return ${statusText}", + 'Permalink': "Legatură permanentă", + 'Overlays': "Straturi vector", + 'Base Layer': "Straturi de bază", + 'noFID': "Nu pot actualiza un feature pentru care nu există FID.", + 'browserNotSupported': + "Browserul tău nu suportă afișarea vectorilor. Supoetul curent pentru randare:\n${renderers}", + // console message + 'minZoomLevelError': + "Proprietatea minZoomLevel este doar pentru a fi folosită " + + "cu straturile FixedZoomLevels-descendent. De aceea acest " + + "strat wfs verifică dacă minZoomLevel este o relicvă" + + ". Nu îl putem , oricum, înlătura fără " + + "a afecta aplicațiile Openlayers care depind de ea." + + " De aceea considerăm depreciat -- minZoomLevel " + + "și îl vom înlătura în 3.0. Folosește " + + "min/max resolution cum este descrisă aici: " + + "http://trac.openlayers.org/wiki/SettingZoomLevels", + 'commitSuccess': "Tranzacție WFS: SUCCES ${response}", + 'commitFailed': "Tranzacție WFS : EȘEC ${response}", + 'googleWarning': + "Stratul Google nu a putut fi încărcat corect.

" + + "Pentru a elimina acest mesaj, selectează un nou strat de bază " + + "în Layerswitcher din colțul dreata-sus.

" + + "Asta datorită, faptului că Google Maps library " + + "script nu este inclus, sau nu conține " + + "cheia API corectă pentru situl tău.

" + + "Developeri: Pentru ajutor, " + + "apăsați aici", + 'getLayerWarning': + "Stratul ${layerType} nu a putut fi încărcat corect.

" + + "pentru a înlătura acest mesaj, selectează un nou strat de bază " + + "Acesta eroare apare de obicei când ${layerLib} library " + + "script nu a fost încărcat corect.

" + + "Developeri: Pentru ajutor privind utilizarea corectă, " + + "apasă aici", + 'Scale = 1 : ${scaleDenom}': "Scara = 1 : ${scaleDenom}", + //labels for the graticule control + 'W': 'V', + 'E': 'E', + 'N': 'N', + 'S': 'S', + 'Graticule': 'Graticule', + // console message + 'reprojectDeprecated': + "foloseÈ™ti opÈ›iunea 'reproject' " + + "pentru stratul ${layerName} . Această opÈ›iune este depreciată: " + + "a fost utilizată pentru afiÈ™area straturilor de bază comerciale " + + "Mai multe informaÈ›ii despre proiecÈ›ia Mercator sunt disponibile aici " + + "http://trac.openlayers.org/wiki/SphericalMercator.", + // console message + 'methodDeprecated': + "Această metodă este depreciată È™i va fi înlăturată in versiunea 3.0. " + + "foloseÈ™te metoda ${newMethod}.", + // **** end **** + 'end': '' +}; diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 94b7706307..9692733678 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -93,7 +93,11 @@ OpenLayers.Layer = OpenLayers.Class({ * loadend - Triggered when layer loading ends. When using a Vector layer * with a Fixed or BBOX strategy, the event object includes a * *response* property holding an OpenLayers.Protocol.Response object. - * visibilitychanged - Triggered when layer visibility is changed. + * visibilitychanged - Triggered when the layer's visibility property is + * changed, e.g. by turning the layer on or off in the layer switcher. + * Note that the actual visibility of the layer can also change if it + * gets out of range (see ). If you also want to catch + * these cases, register for the map's 'changelayer' event instead. * move - Triggered when layer moves (triggered with every mousemove * during a drag). * moveend - Triggered when layer is done moving, object passed as diff --git a/lib/OpenLayers/Layer/ArcGIS93Rest.js b/lib/OpenLayers/Layer/ArcGIS93Rest.js index 7ae60164d6..c5bac36c53 100644 --- a/lib/OpenLayers/Layer/ArcGIS93Rest.js +++ b/lib/OpenLayers/Layer/ArcGIS93Rest.js @@ -1,9 +1,8 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ - /** * @requires OpenLayers/Layer/Grid.js */ diff --git a/lib/OpenLayers/Layer/ArcGISCache.js b/lib/OpenLayers/Layer/ArcGISCache.js index e52ea645e6..99f7ddac5c 100644 --- a/lib/OpenLayers/Layer/ArcGISCache.js +++ b/lib/OpenLayers/Layer/ArcGISCache.js @@ -1,3 +1,8 @@ +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for + * full list of contributors). Published under the 2-clause BSD license. + * See license.txt in the OpenLayers distribution or repository for the + * full text of the license. */ + /** * @requires OpenLayers/Layer/XYZ.js */ @@ -457,9 +462,9 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, { url = url + '/tile/${z}/${y}/${x}'; } else { // The tile images are stored using hex values on disk. - x = 'C' + this.zeroPad(x, 8, 16); - y = 'R' + this.zeroPad(y, 8, 16); - z = 'L' + this.zeroPad(z, 2, 16); + x = 'C' + OpenLayers.Number.zeroPad(x, 8, 16); + y = 'R' + OpenLayers.Number.zeroPad(y, 8, 16); + z = 'L' + OpenLayers.Number.zeroPad(z, 2, 10); url = url + '/${z}/${y}/${x}.' + this.type; } @@ -471,23 +476,5 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, { ); }, - /** - * Method: zeroPad - * Create a zero padded string optionally with a radix for casting numbers. - * - * Parameters: - * num - {Number} The number to be zero padded. - * len - {Number} The length of the string to be returned. - * radix - {Number} An integer between 2 and 36 specifying the base to use - * for representing numeric values. - */ - zeroPad: function(num, len, radix) { - var str = num.toString(radix || 10); - while (str.length < len) { - str = "0" + str; - } - return str; - }, - CLASS_NAME: 'OpenLayers.Layer.ArcGISCache' }); diff --git a/lib/OpenLayers/Layer/ArcIMS.js b/lib/OpenLayers/Layer/ArcIMS.js index eb59f04306..e19584c9f1 100644 --- a/lib/OpenLayers/Layer/ArcIMS.js +++ b/lib/OpenLayers/Layer/ArcIMS.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/Bing.js b/lib/OpenLayers/Layer/Bing.js index 28096b1914..06152853f2 100644 --- a/lib/OpenLayers/Layer/Bing.js +++ b/lib/OpenLayers/Layer/Bing.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -248,7 +248,7 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { this.map.getProjectionObject(), new OpenLayers.Projection("EPSG:4326") ); - var providers = res.imageryProviders, + var providers = res.imageryProviders || [], zoom = OpenLayers.Util.indexOf(this.serverResolutions, this.getServerResolution()), copyrights = "", provider, i, ii, j, jj, bbox, coverage; diff --git a/lib/OpenLayers/Layer/Boxes.js b/lib/OpenLayers/Layer/Boxes.js index c9e7495539..7cd605a94a 100644 --- a/lib/OpenLayers/Layer/Boxes.js +++ b/lib/OpenLayers/Layer/Boxes.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/EventPane.js b/lib/OpenLayers/Layer/EventPane.js index 9e05071a16..15a852fb6d 100644 --- a/lib/OpenLayers/Layer/EventPane.js +++ b/lib/OpenLayers/Layer/EventPane.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/FixedZoomLevels.js b/lib/OpenLayers/Layer/FixedZoomLevels.js index 5b5e52e559..f64723890f 100644 --- a/lib/OpenLayers/Layer/FixedZoomLevels.js +++ b/lib/OpenLayers/Layer/FixedZoomLevels.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/GeoRSS.js b/lib/OpenLayers/Layer/GeoRSS.js index eb409bf9db..564d071cb4 100644 --- a/lib/OpenLayers/Layer/GeoRSS.js +++ b/lib/OpenLayers/Layer/GeoRSS.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/Google.js b/lib/OpenLayers/Layer/Google.js index 8f9bd7ca75..6f9d3e16f1 100644 --- a/lib/OpenLayers/Layer/Google.js +++ b/lib/OpenLayers/Layer/Google.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/Google/v3.js b/lib/OpenLayers/Layer/Google/v3.js index 6147d965d4..10c3e856c5 100644 --- a/lib/OpenLayers/Layer/Google/v3.js +++ b/lib/OpenLayers/Layer/Google/v3.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -92,6 +92,7 @@ OpenLayers.Layer.Google.v3 = { googleControl.style.width = '100%'; googleControl.style.height = '100%'; mapObject.controls[google.maps.ControlPosition.TOP_LEFT].push(googleControl); + this.map.div.appendChild(container); // cache elements for use by any other google layers added to // this same map @@ -140,26 +141,13 @@ OpenLayers.Layer.Google.v3 = { } var container = this.mapObject.getDiv(); if (visible === true) { - if (container.parentNode !== map.div) { - map.div.appendChild(container); - if (!cache.rendered) { - google.maps.event.addListenerOnce(this.mapObject, 'tilesloaded', function() { - cache.googleControl.appendChild(map.viewPortDiv); - cache.rendered = true; - }); - } else { - cache.googleControl.appendChild(map.viewPortDiv); - } - google.maps.event.trigger(this.mapObject, 'resize'); - } + container.style.display = ''; + cache.googleControl.appendChild(map.viewPortDiv); + google.maps.event.trigger(this.mapObject, 'resize'); this.mapObject.setMapTypeId(type); - cache.displayed = this.id; } else { - if (cache.googleControl.hasChildNodes()) { - map.div.appendChild(map.viewPortDiv); - map.div.removeChild(container); - } - delete cache.displayed; + map.div.appendChild(map.viewPortDiv); + container.style.display = 'none'; } } }, diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index f01d0b1885..1187dabb06 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -77,6 +77,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { /** APIProperty: ratio * {Float} Used only when in single-tile mode, this specifies the * ratio of the size of the single tile to the size of the map. + * Default value is 1.5. */ ratio: 1.5, @@ -96,16 +97,21 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { * {String} The transition effect to use when the map is zoomed. * Two posible values: * - * null - No transition effect (the default). * "resize" - Existing tiles are resized on zoom to provide a visual - * effect of the zoom having taken place immediately. As the - * new tiles become available, they are drawn over top of the - * resized tiles. + * effect of the zoom having taken place immediately. As the + * new tiles become available, they are drawn on top of the + * resized tiles (this is the default setting). + * "map-resize" - Existing tiles are resized on zoom and placed below the + * base layer. New tiles for the base layer will cover existing tiles. + * This setting is recommended when having an overlay duplicated during + * the transition is undesirable (e.g. street labels or big transparent + * fills). + * null - No transition effect. * * Using "resize" on non-opaque layers can cause undesired visual - * effects. This is therefore discouraged. + * effects. Set transitionEffect to null in this case. */ - transitionEffect: null, + transitionEffect: "resize", /** * APIProperty: numLoadingTiles @@ -428,6 +434,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { obj.backBuffer = null; obj.backBufferTimerId = null; obj.loading = false; + obj.numLoadingTiles = 0; return obj; }, @@ -649,7 +656,11 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { if(!backBuffer) { return; } - this.div.insertBefore(backBuffer, this.div.firstChild); + if (resolution === this.gridResolution) { + this.div.insertBefore(backBuffer, this.div.firstChild); + } else { + this.map.baseLayer.div.parentNode.insertBefore(backBuffer, this.map.baseLayer.div); + } this.backBuffer = backBuffer; // set some information in the instance for subsequent @@ -699,6 +710,12 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { backBuffer.id = this.div.id + '_bb'; backBuffer.className = 'olBackBuffer'; backBuffer.style.position = 'absolute'; + var map = this.map; + backBuffer.style.zIndex = this.transitionEffect === 'resize' ? + this.getZIndex() - 1 : + // 'map-resize': + map.Z_INDEX_BASE.BaseLayer - + (map.getNumLayers() - map.getLayerIndex(this)); for(var i=0, lenI=this.grid.length; i=0; --i) { + OpenLayers.Event.observe(this._transitionElement, + transitionendEvents[i], + this._removeBackBuffer); + } + // the removal of the back buffer is delayed to prevent + // flash effects due to the animation of tile displaying + this.backBufferTimerId = window.setTimeout( + this._removeBackBuffer, this.removeBackBufferDelay + ); + } + } this.loading = false; this.events.triggerEvent("loadend"); - if(this.backBuffer) { - this._transitionElement = tile.imgDiv; - for (var i=this.transitionendEvents.length-1; i>=0; --i) { - OpenLayers.Event.observe(this._transitionElement, - this.transitionendEvents[i], - this._removeBackBuffer); - } - // the removal of the back buffer is delayed to prevent - // flash effects due to the animation of tile displaying - this.backBufferTimerId = window.setTimeout( - this._removeBackBuffer, this.removeBackBufferDelay - ); - } } }; diff --git a/lib/OpenLayers/Layer/HTTPRequest.js b/lib/OpenLayers/Layer/HTTPRequest.js index e41e19c6c1..ccb0291fa8 100644 --- a/lib/OpenLayers/Layer/HTTPRequest.js +++ b/lib/OpenLayers/Layer/HTTPRequest.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/Image.js b/lib/OpenLayers/Layer/Image.js index ffe8ebe5f6..b96e369e74 100644 --- a/lib/OpenLayers/Layer/Image.js +++ b/lib/OpenLayers/Layer/Image.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/KaMap.js b/lib/OpenLayers/Layer/KaMap.js index 4041a94200..3de2224feb 100644 --- a/lib/OpenLayers/Layer/KaMap.js +++ b/lib/OpenLayers/Layer/KaMap.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/KaMapCache.js b/lib/OpenLayers/Layer/KaMapCache.js index f343d2bc69..be6bdb0d6b 100644 --- a/lib/OpenLayers/Layer/KaMapCache.js +++ b/lib/OpenLayers/Layer/KaMapCache.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/MapGuide.js b/lib/OpenLayers/Layer/MapGuide.js index 9cde653357..8f7d9792fd 100644 --- a/lib/OpenLayers/Layer/MapGuide.js +++ b/lib/OpenLayers/Layer/MapGuide.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/MapServer.js b/lib/OpenLayers/Layer/MapServer.js index 69dcfaf889..713035f633 100644 --- a/lib/OpenLayers/Layer/MapServer.js +++ b/lib/OpenLayers/Layer/MapServer.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/Markers.js b/lib/OpenLayers/Layer/Markers.js index b8e0824396..de848d4937 100644 --- a/lib/OpenLayers/Layer/Markers.js +++ b/lib/OpenLayers/Layer/Markers.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/OSM.js b/lib/OpenLayers/Layer/OSM.js index d5b29468c5..49150fd332 100644 --- a/lib/OpenLayers/Layer/OSM.js +++ b/lib/OpenLayers/Layer/OSM.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/PointGrid.js b/lib/OpenLayers/Layer/PointGrid.js index 72a3d03929..10a4d02275 100644 --- a/lib/OpenLayers/Layer/PointGrid.js +++ b/lib/OpenLayers/Layer/PointGrid.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/PointTrack.js b/lib/OpenLayers/Layer/PointTrack.js index ad9f892059..accfac7da2 100644 --- a/lib/OpenLayers/Layer/PointTrack.js +++ b/lib/OpenLayers/Layer/PointTrack.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/SphericalMercator.js b/lib/OpenLayers/Layer/SphericalMercator.js index 2bcb5545d5..60bb2fe790 100644 --- a/lib/OpenLayers/Layer/SphericalMercator.js +++ b/lib/OpenLayers/Layer/SphericalMercator.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/TMS.js b/lib/OpenLayers/Layer/TMS.js index 2f816e9e86..ab76847588 100644 --- a/lib/OpenLayers/Layer/TMS.js +++ b/lib/OpenLayers/Layer/TMS.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/Text.js b/lib/OpenLayers/Layer/Text.js index 99e559f82f..4a4c9e3fbb 100644 --- a/lib/OpenLayers/Layer/Text.js +++ b/lib/OpenLayers/Layer/Text.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Layer/TileCache.js b/lib/OpenLayers/Layer/TileCache.js index 081969fc33..5b336beb0e 100644 --- a/lib/OpenLayers/Layer/TileCache.js +++ b/lib/OpenLayers/Layer/TileCache.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -116,31 +116,16 @@ OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, { var tileZ = this.serverResolutions != null ? OpenLayers.Util.indexOf(this.serverResolutions, res) : this.map.getZoom(); - /** - * Zero-pad a positive integer. - * number - {Int} - * length - {Int} - * - * Returns: - * {String} A zero-padded string - */ - function zeroPad(number, length) { - number = String(number); - var zeros = []; - for(var i=0; i} If configured at construction time, the map * will use the TileManager to queue image requests and to cache tile image - * elements. + * elements. Note: make sure that OpenLayers/TileManager.js is included in + * your build profile. */ tileManager: null, @@ -383,9 +386,9 @@ OpenLayers.Map = OpenLayers.Class({ * APIProperty: fallThrough * {Boolean} Should OpenLayers allow events on the map to fall through to * other elements on the page, or should it swallow them? (#457) - * Default is to fall through. + * Default is to swallow. */ - fallThrough: true, + fallThrough: false, /** * APIProperty: autoUpdateSize @@ -394,12 +397,6 @@ OpenLayers.Map = OpenLayers.Class({ */ autoUpdateSize: true, - /** - * Property: panTween - * {} Animated panning tween object, see panTo() - */ - panTween: null, - /** * APIProperty: eventListeners * {Object} If set as an option at construction, the eventListeners @@ -409,6 +406,12 @@ OpenLayers.Map = OpenLayers.Class({ */ eventListeners: null, + /** + * Property: panTween + * {} Animated panning tween object, see panTo() + */ + panTween: null, + /** * APIProperty: panMethod * {Function} The Easing function to be used for tweening. Default is @@ -426,6 +429,28 @@ OpenLayers.Map = OpenLayers.Class({ */ panDuration: 50, + /** + * Property: zoomTween + * {} Animated zooming tween object, see zoomTo() + */ + zoomTween: null, + + /** + * APIProperty: zoomMethod + * {Function} The Easing function to be used for tweening. Default is + * OpenLayers.Easing.Quad.easeOut. Setting this to 'null' turns off + * animated zooming. + */ + zoomMethod: OpenLayers.Easing.Quad.easeOut, + + /** + * Property: zoomDuration + * {Integer} The number of steps to be passed to the + * OpenLayers.Tween.start() method when the map is zoomed. + * Default is 20. + */ + zoomDuration: 20, + /** * Property: paddingForPopups * {} Outside margin of the popup. Used to prevent @@ -597,6 +622,7 @@ OpenLayers.Map = OpenLayers.Class({ this.layerContainerDiv = OpenLayers.Util.createDiv(id); this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE['Popup']-1; this.layerContainerOriginPx = {x: 0, y: 0}; + this.applyTransform(); this.viewPortDiv.appendChild(this.layerContainerDiv); @@ -692,6 +718,13 @@ OpenLayers.Map = OpenLayers.Class({ this.setCenter(options.center, options.zoom); } } + + if (this.panMethod) { + this.panTween = new OpenLayers.Tween(this.panMethod); + } + if (this.zoomMethod && this.applyTransform.transform) { + this.zoomTween = new OpenLayers.Tween(this.zoomMethod); + } }, /** @@ -760,6 +793,11 @@ OpenLayers.Map = OpenLayers.Class({ this.panTween.stop(); this.panTween = null; } + // make sure zooming doesn't continue after destruction + if(this.zoomTween) { + this.zoomTween.stop(); + this.zoomTween = null; + } // map has been destroyed. dont do it again! OpenLayers.Event.stopObserving(window, 'unload', this.unloadDestroy); @@ -1680,10 +1718,7 @@ OpenLayers.Map = OpenLayers.Class({ * lonlat - {} */ panTo: function(lonlat) { - if (this.panMethod && this.getExtent().scale(this.panRatio).containsLonLat(lonlat)) { - if (!this.panTween) { - this.panTween = new OpenLayers.Tween(this.panMethod); - } + if (this.panTween && this.getExtent().scale(this.panRatio).containsLonLat(lonlat)) { var center = this.getCachedCenter(); // center will not change, don't do nothing @@ -1734,7 +1769,12 @@ OpenLayers.Map = OpenLayers.Class({ * TBD: reconsider forceZoomChange in 3.0 */ setCenter: function(lonlat, zoom, dragging, forceZoomChange) { - this.panTween && this.panTween.stop(); + if (this.panTween) { + this.panTween.stop(); + } + if (this.zoomTween) { + this.zoomTween.stop(); + } this.moveTo(lonlat, zoom, { 'dragging': dragging, 'forceZoomChange': forceZoomChange @@ -1775,17 +1815,16 @@ OpenLayers.Map = OpenLayers.Class({ } this.center = null; if (dx) { - this.layerContainerDiv.style.left = - (this.layerContainerOriginPx.x -= dx) + "px"; + this.layerContainerOriginPx.x -= dx; this.minPx.x -= dx; this.maxPx.x -= dx; } if (dy) { - this.layerContainerDiv.style.top = - (this.layerContainerOriginPx.y -= dy) + "px"; + this.layerContainerOriginPx.y -= dy; this.minPx.y -= dy; this.maxPx.y -= dy; } + this.applyTransform(); var layer, i, len; for (i=0, len=this.layers.length; i without a lonlat argument. * * Parameters: * zoom - {Integer} */ - zoomTo: function(zoom) { - if (this.isValidZoomLevel(zoom)) { - this.setCenter(null, zoom); + zoomTo: function(zoom, xy) { + // non-API arguments: + // xy - {} optional zoom origin + + var map = this; + if (map.isValidZoomLevel(zoom)) { + if (map.baseLayer.wrapDateLine) { + zoom = map.adjustZoom(zoom); + } + if (map.zoomTween) { + var currentRes = map.getResolution(), + targetRes = map.getResolutionForZoom(zoom), + start = {scale: 1}, + end = {scale: currentRes / targetRes}; + if (map.zoomTween.playing && map.zoomTween.duration < 3 * map.zoomDuration) { + // update the end scale, and reuse the running zoomTween + map.zoomTween.finish = { + scale: map.zoomTween.finish.scale * end.scale + }; + } else { + if (!xy) { + var size = map.getSize(); + xy = {x: size.w / 2, y: size.h / 2}; + } + map.zoomTween.start(start, end, map.zoomDuration, { + minFrameRate: 50, // don't spend much time zooming + callbacks: { + eachStep: function(data) { + var containerOrigin = map.layerContainerOriginPx, + scale = data.scale, + dx = ((scale - 1) * (containerOrigin.x - xy.x)) | 0, + dy = ((scale - 1) * (containerOrigin.y - xy.y)) | 0; + map.applyTransform(containerOrigin.x + dx, containerOrigin.y + dy, scale); + }, + done: function(data) { + map.applyTransform(); + var resolution = map.getResolution() / data.scale, + zoom = map.getZoomForResolution(resolution, true) + map.moveTo(map.getZoomTargetCenter(xy, resolution), zoom, true); + } + } + }); + } + } else { + var center = xy ? + map.getZoomTargetCenter(xy, map.getResolutionForZoom(zoom)) : + null; + map.setCenter(center, zoom); + } } }, - + /** * APIMethod: zoomIn * @@ -2507,7 +2591,32 @@ OpenLayers.Map = OpenLayers.Class({ return px; }, - + /** + * Method: getZoomTargetCenter + * + * Parameters: + * xy - {} The zoom origin pixel location on the screen + * resolution - {Float} The resolution we want to get the center for + * + * Returns: + * {} The location of the map center after the + * transformation described by the origin xy and the target resolution. + */ + getZoomTargetCenter: function (xy, resolution) { + var lonlat = null, + size = this.getSize(), + deltaX = size.w/2 - xy.x, + deltaY = xy.y - size.h/2, + zoomPoint = this.getLonLatFromPixel(xy); + if (zoomPoint) { + lonlat = new OpenLayers.LonLat( + zoomPoint.lon + deltaX * resolution, + zoomPoint.lat + deltaY * resolution + ); + } + return lonlat; + }, + // // CONVENIENCE TRANSLATION FUNCTIONS FOR API // @@ -2667,6 +2776,76 @@ OpenLayers.Map = OpenLayers.Class({ return this.getLayerPxFromViewPortPx(px); }, + /** + * Method: applyTransform + * Applies the given transform to the . This method has + * a 2-stage fallback from translate3d/scale3d via translate/scale to plain + * style.left/style.top, in which case no scaling is supported. + * + * Parameters: + * x - {Number} x parameter for the translation. Defaults to the x value of + * the map's + * y - {Number} y parameter for the translation. Defaults to the y value of + * the map's + * scale - {Number} scale. Defaults to 1 if not provided. + */ + applyTransform: function(x, y, scale) { + scale = scale || 1; + var origin = this.layerContainerOriginPx, + needTransform = scale !== 1; + x = x || origin.x; + y = y || origin.y; + + var style = this.layerContainerDiv.style, + transform = this.applyTransform.transform, + template = this.applyTransform.template; + + if (transform === undefined) { + transform = OpenLayers.Util.vendorPrefix.style('transform'); + this.applyTransform.transform = transform; + if (transform) { + // Try translate3d, but only if the viewPortDiv has a transform + // defined in a stylesheet + var computedStyle = OpenLayers.Element.getStyle(this.viewPortDiv, + OpenLayers.Util.vendorPrefix.css('transform')); + if (!computedStyle || computedStyle !== 'none') { + template = ['translate3d(', ',0) ', 'scale3d(', ',1)']; + style[transform] = [template[0], '0,0', template[1]].join(''); + } + // If no transform is defined in the stylesheet or translate3d + // does not stick, use translate and scale + if (!template || !~style[transform].indexOf(template[0])) { + template = ['translate(', ') ', 'scale(', ')']; + } + this.applyTransform.template = template; + } + } + + // If we do 3d transforms, we always want to use them. If we do 2d + // transforms, we only use them when we need to. + if (transform !== null && (template[0] === 'translate3d(' || needTransform === true)) { + // Our 2d transforms are combined with style.left and style.top, so + // adjust x and y values and set the origin as left and top + if (needTransform === true && template[0] === 'translate(') { + x -= origin.x; + y -= origin.y; + style.left = origin.x + 'px'; + style.top = origin.y + 'px'; + } + style[transform] = [ + template[0], x, 'px,', y, 'px', template[1], + template[2], scale, ',', scale, template[3] + ].join(''); + } else { + style.left = x + 'px'; + style.top = y + 'px'; + // We previously might have had needTransform, so remove transform + if (transform !== null) { + style[transform] = ''; + } + } + }, + CLASS_NAME: "OpenLayers.Map" }); diff --git a/lib/OpenLayers/Marker.js b/lib/OpenLayers/Marker.js index 2d22b583ab..1dde347b4a 100644 --- a/lib/OpenLayers/Marker.js +++ b/lib/OpenLayers/Marker.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Marker/Box.js b/lib/OpenLayers/Marker/Box.js index 5b100a8400..e42e5602eb 100644 --- a/lib/OpenLayers/Marker/Box.js +++ b/lib/OpenLayers/Marker/Box.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -81,7 +81,7 @@ OpenLayers.Marker.Box = OpenLayers.Class(OpenLayers.Marker, { * sz - {} * * Returns: - * {DOMElement} A new DOM Image with this marker´s icon set at the + * {DOMElement} A new DOM Image with this marker's icon set at the * location passed-in */ draw: function(px, sz) { diff --git a/lib/OpenLayers/Popup.js b/lib/OpenLayers/Popup.js index 41cec8ccbb..290318eaf4 100644 --- a/lib/OpenLayers/Popup.js +++ b/lib/OpenLayers/Popup.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Popup/Anchored.js b/lib/OpenLayers/Popup/Anchored.js index e630e7e6a6..9415546976 100644 --- a/lib/OpenLayers/Popup/Anchored.js +++ b/lib/OpenLayers/Popup/Anchored.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Popup/AnchoredBubble.js b/lib/OpenLayers/Popup/AnchoredBubble.js deleted file mode 100644 index 38377ea076..0000000000 --- a/lib/OpenLayers/Popup/AnchoredBubble.js +++ /dev/null @@ -1,196 +0,0 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for - * full list of contributors). Published under the 2-clause BSD license. - * See license.txt in the OpenLayers distribution or repository for the - * full text of the license. */ - - -/** - * @requires OpenLayers/Popup/Anchored.js - * @requires OpenLayers/Console.js - * @requires Rico/Corner.js - */ - -/** - * Class: OpenLayers.Popup.AnchoredBubble - * This class is *deprecated*. Use {} and - * round corners using CSS3's border-radius property. - * - * Inherits from: - * - - */ -OpenLayers.Popup.AnchoredBubble = - OpenLayers.Class(OpenLayers.Popup.Anchored, { - - /** - * Property: rounded - * {Boolean} Has the popup been rounded yet? - */ - rounded: false, - - /** - * Constructor: OpenLayers.Popup.AnchoredBubble - * - * Parameters: - * id - {String} - * lonlat - {} - * contentSize - {} - * contentHTML - {String} - * anchor - {Object} Object to which we'll anchor the popup. Must expose - * a 'size' () and 'offset' () - * (Note that this is generally an ). - * closeBox - {Boolean} - * closeBoxCallback - {Function} Function to be called on closeBox click. - */ - initialize:function(id, lonlat, contentSize, contentHTML, anchor, closeBox, - closeBoxCallback) { - - OpenLayers.Console.warn('AnchoredBubble is deprecated'); - - this.padding = new OpenLayers.Bounds( - 0, OpenLayers.Popup.AnchoredBubble.CORNER_SIZE, - 0, OpenLayers.Popup.AnchoredBubble.CORNER_SIZE - ); - OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments); - }, - - /** - * Method: draw - * - * Parameters: - * px - {} - * - * Returns: - * {DOMElement} Reference to a div that contains the drawn popup. - */ - draw: function(px) { - - OpenLayers.Popup.Anchored.prototype.draw.apply(this, arguments); - - this.setContentHTML(); - - //set the popup color and opacity - this.setBackgroundColor(); - this.setOpacity(); - - return this.div; - }, - - /** - * Method: updateRelativePosition - * The popup has been moved to a new relative location, in which case - * we will want to re-do the rico corners. - */ - updateRelativePosition: function() { - this.setRicoCorners(); - }, - - /** - * APIMethod: setSize - * - * Parameters: - * contentSize - {} the new size for the popup's - * contents div (in pixels). - */ - setSize:function(contentSize) { - OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments); - - this.setRicoCorners(); - }, - - /** - * APIMethod: setBackgroundColor - * - * Parameters: - * color - {String} - */ - setBackgroundColor:function(color) { - if (color != undefined) { - this.backgroundColor = color; - } - - if (this.div != null) { - if (this.contentDiv != null) { - this.div.style.background = "transparent"; - OpenLayers.Rico.Corner.changeColor(this.groupDiv, - this.backgroundColor); - } - } - }, - - /** - * APIMethod: setOpacity - * - * Parameters: - * opacity - {float} - */ - setOpacity:function(opacity) { - OpenLayers.Popup.Anchored.prototype.setOpacity.call(this, opacity); - - if (this.div != null) { - if (this.groupDiv != null) { - OpenLayers.Rico.Corner.changeOpacity(this.groupDiv, - this.opacity); - } - } - }, - - /** - * Method: setBorder - * Always sets border to 0. Bubble Popups can not have a border. - * - * Parameters: - * border - {Integer} - */ - setBorder:function(border) { - this.border = 0; - }, - - /** - * Method: setRicoCorners - * Update RICO corners according to the popup's current relative postion. - */ - setRicoCorners:function() { - - var corners = this.getCornersToRound(this.relativePosition); - var options = {corners: corners, - color: this.backgroundColor, - bgColor: "transparent", - blend: false}; - - if (!this.rounded) { - OpenLayers.Rico.Corner.round(this.div, options); - this.rounded = true; - } else { - OpenLayers.Rico.Corner.reRound(this.groupDiv, options); - //set the popup color and opacity - this.setBackgroundColor(); - this.setOpacity(); - } - }, - - /** - * Method: getCornersToRound - * - * Returns: - * {String} The proper corners string ("tr tl bl br") for rico to round. - */ - getCornersToRound:function() { - - var corners = ['tl', 'tr', 'bl', 'br']; - - //we want to round all the corners _except_ the opposite one. - var corner = OpenLayers.Bounds.oppositeQuadrant(this.relativePosition); - OpenLayers.Util.removeItem(corners, corner); - - return corners.join(" "); - }, - - CLASS_NAME: "OpenLayers.Popup.AnchoredBubble" -}); - -/** - * Constant: CORNER_SIZE - * {Integer} 5. Border space for the RICO corners. - */ -OpenLayers.Popup.AnchoredBubble.CORNER_SIZE = 5; - diff --git a/lib/OpenLayers/Popup/Framed.js b/lib/OpenLayers/Popup/Framed.js index 514b5da834..cb2d5d9cfd 100644 --- a/lib/OpenLayers/Popup/Framed.js +++ b/lib/OpenLayers/Popup/Framed.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Popup/FramedCloud.js b/lib/OpenLayers/Popup/FramedCloud.js index 7be869b6e1..8ad8b94883 100644 --- a/lib/OpenLayers/Popup/FramedCloud.js +++ b/lib/OpenLayers/Popup/FramedCloud.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Projection.js b/lib/OpenLayers/Projection.js index a556073df1..387e26a364 100644 --- a/lib/OpenLayers/Projection.js +++ b/lib/OpenLayers/Projection.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol.js b/lib/OpenLayers/Protocol.js index 0ea6737827..7e63439ae2 100644 --- a/lib/OpenLayers/Protocol.js +++ b/lib/OpenLayers/Protocol.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol/CSW.js b/lib/OpenLayers/Protocol/CSW.js index 53554b41ef..5641182baf 100644 --- a/lib/OpenLayers/Protocol/CSW.js +++ b/lib/OpenLayers/Protocol/CSW.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol/CSW/v2_0_2.js b/lib/OpenLayers/Protocol/CSW/v2_0_2.js index 5efe33ab46..88bfd75441 100644 --- a/lib/OpenLayers/Protocol/CSW/v2_0_2.js +++ b/lib/OpenLayers/Protocol/CSW/v2_0_2.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol/HTTP.js b/lib/OpenLayers/Protocol/HTTP.js index 7b0e1fdc8c..a53b497223 100644 --- a/lib/OpenLayers/Protocol/HTTP.js +++ b/lib/OpenLayers/Protocol/HTTP.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol/SOS.js b/lib/OpenLayers/Protocol/SOS.js index 3c7b64dcea..578f3691fc 100644 --- a/lib/OpenLayers/Protocol/SOS.js +++ b/lib/OpenLayers/Protocol/SOS.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol/SOS/v1_0_0.js b/lib/OpenLayers/Protocol/SOS/v1_0_0.js index 968b0aaaf0..9cf87f5353 100644 --- a/lib/OpenLayers/Protocol/SOS/v1_0_0.js +++ b/lib/OpenLayers/Protocol/SOS/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol/Script.js b/lib/OpenLayers/Protocol/Script.js index 259b21dcb8..93ab32a556 100644 --- a/lib/OpenLayers/Protocol/Script.js +++ b/lib/OpenLayers/Protocol/Script.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol/WFS.js b/lib/OpenLayers/Protocol/WFS.js index 3e0be8893f..66faf43e60 100644 --- a/lib/OpenLayers/Protocol/WFS.js +++ b/lib/OpenLayers/Protocol/WFS.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol/WFS/v1.js b/lib/OpenLayers/Protocol/WFS/v1.js index f22f57b777..8a21d7e189 100644 --- a/lib/OpenLayers/Protocol/WFS/v1.js +++ b/lib/OpenLayers/Protocol/WFS/v1.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol/WFS/v1_0_0.js b/lib/OpenLayers/Protocol/WFS/v1_0_0.js index 19924c06c1..b1e2ca16f5 100644 --- a/lib/OpenLayers/Protocol/WFS/v1_0_0.js +++ b/lib/OpenLayers/Protocol/WFS/v1_0_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Protocol/WFS/v1_1_0.js b/lib/OpenLayers/Protocol/WFS/v1_1_0.js index 187e9c7743..97991a615a 100644 --- a/lib/OpenLayers/Protocol/WFS/v1_1_0.js +++ b/lib/OpenLayers/Protocol/WFS/v1_1_0.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Renderer.js b/lib/OpenLayers/Renderer.js index 0255b7cbb4..c5c7d0d692 100644 --- a/lib/OpenLayers/Renderer.js +++ b/lib/OpenLayers/Renderer.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Renderer/Canvas.js b/lib/OpenLayers/Renderer/Canvas.js index fb5ff82498..61a327c8ce 100644 --- a/lib/OpenLayers/Renderer/Canvas.js +++ b/lib/OpenLayers/Renderer/Canvas.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -712,6 +712,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, { for (var i = 0; i < numRows; i++) { if (style.labelOutlineWidth) { this.canvas.save(); + this.canvas.globalAlpha = style.labelOutlineOpacity || style.fontOpacity || 1.0; this.canvas.strokeStyle = style.labelOutlineColor; this.canvas.lineWidth = style.labelOutlineWidth; this.canvas.strokeText(labelRows[i], pt[0], pt[1] + (lineHeight*i) + 1); diff --git a/lib/OpenLayers/Renderer/Elements.js b/lib/OpenLayers/Renderer/Elements.js index 7f62db315f..18a0d797c5 100644 --- a/lib/OpenLayers/Renderer/Elements.js +++ b/lib/OpenLayers/Renderer/Elements.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Renderer/SVG.js b/lib/OpenLayers/Renderer/SVG.js index fed9289399..263aac0be0 100644 --- a/lib/OpenLayers/Renderer/SVG.js +++ b/lib/OpenLayers/Renderer/SVG.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -655,6 +655,9 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, { outlineStyle.fontColor = outlineStyle.labelOutlineColor; outlineStyle.fontStrokeColor = outlineStyle.labelOutlineColor; outlineStyle.fontStrokeWidth = style.labelOutlineWidth; + if (style.labelOutlineOpacity) { + outlineStyle.fontOpacity = style.labelOutlineOpacity; + } delete outlineStyle.labelOutlineWidth; this.drawText(featureId, outlineStyle, location); } diff --git a/lib/OpenLayers/Renderer/VML.js b/lib/OpenLayers/Renderer/VML.js index bd91bf46e5..8f6374b4b0 100644 --- a/lib/OpenLayers/Renderer/VML.js +++ b/lib/OpenLayers/Renderer/VML.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Request.js b/lib/OpenLayers/Request.js index 03a9ac886f..2b28dfc86b 100644 --- a/lib/OpenLayers/Request.js +++ b/lib/OpenLayers/Request.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Rule.js b/lib/OpenLayers/Rule.js index 7995044dde..dbf5e68890 100644 --- a/lib/OpenLayers/Rule.js +++ b/lib/OpenLayers/Rule.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/SingleFile.js b/lib/OpenLayers/SingleFile.js index 7a76504bc3..0ad8d449dc 100644 --- a/lib/OpenLayers/SingleFile.js +++ b/lib/OpenLayers/SingleFile.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Strategy.js b/lib/OpenLayers/Strategy.js index 4a2b35c547..113deb14e8 100644 --- a/lib/OpenLayers/Strategy.js +++ b/lib/OpenLayers/Strategy.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Strategy/BBOX.js b/lib/OpenLayers/Strategy/BBOX.js index 3c9a591152..e066764586 100644 --- a/lib/OpenLayers/Strategy/BBOX.js +++ b/lib/OpenLayers/Strategy/BBOX.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Strategy/Cluster.js b/lib/OpenLayers/Strategy/Cluster.js index 3be70ac340..d478598a24 100644 --- a/lib/OpenLayers/Strategy/Cluster.js +++ b/lib/OpenLayers/Strategy/Cluster.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Strategy/Filter.js b/lib/OpenLayers/Strategy/Filter.js index d785cfb9a5..721fe52968 100644 --- a/lib/OpenLayers/Strategy/Filter.js +++ b/lib/OpenLayers/Strategy/Filter.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Strategy/Fixed.js b/lib/OpenLayers/Strategy/Fixed.js index c869ab944f..b06f2cd7e7 100644 --- a/lib/OpenLayers/Strategy/Fixed.js +++ b/lib/OpenLayers/Strategy/Fixed.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Strategy/Paging.js b/lib/OpenLayers/Strategy/Paging.js index e1cc4445b2..22154faca6 100644 --- a/lib/OpenLayers/Strategy/Paging.js +++ b/lib/OpenLayers/Strategy/Paging.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Strategy/Refresh.js b/lib/OpenLayers/Strategy/Refresh.js index 9dc095164b..cca187c95a 100644 --- a/lib/OpenLayers/Strategy/Refresh.js +++ b/lib/OpenLayers/Strategy/Refresh.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -79,6 +79,10 @@ OpenLayers.Strategy.Refresh = OpenLayers.Class(OpenLayers.Strategy, { var deactivated = OpenLayers.Strategy.prototype.deactivate.call(this); if(deactivated) { this.stop(); + this.layer.events.un({ + "visibilitychanged": this.reset, + scope: this + }); } return deactivated; }, diff --git a/lib/OpenLayers/Strategy/Save.js b/lib/OpenLayers/Strategy/Save.js index 2216808b26..2211e95f44 100644 --- a/lib/OpenLayers/Strategy/Save.js +++ b/lib/OpenLayers/Strategy/Save.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Style.js b/lib/OpenLayers/Style.js index ff5a6ed803..39c4a48fde 100644 --- a/lib/OpenLayers/Style.js +++ b/lib/OpenLayers/Style.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Style2.js b/lib/OpenLayers/Style2.js index ea2cc969e1..672dae9753 100644 --- a/lib/OpenLayers/Style2.js +++ b/lib/OpenLayers/Style2.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/StyleMap.js b/lib/OpenLayers/StyleMap.js index 232c291085..b6daca21f1 100644 --- a/lib/OpenLayers/StyleMap.js +++ b/lib/OpenLayers/StyleMap.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Symbolizer.js b/lib/OpenLayers/Symbolizer.js index 6ac5c3ba34..e0d54e8812 100644 --- a/lib/OpenLayers/Symbolizer.js +++ b/lib/OpenLayers/Symbolizer.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Symbolizer/Line.js b/lib/OpenLayers/Symbolizer/Line.js index 34fb824e4a..41203e5ea0 100644 --- a/lib/OpenLayers/Symbolizer/Line.js +++ b/lib/OpenLayers/Symbolizer/Line.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Symbolizer/Point.js b/lib/OpenLayers/Symbolizer/Point.js index 41ebbd5d24..fa9d93284f 100644 --- a/lib/OpenLayers/Symbolizer/Point.js +++ b/lib/OpenLayers/Symbolizer/Point.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Symbolizer/Polygon.js b/lib/OpenLayers/Symbolizer/Polygon.js index 6ea68ae7cf..e4158c8589 100644 --- a/lib/OpenLayers/Symbolizer/Polygon.js +++ b/lib/OpenLayers/Symbolizer/Polygon.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Symbolizer/Raster.js b/lib/OpenLayers/Symbolizer/Raster.js index cfeca16443..cf87a42cf7 100644 --- a/lib/OpenLayers/Symbolizer/Raster.js +++ b/lib/OpenLayers/Symbolizer/Raster.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Symbolizer/Text.js b/lib/OpenLayers/Symbolizer/Text.js index 22119e2e82..10dab2032f 100644 --- a/lib/OpenLayers/Symbolizer/Text.js +++ b/lib/OpenLayers/Symbolizer/Text.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Tile.js b/lib/OpenLayers/Tile.js index f943b2c1e3..b3d1ba5e1e 100644 --- a/lib/OpenLayers/Tile.js +++ b/lib/OpenLayers/Tile.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index 153997c4ee..4db5ff8440 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -7,6 +7,7 @@ /** * @requires OpenLayers/Tile.js * @requires OpenLayers/Animation.js + * @requires OpenLayers/Util.js */ /** @@ -317,7 +318,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, { this.layer.div.appendChild(this.getTile()); this.events.triggerEvent(this._loadEvent); var img = this.getImage(); - if (this.url && img.getAttribute("src") == this.url) { + if (this.url && OpenLayers.Util.isEquivalentUrl(img.src, this.url)) { this._loadTimeout = window.setTimeout( OpenLayers.Function.bind(this.onImageLoad, this), 0 ); diff --git a/lib/OpenLayers/Tile/Image/IFrame.js b/lib/OpenLayers/Tile/Image/IFrame.js index d15b4086a0..9e33acc0a1 100644 --- a/lib/OpenLayers/Tile/Image/IFrame.js +++ b/lib/OpenLayers/Tile/Image/IFrame.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Tile/UTFGrid.js b/lib/OpenLayers/Tile/UTFGrid.js index d819227549..2836ee07f8 100644 --- a/lib/OpenLayers/Tile/UTFGrid.js +++ b/lib/OpenLayers/Tile/UTFGrid.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/TileManager.js b/lib/OpenLayers/TileManager.js index a34e9e30ba..4ef5031919 100644 --- a/lib/OpenLayers/TileManager.js +++ b/lib/OpenLayers/TileManager.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ @@ -114,6 +114,7 @@ OpenLayers.TileManager = OpenLayers.Class({ map.events.on({ move: this.move, zoomend: this.zoomEnd, + changelayer: this.changeLayer, addlayer: this.addLayer, preremovelayer: this.removeLayer, scope: this @@ -141,6 +142,7 @@ OpenLayers.TileManager = OpenLayers.Class({ map.events.un({ move: this.move, zoomend: this.zoomEnd, + changelayer: this.changeLayer, addlayer: this.addLayer, preremovelayer: this.removeLayer, scope: this @@ -173,6 +175,19 @@ OpenLayers.TileManager = OpenLayers.Class({ this.updateTimeout(evt.object, this.zoomDelay); }, + /** + * Method: changeLayer + * Handles the map's changeLayer event + * + * Parameters: + * evt - {Object} Listener argument + */ + changeLayer: function(evt) { + if (evt.property === 'visibility' || evt.property === 'params') { + this.updateTimeout(evt.object, 0); + } + }, + /** * Method: addLayer * Handles the map's addlayer event @@ -300,9 +315,16 @@ OpenLayers.TileManager = OpenLayers.Class({ var tile = evt.object; var queued = false; var layer = tile.layer; + var url = layer.getURL(tile.bounds); + var img = this.tileCache[url]; + if (img && img.className !== 'olTileImage') { + // cached image no longer valid, e.g. because we're olTileReplacing + delete this.tileCache[url]; + OpenLayers.Util.removeItem(this.tileCacheIndex, url); + img = null; + } // queue only if image with same url not cached already - if (layer.url && (layer.async || - !this.tileCache[layer.getURL(tile.bounds)])) { + if (layer.url && (layer.async || !img)) { // add to queue only if not in queue already var tileQueue = this.tileQueue[layer.map.id]; if (!~OpenLayers.Util.indexOf(tileQueue, tile)) { @@ -341,6 +363,8 @@ OpenLayers.TileManager = OpenLayers.Class({ img.style.opacity = 0; img.style.visibility = 'hidden'; } + // Only backbuffer tiles have an id, so we don't want one here + img.id = null; tile.setImage(img); // LRU - move tile to the end of the array to mark it as the most // recently used @@ -401,4 +425,4 @@ OpenLayers.TileManager = OpenLayers.Class({ this._destroyed = true; } -}); \ No newline at end of file +}); diff --git a/lib/OpenLayers/Tween.js b/lib/OpenLayers/Tween.js index d722a9933c..0432dad1e6 100644 --- a/lib/OpenLayers/Tween.js +++ b/lib/OpenLayers/Tween.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index f08ab257fc..6c5d6e10b0 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ diff --git a/lib/OpenLayers/Util/vendorPrefix.js b/lib/OpenLayers/Util/vendorPrefix.js index 658719fc0e..89286d7a8b 100644 --- a/lib/OpenLayers/Util/vendorPrefix.js +++ b/lib/OpenLayers/Util/vendorPrefix.js @@ -1,9 +1,9 @@ -/** - * Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the - * full text of the license. - * + * full text of the license. */ + +/** * @requires OpenLayers/SingleFile.js */ diff --git a/lib/OpenLayers/WPSClient.js b/lib/OpenLayers/WPSClient.js index 1b783b4edf..e0c8c49926 100644 --- a/lib/OpenLayers/WPSClient.js +++ b/lib/OpenLayers/WPSClient.js @@ -1,9 +1,9 @@ -/** - * Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the - * full text of the license. - * + * full text of the license. */ + +/** * @requires OpenLayers/SingleFile.js */ diff --git a/lib/OpenLayers/WPSProcess.js b/lib/OpenLayers/WPSProcess.js index 88743575cf..874020d1f9 100644 --- a/lib/OpenLayers/WPSProcess.js +++ b/lib/OpenLayers/WPSProcess.js @@ -1,9 +1,9 @@ -/** - * Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for +/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the - * full text of the license. - * + * full text of the license. */ + +/** * @requires OpenLayers/SingleFile.js */ diff --git a/lib/deprecated.js b/lib/deprecated.js index a389dc7b62..a492faa581 100644 --- a/lib/deprecated.js +++ b/lib/deprecated.js @@ -22,6 +22,8 @@ * @requires OpenLayers/Format/XML.js * @requires OpenLayers/Geometry.js * @requires OpenLayers/Renderer/Elements.js + * @requires OpenLayers/Popup/Anchored.js + * @requires Rico/Corner.js */ /** @@ -5656,4 +5658,185 @@ OpenLayers.Renderer.SVG2.LABEL_VFACTOR = { */ OpenLayers.Renderer.SVG2.preventDefault = function(e) { e.preventDefault && e.preventDefault(); -}; \ No newline at end of file +}; + +/** + * Class: OpenLayers.Popup.AnchoredBubble + * This class is *deprecated*. Use {} and + * round corners using CSS3's border-radius property. + * + * Inherits from: + * - + */ +OpenLayers.Popup.AnchoredBubble = OpenLayers.Class(OpenLayers.Popup.Anchored, { + + /** + * Property: rounded + * {Boolean} Has the popup been rounded yet? + */ + rounded: false, + + /** + * Constructor: OpenLayers.Popup.AnchoredBubble + * + * Parameters: + * id - {String} + * lonlat - {} + * contentSize - {} + * contentHTML - {String} + * anchor - {Object} Object to which we'll anchor the popup. Must expose + * a 'size' () and 'offset' () + * (Note that this is generally an ). + * closeBox - {Boolean} + * closeBoxCallback - {Function} Function to be called on closeBox click. + */ + initialize:function(id, lonlat, contentSize, contentHTML, anchor, closeBox, + closeBoxCallback) { + + this.padding = new OpenLayers.Bounds( + 0, OpenLayers.Popup.AnchoredBubble.CORNER_SIZE, + 0, OpenLayers.Popup.AnchoredBubble.CORNER_SIZE + ); + OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments); + }, + + /** + * Method: draw + * + * Parameters: + * px - {} + * + * Returns: + * {DOMElement} Reference to a div that contains the drawn popup. + */ + draw: function(px) { + + OpenLayers.Popup.Anchored.prototype.draw.apply(this, arguments); + + this.setContentHTML(); + + //set the popup color and opacity + this.setBackgroundColor(); + this.setOpacity(); + + return this.div; + }, + + /** + * Method: updateRelativePosition + * The popup has been moved to a new relative location, in which case + * we will want to re-do the rico corners. + */ + updateRelativePosition: function() { + this.setRicoCorners(); + }, + + /** + * APIMethod: setSize + * + * Parameters: + * contentSize - {} the new size for the popup's + * contents div (in pixels). + */ + setSize:function(contentSize) { + OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments); + + this.setRicoCorners(); + }, + + /** + * APIMethod: setBackgroundColor + * + * Parameters: + * color - {String} + */ + setBackgroundColor:function(color) { + if (color != undefined) { + this.backgroundColor = color; + } + + if (this.div != null) { + if (this.contentDiv != null) { + this.div.style.background = "transparent"; + OpenLayers.Rico.Corner.changeColor(this.groupDiv, + this.backgroundColor); + } + } + }, + + /** + * APIMethod: setOpacity + * + * Parameters: + * opacity - {float} + */ + setOpacity:function(opacity) { + OpenLayers.Popup.Anchored.prototype.setOpacity.call(this, opacity); + + if (this.div != null) { + if (this.groupDiv != null) { + OpenLayers.Rico.Corner.changeOpacity(this.groupDiv, + this.opacity); + } + } + }, + + /** + * Method: setBorder + * Always sets border to 0. Bubble Popups can not have a border. + * + * Parameters: + * border - {Integer} + */ + setBorder:function(border) { + this.border = 0; + }, + + /** + * Method: setRicoCorners + * Update RICO corners according to the popup's current relative postion. + */ + setRicoCorners:function() { + + var corners = this.getCornersToRound(this.relativePosition); + var options = {corners: corners, + color: this.backgroundColor, + bgColor: "transparent", + blend: false}; + + if (!this.rounded) { + OpenLayers.Rico.Corner.round(this.div, options); + this.rounded = true; + } else { + OpenLayers.Rico.Corner.reRound(this.groupDiv, options); + //set the popup color and opacity + this.setBackgroundColor(); + this.setOpacity(); + } + }, + + /** + * Method: getCornersToRound + * + * Returns: + * {String} The proper corners string ("tr tl bl br") for rico to round. + */ + getCornersToRound:function() { + + var corners = ['tl', 'tr', 'bl', 'br']; + + //we want to round all the corners _except_ the opposite one. + var corner = OpenLayers.Bounds.oppositeQuadrant(this.relativePosition); + OpenLayers.Util.removeItem(corners, corner); + + return corners.join(" "); + }, + + CLASS_NAME: "OpenLayers.Popup.AnchoredBubble" +}); + +/** + * Constant: CORNER_SIZE + * {Integer} 5. Border space for the RICO corners. + */ +OpenLayers.Popup.AnchoredBubble.CORNER_SIZE = 5; diff --git a/notes/2.13.md b/notes/2.13.md index 18fc3d833a..efa61bf594 100644 --- a/notes/2.13.md +++ b/notes/2.13.md @@ -37,6 +37,27 @@ Corresponding issues/pull requests: # Behavior Changes from Past Releases +## Control.DragPan: Kinetic by default + +The `enableKinetic` property for the DragPan control has been changed to true by default. This will enable kinetic panning only if the `OpenLayers/Kinetic.js` file is included in your build. + +## Control.ModifyFeature: no more built-in SelectFeature control + +The ModifyFeature control is now much leaner, making it more reliable when combined with other controls. The most noticable change is that it has no +`selectControl` member any more. Users who previously relied on this built-in SelectFeature control will now have to create both a SelectFeature and a ModifyFeature control and configure the ModifyFeature control with `standalone: true`. To get features selected, call the `selectFeature` method e.g. from a `featureselected` listener on the vector layer. + +## Format.GPX: No more prefixes + +No `gpx:` prefix is added in the XML tags anymore when writing GPX from `OpenLayers` features. It seems like it is not supported by most of the tools that are able to read GPX. + +## Different return type for OpenLayers.Format.WMSDescribeLayer + +The return type of WMSDescribeLayer format's `read` method was different from the one of the VersionedOGC format superclass. So it was changed from an array to an object with a layerDescriptions property that holds the array. For backwards compatibility, the object still has a length property and 0, ..., n properties with the previous array values. + +## Moved errorProperty from the base class to the parser in Format.OWSCommon + +This was necessary for WCS support because there are no properties in common between versions 1.0.0 and 1.1.0 that were appropriate for checking. The only existing code that this affected was WFS parsing. + ## Layer.Grid: Tile queue and tileLoadingDelay changes With the introduction of OpenLayers.TileManager, tile queueing has become optional. The default behavior is back to how it was in OpenLayers 2.11. To use a tile queue in 2.13, the map needs to be configured with a tileManager, e.g.: @@ -51,6 +72,40 @@ The `moveDelay` is the replacement for the `tileLoadingDelay` layer config optio In general, when targeting mobile devices or when using slow servers or connections for tiled layers, it is recommended to configure the map with a TileManager. +## Layer.Grid: Resize transitions by default + +The `transitionEffect` property for grid layers has been changed to "resize" by default. This allows smooth transitions with animated zooming (also enabled by default). If resize transitions are not wanted for individual layers, set `transitionEffect` to `null`. + +## Map: Animated zooming and GPU support + +OpenLayers now has animated zooming, which is enabled by default. To turn it off, configure the map with `zoomMethod: null`. + +To make the zoom animation smooth, GPU support is active by default for rendering tiles. This may interer with UI widgets that overlay the map. In this case, it may be necessary to turn GPU support off, which is done with the following css declaration: + + img.olTileImage { + -webkit-transform: inherit; + -moz-transform: inherit; + -o-transform: inherit; + -ms-transform: inherit; + transform: inherit; + -webkit-backface-visibility: inherit; + -moz-backface-visibility: inherit; + -ms-backface-visibility: inherit; + backface-visibility: inherit; + -webkit-perspective: inherit; + -moz-perspective: inherit; + -ms-perspective: inherit; + perspective: inherit; + } + +## Map property fallThrough defaults to false + +The behaviour controlled by map property fallThrough wasn't consistent (some events were swallowed even with fallThrough set to true) and changes have been made to fix that. Defaulting fallThrough to false after this change is sensible in most situations and will probably be what most applications expect, but if you previously relied on pointer or keyboard events being passed through you will probably want to set fallThrough to true. + +Behavioural change was made in this commit: + +* https://github.com/openlayers/openlayers/commit/a6119f6a7528e013b922fd0d997a07df13f6bd6e + ## window.$ is no longer an alias for OpenLayers.Util.getElement We do no longer create a global variable '$' when such a symbol isn't already @@ -79,10 +134,23 @@ Corresponding issue/pull requests: * https://github.com/openlayers/openlayers/pull/528 -# Different return type for OpenLayers.Format.WMSDescribeLayer +## Deprecated Components +A number of properties, methods, and constructors have been marked as +deprecated for multiple releases in the 2.x series. +For the 2.13 release this deprecated functionality has been moved to a +separate deprecated.js file. If you use any of the constructors or +methods below, you will have to explicitly include the deprecated.js +file in your build (or add it in a separate ` diff --git a/tests/Control/ModifyFeature.html b/tests/Control/ModifyFeature.html index 51a10ac184..2f18a66d82 100644 --- a/tests/Control/ModifyFeature.html +++ b/tests/Control/ModifyFeature.html @@ -13,34 +13,27 @@ } }; var options = { - geometryTypes: "bar" + documentDrag: true }; var control = new OpenLayers.Control.ModifyFeature(layer, options); t.ok(control.layer == layer, "constructor sets layer correctly"); - t.eq(control.selectControl.geometryTypes, "bar", - "constructor sets options correctly on feature handler"); + t.eq(control.handlers.drag.documentDrag, true, + "constructor sets options correctly on drag handler"); t.eq(control.mode, OpenLayers.Control.ModifyFeature.RESHAPE, "constructor initializes modification mode correctly"); control.destroy(); } function test_destroy(t) { - t.plan(2); + t.plan(1); var map = new OpenLayers.Map("map"); var layer = new OpenLayers.Layer.Vector(); map.addLayer(layer); var control = new OpenLayers.Control.ModifyFeature(layer); - control.selectControl.destroy = function() { - t.ok(true, - "control.destroy calls destroy on select control"); - } - control.dragControl.destroy = function() { - t.ok(true, - "control.destroy calls destroy on feature handler"); - } control.destroy(); + t.eq(control.layer, null, "Layer reference removed on destroy."); map.destroy(); } @@ -51,11 +44,11 @@ map.addLayer(layer); var control = new OpenLayers.Control.ModifyFeature(layer); map.addControl(control); - t.ok(!control.selectControl.active, - "select control is not active prior to activating control"); + t.ok(!control.handlers.drag.active, + "drag handler is not active prior to activating control"); control.activate(); - t.ok(control.selectControl.active, - "select control is active after activating control"); + t.ok(control.handlers.drag.active, + "drag handler is active after activating control"); map.destroy(); } @@ -99,7 +92,8 @@ ); // mock up vertex deletion - control.dragControl.feature = point; + var origGetFeatureFromEvent = layer.getFeatureFromEvent; + layer.getFeatureFromEvent = function() { return point; }; control.feature = poly; // we cannot use selectFeature since the control is not part of a map control._originalGeometry = poly.geometry.clone(); @@ -139,17 +133,18 @@ t.eq(control.feature.state, OpenLayers.State.UPDATE, "feature state set to update"); // now make sure nothing happens if the vertex is mid-drag - control.dragControl.handlers.drag.dragging = true; + control.handlers.drag.dragging = true; control.handleKeypress({keyCode:delKey}); // clean up + layer.getFeatureFromEvent = origGetFeatureFromEvent; control.destroy(); layer.destroy(); } function test_onUnSelect(t) { - t.plan(6); + t.plan(5); var layer = new OpenLayers.Layer.Vector(); var control = new OpenLayers.Control.ModifyFeature(layer); var fakeFeature = {'id':'myid'}; @@ -159,7 +154,6 @@ layer.events.on({"afterfeaturemodified": function(event) { t.eq(event.feature, fakeFeature, "afterfeaturemodified triggered"); }}); - control.dragControl.deactivate = function() { t.ok(true, "Deactivate called on drag control"); } control.onModificationEnd = function (feature) { t.eq(feature.id, fakeFeature.id, "onModificationEnd got feature.") } layer.removeFeatures = function(verts) { t.ok(verts == 'a', "Normal verts removed correctly"); @@ -190,10 +184,6 @@ // If a feature is to be modified, control.selectFeature gets called. // We want this test to fail if selectFeature gets called. var modified = false; - var _ = OpenLayers.Control.ModifyFeature.prototype.selectFeature; - OpenLayers.Control.ModifyFeature.prototype.selectFeature = function() { - modified = true; - } var control = new OpenLayers.Control.ModifyFeature(layer); map.addControl(control); @@ -202,17 +192,15 @@ // register a listener that will stop feature modification layer.events.on({"beforefeaturemodified": function() {return false}}); - // we can initiate feature modification by selecting a feature with - // the control's select feature control - control.selectControl.select(feature); + // we can initiate feature modification by programmatically selecting + // a feature + control.selectFeature(feature); if(modified) { t.fail("selectFeature called, prepping feature for modification"); } else { t.ok(true, "the beforefeaturemodified listener stopped feature modification"); } - - OpenLayers.Control.ModifyFeature.prototype.selectFeature = _; } function test_selectFeature(t) { @@ -228,7 +216,6 @@ t.ok(obj.feature == fakeFeature, "beforefeaturemodified triggered"); }; layer.events.on({"beforefeaturemodified": callback}); - control.dragControl.activate = function() { t.ok(true, "drag Control activated"); } control.onModificationStart = function(feature) { t.eq(feature.id, fakeFeature.id, "On Modification Start called with correct feature."); } // Start of testing @@ -262,7 +249,7 @@ control.selectFeature(fakeFeature); control.vertices = ['a']; - control.virtualVertices = ['b']; + control.virtualVertices = [{destroy: function() {}}]; layer.addFeatures = function(features) {} @@ -283,7 +270,7 @@ } function test_resetVertices(t) { - t.plan(21); + t.plan(20); var layer = new OpenLayers.Layer.Vector(); var control = new OpenLayers.Control.ModifyFeature(layer); var point = new OpenLayers.Geometry.Point(5,6); @@ -340,18 +327,6 @@ t.eq(control.vertices.length, 0, "No vertices when both resizing and reshaping (RESIZE|RESHAPE)"); t.eq(control.virtualVertices.length, 0, "No virtual vertices when both resizing and reshaping (RESIZE|RESHAPE)"); - control.dragControl.feature = new OpenLayers.Feature.Vector(polygon); - control.dragControl.map = {}; - control.dragControl.map.div = {}; - control.dragControl.map.div.style = {}; - control.dragControl.map.viewPortDiv = "foo"; - control.dragControl.handlers.drag.deactivate = function() { - this.active = false; - } - control.resetVertices(); - t.ok(!control.dragControl.handlers.drag.active, "resetVertices deactivates drag handler"); - control.dragControl.map = null; - control.destroy(); layer.destroy(); } @@ -512,17 +487,19 @@ var control = new OpenLayers.Control.ModifyFeature(layer); map.addControl(control); - control.selectControl.deactivate = function() { + control.handlers.keyboard.deactivate = function() { t.ok(true, - "control.deactivate calls deactivate on select control"); + "control.deactivate calls deactivate on keyboard handler"); } - control.dragControl.deactivate = function() { + control.handlers.drag.deactivate = function() { t.ok(true, - "control.deactivate calls deactivate on drag control"); + "control.deactivate calls deactivate on drag handler"); } control.active = true; control.deactivate(); + control.handlers.keyboard.deactivate = OpenLayers.Handler.Keyboard.prototype.deactivate; + control.handlers.drag.deactivate = OpenLayers.Handler.Drag.prototype.deactivate; map.destroy(); } @@ -609,14 +586,17 @@ layer.events.on({"featuremodified": function(event) { t.eq(event.feature.id, poly.id, "featuremodified triggered"); }}); + control.onModification = function(feature) { t.eq(feature.id, poly.id, "onModification called with the right feature on vertex delete"); }; point.geometry.parent = poly.geometry; - control.dragControl.feature = point; + origGetFeatureFromEvent = layer.getFeatureFromEvent; + layer.getFeatureFromEvent = function() { return point; }; control.handleKeypress({keyCode:46}); layer.drawFeature = oldDraw; + layer.getFeatureFromEvent = origGetFeatureFromEvent; map.destroy(); } @@ -694,7 +674,7 @@ function test_standalone(t) { - t.plan(18); + t.plan(17); var map = new OpenLayers.Map("map"); var layer = new OpenLayers.Layer.Vector(); @@ -733,7 +713,6 @@ // activate control control.activate(); t.eq(control.active, true, "[activate] control activated"); - t.eq(control.selectControl, null, "[activate] no select control"); // manually select feature for editing control.selectFeature(f1); @@ -761,22 +740,19 @@ t.ok(log[0].feature === f2, "[deactivate] correct feature"); t.eq(log[0].modified, false, "[deactivate] feature not actually modified"); - // reactivate control and select a point feature to see if we can drag - // another point feature; - control.activate(); - control.selectFeature(f3); - control.dragControl.handlers.feature.triggerCallback("mousemove", "in", [f4]); - t.eq(control.dragControl.handlers.drag.active, false, "cannot drag unselected feature f4"); - control.dragControl.handlers.feature.triggerCallback("mousemove", "in", [f3]); - t.eq(control.dragControl.handlers.drag.active, true, "can drag selected feature f3"); - // select the polygon feature to make sure that we can drag vertices and // virtual vertices control.selectFeature(f2); - control.dragControl.handlers.feature.triggerCallback("mousemove", "in", [control.vertices[0]]); - t.eq(control.dragControl.handlers.drag.active, true, "can drag vertex of feature f2"); - control.dragControl.handlers.feature.triggerCallback("mousemove", "in", [control.virtualVertices[0]]); - t.eq(control.dragControl.handlers.drag.active, true, "can drag virtual vertex of feature f2"); + var origGetFeatureFromEvent = layer.getFeatureFromEvent; + layer.getFeatureFromEvent = function() { return control.vertices[0]; }; + control.handlers.drag.callbacks.down.call(control, new OpenLayers.Pixel(0,0)); + t.ok(control.vertex === control.vertices[0], "can drag vertex of feature f2"); + t.ok(control.feature === f2, "dragging a vertex does not change the selected feature"); + layer.getFeatureFromEvent = function() { return control.virtualVertices[0]; }; + control.handlers.drag.callbacks.down.call(control, new OpenLayers.Pixel(0,0)); + t.ok(control.vertex === control.virtualVertices[0], "can drag virtual vertex of feature f2"); + t.ok(control.feature === f2, "dragging a vertex does not change the selected feature"); + layer.getFeatureFromEvent = origGetFeatureFromEvent; control.deactivate(); map.destroy(); @@ -826,6 +802,20 @@ control.destroy(); } + function test_moveLayerToTop_moveLayerBack(t) { + t.plan(2); + var map = new OpenLayers.Map("map"); + var layer1 = new OpenLayers.Layer.Vector(); + var layer2 = new OpenLayers.Layer.Vector(); + map.addLayers([layer1, layer2]); + var control = new OpenLayers.Control.ModifyFeature(layer1); + map.addControl(control); + control.activate(); + t.ok(layer1.div.style.zIndex > layer2.div.style.zIndex, "layer raised so events don't get swallowed"); + control.deactivate(); + t.ok(layer1.div.style.zIndex < layer2.div.style.zIndex, 'layer order restored on deactivation'); + } + diff --git a/tests/Control/Navigation.html b/tests/Control/Navigation.html index 70428f5a7b..e73ee42d14 100644 --- a/tests/Control/Navigation.html +++ b/tests/Control/Navigation.html @@ -148,6 +148,7 @@ var nav = new OpenLayers.Control.Navigation({zoomWheelEnabled: false}); var map = new OpenLayers.Map({ div: "map", + zoomMethod: null, controls: [nav], layers: [ new OpenLayers.Layer(null, {isBaseLayer: true}) diff --git a/tests/Control/NavigationHistory.html b/tests/Control/NavigationHistory.html index b766b0e5ae..c992ff2b7a 100644 --- a/tests/Control/NavigationHistory.html +++ b/tests/Control/NavigationHistory.html @@ -170,7 +170,7 @@ function test_clear(t) { t.plan(7); - var map = new OpenLayers.Map("map"); + var map = new OpenLayers.Map("map", {zoomMethod: null}); var layer = new OpenLayers.Layer( "test", {isBaseLayer: true} ); diff --git a/tests/Control/PanZoomBar.html b/tests/Control/PanZoomBar.html index b14ec2adba..5ed2833ec1 100644 --- a/tests/Control/PanZoomBar.html +++ b/tests/Control/PanZoomBar.html @@ -77,7 +77,7 @@ function test_Control_PanZoomBar_onButtonClick (t) { t.plan(2); - map = new OpenLayers.Map('map', {controls:[]}); + map = new OpenLayers.Map('map', {controls:[], zoomMethod: null}); var layer = new OpenLayers.Layer.WMS("Test Layer", "http://octo.metacarta.com/cgi-bin/mapserv?", {map: "/mapdata/vmap_wms.map", layers: "basic"}); @@ -97,7 +97,8 @@ t.plan(1); map = new OpenLayers.Map('map', { controls: [], - fractionalZoom: true + fractionalZoom: true, + zoomMethod: null }); var layer = new OpenLayers.Layer.WMS("Test Layer", "http://octo.metacarta.com/cgi-bin/mapserv?", { map: "/mapdata/vmap_wms.map", @@ -127,7 +128,8 @@ var map = new OpenLayers.Map('map', { controls: [], - fractionalZoom: true + fractionalZoom: true, + zoomMethod: null }); var layer = new OpenLayers.Layer.WMS("Test Layer", "http://octo.metacarta.com/cgi-bin/mapserv?", { map: "/mapdata/vmap_wms.map", diff --git a/tests/Control/PinchZoom.html b/tests/Control/PinchZoom.html index 1aa68f9c04..22db6a5039 100644 --- a/tests/Control/PinchZoom.html +++ b/tests/Control/PinchZoom.html @@ -45,8 +45,8 @@ }); var log = []; - control.applyTransform = function(transform) { - log.push(transform); + map.applyTransform = function(x, y, scale) { + log.push([x, y, scale]); } map.layerContainerOriginPx = { @@ -58,12 +58,12 @@ }; var cases = [ - {x: 100, y: 60, scale: 1, transform: "translate(0px, 10px) scale(1)"}, - {x: 150, y: 60, scale: 1, transform: "translate(50px, 10px) scale(1)"}, - {x: 150, y: 60, scale: 2, transform: "translate(-100px, -90px) scale(2)"}, - {x: 50, y: 20, scale: 2.5, transform: "translate(-275px, -180px) scale(2.5)"}, - {x: 150, y: 60, scale: 2, transform: "translate(-100px, -90px) scale(2)"}, - {x: 50, y: 20, scale: 0.25, transform: "translate(63px, 45px) scale(0.25)"} + {x: 100, y: 60, scale: 1, transform: [-50, -40, 1]}, + {x: 150, y: 60, scale: 1, transform: [0, -40, 1]}, + {x: 150, y: 60, scale: 2, transform: [-150, -140, 2]}, + {x: 50, y: 20, scale: 2.5, transform: [-325, -230, 2.5]}, + {x: 150, y: 60, scale: 2, transform: [-150, -140, 2]}, + {x: 50, y: 20, scale: 0.25, transform: [13, -5, 0.25]} ]; var len = cases.length; @@ -95,23 +95,23 @@ var centerPx = map.getPixelFromLonLat(map.getCenter()); control.pinchStart = function(evt, pinchData) { - t.eq(control.pinchOrigin, centerPx, "center preserved"); - t.eq(control.currentCenter, centerPx, "center preserved"); + t.eq(map.layerContainerOriginPx, {x: 0, y: 0}, "center preserved"); + t.eq(map.getPixelFromLonLat(map.getCenter()), centerPx, "center preserved"); } control.pinchStart(null); var log = []; - control.applyTransform = function(transform) { - log.push(transform); + map.applyTransform = function(x, y, scale) { + log.push([x, y, scale]); } control.pinchOrigin = map.getPixelFromLonLat(map.getCenter()); var cases = [ - {scale: 1, transform: "translate(0px, 0px) scale(1)"}, - {scale: 2, transform: "translate(-128px, -128px) scale(2)"}, - {scale: 2.5, transform: "translate(-192px, -192px) scale(2.5)"}, - {scale: 0.25, transform: "translate(96px, 96px) scale(0.25)"} + {scale: 1, transform: [0, 0, 1]}, + {scale: 2, transform: [-128, -128, 2]}, + {scale: 2.5, transform: [-192, -192, 2.5]}, + {scale: 0.25, transform: [96, 96, 0.25]} ]; var len = cases.length; diff --git a/tests/Control/Scale.html b/tests/Control/Scale.html index 804ceb5622..1d43b25e08 100644 --- a/tests/Control/Scale.html +++ b/tests/Control/Scale.html @@ -22,7 +22,7 @@ control = new OpenLayers.Control.Scale('scale'); t.ok( control instanceof OpenLayers.Control.Scale, "new OpenLayers.Control returns object" ); - map = new OpenLayers.Map('map'); + map = new OpenLayers.Map('map', {zoomMethod: null}); layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'}); map.addLayer(layer); map.zoomTo(0); @@ -38,7 +38,7 @@ t.plan(2); control = new OpenLayers.Control.Scale(); t.ok( control instanceof OpenLayers.Control.Scale, "new OpenLayers.Control returns object" ); - map = new OpenLayers.Map('map'); + map = new OpenLayers.Map('map', {zoomMethod: null}); layer = new OpenLayers.Layer.WMS('Test Layer', "http://octo.metacarta.com/cgi-bin/mapserv", {map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'}); map.addLayer(layer); map.zoomTo(0); diff --git a/tests/Control/TouchNavigation.html b/tests/Control/TouchNavigation.html index 21241dd502..bffc2257cd 100644 --- a/tests/Control/TouchNavigation.html +++ b/tests/Control/TouchNavigation.html @@ -128,27 +128,28 @@ function test_zoomOut(t) { t.plan(1); - var map = new OpenLayers.Map(document.body); + var map = new OpenLayers.Map('map', {zoomMethod: null}); var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} ); map.addLayer(layer); map.setCenter(new OpenLayers.LonLat(0, 0), 5); + var origSetTimeout = window.setTimeout; + window.setTimeout = function(fn) { fn(); return 'id'; }; var control = new OpenLayers.Control.TouchNavigation(); map.addControl(control); var handler = control.handlers.click; handler.touchstart({xy: new OpenLayers.Pixel(1 ,1), touches: ["foo", "bar"]}); handler.touchend({}); - t.delay_call(1, function() { - t.eq(map.getZoom(), 4, "Did we zoom out?"); - // tear down - map.destroy(); - }); - + t.eq(map.getZoom(), 4, "Did we zoom out?"); + // tear down + map.destroy(); + window.setTimeout = origSetTimeout; } +
diff --git a/tests/Control/Zoom.html b/tests/Control/Zoom.html index c27161dab8..cfeb082cc4 100644 --- a/tests/Control/Zoom.html +++ b/tests/Control/Zoom.html @@ -43,7 +43,8 @@ var map = new OpenLayers.Map({ div: "map", - layers: [new OpenLayers.Layer(null, {isBaseLayer: true})] + layers: [new OpenLayers.Layer(null, {isBaseLayer: true})], + zoomMethod: null }); var control = new OpenLayers.Control.Zoom(); map.addControl(control); @@ -60,7 +61,8 @@ var map = new OpenLayers.Map({ div: "map", - layers: [new OpenLayers.Layer(null, {isBaseLayer: true})] + layers: [new OpenLayers.Layer(null, {isBaseLayer: true})], + zoomMethod: null }); var control = new OpenLayers.Control.Zoom(); map.addControl(control); diff --git a/tests/Control/ZoomBox.html b/tests/Control/ZoomBox.html index 2e037192e5..7763bcff2c 100644 --- a/tests/Control/ZoomBox.html +++ b/tests/Control/ZoomBox.html @@ -23,6 +23,7 @@ function test_zoomBox(t) { t.plan(4); var map = new OpenLayers.Map("map", { + zoomMethod: null, layers: [new OpenLayers.Layer("", {isBaseLayer: true})], center: [0, 0], zoom: 1 @@ -37,7 +38,8 @@ t.eq(map.getZoom(), 2, "not zoomed with zoomOnClick set to false"); map.zoomToMaxExtent(); - control.zoomBox(new OpenLayers.Bounds(128, 64, 256, 128)); + // pixel bounds bottom > top + control.zoomBox(new OpenLayers.Bounds(128, 128, 256, 64)); t.eq(map.getCenter().toShortString(), "-45, 22.5", "centered to box center"); t.eq(map.getZoom(), 3, "zoomed to box extent"); diff --git a/tests/Format/EncodedPolyline.html b/tests/Format/EncodedPolyline.html index 1a93a41afa..6bc7208de0 100644 --- a/tests/Format/EncodedPolyline.html +++ b/tests/Format/EncodedPolyline.html @@ -3,6 +3,27 @@ diff --git a/tests/Format/WMSDescribeLayer.html b/tests/Format/WMSDescribeLayer.html index 939bfe1d8f..7a53269109 100644 --- a/tests/Format/WMSDescribeLayer.html +++ b/tests/Format/WMSDescribeLayer.html @@ -49,8 +49,8 @@ function test_read_exception(t) { t.plan(1); var text = '' + - '' + - ' ' + + '' + + ' ' + 'geonode:_map_107_annotations: no such layer on this server' + ''; var format = new OpenLayers.Format.WMSDescribeLayer(); diff --git a/tests/Geometry.html b/tests/Geometry.html index 6bae0ca16f..2a4b4c46c3 100644 --- a/tests/Geometry.html +++ b/tests/Geometry.html @@ -257,24 +257,23 @@ var cases = [{ got: dist({x: 0, y: 0}, {x1: 0, y1: 1, x2: 1, y2: 1}), - expected: {distance: 1, x: 0, y: 1} + expected: {distance: 1, x: 0, y: 1, along: 0} }, { got: dist({x: 0, y: 0}, {x1: -1, y1: -1, x2: 0, y2: -1}), - expected: {distance: 1, x: 0, y: -1} + expected: {distance: 1, x: 0, y: -1, along: 1} }, { got: dist({x: 0, y: 0}, {x1: -1, y1: -1, x2: 1, y2: 1}), - expected: {distance: 0, x: 0, y: 0} + expected: {distance: 0, x: 0, y: 0, along: 0.5} }, { got: dist({x: 1, y: 1}, {x1: 2, y1: 0, x2: 2, y2: 3}), - expected: {distance: 1, x: 2, y: 1} + expected: {distance: 1, x: 2, y: 1, along: 1/3.} }, { got: dist({x: -1, y: -1}, {x1: -2, y1: -2, x2: -1, y2: -3}), - expected: {distance: Math.sqrt(2), x: -2, y: -2} + expected: {distance: Math.sqrt(2), x: -2, y: -2, along: 0} }, { got: dist({x: -1, y: 1}, {x1: -3, y1: 1, x2: -1, y2: 3}), - expected: {distance: Math.sqrt(2), x: -2, y: 2} + expected: {distance: Math.sqrt(2), x: -2, y: 2, along: 0.5} }]; - t.plan(cases.length); for(var i=0; i diff --git a/tests/Handler/Drag.html b/tests/Handler/Drag.html index 71ad3ef71f..fa9a3b2c50 100644 --- a/tests/Handler/Drag.html +++ b/tests/Handler/Drag.html @@ -288,7 +288,7 @@ // "touchend" events set expected states in the drag handler. // We also verify that we prevent the default as appropriate. - t.plan(14); + t.plan(19); // set up @@ -318,6 +318,11 @@ t.eq(h.start.y, 0, '[touchstart] start.y is correct'); t.eq(log.length, 1, '[touchstart] one item in log'); t.ok(log[0] === e, "touchstart", '[touchstart] event is stopped'); + t.eq(m.events.listeners.mousedown.length, 0,"mousedown is not registered"); + t.eq(m.events.listeners.mouseup.length, 0,"mouseup is not registered"); + t.eq(m.events.listeners.mousemove.length, 0,"mousemove is not registered"); + t.eq(m.events.listeners.click.length, 0,"click is not registered"); + t.eq(m.events.listeners.mouseout.length, 0,"mouseout is not registered"); e = {xy: new Px(1, 1)}; m.events.triggerEvent('touchmove', e); diff --git a/tests/Handler/Feature.html b/tests/Handler/Feature.html index 7c768e1a69..4a78e14bce 100644 --- a/tests/Handler/Feature.html +++ b/tests/Handler/Feature.html @@ -280,9 +280,10 @@ handler.mousedown = function() {}; // mock mousedown handler.activate(); + var eventTypes = ['mousedown', 'mouseup', 'mousemove', 'click', 'dblclick']; + function allRegistered() { - var eventTypes = ['mousedown', 'mouseup', 'mousemove', 'click', 'dblclick'], - eventType, + var eventType, listeners, listener, flag; @@ -305,21 +306,18 @@ } function noneRegistered() { - var eventTypes = ['mousedown', 'mouseup', 'mousemove', 'click', 'dblclick'], - eventType, - listeners, - listener; + var eventType, + times, + flag = false; for(var i=0, ilen=eventTypes.length; i diff --git a/tests/Handler/MouseWheel.html b/tests/Handler/MouseWheel.html index 208b4fce3d..687a31d275 100644 --- a/tests/Handler/MouseWheel.html +++ b/tests/Handler/MouseWheel.html @@ -115,12 +115,13 @@ } function test_Handler_MouseWheel_cumulative(t) { - t.plan(1); + t.plan(2); - var deltaUp = 0; + var deltaUp = 0, ticks = 0; var callbacks = { up: function(evt, delta) { deltaUp += delta; + ticks++; } }; @@ -131,7 +132,8 @@ map.addControl(control); var handler = new OpenLayers.Handler.MouseWheel(control, callbacks, { interval: 150, - cumulative: false + cumulative: false, + maxDelta: 6 }); var delta = 120; @@ -140,8 +142,9 @@ handler.onWheelEvent({'target':map.layers[0].div, wheelDelta: delta}); } - t.delay_call(1, function() { - t.eq(deltaUp, 1, "Non cumulative mode works"); + t.delay_call(2, function() { + t.eq(deltaUp / ticks, 1, "Cumulative mode works"); + t.eq(ticks, 4, "up called 4x with maxDelta of 6"); }); } diff --git a/tests/Handler/Path.html b/tests/Handler/Path.html index 66548d624a..8351eea267 100644 --- a/tests/Handler/Path.html +++ b/tests/Handler/Path.html @@ -601,6 +601,12 @@ handler.mousedown({type: "mousedown", xy: px}); handler.mouseup({type: "mouseup", xy: px}); } + function userTap(handler, x, y) { + var px = new OpenLayers.Pixel(x, y); + handler.touchstart({xy: px}); + handler.touchmove({xy: px}); + handler.touchend({}); + } /** * Editing method tests: insertXY, insertDeltaXY, insertDirectionXY, @@ -720,7 +726,7 @@ } function test_undoredo1(t) { - t.plan(4); + t.plan(5); var obj = editingMethodsSetup(); var map = obj.map; var handler = obj.handler; @@ -747,6 +753,17 @@ handler.redo(); t.geom_eq(original, handler.line.geometry, "one redo undoes one undo"); + // add point via touch + userTap(handler, 10, 50); + handler.undo(); + currentLen = handler.line.geometry.components.length; + t.geom_eq( + handler.line.geometry.components[currentLen-1], + handler.line.geometry.components[currentLen-2], + "current point (mouse position) is set to the last digitized " + + "point after undo on touch devices" + ); + // cleanup map.destroy(); } diff --git a/tests/Handler/Pinch.html b/tests/Handler/Pinch.html index 4686447dbf..c4883dfc67 100644 --- a/tests/Handler/Pinch.html +++ b/tests/Handler/Pinch.html @@ -97,7 +97,7 @@ function test_callbacks(t) { t.plan(32); - var map = new OpenLayers.Map('map', {controls: []}); + var map = new OpenLayers.Map('map', {controls: [], fallThrough: true}); var control = new OpenLayers.Control(); map.addControl(control); diff --git a/tests/Handler/Point.html b/tests/Handler/Point.html index 4214478634..b5a7cf3c2f 100644 --- a/tests/Handler/Point.html +++ b/tests/Handler/Point.html @@ -407,7 +407,8 @@ // set up var map = new OpenLayers.Map("map", { - resolutions: [1] + resolutions: [1], + controls: [] }); var layer = new OpenLayers.Layer.Vector("foo", { maxExtent: new OpenLayers.Bounds(-10, -10, 10, 10), @@ -421,9 +422,11 @@ map.setCenter(new OpenLayers.LonLat(0, 0), 0); handler.activate(); + var eventTypes = ['mousedown', 'mouseup', 'mousemove', 'click', 'dblclick', + 'mouseout']; + function allRegistered() { - var eventTypes = ['mousedown', 'mouseup', 'mousemove', 'click', 'dblclick'], - eventType, + var eventType, listeners, listener, flag; @@ -446,23 +449,21 @@ } function noneRegistered() { - var eventTypes = ['mousedown', 'mouseup', 'mousemove', 'click', 'dblclick'], - eventType, - listeners, - listener; + var eventType, + times, + flag = false; for(var i=0, ilen=eventTypes.length; i + - - - -
-
-
- - +function com_test_getRenderedDimensions(t) { + t.plan(17); + var content = (new Array(100)).join("foo "); + + // test with fixed width + var fw = OpenLayers.Util.getRenderedDimensions(content, {w: 20}); + t.eq(fw.w, 20, "got the fixed width"); + + // test with fixed height + var fh = OpenLayers.Util.getRenderedDimensions(content, {h: 15}); + t.eq(fh.h, 15, "got the fixed height"); + + var size = OpenLayers.Util.getRenderedDimensions("

Content

"); + var bigger = OpenLayers.Util.getRenderedDimensions("

Content

", null, {displayClass: 'test_getRenderedDimensions'}); + var overflow = OpenLayers.Util.getRenderedDimensions("

Content

"); + var width = OpenLayers.Util.getRenderedDimensions("

Content

", new OpenLayers.Size(250, null)); + var height = OpenLayers.Util.getRenderedDimensions("

Content

", new OpenLayers.Size(null, 40)); + t.ok((size.w + 40) == bigger.w && (size.h + 40) == bigger.h, "bigger Pass: " + size + ", " + bigger); + t.ok(size.w == overflow.w && size.h == overflow.h, "overflow Pass: " + size + ", " + overflow); + t.ok(width.w == 250 && width.h == size.h, "width Pass: " + size + ", " + width); + t.ok(height.h == 40 && height.w == size.w, "height Pass: " + size + ", " + height); + + content = (new Array(10)).join("foo foo foo
"); + var testName, + finalSize, + initialSize = OpenLayers.Util.getRenderedDimensions(content, null); + // containerElement option on absolute position with width and height + testName = "Absolute with w&h: "; + var optionAbsDiv ={ + containerElement: document.getElementById("absoluteDiv") + }; + finalSize = OpenLayers.Util.getRenderedDimensions(content, null, optionAbsDiv); + t.ok(initialSize.w > 0 && initialSize.h > 0, "Has initial size (requires visible test_iframe)"); + t.eq(finalSize.w, initialSize.w, + testName + "initial width " + initialSize.w + "px is maintained"); + t.eq(finalSize.h, initialSize.h, + testName + "initial height " + initialSize.h + "px is maintained"); + testName = "Absolute with w&h (set height): "; + finalSize = OpenLayers.Util.getRenderedDimensions(content, {h: 15}, optionAbsDiv); + t.eq(finalSize.h, 15, testName + "got the fixed height to 15px"); + t.eq(finalSize.w, initialSize.w, + testName + "initial width " + initialSize.w + "px is maintained"); + testName = "Absolute with w&h (set width): "; + finalSize = OpenLayers.Util.getRenderedDimensions(content, {w: 20}, optionAbsDiv); + t.eq(finalSize.w, 20, testName + "got the fixed width to 20px"); + // containerElement option on absolute position without width and height + testName = "Absolute without w&h: "; + var optionAbsDiv00 ={ + containerElement: document.getElementById("absoluteDiv00") + }; + finalSize = OpenLayers.Util.getRenderedDimensions(content, null, optionAbsDiv00); + t.eq(finalSize.w, initialSize.w, + testName + "initial width " + initialSize.w + "px is maintained"); + t.eq(finalSize.h, initialSize.h, + testName + "initial height " + initialSize.h + "px is maintained"); + testName = "Absolute without w&h (set height): "; + finalSize = OpenLayers.Util.getRenderedDimensions(content, {h: 15}, optionAbsDiv00); + t.eq(finalSize.h, 15, testName + "got the fixed height to 15px"); + t.eq(finalSize.w, initialSize.w, + testName + "initial width " + initialSize.w + "px is maintained"); + testName = "Absolute without w&h (set width): "; + finalSize = OpenLayers.Util.getRenderedDimensions(content, {w: 20}, optionAbsDiv00); + t.eq(finalSize.w, 20, testName + "got the fixed width to 20px"); +} diff --git a/tests/Util_w3c.html b/tests/Util_w3c.html new file mode 100644 index 0000000000..457341f82e --- /dev/null +++ b/tests/Util_w3c.html @@ -0,0 +1,35 @@ + + + + + + + + + + + +
+ + diff --git a/tests/deprecated/Layer/MapServer.html b/tests/deprecated/Layer/MapServer.html index 27ce63dd20..101646e933 100644 --- a/tests/deprecated/Layer/MapServer.html +++ b/tests/deprecated/Layer/MapServer.html @@ -31,11 +31,10 @@ map.addLayer(layer); map.setCenter(new OpenLayers.LonLat(0,0), 5); var tile = layer.grid[0][0]; - tile.draw(true); // the tile queue defers the drawing - t.eq( tile.bounds.left, -22.5, "left side matches" ); - t.eq( tile.bounds.right, -11.25, "top side matches" ); - t.eq( tile.bounds.bottom.toFixed(6), '11.178402', "bottom side matches" ); - t.eq( tile.bounds.top.toFixed(6), '21.943046', "top side matches" ); + t.eq( tile.bounds.left, -22.5, "left side matches" ); + t.eq( tile.bounds.right, -11.25, "right side matches" ); + t.eq( tile.bounds.bottom.toFixed(6), '11.781325', "bottom side matches" ); + t.eq( tile.bounds.top.toFixed(6), '22.512557', "top side matches" ); map.destroy(); } else { t.plan(1); diff --git a/tests/deprecated/Layer/WMS.html b/tests/deprecated/Layer/WMS.html index 523d6eef12..4cbf6e2297 100644 --- a/tests/deprecated/Layer/WMS.html +++ b/tests/deprecated/Layer/WMS.html @@ -1,3 +1,4 @@ + @@ -31,11 +32,10 @@ map.addLayer(wmslayer); map.setCenter(new OpenLayers.LonLat(0,0), 5); var tile = wmslayer.grid[0][0]; - tile.draw(true); // the tile queue defers the drawing t.eq( tile.bounds.left, -22.5, "left side matches" ); t.eq( tile.bounds.right, -11.25, "right side matches" ); - t.eq( tile.bounds.bottom.toFixed(6), '11.178402', "bottom side matches" ); - t.eq( tile.bounds.top.toFixed(6), '21.943046', "top side matches" ); + t.eq( tile.bounds.bottom.toFixed(6), '11.781325', "bottom side matches" ); + t.eq( tile.bounds.top.toFixed(6), '22.512557', "top side matches" ); map.destroy(); } else { t.plan(1); diff --git a/tests/Popup/AnchoredBubble.html b/tests/deprecated/Popup/AnchoredBubble.html similarity index 80% rename from tests/Popup/AnchoredBubble.html rename to tests/deprecated/Popup/AnchoredBubble.html index bd2d8123b2..ffad0690ad 100644 --- a/tests/Popup/AnchoredBubble.html +++ b/tests/deprecated/Popup/AnchoredBubble.html @@ -1,9 +1,11 @@ - + + + diff --git a/tests/list-tests.html b/tests/list-tests.html index 3236c507d6..f79076c165 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -191,9 +191,8 @@
  • SingleFile1.html
  • SingleFile2.html
  • SingleFile3.html -
  • Popup.html
  • +
  • Popup.html?visible
  • Popup/Anchored.html
  • -
  • Popup/AnchoredBubble.html
  • Popup/FramedCloud.html
  • Projection.html
  • Protocol.html
  • @@ -234,7 +233,8 @@
  • TileManager.html
  • Tween.html
  • Kinetic.html
  • -
  • Util.html
  • +
  • Util.html?visible
  • +
  • Util_w3c.html?visible
  • Util/vendorPrefix.html
  • WPSClient.html
  • WPSProcess.html
  • @@ -250,6 +250,7 @@
  • deprecated/Layer/WFS.html
  • deprecated/Layer/WMS.html
  • deprecated/Layer/WMS/Post.html
  • +
  • deprecated/Popup/AnchoredBubble.html
  • deprecated/Protocol/SQL.html
  • deprecated/Protocol/SQL/Gears.html
  • deprecated/Renderer/SVG2.html
  • diff --git a/tests/run-tests.html b/tests/run-tests.html index b2e0556ac3..d1517e4c37 100644 --- a/tests/run-tests.html +++ b/tests/run-tests.html @@ -92,11 +92,13 @@
    + + + - -

    diff --git a/theme/default/style.css b/theme/default/style.css index a3b75ba519..c523a46295 100644 --- a/theme/default/style.css +++ b/theme/default/style.css @@ -7,6 +7,7 @@ div.olMap { div.olMapViewport { text-align: left; + -ms-touch-action: none; } div.olLayerDiv { @@ -487,6 +488,23 @@ a.olControlZoomOut { transition: opacity 0.2s linear; } +/* Turn on GPU support where available */ +.olTileImage { + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -o-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000; + -moz-perspective: 1000; + -ms-perspective: 1000; + perspective: 1000; +} + /* when replacing tiles, do not show tile and backbuffer at the same time */ .olTileImage.olTileReplacing { display: none; diff --git a/theme/default/style.mobile.css b/theme/default/style.mobile.css index 2d4d39257a..92e7d00d4c 100644 --- a/theme/default/style.mobile.css +++ b/theme/default/style.mobile.css @@ -43,21 +43,28 @@ div.olControlZoom a:hover { background: rgba(0, 60, 136, 0.5); } } +div.olMapViewport { + -ms-touch-action: none; +} .olLayerGrid .olTileImage { -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; transition: opacity 0.2s linear; } -/* Enable 3d acceleration when operating on tiles, this is - known to yield better performance on IOS Safari. - http://osgeo-org.1803224.n2.nabble.com/Harware-accelerated-CSS3-animations-for-iOS-td6255560.html - - It also prevents tile blinking effects in iOS 5. - See https://github.com/openlayers/openlayers/issues/511 -*/ -@media (-webkit-transform-3d) { -img.olTileImage { - -webkit-transform: translate3d(0, 0, 0); -} +/* Turn on GPU support where available */ +.olTileImage { + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -o-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000; + -moz-perspective: 1000; + -ms-perspective: 1000; + perspective: 1000; } diff --git a/tools/uglify_js.py b/tools/uglify_js.py new file mode 100644 index 0000000000..50ef0984c5 --- /dev/null +++ b/tools/uglify_js.py @@ -0,0 +1,35 @@ +"""Utility to use the Uglify JS Compiler CLI from Python.""" + +import logging +import subprocess + + +def check_available(): + """ Returns whether the uglify-js tool is available. """ + subprocess.check_output(['which', 'uglifyjs']) + + +def compile(source_paths, flags=None): + """ + Prepares command-line call to uglify-js compiler. + + Args: + source_paths: Source paths to build, in order. + flags: A list of additional flags to pass on to uglify-js. + + Returns: + The compiled source, as a string, or None if compilation failed. + """ + + args = ['uglifyjs'] + args.extend(source_paths) + args.extend(['-c', '-m']) + if flags: + args += flags + + logging.info('Compiling with the following command: %s', ' '.join(args)) + + try: + return subprocess.check_output(args) + except subprocess.CalledProcessError: + return