Changeset 7059


Ignore:
Timestamp:
May 2, 2008 4:28:34 PM (8 years ago)
Author:
edgemaster
Message:

Merge from trunk

Location:
sandbox/edgemaster/openlayers
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • sandbox/edgemaster/openlayers/examples/attribution.html

    r6497 r7059  
    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/edgemaster/openlayers/examples/click.html

    r6571 r7059  
    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/edgemaster/openlayers/lib/OpenLayers/Ajax.js

    r6673 r7059  
    4444 * Parameters:
    4545 * uri - {String} URI of source doc
    46  * params - {String} Params on get (doesnt seem to work)
     46 * params - {String} or {Object} GET params. Either a string in the form
     47 *     "?hello=world&foo=bar" (do not forget the leading question mark)
     48 *     or an object in the form {'hello': 'world', 'foo': 'bar}
    4749 * caller - {Object} object which gets callbacks
    4850 * onComplete - {Function} Optional callback for success.  The callback
  • sandbox/edgemaster/openlayers/lib/OpenLayers/Format/SLD/v1.js

    r6818 r7059  
    44
    55/**
     6 * @requires OpenLayers/Rule.js
     7 * @requires OpenLayers/Filter.js
     8 * @requires OpenLayers/Filter/FeatureId.js
     9 * @requires OpenLayers/Filter/Logical.js
     10 * @requires OpenLayers/Filter/Comparison.js
    611 * @requires OpenLayers/Format/SLD.js
    712 */
  • sandbox/edgemaster/openlayers/lib/OpenLayers/Layer/GeoRSS.js

    r6833 r7059  
    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/edgemaster/openlayers/lib/OpenLayers/Rule.js

    r6833 r7059  
    6666     * Property: symbolizer
    6767     * {Object} Symbolizer or hash of symbolizers for this rule. If hash of
    68      * symbolizers, keys are one or more of ["Point", "Line", "Polygon"]
     68     * symbolizers, keys are one or more of ["Point", "Line", "Polygon"]. The
     69     * latter if useful if it is required to style e.g. vertices of a line
     70     * with a point symbolizer. Note, however, that this is not implemented
     71     * yet in OpenLayers, but it is the way how symbolizers are defined in
     72     * SLD.
    6973     */
    7074    symbolizer: null,
  • sandbox/edgemaster/openlayers/lib/OpenLayers/Util.js

    r6763 r7059  
    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/edgemaster/openlayers/tests/Layer/GeoRSS.html

    r6725 r7059  
    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/edgemaster/openlayers/tests/Layer/Vector.html

    r6971 r7059  
    1717   
    1818    function test_Layer_Vector_addFeatures(t) {
    19         t.plan(5);
     19        t.plan(8);
    2020   
    2121        var layer = new OpenLayers.Layer.Vector(name);
     
    2626        layer.preFeatureInsert = function(feature) {
    2727            t.ok(feature == pointFeature, "OpenLayers.Layer.Vector.addFeatures calls preFeatureInsert with the right arg");
    28         }
     28        };
    2929        layer.onFeatureInsert = function(feature) {
    3030            t.ok(feature == pointFeature, "OpenLayers.Layer.Vector.addFeatures calls onFeatureInsert with the right arg");
    31         }
     31        };
     32        layer.events.register('beforefeatureadded', null, function(obj) {
     33            t.ok(pointFeature == obj.feature, "OpenLayers.Layer.Vector.addFeatures triggers beforefeatureadded with correct feature passed to callback");
     34        });
     35        layer.events.register('featureadded', null, function(obj) {
     36            t.ok(pointFeature == obj.feature, "OpenLayers.Layer.Vector.addFeatures triggers featureadded with correct feature passed to callback");
     37        });
     38        layer.events.register('featuresadded', null, function(obj) {
     39            t.ok(pointFeature == obj.features[0], "OpenLayers.Layer.Vector.addFeatures triggers featuresadded with correct features passed to callback");
     40        });
    3241
    3342        layer.addFeatures([pointFeature]);
     
    3847        layer.preFeatureInsert = function(feature) {
    3948            t.fail("OpenLayers.Layer.Vector.addFeatures calls preFeatureInsert while it must not");
    40         }
     49        };
    4150        layer.onFeatureInsert = function(feature) {
    4251            t.fail("OpenLayers.Layer.Vector.addFeatures calls onFeatureInsert while it must not");
    43         }
     52        };
     53        layer.events.register('beforefeatureadded', null, function(obj) {
     54            t.fail("OpenLayers.Layer.Vector.addFeatures triggers beforefeatureadded while it must not");
     55        });
     56        layer.events.register('featureadded', null, function(obj) {
     57            t.fail("OpenLayers.Layer.Vector.addFeatures triggers featureadded while it must not");
     58        });
     59        layer.events.register('featuresadded', null, function(obj) {
     60            t.fail("OpenLayers.Layer.Vector.addFeatures triggers featuresadded while it must not");
     61        });
    4462
    4563        layer.addFeatures([pointFeature], {silent: true});
  • sandbox/edgemaster/openlayers/tests/Style.html

    r6818 r7059  
    128128   
    129129    function test_Style_context(t) {
    130         t.plan(1);
     130        t.plan(2);
    131131        var rule = new OpenLayers.Rule({
    132132            symbolizer: {"Point": {externalGraphic: "${img1}"}},
     
    146146        var styleHash = style.createSymbolizer(feature);
    147147        t.eq(styleHash.externalGraphic, "myImage.png", "correctly evaluated rule and calculated property styles from a custom context");
    148     }
    149    
     148       
     149        // same as above, but without rule (#1526)
     150        style = new OpenLayers.Style(
     151            {externalGraphic: "${getExternalGraphic}"},
     152            {context: {
     153                getExternalGraphic: function(feature) {
     154                    return "foo" + feature.attributes.size + ".png";
     155                }
     156            }});
     157        t.eq(style.createSymbolizer(feature).externalGraphic, "foo10.png", "correctly evaluated symbolizer without rule");
     158    };
     159       
    150160    function test_Style_findPropertyStyles(t) {
    151161        t.plan(4);
Note: See TracChangeset for help on using the changeset viewer.