Ignore:
Timestamp:
2008-10-13T16:38:49+02:00 (16 years ago)
Author:
stoecker
Message:

some fixes

Location:
applications/editors/josm/plugins/wmsplugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wmsplugin/resources/ymap.html

    r11085 r11172  
    22  <head>
    33    <script type="text/javascript">
    4                 //var bbox = "";
    5         //var width  = 800;
    6         //var height = 800;
    7 
    8                 // Parse query string and set variables
    9                 var url = location.href;
     4        // Parse query string and set variables
     5        var url = location.href;
    106        var queryStringPos = url.indexOf("?");
    11                 if( queryStringPos != -1 )
     7        if( queryStringPos != -1 )
    128        {
    139            url = url.substring(queryStringPos + 1);
    14                 var variables = url.split ("&");
     10            var variables = url.split ("&");
    1511            for (i = 0; i < variables.length; i++)
    1612            {
    17                 if( !variables[i] )
    18                         continue;
     13                if( !variables[i] )
     14                    continue;
    1915                var keyValue = variables[i].split("=");
    2016                eval ('var '+keyValue[0].toLowerCase()+'="'+keyValue[1]+'"');
     
    2521            dump("YWMS ERROR: no queryString\n");
    2622        }
    27        
    28         // Limit size to current window's, to avoid memory problems
    29         //width = Math.min(width, screen.width);
    30         //height = Math.min(height, screen.height);
    31        
    3223    </script>
    3324    <script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=z7qRk3_V34HAbY_SkC7u7GAgG5nDTblw.cuL1OS5LWGwkIIUeGjg4qsnJDPpmhoF"></script>
    3425  </head>
    35  
     26
    3627  <body style="margin: 0px">
    3728    <div id="map"></div>
     
    6051        var zac = map.getBestZoomAndCenter(points);
    6152        var level = zac.zoomLevel;
    62          
     53
    6354        // funny Yahoo bug seems to return 0 if your section is too small
    6455        if( level == 0 ) level = 1;
     
    7465        cx = map.convertXYLatLon(new YCoordPoint((xy0.x+xy1.x)/2, (xy0.y+xy1.y)/2));
    7566        map.drawZoomAndCenter(cx,level)
    76      
     67
    7768        // Create a new size for the map. This makes the need of clipping the image unnecessary.
    7869        new_width  = Math.abs( xy0.x - xy1.x);
    7970        new_height = Math.abs( xy0.y - xy1.y);
    80        
     71
    8172        // Apply the new width-height
     73        map.resizeTo( new YSize(new_width, new_height));
    8274        mapDiv.style.width  = new_width;
    8375        mapDiv.style.height = new_height;
    84         map.resizeTo( new YSize(new_width, new_height));
    8576        window.moveTo(0,0);
    8677        window.resizeTo(new_width, new_height);
    87 
    88 
    89          
    90         /*
    91         /// DEBUG: colour the interesting area
    92         var cPT2 = new YGeoPoint(tllat, tllon);
    93         var cPT3 = new YGeoPoint(tllat, brlon);
    94         var cPT4 = new YGeoPoint(brlat, brlon);
    95         var cPT5 = new YGeoPoint(brlat, tllon);
    96         // args: array of pts, color, width, alpha
    97         var poly1 = new YPolyline([cPT2,cPT3,cPT4,cPT5, cPT2],'blue',7,0.7);
    98         map.addOverlay(poly1);
    99         */
    10078      }
    10179    </script>
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java

    r11084 r11172  
    7373        public WMSLayer(String name, String baseURL) {
    7474                super(name);
    75                 boolean background = true;
     75                background = true; /* set global background variable */
    7676                initializeImages();
    7777                this.baseURL = baseURL;
Note: See TracChangeset for help on using the changeset viewer.