OpenLayers OpenLayers

Changeset 7963

Show
Ignore:
Timestamp:
09/05/08 07:43:13 (3 months ago)
Author:
elemoine
Message:

svn merge -r 7920:HEAD http://svn.openlayers.org/trunk/openlayers .

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/camptocamp/unhcr/doc/authors.txt

    r7785 r7963  
    2323Christopher Schmidt 
    2424Cameron Shorter                                                               
     25Pedro Simonetti 
    2526Paul Spencer                                                                  
    2627Paul Smith                                                                  
  • sandbox/camptocamp/unhcr/examples/behavior-fixed-http-gml.html

    r7937 r7963  
    3131    </head> 
    3232    <body onload="init()"> 
    33         <h1 id="title">Vector Behavior Example</h1> 
     33        <h1 id="title">Vector Behavior Example (Fixed/HTTP/GML)</h1> 
    3434        <p id="shortdesc"> 
    35             Uses a new strategy, protocol, and format combination
     35            Vector layer with a Fixed strategy, HTTP protocol, and GML format
    3636        </p> 
    3737        <div id="map" class="smallmap"></div> 
    3838        <div id="docs"> 
    39             <p>The vector layer shown uses the Fixed strategy, the HTTP protocol, 
    40             and the GML format.</p> 
    41             <p>The Fixed strategy is a simple strategy that fetches features once 
     39            The vector layer shown uses the Fixed strategy, the HTTP protocol, 
     40            and the GML format. 
     41            The Fixed strategy is a simple strategy that fetches features once 
    4242            and never re-requests new data. 
    43             <p>The HTTP protocol makes requests using HTTP verbs.  It should be 
     43            The HTTP protocol makes requests using HTTP verbs.  It should be 
    4444            constructed with a url that corresponds to a collection of features 
    45             (a resource on some server).</p> 
    46             <p>The GML format is used to serialize features.</p> 
     45            (a resource on some server). 
     46            The GML format is used to serialize features. 
    4747        </div> 
    4848    </body> 
  • sandbox/camptocamp/unhcr/examples/mapguide.html

    r7785 r7963  
    2222     
    2323        var map, layer; 
    24         var url = "http://demo01.dmsolutions.ca/mapguide/mapagent/mapagent.fcgi"; 
     24        var url = "http://demo01.dmsolutions.ca/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&"; 
    2525        //you can use this URL when MapGuide OS is installed locally 
    2626        //var url = "/mapguide/mapagent/mapagent.fcgi"; 
     27         
     28        //Adjust the scale assumptions for MapGuide layers 
     29        //Tiled layers MUST use a DPI value of 96, untiled layers can use a  
     30        //different DPI value which will be passed to the server as a parameter. 
     31        //Tiled and untiled layers must adjust the OL INCHES_PER_UNIT values 
     32        //for any degree-based projections. 
     33        var metersPerUnit = 111319.4908;  //value returned from mapguide 
     34        var inPerUnit = OpenLayers.INCHES_PER_UNIT.m * metersPerUnit; 
     35        OpenLayers.INCHES_PER_UNIT["dd"] = inPerUnit; 
     36        OpenLayers.INCHES_PER_UNIT["degrees"] = inPerUnit; 
     37        OpenLayers.DOTS_PER_INCH = 96; 
    2738         
    2839        //tiled version 
    2940        function initTiled(){ 
    3041         
    31             OpenLayers.DOTS_PER_INCH = 96; 
    3242            var extent = new OpenLayers.Bounds(-3631568.75,-1293815.5,4491139.5833333321,4937122); 
    3343            var tempScales = [50000000,23207944.16806,10772173.45016,5000000,2320794.41681,1077217.34502,500000,232079.44168,107721.7345,50000]; 
     
    5666        function initUntiled() { 
    5767         
    58           OpenLayers.DOTS_PER_INCH = 96; 
    5968          var extent = new OpenLayers.Bounds(-87.865114442365922,43.665065564837931,-87.595394059497067,43.823852564430069); 
    6069          var mapOptions = { 
     
    98107              mapName: 'Sheboygan', 
    99108              session: '0b8cb80e-0000-1000-8003-0017a4e6ff5d_en_C0A802AD0AFC0AFB0AFA', 
     109 
     110 
     111 
     112              mapName: 'Sheboygan', 
     113              session: '0b8cb80e-0000-1000-8003-0017a4e6ff5d_en_C0A802AD0AFC0AFB0AFA', 
     114              version: '2.0.0', 
     115              selectioncolor: '0xFF0000', 
     116              behavior: 7 
    100117            }; 
    101118            layer = new OpenLayers.Layer.MapGuide( "MapGuide OS Overlay layer", url, params, options ); 
  • sandbox/camptocamp/unhcr/examples/wfs-t.html

    r7241 r7963  
    1717            ); 
    1818             
     19            // 
     20            // Word to the Wise from an anonymous OpenLayers hacker: 
     21            //              
     22            // The typename in the options list when adding/loading a wfs  
     23            // layer not should contain the namespace before, (as in the  
     24            // first typename parameter to the wfs consctructor). 
     25            //  
     26            // Specifically, in the first parameter you write typename:  
     27            // 'topp:myLayerName', and in the following option list  
     28            // typeName: 'myLayerName'.  
     29            //  
     30            // If you have topp included in the second one you will get  
     31            // namespace 14 errors when trying to insert features. 
     32            // 
    1933            wfs = new OpenLayers.Layer.WFS( 
    2034                "Cities", 
  • sandbox/camptocamp/unhcr/lib/OpenLayers.js

    r7962 r7963  
    112112            "OpenLayers/Layer/MapServer/Untiled.js", 
    113113            "OpenLayers/Layer/KaMap.js", 
     114            "OpenLayers/Layer/KaMapCache.js", 
    114115            "OpenLayers/Layer/MultiMap.js", 
    115116            "OpenLayers/Layer/Markers.js", 
     
    227228            "OpenLayers/Control/MouseToolbar.js", 
    228229            "OpenLayers/Control/NavToolbar.js", 
     230            "OpenLayers/Control/PanPanel.js", 
     231            "OpenLayers/Control/Pan.js", 
     232            "OpenLayers/Control/ZoomIn.js", 
     233            "OpenLayers/Control/ZoomOut.js", 
     234            "OpenLayers/Control/ZoomPanel.js", 
    229235            "OpenLayers/Control/EditingToolbar.js", 
    230236            "OpenLayers/Lang.js", 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Control/ZoomToMaxExtent.js

    r5614 r7963  
    1616 */ 
    1717OpenLayers.Control.ZoomToMaxExtent = OpenLayers.Class(OpenLayers.Control, { 
     18 
    1819    /** 
    1920     * Property: type 
    20      * TYPE_BUTTON. 
     21     * {String} The type of <OpenLayers.Control> -- When added to a  
     22     *     <Control.Panel>, 'type' is used by the panel to determine how to  
     23     *     handle our events. 
    2124     */ 
    2225    type: OpenLayers.Control.TYPE_BUTTON, 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Filter/Spatial.js

    r7945 r7963  
    1919    /** 
    2020     * APIProperty: type 
    21      * {String} type: type of spatial filter. This is one of 
    22      * - OpenLayers.Filter.Spatial.BBOX                 = "BBOX"; 
    23      * - OpenLayers.Filter.Spatial.INTERSECTS           = "INTERSECTS"; 
    24      * - OpenLayers.Filter.Spatial.DWITHIN              = "DWITHIN"; 
     21     * {String} Type of spatial filter. 
     22     * 
     23     * The type should be one of: 
     24     * - OpenLayers.Filter.Spatial.BBOX 
     25     * - OpenLayers.Filter.Spatial.INTERSECTS 
     26     * - OpenLayers.Filter.Spatial.DWITHIN 
    2527     */ 
    2628    type: null, 
     
    2830    /** 
    2931     * APIProperty: property 
    30      * {String} 
    31      * name of the context property to compare 
     32     * {String} Name of the context property to compare. 
    3233     */ 
    3334    property: null, 
     
    3536    /** 
    3637     * APIProperty: value 
    37      * {<OpenLayers.Bounds>} 
    38      * The bounds to pass into the spatial filter 
     38     * {<OpenLayers.Bounds> || <OpenLayers.Geometry>} The bounds or geometry 
     39     *     to be used by the filter.  Use bounds for BBOX filters and geometry 
     40     *     for INTERSECTS or DWITHIN filters. 
    3941     */ 
    4042    value: null, 
    4143 
    42     /**b 
     44    /** 
    4345     * APIProperty: distance 
    44      * {Number} 
    45      * The distance to use in a DWithin spatial filter 
     46     * {Number} The distance to use in a DWithin spatial filter. 
    4647     */ 
    4748    distance: null, 
     
    4950    /** 
    5051     * APIProperty: distanceUnits 
    51      * {String} 
    52      * The units to use for the distance, e.g. m 
     52     * {String} The units to use for the distance, e.g. 'm'. 
    5353     */ 
    5454    distanceUnits: null, 
    55  
    5655     
    5756    /**  
     
    6160     * Parameters: 
    6261     * options - {Object} An optional object with properties to set on the 
    63      *           filter 
     62     *     filter. 
    6463     *  
    6564     * Returns: 
     
    7877    *  
    7978    * Returns: 
    80     * {Boolean} false if the feature is filtered out, true otherwise
     79    * {Boolean} The feature meets filter criteria
    8180    */ 
    82     evaluate: function(feature)
     81    evaluate: function(feature)
    8382        var intersect = false; 
    8483        switch(this.type) { 
     
    106105}); 
    107106 
    108  
    109 OpenLayers.Filter.Spatial.BBOX                 = "BBOX"; 
    110 OpenLayers.Filter.Spatial.INTERSECTS           = "INTERSECTS"; 
    111 OpenLayers.Filter.Spatial.DWITHIN              = "DWITHIN"; 
     107OpenLayers.Filter.Spatial.BBOX = "BBOX"; 
     108OpenLayers.Filter.Spatial.INTERSECTS = "INTERSECTS"; 
     109OpenLayers.Filter.Spatial.DWITHIN = "DWITHIN"; 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Format/Filter/v1.js

    r7785 r7963  
    385385                return node; 
    386386            }, 
    387            "INTERSECTS": function(filter) { 
    388                var node = this.createElementNSPlus("ogc:Intersects"); 
    389                this.writeNode(node, "PropertyName", filter); 
    390                var gml = new OpenLayers.Format.GML(); 
    391                node.appendChild(gml.buildGeometryNode(filter.value)); 
    392                return node; 
    393            }, 
    394            "Distance": function(filter) { 
    395                return this.createElementNSPlus("ogc:Distance",  
    396                    {attributes: {units: filter.distanceUnits},  
    397                     value: filter.distance}); 
    398            
     387            "INTERSECTS": function(filter) { 
     388                var node = this.createElementNSPlus("ogc:Intersects"); 
     389                this.writeNode(node, "PropertyName", filter); 
     390                var gml = new OpenLayers.Format.GML(); 
     391                node.appendChild(gml.buildGeometryNode(filter.value)); 
     392                return node; 
     393            }, 
     394            "Distance": function(filter) { 
     395                return this.createElementNSPlus("ogc:Distance",  
     396                    {attributes: {units: filter.distanceUnits},  
     397                    value: filter.distance}); 
     398           
    399399        } 
    400400    }, 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Format/GML.js

    r7826 r7963  
    140140        var order = ["MultiPolygon", "Polygon", 
    141141                     "MultiLineString", "LineString", 
    142             "MultiPoint", "Point", "Envelope","Box"]; 
     142                     "MultiPoint", "Point", "Envelope", "Box"]; 
    143143        var type, nodeList, geometry, parser; 
    144144        for(var i=0; i<order.length; ++i) { 
     
    830830            return gml; 
    831831 
    832         }, 
     832        }, 
    833833  
    834834        /** 
     
    837837         * 
    838838         * Parameters: 
    839          * geometry - {<OpenLayers.Geometry.Bounds>} A bound. 
    840          *  
     839         * bounds - {<OpenLayers.Geometry.Bounds>} A bounds object. 
    841840         * 
    842841         * Returns: 
    843842         * {DOMElement} A GML box node. 
    844843         */ 
    845         bounds: function(geometry) { 
     844        bounds: function(bounds) { 
    846845            var gml = this.createElementNS(this.gmlns, "gml:Box"); 
    847             gml.appendChild(this.buildCoordinatesNode(geometry)); 
     846            gml.appendChild(this.buildCoordinatesNode(bounds)); 
    848847            return gml; 
    849848        } 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Lang/en.js

    r7946 r7963  
    120120 
    121121    // console message 
    122     'evaluateNotImplemented': "evaluate is not implemented for this filter type
     122    'filterEvaluateNotImplemented': "evaluate is not implemented for this filter type.
    123123}; 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Layer/FixedZoomLevels.js

    r7785 r7963  
    9191        }         
    9292 
     93        // 
     94        // At this point, we know what the minimum desired zoom level is, and 
     95        //  we must calculate the total number of zoom levels.  
     96        //   
     97        //  Because we allow for the setting of either the 'numZoomLevels' 
     98        //   or the 'maxZoomLevel' properties... on either the layer or the   
     99        //   map, we have to define some rules to see which we take into 
     100        //   account first in this calculation.  
     101        // 
     102        // The following is the precedence list for these properties: 
     103        //  
     104        // (1) numZoomLevels set on layer 
     105        // (2) maxZoomLevel set on layer 
     106        // (3) numZoomLevels set on map 
     107        // (4) maxZoomLevel set on map* 
     108        // (5) none of the above* 
     109        // 
     110        // *Note that options (4) and (5) are only possible if the user  
     111        //  _explicitly_ sets the 'numZoomLevels' property on the map to  
     112        //  null, since it is set by default to 16.  
     113        // 
     114 
     115        // 
     116        // Note to future: In 3.0, I think we should remove the default  
     117        // value of 16 for map.numZoomLevels. Rather, I think that value  
     118        // should be set as a default on the Layer.WMS class. If someone 
     119        // creates a 3rd party layer and does not specify any 'minZoomLevel',  
     120        // 'maxZoomLevel', or 'numZoomLevels', and has not explicitly  
     121        // specified any of those on the map object either.. then I think 
     122        // it is fair to say that s/he wants all the zoom levels available. 
     123        //  
     124        // By making map.numZoomLevels *null* by default, that will be the  
     125        // case. As it is, I don't feel comfortable changing that right now 
     126        // as it would be a glaring API change and actually would probably 
     127        // break many peoples' codes.  
     128        // 
     129 
     130        //the number of zoom levels we'd like to have. 
     131        var desiredZoomLevels; 
     132 
     133        //this is the maximum number of zoom levels the layer will allow,  
     134        // given the specified starting minimum zoom level. 
    93135        var limitZoomLevels = this.MAX_ZOOM_LEVEL - this.minZoomLevel + 1; 
    94         if (this.numZoomLevels != null) { 
    95             this.numZoomLevels = Math.min(this.numZoomLevels, limitZoomLevels); 
     136 
     137        if ( ((this.options.numZoomLevels == null) &&  
     138              (this.options.maxZoomLevel != null)) // (2) 
     139              || 
     140             ((this.numZoomLevels == null) && 
     141              (this.maxZoomLevel != null)) // (4) 
     142           ) { 
     143            //calculate based on specified maxZoomLevel (on layer or map) 
     144            desiredZoomLevels = this.maxZoomLevel - this.minZoomLevel + 1; 
    96145        } else { 
    97             if (this.maxZoomLevel != null) { 
    98                 var zoomDiff = this.maxZoomLevel - this.minZoomLevel + 1; 
    99                 this.numZoomLevels = Math.min(zoomDiff, limitZoomLevels); 
    100             } else { 
    101                 this.numZoomLevels = limitZoomLevels; 
    102             } 
    103         } 
    104  
     146            //calculate based on specified numZoomLevels (on layer or map) 
     147            // this covers cases (1) and (3) 
     148            desiredZoomLevels = this.numZoomLevels; 
     149        } 
     150 
     151        if (desiredZoomLevels != null) { 
     152            //Now that we know what we would *like* the number of zoom levels 
     153            // to be, based on layer or map options, we have to make sure that 
     154            // it does not conflict with the actual limit, as specified by  
     155            // the constants on the layer itself (and calculated into the 
     156            // 'limitZoomLevels' variable).  
     157            this.numZoomLevels = Math.min(desiredZoomLevels, limitZoomLevels); 
     158        } else { 
     159            // case (5) -- neither 'numZoomLevels' not 'maxZoomLevel' was  
     160            // set on either the layer or the map. So we just use the  
     161            // maximum limit as calculated by the layer's constants. 
     162            this.numZoomLevels = limitZoomLevels 
     163        } 
     164 
     165        //now that the 'numZoomLevels' is appropriately, safely set,  
     166        // we go back and re-calculate the 'maxZoomLevel'. 
    105167        this.maxZoomLevel = this.minZoomLevel + this.numZoomLevels - 1; 
    106168 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Layer/MapGuide.js

    r7349 r7963  
    2929     *    singleTile *and* isBaseLayer false is *not recommend*: it uses synchronous 
    3030     *    XMLHttpRequests to load tiles, and this will *lock up users browsers* 
    31      *    during requests
     31     *    during requests if the server fails to respond
    3232     **/ 
    3333    singleTile: false, 
     
    6464     * Create a new Mapguide layer, either tiled or untiled.   
    6565     * 
    66      * For tiled layers, the 'groupName' and 'mapDefnition' options  
    67      * must be specified as options. 
    68      * 
    69      * For untiled layers, specify either combination of 'mapName' and 
    70      * 'session', or 'mapDefinition' and 'locale'. 
     66     * For tiled layers, the 'groupName' and 'mapDefinition' values  
     67     * must be specified as parameters in the constructor. 
     68     * 
     69     * For untiled base layers, specify either combination of 'mapName' and 
     70     * 'session', or 'mapDefinition' and 'locale'.   
     71     * 
     72     * For untiled overlay layers (singleTile=true and isBaseLayer=false),  
     73     * mapName and session are required parameters for the Layer constructor.   
     74     * Also NOTE: untiled overlay layers issues a synchronous AJAX request  
     75     * before the image request can be issued so the users browser may lock 
     76     * up if the MG Web tier does not respond in a timely fashion. 
     77     * 
     78     * NOTE: MapGuide OS uses a DPI value and degrees to meters conversion  
     79     * factor that are different than the defaults used in OpenLayers,  
     80     * so these must be adjusted accordingly in your application.   
     81     * See the MapGuide example for how to set these values for MGOS. 
    7182     * 
    7283     * Parameters: 
     
    7586     *            (e.g. http://localhost:8008/mapguide/mapagent/mapagent.fcgi) 
    7687     * params - {Object} hashtable of additional parameters to use. Some 
    77      *     parameters may require additional code on the serer. The ones that 
     88     *     parameters may require additional code on the server. The ones that 
    7889     *     you may want to use are:  
    7990     *   - mapDefinition - {String} The MapGuide resource definition 
     
    117128                           this.SINGLE_TILE_PARAMS 
    118129                           ); 
     130                            
    119131        } else { 
    120132            //initialize for tiled layers 
     
    197209            //but we first need to call GETVISIBLEMAPEXTENT to set the extent 
    198210            var getVisParams = {}; 
     211            getVisParams = OpenLayers.Util.extend(getVisParams, params); 
    199212            getVisParams.operation = "GETVISIBLEMAPEXTENT"; 
    200213            getVisParams.version = "1.0.0"; 
     
    202215            getVisParams.mapName = this.params.mapName; 
    203216            getVisParams.format = 'text/xml'; 
    204             getVisParams = OpenLayers.Util.extend(getVisParams, params); 
     217            url = this.getFullRequestString( getVisParams ); 
    205218             
    206             OpenLayers.Request.GET({ 
    207                 url: this.url, params: getVisParams, async: false 
    208             }); 
     219            OpenLayers.Request.GET({url: url, async: false}); 
    209220          } 
    210221           
     
    226237                           scaleindex: this.resolutions.length - this.map.zoom - 1 
    227238                        }); 
    228          
     239          
    229240         
    230241        return url; 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Layer/Vector.js

    r7938 r7963  
    110110     */ 
    111111    selectedFeatures: null, 
     112     
     113    /** 
     114     * Property: unrenderedFeatures 
     115     * {Object} hash of features, keyed by feature.id, that the renderer 
     116     *     failed to draw 
     117     */ 
     118    unrenderedFeatures: null, 
    112119 
    113120    /** 
     
    217224        this.features = []; 
    218225        this.selectedFeatures = []; 
     226        this.unrenderedFeatures = {}; 
    219227         
    220228        // Allow for custom layer behavior 
     
    251259        this.features = null; 
    252260        this.selectedFeatures = null; 
     261        this.unrenderedFeatures = null; 
    253262        if (this.renderer) { 
    254263            this.renderer.destroy(); 
     
    378387    moveTo: function(bounds, zoomChanged, dragging) { 
    379388        OpenLayers.Layer.prototype.moveTo.apply(this, arguments); 
     389         
     390        var coordSysUnchanged = true; 
    380391 
    381392        if (!dragging) { 
     
    385396            this.div.style.top = -parseInt(this.map.layerContainerDiv.style.top) + "px"; 
    386397            var extent = this.map.getExtent(); 
    387             this.renderer.setExtent(extent); 
     398            coordSysUnchanged = this.renderer.setExtent(extent, zoomChanged); 
    388399             
    389400            this.renderer.root.style.visibility = "visible"; 
     
    395406                this.div.scrollLeft = this.div.scrollLeft; 
    396407            } 
     408             
     409            if(!zoomChanged && coordSysUnchanged) { 
     410                var unrenderedFeatures = {}; 
     411                for(var i in this.unrenderedFeatures) { 
     412                    var feature = this.unrenderedFeatures[i]; 
     413                    if(!this.drawFeature(feature)) { 
     414                        unrenderedFeatures[i] = feature; 
     415                    } 
     416                } 
     417                this.unrenderedFeatures = unrenderedFeatures; 
     418            } 
    397419        } 
    398420         
    399         if (!this.drawn || zoomChanged) { 
     421        if (!this.drawn || zoomChanged || !coordSysUnchanged) { 
     422            this.unrenderedFeatures = {}; 
    400423            this.drawn = true; 
     424            var feature; 
    401425            for(var i=0, len=this.features.length; i<len; i++) { 
    402426                if (i != (this.features.length - 1)) { 
     
    405429                    this.renderer.locked = false; 
    406430                }     
    407                 this.drawFeature(this.features[i]); 
     431                feature = this.features[i]; 
     432                if (!this.drawFeature(feature)) { 
     433                    this.unrenderedFeatures[feature.id] = feature; 
     434                }; 
    408435            } 
    409436        }     
     
    457484 
    458485            if (this.drawn) { 
    459                 this.drawFeature(feature); 
     486                if(!this.drawFeature(feature)) { 
     487                    this.unrenderedFeatures[feature.id] = feature; 
     488                } 
    460489            } 
    461490             
     
    507536     
    508537            var feature = features[i]; 
     538            delete this.unrenderedFeatures[feature.id]; 
    509539 
    510540            if (notify) { 
     
    558588        if(features) { 
    559589            this.removeFeatures(features, options); 
    560             for (var i = 0; i < features.length; i++) { 
     590            for(var i=features.length-1; i>=0; i--) { 
    561591                features[i].destroy(); 
    562592            } 
     
    574604     * feature - {<OpenLayers.Feature.Vector>}  
    575605     * style - {Object} Symbolizer hash or {String} renderIntent 
     606     *  
     607     * Returns: 
     608     * {Boolean} true if the renderer was able to draw the feature, false 
     609     *     otherwise 
    576610     */ 
    577611    drawFeature: function(feature, style) { 
     
    585619        } 
    586620         
    587         this.renderer.drawFeature(feature, style); 
     621        return this.renderer.drawFeature(feature, style); 
    588622    }, 
    589623     
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Layer/VirtualEarth.js

    r7785 r7963  
    5353        0.000171661376953125,  
    5454        0.0000858306884765625,  
    55         0.00004291534423828125 
     55        0.00004291534423828125, 
     56        0.00002145767211914062 
    5657    ], 
    5758 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Protocol/HTTP.js

    r7937 r7963  
    2020    /** 
    2121     * Property: url 
    22      * {String} - Service URL 
     22     * {String} - Service URL, read-only, set through the options 
     23     *     passed to constructor. 
    2324     */ 
    2425    url: null, 
     
    2627    /** 
    2728     * Property: headers 
    28      * {Object} - HTTP request headers 
     29     * {Object} - HTTP request headers, read-only, set through the options 
     30     *     passed to the constructor, 
    2931     *     Example: {'Content-Type': 'plain/text'} 
    3032     */ 
     
    3335    /** 
    3436     * Property: params 
    35      * {Object} - Parameters of GET requests 
     37     * {Object} - Parameters of GET requests, read-only, set through the options 
     38     *     passed to the constructor, 
    3639     *     Example: {'bbox': '5,5,5,5'} 
    3740     */ 
     
    3942     
    4043    /** 
    41      * Property: format 
    42      * {<OpenLayers.Format>} Parser for reading and writing features. 
    43      */ 
    44     format: null, 
    45  
    46     /** 
    4744     * Property: callback 
    48      * {Object} - Function to be called when  
     45     * {Object} - Function to be called when the <read>, <create>, 
     46     *     <update>, <delete> or <commit> operation completes, read-only, 
     47     *     set through the options passed to the constructor. 
    4948     */ 
    5049    callback: null, 
     
    5251    /** 
    5352     * Property: scope 
    54      * {Object} - Callback execution scope. 
     53     * {Object} - Callback execution scope, read-only, set through the 
     54     *     options passed to the constructor. 
    5555     */ 
    5656    scope: null, 
    5757 
    58     /** 
    59      * Property: options 
    60      * {Object} - Optional properties to be set on the protocol. 
    61      */ 
    62     options: null, 
    63      
    6458    /** 
    6559     * Constructor: OpenLayers.Protocol.HTTP 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Renderer.js

    r7875 r7963  
    104104     * cache (this.resolution) -- this way it will be re-computed when  
    105105     * next it is needed. 
    106      * 
    107      * Parameters: 
    108      * extent - {<OpenLayers.Bounds>}  
    109      */ 
    110     setExtent: function(extent) { 
     106     * We nullify the resolution cache (this.resolution) if resolutionChanged 
     107     * is set to true - this way it will be re-computed on the next 
     108     * getResolution() request. 
     109     * 
     110     * Parameters: 
     111     * extent - {<OpenLayers.Bounds>} 
     112     * resolutionChanged - {Boolean} 
     113     */ 
     114    setExtent: function(extent, resolutionChanged) { 
    111115        this.extent = extent.clone(); 
    112         this.resolution = null; 
     116        if (resolutionChanged) { 
     117            this.resolution = null; 
     118        } 
    113119    }, 
    114120     
     
    149155     * Parameters: 
    150156     * feature - {<OpenLayers.Feature.Vector>}  
    151      * style - {<Object>}  
     157     * style - {<Object>} 
     158     *  
     159     * Returns: 
     160     * {Boolean} true if the feature has been drawn completely, false if not, 
     161     *     undefined if the feature had no geometry 
    152162     */ 
    153163    drawFeature: function(feature, style) { 
     
    156166        } 
    157167        if (feature.geometry) { 
    158             this.drawGeometry(feature.geometry, style, feature.id); 
     168            var bounds = feature.geometry.getBounds(); 
     169            if(bounds) { 
     170                if (!bounds.intersectsBounds(this.extent)) { 
     171                    style = {display: "none"}; 
     172                } 
     173                return this.drawGeometry(feature.geometry, style, feature.id); 
     174            } 
    159175        } 
    160176    }, 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Renderer/Elements.js

    r7920 r7963  
    451451     * style - {Object} 
    452452     * featureId - {String} 
     453     *  
     454     * Returns: 
     455     * {Boolean} true if the geometry has been drawn completely; null if 
     456     *     incomplete; false otherwise 
    453457     */ 
    454458    drawGeometry: function(geometry, style, featureId) { 
    455459        var className = geometry.CLASS_NAME; 
     460        var rendered = true; 
    456461        if ((className == "OpenLayers.Geometry.Collection") || 
    457462            (className == "OpenLayers.Geometry.MultiPoint") || 
     
    459464            (className == "OpenLayers.Geometry.MultiPolygon")) { 
    460465            for (var i = 0, len=geometry.components.length; i<len; i++) { 
    461                 this.drawGeometry(geometry.components[i], style, featureId); 
     466                rendered = rendered && this.drawGeometry( 
     467                    geometry.components[i], style, featureId); 
    462468            } 
    463             return
     469            return rendered
    464470        }; 
    465471 
     472        rendered = false; 
    466473        if (style.display != "none") { 
    467474            if (style.backgroundGraphic) { 
    468                 this.redrawBackgroundNode(geometry.id, geometry, style, featureId); 
     475                this.redrawBackgroundNode(geometry.id, geometry, style, 
     476                    featureId); 
    469477            } 
    470             this.redrawNode(geometry.id, geometry, style, featureId); 
    471         } else { 
    472             var node = OpenLayers.Util.getElement(geometry.id); 
     478            rendered = this.redrawNode(geometry.id, geometry, style, 
     479                featureId); 
     480        } 
     481        if (rendered == false) { 
     482            var node = document.getElementById(geometry.id); 
    473483            if (node) { 
    474484                if (node._style.backgroundGraphic) { 
     
    479489            } 
    480490        } 
     491        return rendered; 
    481492    }, 
    482493