Changeset 2283 in osm for utils/josm/plugins/ywms/resources
- Timestamp:
- 2007-03-19T12:21:40+01:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
utils/josm/plugins/ywms/resources/ymap.html
r2264 r2283 34 34 window.resizeTo(width,height); 35 35 </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> 37 37 </head> 38 38 … … 62 62 // other map types work as well but only satellite allowed for use with OSM! 63 63 var map = new YMap(document.getElementById("map"), YAHOO_MAP_SAT); 64 map.removeZoomScale(); 64 65 var zac = map.getBestZoomAndCenter(points); 65 66 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); 66 73 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 71 96 var bounds = map.getBoundsLatLon(); 72 97 73 98 // Dumps the actual bounding box 74 99 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"); 75 102 } 76 103 </script>
Note:
See TracChangeset
for help on using the changeset viewer.