Changeset 2121

Show
Ignore:
Timestamp:
11/28/07 17:52:00 (6 years ago)
Author:
gyuque
Message:

lang/ruby/RubyESRIShape: updated test script and data

Location:
lang/ruby/RubyESRIShape/test/shape-test
Files:
3 added
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/RubyESRIShape/test/shape-test/sample/jsonp_map.html

    r2115 r2121  
    2222        font-weight: bold; 
    2323        color: #000; 
     24} 
     25 
     26.pref-name { 
     27        display: block; 
     28        text-align: center; 
     29        width: 160px; 
     30        color: #666; 
     31        text-shadow: 1px 1px 2px #fff; 
    2432} 
    2533 
  • lang/ruby/RubyESRIShape/test/shape-test/sample/jsonp_map.js

    r2118 r2121  
    44 
    55var JSONP_files = [ 
     6        "./pref_points.jsonp", 
    67        "./japan_1.jsonp", 
    78        "./japan_2.jsonp", 
     
    1819]; 
    1920 
    20 var ShapeColors = {"bnda_1_1": "#897", "trans_rails": "#007", "transp_1_1": "#259"}; 
    21 var ShapeWidths = {"bnda_1_1": 0.5, "trans_rails": 1, "transp_1_1": 1}; 
    22 var ShapeFillColors = {"bnda_1_1": "#eeffe0", "trans_rails": null, "transp_1_1": null}; 
     21var ShapeColors = {"pref_points": null, "bnda_1_1": "#897", "trans_rails": "#007", "transp_1_1": "#259"}; 
     22var ShapeWidths = {"pref_points": null, "bnda_1_1": 0.5, "trans_rails": 1, "transp_1_1": 1}; 
     23var ShapeFillColors = {"pref_points": null, "bnda_1_1": "#eeffe0", "trans_rails": null, "transp_1_1": null}; 
    2324 
    2425var OUT; 
    2526var AirportIcon; 
    2627var AirportLabel; 
     28var PrefLabel; 
    2729 
    2830var Params; 
     
    184186                                if (sx < this.width && sx >= 0 && sy < this.height && sy >= 0) 
    185187                                { 
    186                                         this.g.drawImage(AirportIcon, Math.floor(sx) - 10, Math.floor(sy) - 10); 
    187                                         AirportLabel.create(dat.name, sx + 15, sy - 5, 10, "airport-name"); 
     188                                        if (ShapeName == "pref_points") 
     189                                        { 
     190                                                PrefLabel.create(dat.name, sx-80, sy - 5, 14, "pref-name"); 
     191                                        } 
     192                                        else 
     193                                        { 
     194                                                this.g.drawImage(AirportIcon, Math.floor(sx) - 10, Math.floor(sy) - 10); 
     195                                                AirportLabel.create(dat.name, sx + 15, sy - 5, 10, "airport-name"); 
     196                                        } 
    188197                                } 
    189198                        } 
     
    275284        document.getElementById("theCanvas").style.background = "#f0f2ff"; 
    276285        AirportLabel = new HTMLLabel(document.body, document.getElementById("theCanvas")); 
     286        PrefLabel = new HTMLLabel(document.body, document.getElementById("theCanvas")); 
    277287 
    278288        OUT = new DebugOut();