allow for setting opacity of alpha image divs. also give both Icon and Marker setOpacity() functions. added tests and modified examples/markers.html to show how to do it.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1541 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -45,6 +45,32 @@
|
||||
|
||||
}
|
||||
|
||||
function test_02_Marker_setOpacity(t) {
|
||||
t.plan( 2 );
|
||||
|
||||
var map = new OpenLayers.Map("map");
|
||||
|
||||
var url = "http://octo.metacarta.com/cgi-bin/mapserv";
|
||||
layer = new OpenLayers.Layer.WMS(name, url);
|
||||
|
||||
map.addLayer(layer);
|
||||
|
||||
mlayer = new OpenLayers.Layer.Markers('Test Layer');
|
||||
map.addLayer(mlayer);
|
||||
|
||||
map.zoomToExtent(new OpenLayers.Bounds(-50,-50,50,50));
|
||||
|
||||
//onscreen marker
|
||||
var ll = new OpenLayers.LonLat(0,0);
|
||||
var marker = new OpenLayers.Marker(ll);
|
||||
mlayer.addMarker(marker);
|
||||
|
||||
t.ok(!marker.icon.imageDiv.style.opacity, "default marker has no opacity");
|
||||
|
||||
marker.setOpacity(0.5);
|
||||
|
||||
t.eq(marker.icon.imageDiv.style.opacity + "", "0.5", "marker.setOpacity() works");
|
||||
}
|
||||
|
||||
// -->
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user