Changeset 7059
- Timestamp:
- 05/02/08 19:28:34 (8 months ago)
- Files:
-
- sandbox/edgemaster/openlayers/examples/attribution.html (modified) (4 diffs)
- sandbox/edgemaster/openlayers/examples/click.html (modified) (2 diffs)
- sandbox/edgemaster/openlayers/lib/OpenLayers/Ajax.js (modified) (1 diff)
- sandbox/edgemaster/openlayers/lib/OpenLayers/Format/SLD/v1.js (modified) (1 diff)
- sandbox/edgemaster/openlayers/lib/OpenLayers/Layer/GeoRSS.js (modified) (1 diff)
- sandbox/edgemaster/openlayers/lib/OpenLayers/Rule.js (modified) (1 diff)
- sandbox/edgemaster/openlayers/lib/OpenLayers/Util.js (modified) (2 diffs)
- sandbox/edgemaster/openlayers/tests/Layer/GeoRSS.html (modified) (2 diffs)
- sandbox/edgemaster/openlayers/tests/Layer/Vector.html (modified) (3 diffs)
- sandbox/edgemaster/openlayers/tests/Style.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/edgemaster/openlayers/examples/attribution.html
r6497 r7059 12 12 </style> 13 13 <script src="../lib/OpenLayers.js"></script> 14 14 15 <script type="text/javascript"> 15 16 var map; … … 21 22 {'attribution': 'Provided by <a href="http://labs.metacarta.com/">MetaCarta</a>'}); 22 23 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"}); 26 27 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 28 33 map.addControl(new OpenLayers.Control.LayerSwitcher()); 29 34 map.addControl(new OpenLayers.Control.Attribution()); … … 37 42 38 43 <div id="tags"> 44 copyright watermark logo attribution 39 45 </div> 40 46 … … 48 54 This is an example of how to add an attribution block to the OpenLayers window. In order to use an 49 55 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. 51 59 </div> 52 60 </body> sandbox/edgemaster/openlayers/examples/click.html
r6571 r7059 31 31 this.handler = new OpenLayers.Handler.Click( 32 32 this, { 33 'click': this.trigger ,33 'click': this.trigger 34 34 }, this.handlerOptions 35 35 ); … … 40 40 alert("You clicked near " + lonlat.lat + " N, " + 41 41 + lonlat.lon + " E"); 42 } ,42 } 43 43 44 44 }); sandbox/edgemaster/openlayers/lib/OpenLayers/Ajax.js
r6673 r7059 44 44 * Parameters: 45 45 * 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} 47 49 * caller - {Object} object which gets callbacks 48 50 * onComplete - {Function} Optional callback for success. The callback sandbox/edgemaster/openlayers/lib/OpenLayers/Format/SLD/v1.js
r6818 r7059 4 4 5 5 /** 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 6 11 * @requires OpenLayers/Format/SLD.js 7 12 */ sandbox/edgemaster/openlayers/lib/OpenLayers/Layer/GeoRSS.js
r6833 r7059 191 191 192 192 if (title || description) { 193 // we have supplemental data, store them. 194 data.title = title; 195 data.description = description; 196 193 197 var contentHTML = '<div class="olLayerGeoRSSClose">[x]</div>'; 194 198 contentHTML += '<div class="olLayerGeoRSSTitle">'; sandbox/edgemaster/openlayers/lib/OpenLayers/Rule.js
r6833 r7059 66 66 * Property: symbolizer 67 67 * {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. 69 73 */ 70 74 symbolizer: null, sandbox/edgemaster/openlayers/lib/OpenLayers/Util.js
r6763 r7059 198 198 * Creates a new div and optionally set some standard attributes. 199 199 * 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. 203 202 * 204 203 * Parameters: … … 417 416 opacity) { 418 417 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); 421 420 422 421 var img = div.childNodes[0]; sandbox/edgemaster/openlayers/tests/Layer/GeoRSS.html
r6725 r7059 17 17 18 18 function test_Layer_GeoRSS_constructor (t) { 19 t.plan( 5);19 t.plan( 7 ); 20 20 layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt ); 21 21 t.ok( layer instanceof OpenLayers.Layer.GeoRSS, "new OpenLayers.Layer.GeoRSS returns object" ); … … 26 26 t.eq( layer.markers.length, 40, "marker length is correct" ); 27 27 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> '; 28 30 t.ok( layer.markers[0].lonlat.equals(ll), "lonlat on first marker is correct" ); 29 31 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); 30 34 } ); 31 35 } sandbox/edgemaster/openlayers/tests/Layer/Vector.html
r6971 r7059 17 17 18 18 function test_Layer_Vector_addFeatures(t) { 19 t.plan( 5);19 t.plan(8); 20 20 21 21 var layer = new OpenLayers.Layer.Vector(name); … … 26 26 layer.preFeatureInsert = function(feature) { 27 27 t.ok(feature == pointFeature, "OpenLayers.Layer.Vector.addFeatures calls preFeatureInsert with the right arg"); 28 } 28 }; 29 29 layer.onFeatureInsert = function(feature) { 30 30 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 }); 32 41 33 42 layer.addFeatures([pointFeature]); … … 38 47 layer.preFeatureInsert = function(feature) { 39 48 t.fail("OpenLayers.Layer.Vector.addFeatures calls preFeatureInsert while it must not"); 40 } 49 }; 41 50 layer.onFeatureInsert = function(feature) { 42 51 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 }); 44 62 45 63 layer.addFeatures([pointFeature], {silent: true}); sandbox/edgemaster/openlayers/tests/Style.html
r6818 r7059 128 128 129 129 function test_Style_context(t) { 130 t.plan( 1);130 t.plan(2); 131 131 var rule = new OpenLayers.Rule({ 132 132 symbolizer: {"Point": {externalGraphic: "${img1}"}}, … … 146 146 var styleHash = style.createSymbolizer(feature); 147 147 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 150 160 function test_Style_findPropertyStyles(t) { 151 161 t.plan(4);
