Changeset 4390
- Timestamp:
- 09/19/07 07:36:13 (1 year ago)
- Files:
-
- branches/openlayers/2.5/examples/proxy.cgi (modified) (3 diffs)
- branches/openlayers/2.5/lib/OpenLayers/BaseTypes.js (modified) (11 diffs)
- branches/openlayers/2.5/lib/OpenLayers/BaseTypes/Bounds.js (modified) (20 diffs)
- branches/openlayers/2.5/lib/OpenLayers/Control.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Control/DragFeature.js (modified) (16 diffs)
- branches/openlayers/2.5/lib/OpenLayers/Control/ModifyFeature.js (modified) (3 diffs)
- branches/openlayers/2.5/lib/OpenLayers/Control/OverviewMap.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Control/PanZoom.js (modified) (6 diffs)
- branches/openlayers/2.5/lib/OpenLayers/Format/GML.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Format/GeoJSON.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Format/GeoRSS.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Format/KML.js (modified) (2 diffs)
- branches/openlayers/2.5/lib/OpenLayers/Format/WKT.js (modified) (2 diffs)
- branches/openlayers/2.5/lib/OpenLayers/Handler/Drag.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Handler/RegularPolygon.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Layer.js (modified) (2 diffs)
- branches/openlayers/2.5/lib/OpenLayers/Layer/Google.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Layer/Image.js (modified) (1 diff)
- branches/openlayers/2.5/lib/OpenLayers/Map.js (modified) (1 diff)
- branches/openlayers/2.5/tests/Control/test_OverviewMap.html (modified) (2 diffs)
- branches/openlayers/2.5/tests/Handler/test_Drag.html (modified) (2 diffs)
- branches/openlayers/2.5/tests/Layer/test_GeoRSS.html (modified) (2 diffs)
- branches/openlayers/2.5/tests/Layer/test_Grid.html (modified) (3 diffs)
- branches/openlayers/2.5/tests/Layer/test_Image.html (modified) (2 diffs)
- branches/openlayers/2.5/tests/Layer/test_KaMap.html (modified) (2 diffs)
- branches/openlayers/2.5/tests/Layer/test_TMS.html (modified) (1 diff)
- branches/openlayers/2.5/tests/Layer/test_Text.html (modified) (1 diff)
- branches/openlayers/2.5/tests/Layer/test_TileCache.html (modified) (1 diff)
- branches/openlayers/2.5/tests/Layer/test_Vector.html (modified) (5 diffs)
- branches/openlayers/2.5/tests/Layer/test_WrapDateLine.html (modified) (3 diffs)
- branches/openlayers/2.5/tests/test_Layer.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/openlayers/2.5/examples/proxy.cgi
r2803 r4390 7 7 efficient, it might break some sites, and it's a security risk because 8 8 people can use this proxy to browse the web and possibly do bad stuff 9 with it. If you can get your code signed (see:10 http://trac.openlayers.org/wiki/HowToSignJavascript), then you should11 modify Parameters.js so that this isn't used. Otherwise, you're stuck12 9 with it. It only loads pages via http and https, but it can load any 13 content type. XML and HTML are both currently used by Openlayers."""10 content type. It supports GET and POST requests.""" 14 11 15 import urllib 12 import urllib2 16 13 import cgi 17 18 fs = cgi.FieldStorage() 19 url = fs.getvalue('url', "http://openlayers.org") 14 import sys, os 20 15 21 16 # Designed to prevent Open Proxy type stuff. 22 17 23 allowedHosts = ['www.openlayers.org', 'openlayers.org', 'octo.metacarta.com', 'merrimack.metacarta.com', 'labs.metacarta.com', 'world.freemap.in', 24 'prototype.openmnnd.org'] 18 allowedHosts = ['www.openlayers.org', 'openlayers.org', 19 'labs.metacarta.com', 'world.freemap.in', 20 'prototype.openmnnd.org', 'geo.openplans.org'] 21 22 method = os.environ["REQUEST_METHOD"] 23 24 if method == "POST": 25 qs = os.environ["QUERY_STRING"] 26 d = cgi.parse_qs(qs) 27 if d.has_key("url"): 28 url = d["url"][0] 29 else: 30 url = "http://www.openlayers.org" 31 else: 32 fs = cgi.FieldStorage() 33 url = fs.getvalue('url', "http://www.openlayers.org") 25 34 26 35 try: … … 31 40 print 32 41 print "This proxy does not allow you to access that location." 33 42 print 43 print os.environ 44 34 45 elif url.startswith("http://") or url.startswith("https://"): 35 46 36 y = urllib.urlopen(url) 47 if method == "POST": 48 length = int(os.environ["CONTENT_LENGTH"]) 49 headers = {"Content-Type": os.environ["CONTENT_TYPE"]} 50 body = sys.stdin.read(length) 51 r = urllib2.Request(url, body, headers) 52 y = urllib2.urlopen(r) 53 else: 54 y = urllib2.urlopen(url) 37 55 38 headers = str(y.info()).split('\n') 39 for h in headers: 40 if h.startswith("Content-Type:"): 41 print h 56 # print content type header 57 i = y.info() 58 if i.has_key("Content-Type"): 59 print "Content-Type: %s" % (i["Content-Type"]) 60 else: 61 print "Content-Type: text/plain" 42 62 print 43 63 … … 46 66 y.close() 47 67 else: 48 print """Content-Type: text/plain 49 50 Illegal request.""" 68 print "Content-Type: text/plain" 69 print 70 print "Illegal request." 71 51 72 except Exception, E: 52 73 print "Status: 500 Unexpected Error" branches/openlayers/2.5/lib/OpenLayers/BaseTypes.js
r4339 r4390 4 4 5 5 /** 6 * @requires OpenLayers/BaseTypes/Class.js 7 * @requires OpenLayers/BaseTypes/LonLat.js 8 * @requires OpenLayers/BaseTypes/Size.js 9 * @requires OpenLayers/BaseTypes/Pixel.js 10 * @requires OpenLayers/BaseTypes/Bounds.js 11 * @requires OpenLayers/BaseTypes/Element.js 12 * 6 13 * Header: OpenLayers Base Types 7 14 * OpenLayers custom string, number and function functions are described here. … … 17 24 /** 18 25 * APIMethod: OpenLayers.String.startsWith 19 * Whether or nota string starts with another string.26 * Test whether a string starts with another string. 20 27 * 21 28 * Parameters: … … 32 39 /** 33 40 * APIMethod: OpenLayers.String.contains 34 * Whether or nota string contains another string.41 * Test whether a string contains another string. 35 42 * 36 43 * Parameters: … … 54 61 * 55 62 * Returns: 56 * {String} A trimmed version of the string -all leading and63 * {String} A trimmed version of the string with all leading and 57 64 * trailing spaces removed. 58 65 */ … … 87 94 /** 88 95 * APIMethod: String.startsWith 89 * Deprecated. Whether or not a string starts with another string.96 * *Deprecated*. Whether or not a string starts with another string. 90 97 * 91 98 * Parameters: … … 107 114 /** 108 115 * APIMethod: String.contains 109 * Deprecated. Whether or not a string contains another string.116 * *Deprecated*. Whether or not a string contains another string. 110 117 * 111 118 * Parameters: … … 127 134 /** 128 135 * APIMethod: String.trim 129 * Deprecated. Removes leading and trailing whitespace characters from a string.136 * *Deprecated*. Removes leading and trailing whitespace characters from a string. 130 137 * 131 138 * Returns: … … 144 151 if (!String.prototype.camelize) { 145 152 /** 146 * APIMethod: camelize147 * Deprecated. Camel-case a hyphenated string.153 * APIMethod: String.camelize 154 * *Deprecated*. Camel-case a hyphenated string. 148 155 * Ex. "chicken-head" becomes "chickenHead", and 149 156 * "-chicken-head" becomes "ChickenHead". … … 194 201 /** 195 202 * APIMethod: Number.limitSigDigs 196 * Deprecated. Limit the number of significant digits on an integer. Does *not*203 * *Deprecated*. Limit the number of significant digits on an integer. Does *not* 197 204 * work with floats! 198 205 * … … 267 274 /** 268 275 * APIMethod: Function.bind 269 * Deprecated. Bind a function to an object.276 * *Deprecated*. Bind a function to an object. 270 277 * Method to easily create closures with 'this' altered. 271 278 * … … 291 298 /** 292 299 * APIMethod: Function.bindAsEventListener 293 * Deprecated. Bind a function to an object, and configure it to receive the300 * *Deprecated*. Bind a function to an object, and configure it to receive the 294 301 * event object as first parameter when called. 295 302 * branches/openlayers/2.5/lib/OpenLayers/BaseTypes/Bounds.js
r4110 r4390 8 8 * bottom, right, top floats. All values are initialized to null, however, 9 9 * you should make sure you set them before using the bounds for anything. 10 * 10 11 * Possible use case: 11 *12 12 * > bounds = new OpenLayers.Bounds(); 13 13 * > bounds.extend(new OpenLayers.LonLat(4,5)); 14 14 * > bounds.extend(new OpenLayers.LonLat(5,6)); 15 * > bounds.toBBOX() // returns 4,5,5,615 * > bounds.toBBOX(); // returns 4,5,5,6 16 16 */ 17 17 OpenLayers.Bounds = OpenLayers.Class({ … … 82 82 /** 83 83 * Method: equals 84 * Test a two bounds for equivalence 84 * Test a two bounds for equivalence. 85 85 * 86 86 * Parameters: … … 88 88 * 89 89 * Returns: 90 * {Boolean} The passed-in OpenLayers.Bounds object has the same left,90 * {Boolean} The passed-in bounds object has the same left, 91 91 * right, top, bottom components as this. Note that if bounds 92 92 * passed in is null, returns false. … … 107 107 * 108 108 * Returns: 109 * {String} String representation of OpenLayers.Bounds object.109 * {String} String representation of bounds object. 110 110 * (ex.<i>"left-bottom=(5,42) right-top=(10,45)"</i>) 111 111 */ … … 133 133 * 134 134 * Returns: 135 * {String} Simple String representation of OpenLayers.Bounds object.135 * {String} Simple String representation of bounds object. 136 136 * (ex. <i>"5,42,10,45"</i>) 137 137 */ … … 163 163 * 164 164 * Returns: 165 * {Float} The height of the bounds 165 * {Float} The height of the bounds (top minus bottom). 166 166 */ 167 167 getHeight:function() { … … 173 173 * 174 174 * Returns: 175 * {<OpenLayers.Size>} An <OpenLayers.Size> which represents the size of the box175 * {<OpenLayers.Size>} The size of the box. 176 176 */ 177 177 getSize:function() { … … 183 183 * 184 184 * Returns: 185 * {<OpenLayers.Pixel>} An <OpenLayers.Pixel> which represents the center 186 * of the bounds 185 * {<OpenLayers.Pixel>} The center of the bounds in pixel space. 187 186 */ 188 187 getCenterPixel:function() { … … 195 194 * 196 195 * Returns: 197 * {<OpenLayers.LonLat>} An <OpenLayers.LonLat> which represents the center 198 * of the bounds 196 * {<OpenLayers.LonLat>} The center of the bounds in map space. 199 197 */ 200 198 getCenterLonLat:function() { … … 211 209 * 212 210 * Returns: 213 * {<OpenLayers.Bounds>} A new <OpenLayers.Bounds> whose coordinates are 214 * the same as this, but shifted by the passed-in 215 * x and y values 211 * {<OpenLayers.Bounds>} A new bounds whose coordinates are the same as 212 * this, but shifted by the passed-in x and y values. 216 213 */ 217 214 add:function(x, y) { … … 228 225 * APIMethod: extend 229 226 * Extend the bounds to include the point, lonlat, or bounds specified. 230 * Note: This function assumes that left<right and bottom<top. 231 * 227 * Note, this function assumes that left < right and bottom < top. 232 228 * 233 229 * Parameters: … … 274 270 * Parameters: 275 271 * ll - {<OpenLayers.LonLat>} 276 * inclusive - {Boolean} Whether or not to include the border. 277 * Default is true.278 * 279 * Returns: 280 * {Boolean} Whether or not the passed-in lonlat is within this bounds.272 * inclusive - {Boolean} Whether or not to include the border. 273 * Default is true. 274 * 275 * Returns: 276 * {Boolean} The passed-in lonlat is within this bounds. 281 277 */ 282 278 containsLonLat:function(ll, inclusive) { … … 289 285 * Parameters: 290 286 * px - {<OpenLayers.Pixel>} 291 * inclusive - {Boolean} Whether or not to include the border. 292 * Default istrue.293 * 294 * Returns: 295 * {Boolean} Whether or not the passed-in pixel is within this bounds.287 * inclusive - {Boolean} Whether or not to include the border. Default is 288 * true. 289 * 290 * Returns: 291 * {Boolean} The passed-in pixel is within this bounds. 296 292 */ 297 293 containsPixel:function(px, inclusive) { … … 305 301 * x - {Float} 306 302 * y - {Float} 307 * inclusive - {Boolean} Whether or not to include the border. 308 * Default istrue.303 * inclusive - {Boolean} Whether or not to include the border. Default is 304 * true. 309 305 * 310 306 * Returns: 311 307 * {Boolean} Whether or not the passed-in coordinates are within this 312 * bounds.308 * bounds. 313 309 */ 314 310 contains:function(x, y, inclusive) { … … 335 331 * Parameters: 336 332 * bounds - {<OpenLayers.Bounds>} 337 * inclusive - {<Boolean>} Whether or not to include the border. 338 * Defaultis true.339 * 340 * Returns: 341 * {Boolean} Whether or not the passed-in OpenLayers.Bounds object342 * intersects this bounds. Simple math just check if either343 * contains the other, allowing forpartial.333 * inclusive - {<Boolean>} Whether or not to include the border. Default 334 * is true. 335 * 336 * Returns: 337 * {Boolean} The passed-in OpenLayers.Bounds object intersects this bounds. 338 * Simple math just check if either contains the other, allowing for 339 * partial. 344 340 */ 345 341 intersectsBounds:function(bounds, inclusive) { … … 370 366 * 371 367 * bounds - {<OpenLayers.Bounds>} 372 * partial - {<Boolean>} If true, only part of passed-in 373 * <OpenLayers.Bounds> needs be within this bounds. 374 * If false, the entire passed-in bounds must be 375 * within. Default is false 376 * inclusive - {<Boolean>} Whether or not to include the border. 377 * Default is true. 378 * 379 * Returns: 380 * {Boolean} Whether or not the passed-in OpenLayers.Bounds object is 381 * contained within this bounds. 368 * partial - {<Boolean>} If true, only part of passed-in bounds needs be 369 * within this bounds. If false, the entire passed-in bounds must be 370 * within. Default is false 371 * inclusive - {<Boolean>} Whether or not to include the border. Default is 372 * true. 373 * 374 * Returns: 375 * {Boolean} The passed-in bounds object is contained within this bounds. 382 376 */ 383 377 containsBounds:function(bounds, partial, inclusive) { … … 419 413 * 420 414 * Returns: 421 * {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which 422 * thecoordinate lies.415 * {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which the 416 * coordinate lies. 423 417 */ 424 418 determineQuadrant: function(lonlat) { … … 496 490 * 497 491 * Returns: 498 * {<OpenLayers.Bounds>} New <OpenLayers.Bounds>object built from the492 * {<OpenLayers.Bounds>} New bounds object built from the 499 493 * passed-in String. 500 494 */ … … 513 507 * 514 508 * Returns: 515 * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the 516 * passed-in Array. 509 * {<OpenLayers.Bounds>} New bounds object built from the passed-in Array. 517 510 */ 518 511 OpenLayers.Bounds.fromArray = function(bbox) { … … 532 525 * 533 526 * Returns: 534 * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the 535 * passed-in size. 527 * {<OpenLayers.Bounds>} New bounds object built from the passed-in size. 536 528 */ 537 529 OpenLayers.Bounds.fromSize = function(size) { branches/openlayers/2.5/lib/OpenLayers/Control.js
r4110 r4390 94 94 /** 95 95 * Property: handler 96 * {<OpenLayers.Handler }>null96 * {<OpenLayers.Handler>} null 97 97 */ 98 98 handler: null, branches/openlayers/2.5/lib/OpenLayers/Control/DragFeature.js
r4341 r4390 32 32 * 33 33 * Parameters: 34 * feature - { OpenLayers.Feature.Vector} The feature that is about to be34 * feature - {<OpenLayers.Feature.Vector>} The feature that is about to be 35 35 * dragged. 36 * pixel - { OpenLayers.Pixel} The pixel location of the mouse.36 * pixel - {<OpenLayers.Pixel>} The pixel location of the mouse. 37 37 */ 38 38 onStart: function(feature, pixel) {}, … … 45 45 * 46 46 * Parameters: 47 * feature - { OpenLayers.Feature.Vector} The feature that was dragged.48 * pixel - { OpenLayers.Pixel} The pixel location of the mouse.47 * feature - {<OpenLayers.Feature.Vector>} The feature that was dragged. 48 * pixel - {<OpenLayers.Pixel>} The pixel location of the mouse. 49 49 */ 50 50 onDrag: function(feature, pixel) {}, … … 58 58 * 59 59 * Parameters: 60 * feature - { OpenLayers.Feature.Vector} The feature that was dragged.61 * pixel - { OpenLayers.Pixel} The pixel location of the mouse.60 * feature - {<OpenLayers.Feature.Vector>} The feature that was dragged. 61 * pixel - {<OpenLayers.Pixel>} The pixel location of the mouse. 62 62 */ 63 63 onComplete: function(feature, pixel) {}, … … 65 65 /** 66 66 * Property: layer 67 * { OpenLayers.Layer.Vector}67 * {<OpenLayers.Layer.Vector>} 68 68 */ 69 69 layer: null, … … 71 71 /** 72 72 * Property: feature 73 * { OpenLayers.Feature.Vector}73 * {<OpenLayers.Feature.Vector>} 74 74 */ 75 75 feature: null, … … 77 77 /** 78 78 * Property: dragHandler 79 * { OpenLayers.Handler.Drag}79 * {<OpenLayers.Handler.Drag>} 80 80 */ 81 81 dragHandler: null, … … 89 89 /** 90 90 * Property: featureHandler 91 * { OpenLayers.Handler.Feature}91 * {<OpenLayers.Handler.Feature>} 92 92 */ 93 93 featureHandler: null, … … 101 101 /** 102 102 * Property: lastPixel 103 * { OpenLayers.Pixel}103 * {<OpenLayers.Pixel>} 104 104 */ 105 105 lastPixel: null, … … 110 110 * 111 111 * Parameters: 112 * layer - { OpenLayers.Layer.Vector} The layer containing features to be112 * layer - {<OpenLayers.Layer.Vector>} The layer containing features to be 113 113 * dragged. 114 114 * options - {Object} Optional object whose properties will be set on the … … 180 180 * 181 181 * Parameters: 182 * feature - { OpenLayers.Feature.Vector} The selected feature.182 * feature - {<OpenLayers.Feature.Vector>} The selected feature. 183 183 */ 184 184 overFeature: function(feature) { … … 203 203 * 204 204 * Parameters: 205 * pixel - { OpenLayers.Pixel} Location of the mouse event.205 * pixel - {<OpenLayers.Pixel>} Location of the mouse event. 206 206 */ 207 207 downFeature: function(pixel) { … … 216 216 * 217 217 * Parameters: 218 * pixel - { OpenLayers.Pixel} Location of the mouse event.218 * pixel - {<OpenLayers.Pixel>} Location of the mouse event. 219 219 */ 220 220 moveFeature: function(pixel) { … … 233 233 * 234 234 * Parameters: 235 * pixel - { OpenLayers.Pixel} Location of the mouse event.235 * pixel - {<OpenLayers.Pixel>} Location of the mouse event. 236 236 */ 237 237 upFeature: function(pixel) { … … 249 249 * 250 250 * Parameters: 251 * pixel - { OpenLayers.Pixel} The last event pixel location. If this event251 * pixel - {<OpenLayers.Pixel>} The last event pixel location. If this event 252 252 * came from a mouseout, this may not be in the map viewport. 253 253 */ … … 261 261 * 262 262 * Parameters: 263 * feature - { OpenLayers.Feature.Vector} The feature that the mouse left.263 * feature - {<OpenLayers.Feature.Vector>} The feature that the mouse left. 264 264 */ 265 265 outFeature: function(feature) { … … 291 291 * 292 292 * Parameters: 293 * map - { OpenLayers.Map} The control's map.293 * map - {<OpenLayers.Map>} The control's map. 294 294 */ 295 295 setMap: function(map) { branches/openlayers/2.5/lib/OpenLayers/Control/ModifyFeature.js
r4272 r4390 31 31 /** 32 32 * Property: layer 33 * { OpenLayers.Layer.Vector}33 * {<OpenLayers.Layer.Vector>} 34 34 */ 35 35 layer: null, … … 117 117 * 118 118 * Parameters: 119 * layer - { OpenLayers.Layer.Vector} Layer that contains features that119 * layer - {<OpenLayers.Layer.Vector>} Layer that contains features that 120 120 * will be modified. 121 121 * options - {Object} Optional object whose properties will be set on the … … 451 451 * 452 452 * Parameters: 453 * map - { OpenLayers.Map} The control's map.453 * map - {<OpenLayers.Map>} The control's map. 454 454 */ 455 455 setMap: function(map) { branches/openlayers/2.5/lib/OpenLayers/Control/OverviewMap.js
r4302 r4390 54 54 /** 55 55 * APIProperty: minRatio 56 * { Numver} The ratio of the overview map resolution to the main map56 * {Float} The ratio of the overview map resolution to the main map 57 57 * resolution at which to zoom farther out on the overview map. 58 58 */ branches/openlayers/2.5/lib/OpenLayers/Control/PanZoom.js
r4302 r4390 16 16 /** 17 17 * APIProperty: slideFactor 18 * { Float}18 * {Integer} 19 19 */ 20 20 slideFactor: 50, … … 22 22 /** 23 23 * Property: buttons 24 * Array of Button Divs24 * {Array(DOMElement)} Array of Button Divs 25 25 */ 26 26 buttons: null, … … 33 33 34 34 /** 35 * Constructor: OpenLayers.PanZoom 35 * Constructor: OpenLayers.Control.PanZoom 36 * 37 * Parameters: 38 * options - {Object} 36 39 */ 37 initialize: function( ) {40 initialize: function(options) { 38 41 this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X, 39 42 OpenLayers.Control.PanZoom.Y); … … 62 65 * 63 66 * Returns: 64 * {DOMElement} A reference to the container div for the PanZoom control 67 * {DOMElement} A reference to the container div for the PanZoom control. 65 68 */ 66 69 draw: function(px) { … … 101 104 * Returns: 102 105 * {DOMElement} A Div (an alphaImageDiv, to be precise) that contains the 103 * image of the button, and has all the proper event handlers set.106 * image of the button, and has all the proper event handlers set. 104 107 */ 105 108 _addButton:function(id, img, xy, sz) { … … 180 183 }); 181 184 185 /** 186 * Constant: X 187 * {Integer} 188 */ 182 189 OpenLayers.Control.PanZoom.X = 4; 190 191 /** 192 * Constant: Y 193 * {Integer} 194 */ 183 195 OpenLayers.Control.PanZoom.Y = 4; branches/openlayers/2.5/lib/OpenLayers/Format/GML.js
r4206 r4390 6 6 * @requires OpenLayers/Format/XML.js 7 7 * @requires OpenLayers/Feature/Vector.js 8 * @requires OpenLayers/Geometry.js 8 * @requires OpenLayers/Geometry/Point.js 9 * @requires OpenLayers/Geometry/MultiPoint.js 10 * @requires OpenLayers/Geometry/LineString.js 11 * @requires OpenLayers/Geometry/MultiLineString.js 12 * @requires OpenLayers/Geometry/Polygon.js 13 * @requires OpenLayers/Geometry/MultiPolygon.js 9 14 * 10 15 * Class: OpenLayers.Format.GML branches/openlayers/2.5/lib/OpenLayers/Format/GeoJSON.js
r4257 r4390 5 5 /** 6 6 * @requires OpenLayers/Format/JSON.js 7 * @requires OpenLayers/Feature/Vector.js 8 * @requires OpenLayers/Geometry/Point.js 9 * @requires OpenLayers/Geometry/MultiPoint.js 10 * @requires OpenLayers/Geometry/LineString.js 11 * @requires OpenLayers/Geometry/MultiLineString.js 12 * @requires OpenLayers/Geometry/Polygon.js 13 * @requires OpenLayers/Geometry/MultiPolygon.js 7 14 * 8 15 * Class: OpenLayers.Format.GeoJSON branches/openlayers/2.5/lib/OpenLayers/Format/GeoRSS.js
r4305 r4390 4 4 5 5 /** 6 * @requires OpenLayers/Format.js7 6 * @requires OpenLayers/Format/XML.js 7 * @requires OpenLayers/Feature/Vector.js 8 * @requires OpenLayers/Geometry/Point.js 9 * @requires OpenLayers/Geometry/LineString.js 10 * @requires OpenLayers/Geometry/Polygon.js 8 11 * 9 12 * Class: OpenLayers.Format.GeoRSS branches/openlayers/2.5/lib/OpenLayers/Format/KML.js
r4219 r4390 4 4 5 5 /** 6 * @requires OpenLayers/Format .js6 * @requires OpenLayers/Format/XML.js 7 7 * @requires OpenLayers/Feature/Vector.js 8 * @requires OpenLayers/Geometry/Point.js 9 * @requires OpenLayers/Geometry/LineString.js 10 * @requires OpenLayers/Geometry/Polygon.js 11 * @requires OpenLayers/Geometry/Collection.js 8 12 * 9 13 * Class: OpenLayers.Format.KML … … 280 284 * 281 285 * Returns: 282 * {<OpenLayers.Geometry. Polygon>} A geometry collection.286 * {<OpenLayers.Geometry.Collection>} A geometry collection. 283 287 */ 284 288 multigeometry: function(node) { branches/openlayers/2.5/lib/OpenLayers/Format/WKT.js
r4302 r4390 5 5 /** 6 6 * @requires OpenLayers/Format.js 7 * @requires OpenLayers/Feature/Vector.js 7 8 * 8 9 * Class: OpenLayers.Format.WKT … … 39 40 /** 40 41 * Method: read 41 * Deserialize a WKT string and return a n OpenLayers.Feature.Vectoror an42 * array of OpenLayers.Feature.Vector. Supports WKT for POINT, MULTIPOINT,42 * Deserialize a WKT string and return a vector feature or an 43 * array of vector features. Supports WKT for POINT, MULTIPOINT, 43 44 * LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, and 44 45 * GEOMETRYCOLLECTION. branches/openlayers/2.5/lib/OpenLayers/Handler/Drag.js
r4230 r4390 254 254 */ 255 255 click: function (evt) { 256 // throw away the first left click event that happens after a mouse up 257 if (this.dragging) { 258 this.dragging = false; 259 return false; 260 } 261 this.started = false; 262 return true; 256 // let the click event propagate only if the mouse moved 257 return (this.start == this.last); 263 258 }, 264 259 branches/openlayers/2.5/lib/OpenLayers/Handler/RegularPolygon.js
r4256 r4390 285 285 * 286 286 * Parameters: 287 * point - { OpenLayers.Geometry.Point}287 * point - {<OpenLayers.Geometry.Point>} 288 288 * evt - {Event} 289 289 */ branches/openlayers/2.5/lib/OpenLayers/Layer.js
r4231 r4390 737 737 * that still contains the passed-in extent. We do this by calculating 738 738 * the ideal resolution for the given exteng (based on the map size) 739 * and then find the smallest resolution that is greater than this 740 * ideal resolution. 739 * and then find the closest resolution to this ideal resolution. 741 740 */ 742 741 getZoomForExtent: function(extent) { … … 762 761 /** 763 762 * APIMethod: getZoomForResolution 764 * 765 * Parameters: 766 * resolution - {Float} 763 * Get the index for the closest resolution in the layers resolutions array. 764 * 765 * Parameters: 766 * resolution - {Float} Map units per pixel. 767 767 * 768 768 * Returns: 769 769 * {Integer} The index of the zoomLevel (entry in the resolutions array) 770 * that is the smallest resolution that is greater than the passed-in 771 * resolution. 770 * that is the closest to the passed-in resolution. 772 771 */ 773 772 getZoomForResolution: function(resolution) { 774 775 for(var i=1; i < this.resolutions.length; i++) { 776 if ( this.resolutions[i] < resolution) { 773 var zoom, diff; 774 var minDiff = Number.POSITIVE_INFINITY; 775 for(var i=0; i < this.resolutions.length; i++) { 776 diff = Math.abs(this.resolutions[i] - resolution); 777 if(diff < minDiff) { 778 zoom = i; 779 minDiff = diff; 780 } else if(diff > minDiff) { 777 781 break; 778 782 } 779 783 } 780 return (i - 1);784 return zoom; 781 785 }, 782 786 branches/openlayers/2.5/lib/OpenLayers/Layer/Google.js
r4223 r4390 265 265 */ 266 266 addContainerPxFunction: function() { 267 if (typeof GMap2 != "undefined" && !GMap2.fromLatLngToContainerPixel) { 267 if ( (typeof GMap2 != "undefined") && 268 !GMap2.prototype.fromLatLngToContainerPixel) { 268 269 269 270 GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) { 270 271 271 272 // first we translate into "DivPixel" 272 var gPoint = this.fromLatLngToDivPixel(gLatLng);273 var gPoint = this.fromLatLngToDivPixel(gLatLng); 273 274 274 // locate the sliding "Div" div 275 // it seems like "b" is the main div 276 var div = this.b.firstChild.firstChild; 277 278 // adjust by the offset of "Div" and voila! 275 // locate the sliding "Div" div 276 var div = this.getContainer().firstChild.firstChild; 277 278 // adjust by the offset of "Div" and voila! 279 279 gPoint.x += div.offsetLeft; 280 280 gPoint.y += div.offsetTop; branches/openlayers/2.5/lib/OpenLayers/Layer/Image.js
r4110 r4390 187 187 setUrl: function(newUrl) { 188 188 this.url = newUrl; 189 this. draw();189 this.tile.draw(); 190 190 }, 191 191 branches/openlayers/2.5/lib/OpenLayers/Map.js
r4334 r4390 1353 1353 1354 1354 /** 1355 * APIMethod: getZoomForExten g1355 * APIMethod: getZoomForExtent 1356 1356 * 1357 1357 * Parameters: branches/openlayers/2.5/tests/Control/test_OverviewMap.html
r4337 r4390 44 44 t.eq(overviewCenter.lon, -71, "Overviewmap center lon correct"); 45 45 t.eq(overviewCenter.lat, 42, "Overviewmap center lat correct"); 46 t.eq(overviewZoom, 8, "Overviewmap zoomcorrect");46 t.eq(overviewZoom, 9, "Overviewmap zoomcorrect"); 47 47 48 48 control.mapDivClick({'xy':new OpenLayers.Pixel(5,5)}); 49 49 50 // There are box model issues that keep browsers from giving us 51 // identical results here. Test the normalized difference against 52 // a tolerance instead of testing equality. 53 function normalizedDiff(a, b) { 54 return Math.abs((a - b) / (a + b)); 55 } 56 var tolerance = 1e-4; 57 50 58 var cent = map.getCenter(); 51 <
