X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fpres_view_map%2Fvisible.js;fp=plugins%2Fpres_view_map%2Fvisible.js;h=94086fadf0cc3d0e193e051362fe442f7c21331e;hb=a09c116497c4fce2e8e2290e7255a3ec946163be;hp=0000000000000000000000000000000000000000;hpb=96cf681a06ae76e67bb186e5bc02a696a9784c3d;p=unfold.git diff --git a/plugins/pres_view_map/visible.js b/plugins/pres_view_map/visible.js new file mode 100644 index 00000000..94086fad --- /dev/null +++ b/plugins/pres_view_map/visible.js @@ -0,0 +1,83 @@ +/* + + modifie la visibilité des markers si une case est décoché + +*/ + + + +function set_visibility ( v, id, method ) +{ + switch ( method ) + { + case 'static': + if ( typeof(marker[id])!='undefined' ) + { + for ( var i=0 ; i< marker[id].length; i++ ) + { + marker[id][i].setVisible(v); + } + }else if ( typeof(line[id])!='undefined' ){ + { + for ( var i=0 ; i< line[id].length; i++ ) + { + line[id][i].setVisible(v); + } + } + } + else if ( typeof(circle[id])!='undefined' ) { + { + for ( var i=0 ; i < circle[id].length; i++ ) + { + circle[id][i].setVisible(v); + } + } + } + break; + + case 'animation': + if ( opt_marker[id].length != null ) + { + for ( var i=0 ; i< marker[id].length; i++ ) + { + + marker[id][i].setVisible(v); + } + }else if ( line[id].length != null ){ + { + for ( var i=0 ; i< line[id].length; i++ ) + { + line[id][i].setVisible(v); + } + } + } + else if ( circle[id].length != null ) { + { + for ( var i=0 ; i < circle[id].length; i++ ) + { + circle[id][i].setVisible(v); + } + } + } + for ( var i=0 ; i< animation[id].length; i++ ) + { + + clearTimeout ( animation[id][i] ); + } + animation [id] = []; + break; + + default: + + break; + } + +} + +function sup_sites (tab) +{ + for( var i=0; i < tab.length; i++) + { + tab[i].setVisible(false); + } +} \ No newline at end of file