OpenLayers OpenLayers

Changeset 7017

Show
Ignore:
Timestamp:
04/27/08 11:00:37 (9 months ago)
Author:
tschaub
Message:

merge r6849:HEAD from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/topp/almanac/examples/attribution.html

    r6497 r7017  
    1212        </style> 
    1313        <script src="../lib/OpenLayers.js"></script> 
     14 
    1415        <script type="text/javascript"> 
    1516            var map; 
     
    2122                    {'attribution': 'Provided by <a href="http://labs.metacarta.com/">MetaCarta</a>'}); 
    2223 
    23             var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic", 
    24                 "http://t1.hypercube.telascience.org/cgi-bin/landsat7",  
    25                 {layers: "landsat7"},{attribution:"Provided by Telascience"}); 
     24                var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic", 
     25                    "http://t1.hypercube.telascience.org/cgi-bin/landsat7",  
     26                    {layers: "landsat7"},{attribution:"Provided by Telascience"}); 
    2627 
    27                 map.addLayers([ol_wms, jpl_wms]); 
     28                var vector = new OpenLayers.Layer.Vector("Simple Geometry", 
     29                              {attribution:"Vector Attibution in 2nd arg"}); 
     30 
     31                map.addLayers([ol_wms, jpl_wms, vector]); 
     32 
    2833                map.addControl(new OpenLayers.Control.LayerSwitcher()); 
    2934                map.addControl(new OpenLayers.Control.Attribution()); 
     
    3742 
    3843        <div id="tags"> 
     44            copyright watermark logo attribution 
    3945        </div> 
    4046 
     
    4854            This is an example of how to add an attribution block to the OpenLayers window.  In order to use an 
    4955            attribution block, an attribution parameter must be set in each layer that requires attribution. In 
    50             addition, an attribution control must be added to the map. 
     56            addition, an attribution control must be added to the map, though one is added to all OpenLayers Maps by default.  
     57            Be aware that this is a layer *option*: the options hash goes in 
     58            different places depending on the layer type you are using.   
    5159        </div> 
    5260    </body> 
  • sandbox/topp/almanac/examples/click.html

    r6571 r7017  
    3131                    this.handler = new OpenLayers.Handler.Click( 
    3232                        this, { 
    33                             'click': this.trigger, 
     33                            'click': this.trigger 
    3434                        }, this.handlerOptions 
    3535                    ); 
     
    4040                    alert("You clicked near " + lonlat.lat + " N, " + 
    4141                                              + lonlat.lon + " E"); 
    42                 }, 
     42                } 
    4343 
    4444            }); 
  • sandbox/topp/almanac/lib/OpenLayers/Format/SLD.js

    r6849 r7017  
    66 * @requires OpenLayers/Format/XML.js 
    77 * @requires OpenLayers/Style.js 
     8 * @requires OpenLayers/Rule.js 
    89 * @requires OpenLayers/Filter/FeatureId.js 
    910 * @requires OpenLayers/Filter/Logical.js 
  • sandbox/topp/almanac/lib/OpenLayers/Layer/GeoRSS.js

    r6849 r7017  
    191191             
    192192            if (title || description) { 
     193                // we have supplemental data, store them. 
     194                data.title = title; 
     195                data.description = description; 
     196             
    193197                var contentHTML = '<div class="olLayerGeoRSSClose">[x]</div>';  
    194198                contentHTML += '<div class="olLayerGeoRSSTitle">'; 
  • sandbox/topp/almanac/lib/OpenLayers/Layer/Text.js

    r6849 r7017  
    172172            // FIXME: At the moment, we only use this if we have an  
    173173            // externalGraphic, because icon has no setOffset API Method.   
    174             if (feature.style.graphicXOffset  
    175                 && feature.style.graphicYOffset) { 
     174            if (feature.style.graphicXOffset !== null 
     175                && feature.style.graphicYOffset !== null) { 
    176176                iconOffset = new OpenLayers.Pixel( 
    177177                    feature.style.graphicXOffset,  
  • sandbox/topp/almanac/lib/OpenLayers/Layer/Vector.js

    r6985 r7017  
    1313 * Class: OpenLayers.Layer.Vector 
    1414 * Instances of OpenLayers.Layer.Vector are used to render vector data from 
    15  * a variety of sources. Create a new image layer with the 
    16  * <OpenLayers.Layer.Vector> constructor. 
     15 *     a variety of sources. Create a new vector layer with the 
     16 *     <OpenLayers.Layer.Vector> constructor. 
    1717 * 
    1818 * Inherits from: 
     
    152152     * Parameters: 
    153153     * name - {String} A name for the layer 
    154      * options - {Object} options Object with non-default properties to set on 
     154     * options - {Object} Optional object with non-default properties to set on 
    155155     *           the layer. 
    156156     * 
     
    535535    }, 
    536536 
     537    /**  
     538     * APIMethod: getDataExtent 
     539     * Calculates the max extent which includes all of the features. 
     540     *  
     541     * Returns: 
     542     * {<OpenLayers.Bounds>} 
     543     */ 
     544    getDataExtent: function () { 
     545        var maxExtent = null; 
     546        if( this.features && (this.features.length > 0)){ 
     547            var maxExtent = this.features[0].geometry.getBounds(); 
     548            for(var i=0; i < this.features.length; i++){ 
     549                maxExtent.extend(this.features[i].geometry.getBounds()); 
     550            } 
     551        } 
     552 
     553        return maxExtent; 
     554    }, 
     555 
    537556    CLASS_NAME: "OpenLayers.Layer.Vector" 
    538557}); 
  • sandbox/topp/almanac/lib/OpenLayers/Popup/Anchored.js

    r6849 r7017  
    1919    /**  
    2020     * Parameter: relativePosition 
    21      * {String} Relative position of the popup ("lr", "ll", "tr", or "tl"). 
     21     * {String} Relative position of the popup ("br", "tr", "tl" or "bl"). 
    2222     */ 
    2323    relativePosition: null, 
     
    127127     *  
    128128     * Returns: 
    129      * {String} The relative position ("br" "tr" "tl "bl") at which the popup 
     129     * {String} The relative position ("br" "tr" "tl" "bl") at which the popup 
    130130     *     should be placed. 
    131131     */ 
  • sandbox/topp/almanac/lib/OpenLayers/Util.js

    r6849 r7017  
    198198 * Creates a new div and optionally set some standard attributes. 
    199199 * Null may be passed to each parameter if you do not wish to 
    200  * set a particular attribute.d 
    201  *  
    202  * Note: zIndex is NOT set 
     200 * set a particular attribute. 
     201 * Note - zIndex is NOT set on the resulting div. 
    203202 *  
    204203 * Parameters: 
     
    417416                                               opacity) { 
    418417 
    419     OpenLayers.Util.modifyDOMElement(div, id, px, sz,  
    420                                      null, null, null, opacity); 
     418    OpenLayers.Util.modifyDOMElement(div, id, px, sz, position, 
     419                                     null, null, opacity); 
    421420 
    422421    var img = div.childNodes[0]; 
  • sandbox/topp/almanac/tests/Layer/GeoRSS.html

    r6849 r7017  
    1717 
    1818    function test_Layer_GeoRSS_constructor (t) { 
    19         t.plan( 5 ); 
     19        t.plan( 7 ); 
    2020        layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt ); 
    2121        t.ok( layer instanceof OpenLayers.Layer.GeoRSS, "new OpenLayers.Layer.GeoRSS returns object" ); 
     
    2626            t.eq( layer.markers.length, 40, "marker length is correct" ); 
    2727            var ll = new OpenLayers.LonLat(-71.142197, 42.405696); 
     28            var theTitle = "Knitting Room"; 
     29            var theDescription = 'This little shop is jammed full. Yarn, yarn everywhere. They make the most of every possible nook and cranny. I like this place also because they have a lot of different kinds of knitting needles in all different sizes. Also, the people who work here are younger and hipper than in the other stores I go to. I reccomend buying supplies here and then knitting your way through a good documentary at the Capitol Theater across the street.<br/>Address: 2 lake St, Arlington, MA <br/>Tags: knitting, yarn, pins and needles, handspun, hand dyed, novelty yarn, fancy, simple, young, hip, friendly, needles, addy, cute hats<br /><br /><a href="http://platial.com/place/90306">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/90306">Grab this on Platial</a> '; 
    2830            t.ok( layer.markers[0].lonlat.equals(ll), "lonlat on first marker is correct" ); 
    2931            t.eq( layer.name, "Crschmidt's Places At Platial", "Layer name is correct." ); 
     32            t.eq( layer.features[0].data.title, theTitle); 
     33            t.eq( layer.features[0].data.description, theDescription); 
    3034        } ); 
    3135    } 
  • sandbox/topp/almanac/tests/Layer/Vector.html

    r6849 r7017  
    1717     
    1818    function test_Layer_Vector_addFeatures(t) { 
    19         t.plan(4); 
     19        t.plan(5); 
    2020     
    2121        var layer = new OpenLayers.Layer.Vector(name); 
     
    4444 
    4545        layer.addFeatures([pointFeature], {silent: true}); 
     46 
     47        var extent = layer.getDataExtent(); 
     48        t.eq(extent.toBBOX(), "-111.04,45.68,-111.04,45.68", "extent from getDataExtent is correct"); 
    4649    } 
    4750