OpenLayers OpenLayers

Changeset 4390

Show
Ignore:
Timestamp:
09/19/07 07:36:13 (1 year ago)
Author:
crschmidt
Message:

Pullup changes to trunk for RC2. Includes drag-fires click changes
(Closes #982), comment/documentation/requires changes (Closes #983, #993, #988),
Fixing post support in proxy.cgi (Closes #991), baseLayer zoom level change
(Closes #990), typo in Layer.Image.setURL (Closes #985), and a fix or the
Layer.Google bug caused by Google's changing internals (#994). RC2, here we
come.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/openlayers/2.5/examples/proxy.cgi

    r2803 r4390  
    77efficient, it might break some sites, and it's a security risk because 
    88people 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 should 
    11 modify Parameters.js so that this isn't used.  Otherwise, you're stuck 
    129with 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.""" 
     10content type. It supports GET and POST requests.""" 
    1411 
    15 import urllib 
     12import urllib2 
    1613import cgi 
    17  
    18 fs = cgi.FieldStorage() 
    19 url = fs.getvalue('url', "http://openlayers.org") 
     14import sys, os 
    2015 
    2116# Designed to prevent Open Proxy type stuff. 
    2217 
    23 allowedHosts = ['www.openlayers.org', 'openlayers.org', 'octo.metacarta.com', 'merrimack.metacarta.com', 'labs.metacarta.com', 'world.freemap.in', 
    24                 'prototype.openmnnd.org'] 
     18allowedHosts = ['www.openlayers.org', 'openlayers.org',  
     19                'labs.metacarta.com', 'world.freemap.in',  
     20                'prototype.openmnnd.org', 'geo.openplans.org'] 
     21 
     22method = os.environ["REQUEST_METHOD"] 
     23 
     24if 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" 
     31else: 
     32    fs = cgi.FieldStorage() 
     33    url = fs.getvalue('url', "http://www.openlayers.org") 
    2534 
    2635try: 
     
    3140        print 
    3241        print "This proxy does not allow you to access that location." 
    33      
     42        print  
     43        print os.environ 
     44   
    3445    elif url.startswith("http://") or url.startswith("https://"): 
    3546     
    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) 
    3755         
    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" 
    4262        print 
    4363         
     
    4666        y.close() 
    4767    else: 
    48         print """Content-Type: text/plain 
    49   
    50 Illegal request.""" 
     68        print "Content-Type: text/plain" 
     69        print 
     70        print "Illegal request." 
     71 
    5172except Exception, E: 
    5273    print "Status: 500 Unexpected Error" 
  • branches/openlayers/2.5/lib/OpenLayers/BaseTypes.js

    r4339 r4390  
    44 
    55/** 
     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 *  
    613 * Header: OpenLayers Base Types 
    714 * OpenLayers custom string, number and function functions are described here. 
     
    1724    /** 
    1825     * APIMethod: OpenLayers.String.startsWith 
    19      * Whether or not a string starts with another string.  
     26     * Test whether a string starts with another string.  
    2027     *  
    2128     * Parameters: 
     
    3239    /** 
    3340     * APIMethod: OpenLayers.String.contains 
    34      * Whether or not a string contains another string. 
     41     * Test whether a string contains another string. 
    3542     *  
    3643     * Parameters: 
     
    5461     *  
    5562     * Returns: 
    56      * {String} A trimmed version of the string - all leading and  
     63     * {String} A trimmed version of the string with all leading and  
    5764     *     trailing spaces removed. 
    5865     */ 
     
    8794    /** 
    8895     * 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.  
    9097     *  
    9198     * Parameters: 
     
    107114    /** 
    108115     * APIMethod: String.contains 
    109      * Deprecated. Whether or not a string contains another string. 
     116     * *Deprecated*. Whether or not a string contains another string. 
    110117     *  
    111118     * Parameters: 
     
    127134    /** 
    128135     * 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. 
    130137     *  
    131138     * Returns: 
     
    144151if (!String.prototype.camelize) { 
    145152    /** 
    146      * APIMethod: camelize 
    147      * Deprecated. Camel-case a hyphenated string.  
     153     * APIMethod: String.camelize 
     154     * *Deprecated*. Camel-case a hyphenated string.  
    148155     *     Ex. "chicken-head" becomes "chickenHead", and 
    149156     *     "-chicken-head" becomes "ChickenHead". 
     
    194201    /** 
    195202     * 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* 
    197204     *     work with floats! 
    198205     *  
     
    267274    /** 
    268275     * APIMethod: Function.bind 
    269      * Deprecated. Bind a function to an object.  
     276     * *Deprecated*. Bind a function to an object.  
    270277     * Method to easily create closures with 'this' altered. 
    271278     *  
     
    291298    /** 
    292299     * APIMethod: Function.bindAsEventListener 
    293      * Deprecated. Bind a function to an object, and configure it to receive the 
     300     * *Deprecated*. Bind a function to an object, and configure it to receive the 
    294301     *     event object as first parameter when called.  
    295302     *  
  • branches/openlayers/2.5/lib/OpenLayers/BaseTypes/Bounds.js

    r4110 r4390  
    88 * bottom, right, top floats. All values are initialized to null, however, 
    99 * you should make sure you set them before using the bounds for anything. 
     10 *  
    1011 * Possible use case: 
    11  * 
    1212 * > bounds = new OpenLayers.Bounds(); 
    1313 * > bounds.extend(new OpenLayers.LonLat(4,5)); 
    1414 * > bounds.extend(new OpenLayers.LonLat(5,6)); 
    15  * > bounds.toBBOX() // returns 4,5,5,6 
     15 * > bounds.toBBOX(); // returns 4,5,5,6 
    1616 */ 
    1717OpenLayers.Bounds = OpenLayers.Class({ 
     
    8282    /** 
    8383     * Method: equals 
    84      * Test a two bounds for equivalence 
     84     * Test a two bounds for equivalence. 
    8585     * 
    8686     * Parameters: 
     
    8888     * 
    8989     * Returns: 
    90      * {Boolean} The passed-in OpenLayers.Bounds object has the same left, 
     90     * {Boolean} The passed-in bounds object has the same left, 
    9191     *           right, top, bottom components as this.  Note that if bounds  
    9292     *           passed in is null, returns false. 
     
    107107     *  
    108108     * Returns: 
    109      * {String} String representation of OpenLayers.Bounds object.  
     109     * {String} String representation of bounds object.  
    110110     *          (ex.<i>"left-bottom=(5,42) right-top=(10,45)"</i>) 
    111111     */ 
     
    133133     *  
    134134     * Returns: 
    135      * {String} Simple String representation of OpenLayers.Bounds object. 
     135     * {String} Simple String representation of bounds object. 
    136136     *          (ex. <i>"5,42,10,45"</i>) 
    137137     */ 
     
    163163     *  
    164164     * Returns: 
    165      * {Float} The height of the bounds 
     165     * {Float} The height of the bounds (top minus bottom). 
    166166     */ 
    167167    getHeight:function() { 
     
    173173     *  
    174174     * Returns: 
    175      * {<OpenLayers.Size>} An <OpenLayers.Size> which represents the size of the box 
     175     * {<OpenLayers.Size>} The size of the box. 
    176176     */ 
    177177    getSize:function() { 
     
    183183     *  
    184184     * 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. 
    187186     */ 
    188187    getCenterPixel:function() { 
     
    195194     *  
    196195     * 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. 
    199197     */ 
    200198    getCenterLonLat:function() { 
     
    211209     *  
    212210     * 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. 
    216213     */ 
    217214    add:function(x, y) { 
     
    228225     * APIMethod: extend 
    229226     * 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. 
    232228     *  
    233229     * Parameters:  
     
    274270     * Parameters: 
    275271     * 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. 
    281277     */ 
    282278    containsLonLat:function(ll, inclusive) { 
     
    289285     * Parameters: 
    290286     * px - {<OpenLayers.Pixel>} 
    291      * inclusive - {Boolean} Whether or not to include the border.  
    292      *                       Default is true. 
    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. 
    296292     */ 
    297293    containsPixel:function(px, inclusive) { 
     
    305301     * x - {Float} 
    306302     * y - {Float} 
    307      * inclusive - {Boolean} Whether or not to include the border.  
    308      *                       Default is true. 
     303     * inclusive - {Boolean} Whether or not to include the border. Default is 
     304     *     true. 
    309305     * 
    310306     * Returns: 
    311307     * {Boolean} Whether or not the passed-in coordinates are within this 
    312      *           bounds. 
     308     *     bounds. 
    313309     */ 
    314310    contains:function(x, y, inclusive) { 
     
    335331     * Parameters: 
    336332     * bounds - {<OpenLayers.Bounds>} 
    337      * inclusive - {<Boolean>} Whether or not to include the border.  
    338      *                         Default is true. 
    339      * 
    340      * Returns: 
    341      * {Boolean} Whether or not the passed-in OpenLayers.Bounds object  
    342      *           intersects this bounds. Simple math just check if either  
    343      *           contains the other, allowing for partial. 
     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. 
    344340     */ 
    345341    intersectsBounds:function(bounds, inclusive) { 
     
    370366     *  
    371367     * 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.  
    382376     */ 
    383377    containsBounds:function(bounds, partial, inclusive) { 
     
    419413     *  
    420414     * Returns: 
    421      * {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which  
    422      *          the coordinate lies. 
     415     * {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which the 
     416     *     coordinate lies. 
    423417     */ 
    424418    determineQuadrant: function(lonlat) { 
     
    496490 *  
    497491 * Returns: 
    498  * {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the  
     492 * {<OpenLayers.Bounds>} New bounds object built from the  
    499493 *                       passed-in String. 
    500494 */ 
     
    513507 * 
    514508 * 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. 
    517510 */ 
    518511OpenLayers.Bounds.fromArray = function(bbox) { 
     
    532525 * 
    533526 * 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. 
    536528 */ 
    537529OpenLayers.Bounds.fromSize = function(size) { 
  • branches/openlayers/2.5/lib/OpenLayers/Control.js

    r4110 r4390  
    9494    /**  
    9595     * Property: handler  
    96      * {<OpenLayers.Handler}> null 
     96     * {<OpenLayers.Handler>} null 
    9797     */ 
    9898    handler: null, 
  • branches/openlayers/2.5/lib/OpenLayers/Control/DragFeature.js

    r4341 r4390  
    3232     * 
    3333     * Parameters: 
    34      * feature - {OpenLayers.Feature.Vector} The feature that is about to be 
     34     * feature - {<OpenLayers.Feature.Vector>} The feature that is about to be 
    3535     *     dragged. 
    36      * pixel - {OpenLayers.Pixel} The pixel location of the mouse. 
     36     * pixel - {<OpenLayers.Pixel>} The pixel location of the mouse. 
    3737     */ 
    3838    onStart: function(feature, pixel) {}, 
     
    4545     * 
    4646     * 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. 
    4949     */ 
    5050    onDrag: function(feature, pixel) {}, 
     
    5858     * 
    5959     * 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. 
    6262     */ 
    6363    onComplete: function(feature, pixel) {}, 
     
    6565    /** 
    6666     * Property: layer 
    67      * {OpenLayers.Layer.Vector
     67     * {<OpenLayers.Layer.Vector>
    6868     */ 
    6969    layer: null, 
     
    7171    /** 
    7272     * Property: feature 
    73      * {OpenLayers.Feature.Vector
     73     * {<OpenLayers.Feature.Vector>
    7474     */ 
    7575    feature: null, 
     
    7777    /** 
    7878     * Property: dragHandler 
    79      * {OpenLayers.Handler.Drag
     79     * {<OpenLayers.Handler.Drag>
    8080     */ 
    8181    dragHandler: null, 
     
    8989    /** 
    9090     * Property: featureHandler 
    91      * {OpenLayers.Handler.Feature
     91     * {<OpenLayers.Handler.Feature>
    9292     */ 
    9393    featureHandler: null, 
     
    101101    /** 
    102102     * Property: lastPixel 
    103      * {OpenLayers.Pixel
     103     * {<OpenLayers.Pixel>
    104104     */ 
    105105    lastPixel: null, 
     
    110110     * 
    111111     * Parameters: 
    112      * layer - {OpenLayers.Layer.Vector} The layer containing features to be 
     112     * layer - {<OpenLayers.Layer.Vector>} The layer containing features to be 
    113113     *     dragged. 
    114114     * options - {Object} Optional object whose properties will be set on the 
     
    180180     * 
    181181     * Parameters: 
    182      * feature - {OpenLayers.Feature.Vector} The selected feature. 
     182     * feature - {<OpenLayers.Feature.Vector>} The selected feature. 
    183183     */ 
    184184    overFeature: function(feature) { 
     
    203203     * 
    204204     * Parameters: 
    205      * pixel - {OpenLayers.Pixel} Location of the mouse event. 
     205     * pixel - {<OpenLayers.Pixel>} Location of the mouse event. 
    206206     */ 
    207207    downFeature: function(pixel) { 
     
    216216     *  
    217217     * Parameters: 
    218      * pixel - {OpenLayers.Pixel} Location of the mouse event. 
     218     * pixel - {<OpenLayers.Pixel>} Location of the mouse event. 
    219219     */ 
    220220    moveFeature: function(pixel) { 
     
    233233     *  
    234234     * Parameters: 
    235      * pixel - {OpenLayers.Pixel} Location of the mouse event. 
     235     * pixel - {<OpenLayers.Pixel>} Location of the mouse event. 
    236236     */ 
    237237    upFeature: function(pixel) { 
     
    249249     * 
    250250     * Parameters: 
    251      * pixel - {OpenLayers.Pixel} The last event pixel location.  If this event 
     251     * pixel - {<OpenLayers.Pixel>} The last event pixel location.  If this event 
    252252     *     came from a mouseout, this may not be in the map viewport. 
    253253     */ 
     
    261261     * 
    262262     * Parameters: 
    263      * feature - {OpenLayers.Feature.Vector} The feature that the mouse left. 
     263     * feature - {<OpenLayers.Feature.Vector>} The feature that the mouse left. 
    264264     */ 
    265265    outFeature: function(feature) { 
     
    291291     * 
    292292     * Parameters:  
    293      * map - {OpenLayers.Map} The control's map. 
     293     * map - {<OpenLayers.Map>} The control's map. 
    294294     */ 
    295295    setMap: function(map) { 
  • branches/openlayers/2.5/lib/OpenLayers/Control/ModifyFeature.js

    r4272 r4390  
    3131    /** 
    3232     * Property: layer 
    33      * {OpenLayers.Layer.Vector
     33     * {<OpenLayers.Layer.Vector>
    3434     */ 
    3535    layer: null, 
     
    117117     * 
    118118     * Parameters: 
    119      * layer - {OpenLayers.Layer.Vector} Layer that contains features that 
     119     * layer - {<OpenLayers.Layer.Vector>} Layer that contains features that 
    120120     *     will be modified. 
    121121     * options - {Object} Optional object whose properties will be set on the 
     
    451451     * 
    452452     * Parameters: 
    453      * map - {OpenLayers.Map} The control's map. 
     453     * map - {<OpenLayers.Map>} The control's map. 
    454454     */ 
    455455    setMap: function(map) { 
  • branches/openlayers/2.5/lib/OpenLayers/Control/OverviewMap.js

    r4302 r4390  
    5454    /** 
    5555     * APIProperty: minRatio 
    56      * {Numver} The ratio of the overview map resolution to the main map 
     56     * {Float} The ratio of the overview map resolution to the main map 
    5757     * resolution at which to zoom farther out on the overview map. 
    5858     */ 
  • branches/openlayers/2.5/lib/OpenLayers/Control/PanZoom.js

    r4302 r4390  
    1616    /**  
    1717     * APIProperty: slideFactor 
    18      * {Float
     18     * {Integer
    1919     */ 
    2020    slideFactor: 50, 
     
    2222    /**  
    2323     * Property: buttons 
    24      * Array of Button Divs  
     24     * {Array(DOMElement)} Array of Button Divs  
    2525     */ 
    2626    buttons: null, 
     
    3333 
    3434    /** 
    35      * Constructor: OpenLayers.PanZoom 
     35     * Constructor: OpenLayers.Control.PanZoom 
     36     *  
     37     * Parameters: 
     38     * options - {Object} 
    3639     */ 
    37     initialize: function() { 
     40    initialize: function(options) { 
    3841        this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X, 
    3942                                             OpenLayers.Control.PanZoom.Y); 
     
    6265     *  
    6366     * 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. 
    6568     */ 
    6669    draw: function(px) { 
     
    101104     * Returns: 
    102105     * {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. 
    104107     */ 
    105108    _addButton:function(id, img, xy, sz) { 
     
    180183}); 
    181184 
     185/** 
     186 * Constant: X 
     187 * {Integer} 
     188 */ 
    182189OpenLayers.Control.PanZoom.X = 4; 
     190 
     191/** 
     192 * Constant: Y 
     193 * {Integer} 
     194 */ 
    183195OpenLayers.Control.PanZoom.Y = 4; 
  • branches/openlayers/2.5/lib/OpenLayers/Format/GML.js

    r4206 r4390  
    66 * @requires OpenLayers/Format/XML.js 
    77 * @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 
    914 * 
    1015 * Class: OpenLayers.Format.GML 
  • branches/openlayers/2.5/lib/OpenLayers/Format/GeoJSON.js

    r4257 r4390  
    55/** 
    66 * @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 
    714 * 
    815 * Class: OpenLayers.Format.GeoJSON 
  • branches/openlayers/2.5/lib/OpenLayers/Format/GeoRSS.js

    r4305 r4390  
    44 
    55/** 
    6  * @requires OpenLayers/Format.js 
    76 * @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 
    811 * 
    912 * Class: OpenLayers.Format.GeoRSS 
  • branches/openlayers/2.5/lib/OpenLayers/Format/KML.js

    r4219 r4390  
    44 
    55/** 
    6  * @requires OpenLayers/Format.js 
     6 * @requires OpenLayers/Format/XML.js 
    77 * @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 
    812 * 
    913 * Class: OpenLayers.Format.KML 
     
    280284         * 
    281285         * Returns: 
    282          * {<OpenLayers.Geometry.Polygon>} A geometry collection. 
     286         * {<OpenLayers.Geometry.Collection>} A geometry collection. 
    283287         */ 
    284288        multigeometry: function(node) { 
  • branches/openlayers/2.5/lib/OpenLayers/Format/WKT.js

    r4302 r4390  
    55/** 
    66 * @requires OpenLayers/Format.js 
     7 * @requires OpenLayers/Feature/Vector.js 
    78 *  
    89 * Class: OpenLayers.Format.WKT 
     
    3940    /** 
    4041     * Method: read 
    41      * Deserialize a WKT string and return an OpenLayers.Feature.Vector or an 
    42      * 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, 
    4344     * LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, and 
    4445     * GEOMETRYCOLLECTION. 
  • branches/openlayers/2.5/lib/OpenLayers/Handler/Drag.js

    r4230 r4390  
    254254     */ 
    255255    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); 
    263258    }, 
    264259 
  • branches/openlayers/2.5/lib/OpenLayers/Handler/RegularPolygon.js

    r4256 r4390  
    285285     * 
    286286     * Parameters: 
    287      * point - {OpenLayers.Geometry.Point
     287     * point - {<OpenLayers.Geometry.Point>
    288288     * evt - {Event} 
    289289     */ 
  • branches/openlayers/2.5/lib/OpenLayers/Layer.js

    r4231 r4390  
    737737     *     that still contains the passed-in extent. We do this by calculating 
    738738     *     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. 
    741740     */ 
    742741    getZoomForExtent: function(extent) { 
     
    762761    /** 
    763762     * 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. 
    767767     *  
    768768     * Returns: 
    769769     * {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. 
    772771     */ 
    773772    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) { 
    777781                break; 
    778782            } 
    779783        } 
    780         return (i - 1)
     784        return zoom
    781785    }, 
    782786     
  • branches/openlayers/2.5/lib/OpenLayers/Layer/Google.js

    r4223 r4390  
    265265     */ 
    266266    addContainerPxFunction: function() { 
    267         if (typeof GMap2 != "undefined" && !GMap2.fromLatLngToContainerPixel) { 
     267        if ( (typeof GMap2 != "undefined") &&  
     268             !GMap2.prototype.fromLatLngToContainerPixel) { 
    268269           
    269270            GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) { 
    270271           
    271272                // first we translate into "DivPixel" 
    272                     var gPoint = this.fromLatLngToDivPixel(gLatLng); 
     273                var gPoint = this.fromLatLngToDivPixel(gLatLng); 
    273274       
    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! 
    279279                gPoint.x += div.offsetLeft; 
    280280                gPoint.y += div.offsetTop; 
  • branches/openlayers/2.5/lib/OpenLayers/Layer/Image.js

    r4110 r4390  
    187187    setUrl: function(newUrl) { 
    188188        this.url = newUrl; 
    189         this.draw(); 
     189        this.tile.draw(); 
    190190    }, 
    191191 
  • branches/openlayers/2.5/lib/OpenLayers/Map.js

    r4334 r4390  
    13531353 
    13541354    /** 
    1355      * APIMethod: getZoomForExteng 
     1355     * APIMethod: getZoomForExtent 
    13561356     *  
    13571357     * Parameters:  
  • branches/openlayers/2.5/tests/Control/test_OverviewMap.html

    r4337 r4390  
    4444        t.eq(overviewCenter.lon, -71, "Overviewmap center lon correct"); 
    4545        t.eq(overviewCenter.lat, 42, "Overviewmap center lat correct"); 
    46         t.eq(overviewZoom, 8, "Overviewmap zoomcorrect"); 
     46        t.eq(overviewZoom, 9, "Overviewmap zoomcorrect"); 
    4747         
    4848        control.mapDivClick({'xy':new OpenLayers.Pixel(5,5)}); 
    4949         
     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         
    5058        var cent = map.getCenter(); 
    51 <