diff --git a/apidoc_config/Menu.txt b/apidoc_config/Menu.txt index 1048e2fe50..2fdc653484 100644 --- a/apidoc_config/Menu.txt +++ b/apidoc_config/Menu.txt @@ -69,7 +69,7 @@ Group: OpenLayers { File: Control (no auto-title, OpenLayers/Control.js) File: ArgParser (no auto-title, OpenLayers/Control/ArgParser.js) File: Attribution (no auto-title, OpenLayers/Control/Attribution.js) - File: Control.Button (no auto-title, OpenLayers/Control/Button.js) + File: Button (no auto-title, OpenLayers/Control/Button.js) File: DragFeature (no auto-title, OpenLayers/Control/DragFeature.js) File: DragPan (no auto-title, OpenLayers/Control/DragPan.js) File: DrawFeature (no auto-title, OpenLayers/Control/DrawFeature.js) @@ -104,6 +104,14 @@ Group: OpenLayers { File: WFS (no auto-title, OpenLayers/Feature/WFS.js) } # Group: Feature + Group: Filter { + + File: Filter (no auto-title, OpenLayers/Filter.js) + File: Comparison (no auto-title, OpenLayers/Filter/Comparison.js) + File: FeatureId (no auto-title, OpenLayers/Filter/FeatureId.js) + File: Logical (no auto-title, OpenLayers/Filter/Logical.js) + } # Group: Filter + Group: Format { File: Format (no auto-title, OpenLayers/Format.js) @@ -113,10 +121,18 @@ Group: OpenLayers { File: JSON (no auto-title, OpenLayers/Format/JSON.js) File: KML (no auto-title, OpenLayers/Format/KML.js) File: OSM (no auto-title, OpenLayers/Format/OSM.js) - File: SLD (no auto-title, OpenLayers/Format/SLD.js) + + Group: SLD { + + File: SLD (no auto-title, OpenLayers/Format/SLD.js) + File: v1 (no auto-title, OpenLayers/Format/SLD/v1.js) + File: v1_0_0 (no auto-title, OpenLayers/Format/SLD/v1_0_0.js) + } # Group: SLD + File: Text (no auto-title, OpenLayers/Format/Text.js) File: WFS (no auto-title, OpenLayers/Format/WFS.js) File: WKT (no auto-title, OpenLayers/Format/WKT.js) + File: XML (no auto-title, OpenLayers/Format/XML.js) Group: WMC { @@ -126,7 +142,6 @@ Group: OpenLayers { File: v1_1_0 (no auto-title, OpenLayers/Format/WMC/v1_1_0.js) } # Group: WMC - File: XML (no auto-title, OpenLayers/Format/XML.js) } # Group: Format Group: Geometry { @@ -142,7 +157,6 @@ Group: OpenLayers { File: Point (no auto-title, OpenLayers/Geometry/Point.js) File: Polygon (no auto-title, OpenLayers/Geometry/Polygon.js) File: Rectangle (no auto-title, OpenLayers/Geometry/Rectangle.js) - File: Surface (no auto-title, OpenLayers/Geometry/Surface.js) } # Group: Geometry Group: Handler { @@ -166,6 +180,7 @@ Group: OpenLayers { Group: Lang { File: Lang (no auto-title, OpenLayers/Lang.js) + File: Lang["cs-CZ"] (OpenLayers/Lang/cs-CZ.js) File: Lang["de"] (no auto-title, OpenLayers/Lang/de.js) File: Lang["en"] (no auto-title, OpenLayers/Lang/en.js) File: Lang["en-CA"] (no auto-title, OpenLayers/Lang/en-CA.js) @@ -217,6 +232,8 @@ 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 (OpenLayers/Popup/Framed.js) + File: FramedCloud (OpenLayers/Popup/FramedCloud.js) } # Group: Popup File: Projection (no auto-title, OpenLayers/Projection.js) @@ -229,14 +246,7 @@ Group: OpenLayers { File: VML (no auto-title, OpenLayers/Renderer/VML.js) } # Group: Renderer - Group: Rule { - - File: Rule (no auto-title, OpenLayers/Rule.js) - File: Comparison (no auto-title, OpenLayers/Rule/Comparison.js) - File: FeatureId (no auto-title, OpenLayers/Rule/FeatureId.js) - File: Logical (no auto-title, OpenLayers/Rule/Logical.js) - } # Group: Rule - + File: Rule (no auto-title, OpenLayers/Rule.js) File: Style (no auto-title, OpenLayers/Style.js) File: StyleMap (no auto-title, OpenLayers/StyleMap.js) diff --git a/doc_config/Menu.txt b/doc_config/Menu.txt index 1048e2fe50..2fdc653484 100644 --- a/doc_config/Menu.txt +++ b/doc_config/Menu.txt @@ -69,7 +69,7 @@ Group: OpenLayers { File: Control (no auto-title, OpenLayers/Control.js) File: ArgParser (no auto-title, OpenLayers/Control/ArgParser.js) File: Attribution (no auto-title, OpenLayers/Control/Attribution.js) - File: Control.Button (no auto-title, OpenLayers/Control/Button.js) + File: Button (no auto-title, OpenLayers/Control/Button.js) File: DragFeature (no auto-title, OpenLayers/Control/DragFeature.js) File: DragPan (no auto-title, OpenLayers/Control/DragPan.js) File: DrawFeature (no auto-title, OpenLayers/Control/DrawFeature.js) @@ -104,6 +104,14 @@ Group: OpenLayers { File: WFS (no auto-title, OpenLayers/Feature/WFS.js) } # Group: Feature + Group: Filter { + + File: Filter (no auto-title, OpenLayers/Filter.js) + File: Comparison (no auto-title, OpenLayers/Filter/Comparison.js) + File: FeatureId (no auto-title, OpenLayers/Filter/FeatureId.js) + File: Logical (no auto-title, OpenLayers/Filter/Logical.js) + } # Group: Filter + Group: Format { File: Format (no auto-title, OpenLayers/Format.js) @@ -113,10 +121,18 @@ Group: OpenLayers { File: JSON (no auto-title, OpenLayers/Format/JSON.js) File: KML (no auto-title, OpenLayers/Format/KML.js) File: OSM (no auto-title, OpenLayers/Format/OSM.js) - File: SLD (no auto-title, OpenLayers/Format/SLD.js) + + Group: SLD { + + File: SLD (no auto-title, OpenLayers/Format/SLD.js) + File: v1 (no auto-title, OpenLayers/Format/SLD/v1.js) + File: v1_0_0 (no auto-title, OpenLayers/Format/SLD/v1_0_0.js) + } # Group: SLD + File: Text (no auto-title, OpenLayers/Format/Text.js) File: WFS (no auto-title, OpenLayers/Format/WFS.js) File: WKT (no auto-title, OpenLayers/Format/WKT.js) + File: XML (no auto-title, OpenLayers/Format/XML.js) Group: WMC { @@ -126,7 +142,6 @@ Group: OpenLayers { File: v1_1_0 (no auto-title, OpenLayers/Format/WMC/v1_1_0.js) } # Group: WMC - File: XML (no auto-title, OpenLayers/Format/XML.js) } # Group: Format Group: Geometry { @@ -142,7 +157,6 @@ Group: OpenLayers { File: Point (no auto-title, OpenLayers/Geometry/Point.js) File: Polygon (no auto-title, OpenLayers/Geometry/Polygon.js) File: Rectangle (no auto-title, OpenLayers/Geometry/Rectangle.js) - File: Surface (no auto-title, OpenLayers/Geometry/Surface.js) } # Group: Geometry Group: Handler { @@ -166,6 +180,7 @@ Group: OpenLayers { Group: Lang { File: Lang (no auto-title, OpenLayers/Lang.js) + File: Lang["cs-CZ"] (OpenLayers/Lang/cs-CZ.js) File: Lang["de"] (no auto-title, OpenLayers/Lang/de.js) File: Lang["en"] (no auto-title, OpenLayers/Lang/en.js) File: Lang["en-CA"] (no auto-title, OpenLayers/Lang/en-CA.js) @@ -217,6 +232,8 @@ 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 (OpenLayers/Popup/Framed.js) + File: FramedCloud (OpenLayers/Popup/FramedCloud.js) } # Group: Popup File: Projection (no auto-title, OpenLayers/Projection.js) @@ -229,14 +246,7 @@ Group: OpenLayers { File: VML (no auto-title, OpenLayers/Renderer/VML.js) } # Group: Renderer - Group: Rule { - - File: Rule (no auto-title, OpenLayers/Rule.js) - File: Comparison (no auto-title, OpenLayers/Rule/Comparison.js) - File: FeatureId (no auto-title, OpenLayers/Rule/FeatureId.js) - File: Logical (no auto-title, OpenLayers/Rule/Logical.js) - } # Group: Rule - + File: Rule (no auto-title, OpenLayers/Rule.js) File: Style (no auto-title, OpenLayers/Style.js) File: StyleMap (no auto-title, OpenLayers/StyleMap.js) diff --git a/examples/layer-opacity.html b/examples/layer-opacity.html index 95ecf04eb1..adb70aa6c6 100644 --- a/examples/layer-opacity.html +++ b/examples/layer-opacity.html @@ -49,23 +49,20 @@ } function init(){ var options = { - projection: "EPSG:26912", - units: 'm', - maxExtent: new OpenLayers.Bounds(455402, 4967657, 473295, 4984095), - maxResolution: 'auto', - maxZoomLevel: 8 + maxExtent: new OpenLayers.Bounds(-110.994, 45.885, -110.950, 45.929), + maxResolution: "auto" }; map = new OpenLayers.Map('map', options); var drg = new OpenLayers.Layer.WMS("Topo Maps", "http://terraservice.net/ogcmap.ashx", {layers: "DRG"}); shade = new OpenLayers.Layer.WMS("Shaded Relief", - "http://ims.cr.usgs.gov/servlet19/com.esri.wms.Esrimap/USGS_EDC_Elev_NED_3", + "http://gisdata.usgs.gov/wmsconnector/com.esri.wms.Esrimap?ServiceName=USGS_EDC_Elev_NED_3", {layers: "HR-NED.IMAGE", reaspect: "false", transparent: 'true'}, {isBaseLayer: false, opacity: 0.3}); map.addLayers([drg, shade]); map.addControl(new OpenLayers.Control.LayerSwitcher()); - map.setCenter(new OpenLayers.LonLat(464348.5,4975876), 1); + map.zoomToMaxExtent(); } diff --git a/lib/OpenLayers/BaseTypes.js b/lib/OpenLayers/BaseTypes.js index 939753efe4..b9e2cbc054 100644 --- a/lib/OpenLayers/BaseTypes.js +++ b/lib/OpenLayers/BaseTypes.js @@ -17,16 +17,14 @@ * OpenLayers custom string, number and function functions are described here. */ -/********************* - * * - * STRING * - * * - *********************/ - +/** + * Namespace: OpenLayers.String + * Contains convenience functions for string manipulation. + */ OpenLayers.String = { /** - * APIFunction: OpenLayers.String.startsWith + * APIFunction: startsWith * Test whether a string starts with another string. * * Parameters: @@ -41,7 +39,7 @@ OpenLayers.String = { }, /** - * APIFunction: OpenLayers.String.contains + * APIFunction: contains * Test whether a string contains another string. * * Parameters: @@ -56,7 +54,7 @@ OpenLayers.String = { }, /** - * APIFunction: OpenLayers.String.trim + * APIFunction: trim * Removes leading and trailing whitespace characters from a string. * * Parameters: @@ -72,7 +70,7 @@ OpenLayers.String = { }, /** - * APIFunction: OpenLayers.String.camelize + * APIFunction: camelize * Camel-case a hyphenated string. * Ex. "chicken-head" becomes "chickenHead", and * "-chicken-head" becomes "ChickenHead". @@ -94,7 +92,7 @@ OpenLayers.String = { }, /** - * APIFunction: OpenLayers.String.format + * APIFunction: format * Given a string with tokens in the form ${token}, return a string * with tokens replaced with properties from the given context * object. Represent a literal "${" by doubling it, e.g. "${${". @@ -209,28 +207,26 @@ if (!String.prototype.camelize) { }; } -/********************* - * * - * NUMBER * - * * - *********************/ - +/** + * Namespace: OpenLayers.Number + * Contains convenience functions for manipulating numbers. + */ OpenLayers.Number = { /** - * Property: OpenLayers.Number.decimalSeparator + * Property: decimalSeparator * Decimal separator to use when formatting numbers. */ decimalSeparator: ".", /** - * Property: OpenLayers.Number.thousandsSeparator + * Property: thousandsSeparator * Thousands separator to use when formatting numbers. */ thousandsSeparator: ",", /** - * APIFunction: OpenLayers.Number.limitSigDigs + * APIFunction: limitSigDigs * Limit the number of significant digits on a float. * * Parameters: @@ -250,7 +246,7 @@ OpenLayers.Number = { }, /** - * APIFunction: OpenLayers.Number.format + * APIFunction: format * Formats a number for output. * * Parameters: @@ -324,15 +320,13 @@ if (!Number.prototype.limitSigDigs) { }; } -/********************* - * * - * FUNCTION * - * * - *********************/ - +/** + * Namespace: OpenLayers.Function + * Contains convenience functions for function manipulation. + */ OpenLayers.Function = { /** - * APIFunction: OpenLayers.Function.bind + * APIFunction: bind * Bind a function to an object. Method to easily create closures with * 'this' altered. * @@ -357,7 +351,7 @@ OpenLayers.Function = { }, /** - * APIFunction: OpenLayers.Function.bindAsEventListener + * APIFunction: bindAsEventListener * Bind a function to an object, and configure it to receive the event * object as first parameter when called. * @@ -416,16 +410,14 @@ if (!Function.prototype.bindAsEventListener) { }; } -/********************* - * * - * ARRAY * - * * - *********************/ - +/** + * Namespace: OpenLayers.Array + * Contains convenience functions for array manipulation. + */ OpenLayers.Array = { /** - * APIMethod: OpenLayers.Array.filter + * APIMethod: filter * Filter an array. Provides the functionality of the * Array.prototype.filter extension to the ECMA-262 standard. Where * available, Array.prototype.filter will be used. diff --git a/lib/OpenLayers/BaseTypes/Bounds.js b/lib/OpenLayers/BaseTypes/Bounds.js index 1bbcdd10a5..7ea7f3bcda 100644 --- a/lib/OpenLayers/BaseTypes/Bounds.js +++ b/lib/OpenLayers/BaseTypes/Bounds.js @@ -18,25 +18,25 @@ OpenLayers.Bounds = OpenLayers.Class({ /** * Property: left - * {Number} + * {Number} Minimum horizontal coordinate. */ left: null, /** * Property: bottom - * {Number} + * {Number} Minimum vertical coordinate. */ bottom: null, /** * Property: right - * {Number} + * {Number} Maximum horizontal coordinate. */ right: null, /** * Property: top - * {Number} + * {Number} Maximum vertical coordinate. */ top: null, @@ -349,7 +349,7 @@ OpenLayers.Bounds = OpenLayers.Class({ * * Parameters: * bounds - {} - * inclusive - {} Whether or not to include the border. Default + * inclusive - {Boolean} Whether or not to include the border. Default * is true. * * Returns: @@ -384,10 +384,10 @@ OpenLayers.Bounds = OpenLayers.Class({ * APIMethod: containsBounds * * bounds - {} - * partial - {} If true, only part of passed-in bounds needs be + * partial - {Boolean} If true, only part of passed-in bounds needs be * within this bounds. If false, the entire passed-in bounds must be * within. Default is false - * inclusive - {} Whether or not to include the border. Default is + * inclusive - {Boolean} Whether or not to include the border. Default is * true. * * Returns: diff --git a/lib/OpenLayers/Control.js b/lib/OpenLayers/Control.js index d1196f3c0e..d0d16a83aa 100644 --- a/lib/OpenLayers/Control.js +++ b/lib/OpenLayers/Control.js @@ -103,7 +103,7 @@ OpenLayers.Control = OpenLayers.Class({ /** * Property: active - * {boolean} null + * {Boolean} The control is active. */ active: null, diff --git a/lib/OpenLayers/Control/DragPan.js b/lib/OpenLayers/Control/DragPan.js index 5eb3edf39f..7fdbacfa7e 100644 --- a/lib/OpenLayers/Control/DragPan.js +++ b/lib/OpenLayers/Control/DragPan.js @@ -30,8 +30,8 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, { /** * Method: draw - * Creates a Drag handler, using and - * as callbacks. + * Creates a Drag handler, using and + * as callbacks. */ draw: function() { this.handler = new OpenLayers.Handler.Drag(this, diff --git a/lib/OpenLayers/Control/ModifyFeature.js b/lib/OpenLayers/Control/ModifyFeature.js index 302862789f..41b9b4dd5c 100644 --- a/lib/OpenLayers/Control/ModifyFeature.js +++ b/lib/OpenLayers/Control/ModifyFeature.js @@ -72,7 +72,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { /** * Property: selectControl - * {} + * {} */ selectControl: null, @@ -99,7 +99,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { /** * APIProperty: virtualStyle - * {} + * {Object} A symbolizer to be used for virtual vertices. */ virtualStyle: null, diff --git a/lib/OpenLayers/Control/NavToolbar.js b/lib/OpenLayers/Control/NavToolbar.js index 09b8c4c9c9..76f026e3f8 100644 --- a/lib/OpenLayers/Control/NavToolbar.js +++ b/lib/OpenLayers/Control/NavToolbar.js @@ -10,6 +10,9 @@ /** * Class: OpenLayers.Control.NavToolbar + * + * Inherits from: + * - */ OpenLayers.Control.NavToolbar = OpenLayers.Class(OpenLayers.Control.Panel, { diff --git a/lib/OpenLayers/Control/NavigationHistory.js b/lib/OpenLayers/Control/NavigationHistory.js index bbcf81162c..1dace12aa9 100644 --- a/lib/OpenLayers/Control/NavigationHistory.js +++ b/lib/OpenLayers/Control/NavigationHistory.js @@ -16,7 +16,7 @@ * when there are no states to restore. * * Inherits from: - * - + * - */ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, { @@ -32,7 +32,7 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, { /** * APIProperty: previous - * {OpenLayers.Control} A button type control whose trigger method restores + * {} A button type control whose trigger method restores * the previous state managed by this control. */ previous: null, @@ -46,7 +46,7 @@ OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, { /** * APIProperty: next - * {OpenLayers.Control} A button type control whose trigger method restores + * {} A button type control whose trigger method restores * the next state managed by this control. */ next: null, diff --git a/lib/OpenLayers/Control/PanZoom.js b/lib/OpenLayers/Control/PanZoom.js index d21422d511..086afd16d0 100644 --- a/lib/OpenLayers/Control/PanZoom.js +++ b/lib/OpenLayers/Control/PanZoom.js @@ -8,7 +8,7 @@ */ /** - * Class: OpenLayers.PanZoom + * Class: OpenLayers.Control.PanZoom * * Inherits from: * - diff --git a/lib/OpenLayers/Control/PanZoomBar.js b/lib/OpenLayers/Control/PanZoomBar.js index 26ba2ff858..e4b6c82f5c 100644 --- a/lib/OpenLayers/Control/PanZoomBar.js +++ b/lib/OpenLayers/Control/PanZoomBar.js @@ -12,7 +12,6 @@ * * Inherits from: * - - * - */ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, { @@ -56,7 +55,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, { zoomWorldIcon: false, /** - * Constructor: + * Constructor: OpenLayers.Control.PanZoomBar */ initialize: function() { OpenLayers.Control.PanZoom.prototype.initialize.apply(this, arguments); diff --git a/lib/OpenLayers/Control/Panel.js b/lib/OpenLayers/Control/Panel.js index b31b025df4..46201e443d 100644 --- a/lib/OpenLayers/Control/Panel.js +++ b/lib/OpenLayers/Control/Panel.js @@ -15,7 +15,7 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, { /** * Property: controls - * Array({}) + * {Array()} */ controls: null, diff --git a/lib/OpenLayers/Events.js b/lib/OpenLayers/Events.js index 0a6349dfef..80a95ff7ee 100644 --- a/lib/OpenLayers/Events.js +++ b/lib/OpenLayers/Events.js @@ -532,7 +532,9 @@ OpenLayers.Events = OpenLayers.Class({ */ register: function (type, obj, func) { - if (func != null) { + if (func != null && + ((this.eventTypes && OpenLayers.Util.indexOf(this.eventTypes, type) != -1) || + OpenLayers.Util.indexOf(this.BROWSER_EVENTS, type) != -1)) { if (obj == null) { obj = this.object; } diff --git a/lib/OpenLayers/Feature.js b/lib/OpenLayers/Feature.js index 7b5a3c593c..2eaafbdba5 100644 --- a/lib/OpenLayers/Feature.js +++ b/lib/OpenLayers/Feature.js @@ -161,6 +161,10 @@ OpenLayers.Feature = OpenLayers.Class({ * * If no 'lonlat' is set, returns null. * If no this.marker has been created, no anchor is sent. + * + * Note - the returned popup object is 'owned' by the feature, so you + * cannot use the popup's destroy method to discard the popup. + * Instead, you must use the feature's destroyPopup * * Note - this.popup is set to return value * diff --git a/lib/OpenLayers/Filter/Comparison.js b/lib/OpenLayers/Filter/Comparison.js index 0cf3e7a059..04f41a2f55 100644 --- a/lib/OpenLayers/Filter/Comparison.js +++ b/lib/OpenLayers/Filter/Comparison.js @@ -68,9 +68,6 @@ OpenLayers.Filter.Comparison = OpenLayers.Class(OpenLayers.Filter, { * Creates a comparison rule. * * Parameters: - * params - {Object} Hash of parameters for this rule: - * - - * - value: * options - {Object} An optional object with properties to set on the * rule * @@ -204,7 +201,7 @@ OpenLayers.Filter.Comparison = OpenLayers.Class(OpenLayers.Filter, { * value - {String} or {Number}, same as property * * Returns: - * {boolean} + * {Boolean} */ binaryCompare: function(context, property, value) { switch (this.type) { diff --git a/lib/OpenLayers/Filter/FeatureId.js b/lib/OpenLayers/Filter/FeatureId.js index ca458fb084..a61a8dc1ee 100644 --- a/lib/OpenLayers/Filter/FeatureId.js +++ b/lib/OpenLayers/Filter/FeatureId.js @@ -19,7 +19,7 @@ OpenLayers.Filter.FeatureId = OpenLayers.Class(OpenLayers.Filter, { /** * APIProperty: fids - * {Array()} Feature Ids to evaluate this rule against. To be passed + * {Array(String)} Feature Ids to evaluate this rule against. To be passed * To be passed inside the params object. */ fids: null, @@ -50,7 +50,7 @@ OpenLayers.Filter.FeatureId = OpenLayers.Class(OpenLayers.Filter, { * for plain features against the id. * * Returns: - * {boolean} true if the rule applies, false if it does not + * {Boolean} true if the rule applies, false if it does not */ evaluate: function(feature) { for (var i=0; i}) List of features to serialize into a string. + * features - {Array()} List of features to serialize into a string. */ write: function(features) { var georss; diff --git a/lib/OpenLayers/Format/OSM.js b/lib/OpenLayers/Format/OSM.js index 579d2e8805..e8efd71a50 100644 --- a/lib/OpenLayers/Format/OSM.js +++ b/lib/OpenLayers/Format/OSM.js @@ -283,7 +283,7 @@ OpenLayers.Format.OSM = OpenLayers.Class(OpenLayers.Format.XML, { * in tools like JOSM. * * Parameters: - * features - Array({}) + * features - {Array()} */ write: function(features) { if (!(features instanceof Array)) { diff --git a/lib/OpenLayers/Format/SLD.js b/lib/OpenLayers/Format/SLD.js index eff1adff34..498e10c4fb 100644 --- a/lib/OpenLayers/Format/SLD.js +++ b/lib/OpenLayers/Format/SLD.js @@ -5,9 +5,9 @@ /** * @requires OpenLayers/Format/XML.js * @requires OpenLayers/Style.js - * @requires OpenLayers/Rule/FeatureId.js - * @requires OpenLayers/Rule/Logical.js - * @requires OpenLayers/Rule/Comparison.js + * @requires OpenLayers/Filter/FeatureId.js + * @requires OpenLayers/Filter/Logical.js + * @requires OpenLayers/Filter/Comparison.js */ /** diff --git a/lib/OpenLayers/Geometry/MultiPoint.js b/lib/OpenLayers/Geometry/MultiPoint.js index b6ca1cca42..c787941e46 100644 --- a/lib/OpenLayers/Geometry/MultiPoint.js +++ b/lib/OpenLayers/Geometry/MultiPoint.js @@ -31,7 +31,7 @@ OpenLayers.Geometry.MultiPoint = OpenLayers.Class( * Create a new MultiPoint Geometry * * Parameters: - * components - Array({}) + * components - {Array()} * * Returns: * {} diff --git a/lib/OpenLayers/Geometry/Polygon.js b/lib/OpenLayers/Geometry/Polygon.js index ab3a994901..8a6031f4fb 100644 --- a/lib/OpenLayers/Geometry/Polygon.js +++ b/lib/OpenLayers/Geometry/Polygon.js @@ -33,7 +33,7 @@ OpenLayers.Geometry.Polygon = OpenLayers.Class( * * * Parameters: - * components - Array({}) + * components - {Array()} */ initialize: function(components) { OpenLayers.Geometry.Collection.prototype.initialize.apply(this, diff --git a/lib/OpenLayers/Geometry/Surface.js b/lib/OpenLayers/Geometry/Surface.js index 7c7a3fbb1c..f20762aee6 100644 --- a/lib/OpenLayers/Geometry/Surface.js +++ b/lib/OpenLayers/Geometry/Surface.js @@ -6,15 +6,8 @@ * @requires OpenLayers/Geometry.js */ -/** - * Class: OpenLayers.Geometry.Surface - */ OpenLayers.Geometry.Surface = OpenLayers.Class(OpenLayers.Geometry, { - /** - * Constructor: OpenLayers.Geometry.Surface - * - */ initialize: function() { OpenLayers.Geometry.prototype.initialize.apply(this, arguments); }, diff --git a/lib/OpenLayers/Handler/Click.js b/lib/OpenLayers/Handler/Click.js index 62a3baad10..42737e868d 100644 --- a/lib/OpenLayers/Handler/Click.js +++ b/lib/OpenLayers/Handler/Click.js @@ -79,7 +79,7 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, { /** * Property: timerId - * {Number} The id of the timeout waiting to clear the . + * {Number} The id of the timeout waiting to clear the . */ timerId: null, diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 3cf5d7ef4d..f18374d21c 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -997,6 +997,8 @@ OpenLayers.Layer = OpenLayers.Class({ /** * APIMethod: getViewPortPxFromLonLat + * Returns a pixel location given a map location. This method will return + * fractional pixel values. * * Parameters: * lonlat - {} @@ -1011,8 +1013,8 @@ OpenLayers.Layer = OpenLayers.Class({ var resolution = this.map.getResolution(); var extent = this.map.getExtent(); px = new OpenLayers.Pixel( - Math.round(1/resolution * (lonlat.lon - extent.left)), - Math.round(1/resolution * (extent.top - lonlat.lat)) + (1/resolution * (lonlat.lon - extent.left)), + (1/resolution * (extent.top - lonlat.lat)) ); } return px; diff --git a/lib/OpenLayers/Layer/GeoRSS.js b/lib/OpenLayers/Layer/GeoRSS.js index 8b12a62265..1bb4893a0a 100644 --- a/lib/OpenLayers/Layer/GeoRSS.js +++ b/lib/OpenLayers/Layer/GeoRSS.js @@ -26,7 +26,7 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, { /** * Property: features - * Array({}) + * {Array()} */ features: null, diff --git a/lib/OpenLayers/Layer/MapServer/Untiled.js b/lib/OpenLayers/Layer/MapServer/Untiled.js index 8af98d42e7..015fba51ae 100644 --- a/lib/OpenLayers/Layer/MapServer/Untiled.js +++ b/lib/OpenLayers/Layer/MapServer/Untiled.js @@ -9,8 +9,8 @@ /** * Class: OpenLayers.Layer.MapServer.Untiled - * Deprecated, to be removed in 3.0 - instead use OpenLayers.Layer.MapServer and - * pass the option 'singleTile' as true. + * *Deprecated*. To be removed in 3.0. Instead use OpenLayers.Layer.MapServer + * and pass the option 'singleTile' as true. * * Inherits from: * - diff --git a/lib/OpenLayers/Layer/Markers.js b/lib/OpenLayers/Layer/Markers.js index e56a2da7fe..b2a7f01f56 100644 --- a/lib/OpenLayers/Layer/Markers.js +++ b/lib/OpenLayers/Layer/Markers.js @@ -23,7 +23,7 @@ OpenLayers.Layer.Markers = OpenLayers.Class(OpenLayers.Layer, { /** * Property: markers - * Array({}) internal marker list + * {Array()} internal marker list */ markers: null, diff --git a/lib/OpenLayers/Layer/MultiMap.js b/lib/OpenLayers/Layer/MultiMap.js index 55ba1365c7..868830b198 100644 --- a/lib/OpenLayers/Layer/MultiMap.js +++ b/lib/OpenLayers/Layer/MultiMap.js @@ -13,8 +13,8 @@ * option. See Ticket #953 for more details. * * Inherits from: - * - - * - + * - + * - */ OpenLayers.Layer.MultiMap = OpenLayers.Class( OpenLayers.Layer.EventPane, OpenLayers.Layer.FixedZoomLevels, { diff --git a/lib/OpenLayers/Layer/Text.js b/lib/OpenLayers/Layer/Text.js index 760d1b6a6e..dd1b7479b6 100644 --- a/lib/OpenLayers/Layer/Text.js +++ b/lib/OpenLayers/Layer/Text.js @@ -50,7 +50,7 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, { /** * Property: features - * Array({}) + * {Array()} */ features: null, diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index 8ddc18d5c5..673a7faa5b 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -87,13 +87,13 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { /** * APIProperty: features - * Array({}) + * {Array()} */ features: null, /** * Property: selectedFeatures - * Array({}) + * {Array()} */ selectedFeatures: null, @@ -118,7 +118,7 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { /** * Property: renderers - * Array({String}) List of supported Renderer classes. Add to this list to + * {Array(String)} List of supported Renderer classes. Add to this list to * add support for additional renderers. This list is ordered: * the first renderer which returns true for the 'supported()' * method will be used, if not defined in the 'renderer' option. diff --git a/lib/OpenLayers/Layer/WMS/Untiled.js b/lib/OpenLayers/Layer/WMS/Untiled.js index 32b1456da4..b79355feed 100644 --- a/lib/OpenLayers/Layer/WMS/Untiled.js +++ b/lib/OpenLayers/Layer/WMS/Untiled.js @@ -9,7 +9,7 @@ /** * Class: OpenLayers.Layer.WMS.Untiled - * Deprecated, to be removed in 3.0 - instead use OpenLayers.Layer.WMS and + * *Deprecated*. To be removed in 3.0. Instead use OpenLayers.Layer.WMS and * pass the option 'singleTile' as true. * * Inherits from: diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index feda3b10e7..bc9693923a 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -820,7 +820,7 @@ OpenLayers.Map = OpenLayers.Class({ * APIMethod: addLayers * * Parameters: - * layers - Array({}) + * layers - {Array()} */ addLayers: function (layers) { for (var i = 0; i < layers.length; i++) { @@ -1593,8 +1593,8 @@ OpenLayers.Map = OpenLayers.Class({ var newPx = this.getViewPortPxFromLonLat(lonlat); if ((originPx != null) && (newPx != null)) { - this.layerContainerDiv.style.left = (originPx.x - newPx.x) + "px"; - this.layerContainerDiv.style.top = (originPx.y - newPx.y) + "px"; + this.layerContainerDiv.style.left = Math.round(originPx.x - newPx.x) + "px"; + this.layerContainerDiv.style.top = Math.round(originPx.y - newPx.y) + "px"; } }, @@ -1963,7 +1963,7 @@ OpenLayers.Map = OpenLayers.Class({ // /** - * APIMethod: getLonLatFromViewPortPx + * Method: getLonLatFromViewPortPx * * Parameters: * viewPortPx - {} @@ -2022,17 +2022,23 @@ OpenLayers.Map = OpenLayers.Class({ /** * APIMethod: getPixelFromLonLat + * Returns a pixel location given a map location. The map location is + * translated to an integer pixel location (in viewport pixel + * coordinates) by the current base layer. * * Parameters: - * lonlat - {} + * lonlat - {} A map location. * * Returns: * {} An OpenLayers.Pixel corresponding to the - * translated into view port - * pixels by the current base layer. + * translated into view port pixels by the current + * base layer. */ getPixelFromLonLat: function (lonlat) { - return this.getViewPortPxFromLonLat(lonlat); + var px = this.getViewPortPxFromLonLat(lonlat); + px.x = Math.round(px.x); + px.y = Math.round(px.y); + return px; }, @@ -2089,7 +2095,7 @@ OpenLayers.Map = OpenLayers.Class({ // /** - * APIMethod: getLonLatFromLayerPx + * Method: getLonLatFromLayerPx * * Parameters: * px - {} @@ -2116,7 +2122,7 @@ OpenLayers.Map = OpenLayers.Class({ */ getLayerPxFromLonLat: function (lonlat) { //adjust for displacement of layerContainerDiv - var px = this.getViewPortPxFromLonLat(lonlat); + var px = this.getPixelFromLonLat(lonlat); return this.getLayerPxFromViewPortPx(px); }, diff --git a/lib/OpenLayers/Rule.js b/lib/OpenLayers/Rule.js index 980cacbcbc..ac52696fcb 100644 --- a/lib/OpenLayers/Rule.js +++ b/lib/OpenLayers/Rule.js @@ -122,7 +122,7 @@ OpenLayers.Rule = OpenLayers.Class({ * feature - {} feature to apply the rule to. * * Returns: - * {boolean} true if the rule applies, false if it does not. + * {Boolean} true if the rule applies, false if it does not. * This rule is the default rule and always returns true. */ evaluate: function(feature) { diff --git a/lib/OpenLayers/Style.js b/lib/OpenLayers/Style.js index 6cef5157a1..400c7f6428 100644 --- a/lib/OpenLayers/Style.js +++ b/lib/OpenLayers/Style.js @@ -48,7 +48,7 @@ OpenLayers.Style = OpenLayers.Class({ /** * Property: rules - * Array({}) + * {Array()} */ rules: null, diff --git a/lib/OpenLayers/StyleMap.js b/lib/OpenLayers/StyleMap.js index 17940f44a1..88f33a5bbf 100644 --- a/lib/OpenLayers/StyleMap.js +++ b/lib/OpenLayers/StyleMap.js @@ -22,8 +22,8 @@ OpenLayers.StyleMap = OpenLayers.Class({ /** * Property: extendDefault * {Boolean} if true, every render intent will extend the symbolizers - * specified for the "default" intent. Otherwise, every rendering intent - * is treated as a completely independent symbolizer. + * specified for the "default" intent at rendering time. Otherwise, every + * rendering intent will be treated as a completely independent style. */ extendDefault: true, @@ -33,7 +33,9 @@ OpenLayers.StyleMap = OpenLayers.Class({ * Parameters: * style - {Object} Optional. Either a style hash, or a style object, or * a hash of style objects (style hashes) keyed by rendering - * intent + * intent. If just one style hash or style object is passed, + * this will be used for all known render intents (default, + * select, temporary) * options - {Object} optional hash of additional options for this * instance */ @@ -52,6 +54,8 @@ OpenLayers.StyleMap = OpenLayers.Class({ if(style instanceof OpenLayers.Style) { // user passed a style object this.styles["default"] = style; + this.styles["select"] = style; + this.styles["temporary"] = style; } else if(typeof style == "object") { for(var key in style) { if(style[key] instanceof OpenLayers.Style) { @@ -63,6 +67,8 @@ OpenLayers.StyleMap = OpenLayers.Class({ } else { // user passed a style hash (i.e. symbolizer) this.styles["default"] = new OpenLayers.Style(style); + this.styles["select"] = new OpenLayers.Style(style); + this.styles["temporary"] = new OpenLayers.Style(style); break; } } @@ -128,11 +134,14 @@ OpenLayers.StyleMap = OpenLayers.Class({ addUniqueValueRules: function(renderIntent, property, symbolizers) { var rules = []; for (var value in symbolizers) { - rules.push(new OpenLayers.Rule.Comparison({ - type: OpenLayers.Rule.Comparison.EQUAL_TO, - property: property, - value: value, - symbolizer: symbolizers[value]})); + rules.push(new OpenLayers.Rule({ + symbolizer: symbolizers[value], + filter: new OpenLayers.Filter.Comparison({ + type: OpenLayers.Filter.Comparison.EQUAL_TO, + property: property, + value: value + }) + })); } this.styles[renderIntent].addRules(rules); }, diff --git a/tests/Extras.html b/tests/Extras.html new file mode 100644 index 0000000000..948f3abf99 --- /dev/null +++ b/tests/Extras.html @@ -0,0 +1,21 @@ + + + + + + +
+ + diff --git a/tests/Format/GeoRSS.html b/tests/Format/GeoRSS.html index f023ba53a9..b8b6edc3dc 100644 --- a/tests/Format/GeoRSS.html +++ b/tests/Format/GeoRSS.html @@ -24,8 +24,7 @@ var l = new OpenLayers.Geometry.LineString([point, point2]); var f = new OpenLayers.Feature.Vector(l); var data = parser.write([f]); - var data = data.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog - t.eq(data, '45.68 -111.04 45.68 -112.04', 'GeoRSS serializes a line correctly'); + t.xml_eq(data, '45.68 -111.04 45.68 -112.04', 'GeoRSS serializes a line correctly'); } function test_Format_GeoRSS_w3cgeo(t) { t.plan(2); @@ -50,11 +49,7 @@ var data = parser.read(feed); var out = parser.write(data); var expected_result = output[i]; - if (OpenLayers.Util.getBrowserName() == "opera") { - expected_result = expected_result.replace(/>/g, ">"); - } - var out = out.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog - t.eq(out, expected_result, "Output gave expected value"); + t.xml_eq(out, expected_result, "Output gave expected value"); } } function test_Format_GeoRSS_gml_roundtrip(t) { @@ -65,11 +60,7 @@ var data = parser.read(feed); var out = parser.write(data); var expected_result = output_gml[i]; - if (OpenLayers.Util.getBrowserName() == "opera") { - expected_result = expected_result.replace(/>/g, ">"); - } - var out = out.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog - t.eq(out, expected_result, "Output gave expected value"); + t.xml_eq(out, expected_result, "Output gave expected value"); } } diff --git a/tests/auto-tests.html b/tests/auto-tests.html index 3ba3acdad4..9d2a30cbce 100644 --- a/tests/auto-tests.html +++ b/tests/auto-tests.html @@ -2332,7 +2332,9 @@ onload=function() } } // --> - + + +
Test pages:
diff --git a/tests/list-tests.html b/tests/list-tests.html index 8ef9a61134..18823a8397 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -1,5 +1,6 @@
  • OpenLayers.html
  • +
  • Extras.html
  • Ajax.html
  • BaseTypes.html
  • BaseTypes/Bounds.html