Changeset 7017
- Timestamp:
- 04/27/08 11:00:37 (9 months ago)
- Files:
-
- sandbox/topp/almanac/examples/attribution.html (modified) (4 diffs)
- sandbox/topp/almanac/examples/click.html (modified) (2 diffs)
- sandbox/topp/almanac/lib/OpenLayers/Format/SLD.js (modified) (1 diff)
- sandbox/topp/almanac/lib/OpenLayers/Layer/GeoRSS.js (modified) (1 diff)
- sandbox/topp/almanac/lib/OpenLayers/Layer/Text.js (modified) (1 diff)
- sandbox/topp/almanac/lib/OpenLayers/Layer/Vector.js (modified) (3 diffs)
- sandbox/topp/almanac/lib/OpenLayers/Popup/Anchored.js (modified) (2 diffs)
- sandbox/topp/almanac/lib/OpenLayers/Util.js (modified) (2 diffs)
- sandbox/topp/almanac/tests/Layer/GeoRSS.html (modified) (2 diffs)
- sandbox/topp/almanac/tests/Layer/Vector.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/topp/almanac/examples/attribution.html
r6497 r7017 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/topp/almanac/examples/click.html
r6571 r7017 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/topp/almanac/lib/OpenLayers/Format/SLD.js
r6849 r7017 6 6 * @requires OpenLayers/Format/XML.js 7 7 * @requires OpenLayers/Style.js 8 * @requires OpenLayers/Rule.js 8 9 * @requires OpenLayers/Filter/FeatureId.js 9 10 * @requires OpenLayers/Filter/Logical.js sandbox/topp/almanac/lib/OpenLayers/Layer/GeoRSS.js
r6849 r7017 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/topp/almanac/lib/OpenLayers/Layer/Text.js
r6849 r7017 172 172 // FIXME: At the moment, we only use this if we have an 173 173 // 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) { 176 176 iconOffset = new OpenLayers.Pixel( 177 177 feature.style.graphicXOffset, sandbox/topp/almanac/lib/OpenLayers/Layer/Vector.js
r6985 r7017 13 13 * Class: OpenLayers.Layer.Vector 14 14 * Instances of OpenLayers.Layer.Vector are used to render vector data from 15 * a variety of sources. Create a new imagelayer with the16 * <OpenLayers.Layer.Vector> constructor.15 * a variety of sources. Create a new vector layer with the 16 * <OpenLayers.Layer.Vector> constructor. 17 17 * 18 18 * Inherits from: … … 152 152 * Parameters: 153 153 * name - {String} A name for the layer 154 * options - {Object} options Object with non-default properties to set on154 * options - {Object} Optional object with non-default properties to set on 155 155 * the layer. 156 156 * … … 535 535 }, 536 536 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 537 556 CLASS_NAME: "OpenLayers.Layer.Vector" 538 557 }); sandbox/topp/almanac/lib/OpenLayers/Popup/Anchored.js
r6849 r7017 19 19 /** 20 20 * 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"). 22 22 */ 23 23 relativePosition: null, … … 127 127 * 128 128 * Returns: 129 * {String} The relative position ("br" "tr" "tl "bl") at which the popup129 * {String} The relative position ("br" "tr" "tl" "bl") at which the popup 130 130 * should be placed. 131 131 */ sandbox/topp/almanac/lib/OpenLayers/Util.js
r6849 r7017 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/topp/almanac/tests/Layer/GeoRSS.html
r6849 r7017 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/topp/almanac/tests/Layer/Vector.html
r6849 r7017 17 17 18 18 function test_Layer_Vector_addFeatures(t) { 19 t.plan( 4);19 t.plan(5); 20 20 21 21 var layer = new OpenLayers.Layer.Vector(name); … … 44 44 45 45 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"); 46 49 } 47 50
