Changeset 8

Show
Ignore:
Timestamp:
03/25/06 03:34:08 (3 years ago)
Author:
mikel
Message:

new JS functions (JInputComm, JGetItemComm); annotations now obey all styles; hopefully a fix to sitemeter image problems

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • worldkit/com/brainoff/worldkitAnnotation.as

    r7 r8  
    307307        var x = 0; var y = 0; //movie clip is already positioned 
    308308        var s = plotsize; 
    309         mc[clipname].lineStyle( 0, 0x000000, 100 ); 
     309        mc[clipname].lineStyle( linethickness, linecolor, linealpha ); 
    310310        mc[clipname].moveTo(x-s,y-s); 
    311         mc[clipname].beginFill( color ); 
     311        mc[clipname].beginFill( color, fillalpha ); 
    312312        mc[clipname].lineTo(x-s,y+s); 
    313313        mc[clipname].lineTo(x+s,y+s); 
     
    320320        var x = 0; var y = 0; //movie clip is already positioned 
    321321        var s = plotsize; 
    322         mc[clipname].lineStyle( 1, linecolor, linealpha ); 
     322        mc[clipname].lineStyle( linethickness, linecolor, linealpha ); 
    323323        mc[clipname].moveTo(x+s,y); //move to point on the circle to drawArc 
    324         mc[clipname].beginFill( color, 100 ); 
     324        mc[clipname].beginFill( color, fillalpha ); 
    325325        mc[clipname].drawArc(x+s,y,s,360,0); 
    326326        mc[clipname].endFill();  
     
    330330        var x = 0; var y = 0; //movie clip is already positioned 
    331331        var s = plotsize; 
    332         mc[clipname].lineStyle( 1, 0x000000, 100 ); 
     332        mc[clipname].lineStyle( linethickness, linecolor, linealpha ); 
    333333        mc[clipname].moveTo(x /*Math.cos(Math.PI / 2)*/, 
    334334                            y - s /*Math.sin(Math.PI / 2)*/); 
     
    512512        } 
    513513    } 
     514 
     515    public function GetItem():Void { 
     516        var s = "||"; 
     517        var catstring = cats.join(","); 
     518        var coords; 
     519        if (vtype == "poly" || vtype == "line") { 
     520            coords = vector; 
     521        } else { 
     522            coords = String(lat) + "," + String(lon); 
     523        } 
     524        var args = title + s + url + s + summary + s + catstring + s + coords + s + vtype; 
     525        interact.annotate(null,null,args); 
     526    } 
    514527} 
  • worldkit/com/brainoff/worldkitConfig.as

    r7 r8  
    167167 
    168168        activatecolor = new worldkitConfigCat(0xFF0000); 
    169         fillalpha = new worldkitConfigCat(30); 
     169        fillalpha = new worldkitConfigCat(100); 
    170170        icon = new worldkitConfigCat(""); 
    171171        initialplotcolor = new worldkitConfigCat(0xFF0000); 
  • worldkit/com/brainoff/worldkitImages.as

    r7 r8  
    120120 
    121121        mc.createEmptyMovieClip(id, level); 
    122         mc[ id ]._alpha = 0; 
     122        if (bg == 1) { 
     123            mc[ id ]._alpha = 0; 
     124        } 
    123125 
    124126        var image_mcl:MovieClipLoader = new MovieClipLoader(); 
     
    185187        } 
    186188 
    187         if (! imglist[key].bg) { 
    188             target_mc._alpha = 100; 
    189        
     189        //if (! imglist[key].bg) { 
     190        //    target_mc._alpha = 100; 
     191        //
    190192 
    191193        imagesLoading--; 
  • worldkit/com/brainoff/worldkitInteraction.as

    r7 r8  
    523523 
    524524    */ 
    525     public function annotate(x:Number,y:Number):Void { 
    526         var w, h, xoffset=0, yoffset=0; 
    527         if (conf.displaytype == "zoomify") { 
    528             w = conf.w; 
    529             h = conf.h; 
    530         } else { 
    531             if (ratio > 1) { 
    532                 w = 100 * ratio; h = 100; 
    533                 xoffset = (w - h) / 2; 
    534             } else { 
    535                 h = 100 / ratio; w = 100; 
    536                 yoffset = (h - w) / 2; 
    537             } 
    538         } 
    539         var lon = ((x + xoffset)/w) * (ceast - cwest) + cwest; 
    540         var lat = cnorth - ((y + yoffset)/h) * (cnorth - csouth); 
    541          
    542  
    543         var args = "lat=" + lat + "&long=" + lon + "&zoom=" + scale + "&extent=" + cwest + "," + csouth + "," + ceast + "," + cnorth; 
    544          
     525    public function annotate(x:Number,y:Number,args:String):Void { 
     526        if (args == undefined) { 
     527            var w, h, xoffset=0, yoffset=0; 
     528            if (conf.displaytype == "zoomify") { 
     529                w = conf.w; 
     530                h = conf.h; 
     531            } else { 
     532                if (ratio > 1) { 
     533                    w = 100 * ratio; h = 100; 
     534                    xoffset = (w - h) / 2; 
     535                } else { 
     536                    h = 100 / ratio; w = 100; 
     537                    yoffset = (h - w) / 2; 
     538                } 
     539            } 
     540            var lon = ((x + xoffset)/w) * (ceast - cwest) + cwest; 
     541            var lat = cnorth - ((y + yoffset)/h) * (cnorth - csouth); 
     542         
     543            args = "lat=" + lat + "&long=" + lon + "&zoom=" + scale + "&extent=" + cwest + "," + csouth + "," + ceast + "," + cnorth; 
     544        } 
     545 
    545546        if (conf.annotateurl.indexOf("javascript") == 0) { 
    546547            if (conf.fscommand == true) { 
     
    555556 
    556557    } 
    557   
     558     
    558559    public function SetupJavascript():Void { 
    559560        _root.JComm = ""; 
     
    566567        _root.JAnnoComm = ""; 
    567568        _root.JHackComm = ""; 
     569        _root.JInputComm = ""; 
     570        _root.JGetItemComm = ""; 
    568571        _root.watch("JComm",worldkitInteraction.onJavascript,this); 
    569572        _root.watch("JSubComm", worldkitInteraction.onJavascript,this); 
     
    575578        _root.watch("JAnnoComm", worldkitInteraction.onJavascript,this); 
    576579        _root.watch("JHackComm", worldkitInteraction.onJavascript,this); 
     580        _root.watch("JInputComm", worldkitInteraction.onJavascript,this); 
     581        _root.watch("JGetItemComm", worldkitInteraction.onJavascript,this); 
    577582    } 
    578583 
     
    637642        annotate(geo[0], geo[1]); 
    638643    } 
    639  
     644    public function onJInputComm(newVal) { 
     645        var val = false; 
     646        if (newVal == "true") { 
     647            val = true; 
     648        } 
     649        conf.inputonly = val; 
     650        acceptInput = val; 
     651    } 
     652    public function onJGetItemComm(newVal) { 
     653        rss.onJGetItemComm(newVal); 
     654    } 
    640655    public function SetupTimenav():Void { 
    641656        mc.createEmptyMovieClip("timenav",timenavdepth); 
  • worldkit/com/brainoff/worldkitMain.as

    r7 r8  
    77 
    88class com.brainoff.worldkitMain { 
    9     static var version:String = "3.0b-07032006-3"; 
     9    static var version:String = "3.0"; 
    1010 
    1111    var conf:worldkitConfig; 
  • worldkit/com/brainoff/worldkitRSS.as

    r7 r8  
    538538        loader.onLoad(true); 
    539539    } 
     540    public function onJGetItemComm(id:String):Void { 
     541        if (Points[ id ] != undefined) { 
     542            Points[id].GetItem(); 
     543        } 
     544    } 
     545     
    540546}