Ignore:
Timestamp:
2007-03-19T12:21:40+01:00 (18 years ago)
Author:
frsantos
Message:

Keep Yahoo logo in images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/josm/plugins/ywms/resources/ymap.html

    r2264 r2283  
    3434        window.resizeTo(width,height);
    3535    </script>
    36     <script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=YahooDemo"></script>
     36    <script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.4&appid=z7qRk3_V34HAbY_SkC7u7GAgG5nDTblw.cuL1OS5LWGwkIIUeGjg4qsnJDPpmhoF"></script>
    3737  </head>
    3838 
     
    6262          // other map types work as well but only satellite allowed for use with OSM!
    6363          var map = new YMap(document.getElementById("map"), YAHOO_MAP_SAT);
     64          map.removeZoomScale();
    6465          var zac = map.getBestZoomAndCenter(points);
    6566          var level = zac.zoomLevel;
     67           
     68           // funny Yahoo bug seems to return 0 if your section is too small
     69           if( level == 0 ) level = 1;
     70           if (level>1) level--;
     71           
     72           map.drawZoomAndCenter(zac.YGeoPoint,level);
    6673
    67           // funny Yahoo bug seems to return 0 if your section is too small
    68           if (level==0) level=1;
    69 
    70           map.drawZoomAndCenter(zac.YGeoPoint,level);
     74                  // Get the on-screen coordinates of the points
     75                  xy0 = map.convertLatLonXY(points[0]);
     76                  xy1 = map.convertLatLonXY(points[1]);
     77                 
     78                  // Create a new size for the map. This makes the need of clipping the image unnecesary.
     79                  new_width  = Math.abs( xy0.x - xy1.x);
     80                  new_height = Math.abs( xy0.y - xy1.y);
     81                 
     82                  // Apply the new width-height
     83          mapDiv.style.width  = new_width;
     84          mapDiv.style.height = new_height;
     85          map.resizeTo( new YSize(new_width, new_height));
     86         
     87                  /// DEBUG: colour the interesting area
     88                  var cPT2 = new YGeoPoint(tllat, tllon);
     89                  var cPT3 = new YGeoPoint(tllat, brlon);
     90                  var cPT4 = new YGeoPoint(brlat, brlon);
     91                  var cPT5 = new YGeoPoint(brlat, tllon);
     92                  // args: array of pts, color, width, alpha
     93                  var poly1 = new YPolyline([cPT2,cPT3,cPT4,cPT5, cPT2],'blue',7,0.7);
     94                  //map.addOverlay(poly1);
     95                 
    7196          var bounds = map.getBoundsLatLon();
    7297
    7398          // Dumps the actual bounding box
    7499          dump("bbox=" + bounds.LonMin + "," + bounds.LatMin + "," + bounds.LonMax + "," + bounds.LatMax + "\n");
     100          dump("new_width=" + new_width + "\n");
     101          dump("new_height=" + new_height + "\n");
    75102      }
    76103    </script>
Note: See TracChangeset for help on using the changeset viewer.