Changeset 4784
- Timestamp:
- 10/03/07 12:17:55 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Icon.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Marker.js (modified) (1 diff)
- trunk/openlayers/tests/test_Marker.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Icon.js
r4110 r4784 107 107 this.draw(); 108 108 }, 109 110 /** 111 * Method: setUrl 112 * 113 * url - {String} 114 */ 115 setUrl: function(url) { 116 if (url != null) { 117 this.url = url; 118 } 119 this.draw(); 120 }, 109 121 110 122 /** trunk/openlayers/lib/OpenLayers/Marker.js
r4110 r4784 172 172 }, 173 173 174 /** 175 * Method: setUrl 176 * Change URL of the Icon Image. 177 * 178 * url - {String} 179 */ 180 setUrl: function(url) { 181 this.icon.setUrl(url); 182 }, 183 174 184 /** 175 185 * Method: display trunk/openlayers/tests/test_Marker.html
r4157 r4784 74 74 map.destroy(); 75 75 } 76 77 function test_03_Marker_setUrl(t) { 78 t.plan( 2 ); 79 80 var map = new OpenLayers.Map("map"); 81 82 var url = "http://octo.metacarta.com/cgi-bin/mapserv"; 83 layer = new OpenLayers.Layer.WMS(name, url); 84 85 map.addLayer(layer); 86 87 mlayer = new OpenLayers.Layer.Markers('Test Layer'); 88 map.addLayer(mlayer); 89 90 map.zoomToExtent(new OpenLayers.Bounds(-50,-50,50,50)); 91 92 //onscreen marker 93 var ll = new OpenLayers.LonLat(0,0); 94 var marker = new OpenLayers.Marker(ll); 95 mlayer.addMarker(marker); 96 97 t.ok(marker.icon.imageDiv.firstChild.src.contains("img/marker.png"), "Marker.png is default URL"); 98 99 marker.setUrl("http://example.com/broken.png"); 100 t.eq(marker.icon.imageDiv.firstChild.src, "http://example.com/broken.png", "image source changes correctly."); 101 102 map.destroy(); 103 } 76 104 77 105 function test_04_Marker_moveTo(t) {
