Changeset 3208
- Timestamp:
- 05/30/07 10:13:32 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Layer/GeoRSS.js
r2803 r3208 24 24 selectedFeature: null, 25 25 26 /**@type OpenLayers.Icon */ 27 icon: null, 28 26 29 /** 27 30 * @constructor … … 30 33 * @param {String} location 31 34 */ 32 initialize: function(name, location ) {33 OpenLayers.Layer.Markers.prototype.initialize.apply(this, [name ]);35 initialize: function(name, location, options) { 36 OpenLayers.Layer.Markers.prototype.initialize.apply(this, [name, options]); 34 37 this.location = location; 35 38 this.features = new Array(); … … 144 147 } 145 148 146 data.icon = OpenLayers.Marker.defaultIcon(); 149 data.icon = this.icon == null ? 150 OpenLayers.Marker.defaultIcon() : 151 this.icon.clone(); 147 152 data.popupSize = new OpenLayers.Size(250, 120); 148 153 if ((title != null) && (description != null)) { trunk/openlayers/tests/Layer/test_GeoRSS.html
r2850 r3208 83 83 } 84 84 85 function test_04_Layer_GeoRSS_icon(t) { 86 t.plan( 3 ); 87 layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt); 88 var the_icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png'); 89 var otherLayer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt,{icon:the_icon}); 90 var map = new OpenLayers.Map('map'); 91 var baseLayer = new OpenLayers.Layer.WMS("Test Layer", 92 "http://octo.metacarta.com/cgi-bin/mapserv?", 93 {map: "/mapdata/vmap_wms.map", layers: "basic"}); 94 map.addLayer(baseLayer); 95 map.addLayers([layer,otherLayer]); 96 map.setCenter(new OpenLayers.LonLat(0,0),0); 97 var defaultIcon = OpenLayers.Marker.defaultIcon(); 98 t.delay_call( 1, function() { 99 t.ok(layer.markers[0].icon, "The layer has a icon"); 100 t.eq(layer.markers[0].icon.url, defaultIcon.url, "The layer without icon has the default icon."); 101 t.eq(otherLayer.markers[0].icon.url, the_icon.url,"The layer with an icon has that icon."); 102 }); 103 } 104 85 105 function test_99_Layer_GeoRSS_destroy (t) { 86 106 t.plan( 1 );
