Changeset 2096 in osm for utils/josm/plugins
- Timestamp:
- 2007-02-11T14:38:45+01:00 (18 years ago)
- Location:
- utils/josm/plugins/landsat/src/landsat
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
utils/josm/plugins/landsat/src/landsat/LandsatPlugin.java
r1566 r2096 28 28 "New Popular Edition maps - " + 29 29 "see npemap.org.uk for conditions of use"); 30 31 /* can now do these always 30 32 task.setEnabled(false); 31 33 npeTask.setEnabled(false); 34 */ 32 35 Main.main.menu.download.downloadTasks.add(task); 33 36 Main.main.menu.download.downloadTasks.add(npeTask); … … 35 38 36 39 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 40 /* don't do anything now 37 41 if(oldFrame==null && newFrame!=null) { 38 42 task.setEnabled(true); … … 54 58 npeTask.setEnabled(false); 55 59 } 60 */ 56 61 } 57 62 } -
utils/josm/plugins/landsat/src/landsat/OSGBLayer.java
r1567 r2096 15 15 throws IOException { 16 16 MapView mv = Main.map.mapView; 17 initMapView(mv); 17 18 OSGBImage npeImage = new OSGBImage(url); 18 19 npeImage.grab(mv,minlat,minlon,maxlat,maxlon); -
utils/josm/plugins/landsat/src/landsat/WMSLayer.java
r1567 r2096 65 65 { 66 66 MapView mv = Main.map.mapView; 67 initMapView(mv); 67 68 WMSImage wmsImage = new WMSImage(url); 68 69 wmsImage.grab(mv,minlat,minlon,maxlat,maxlon); 69 70 wmsImages.add(wmsImage); 71 } 72 73 protected void initMapView(MapView mv) 74 { 75 // If there is no data we need to initialise the centre and scale 76 // of the map view, so that we can display the Landsat/OSGB image. 77 // To do this, we centre the map in the centre point of the requested 78 // data, and set the scale so that the requested data is just 79 // completely within the visible area, even if it's a non-square area. 80 81 if(mv.getCenter()==null) 82 { 83 EastNorth centre = Main.proj.latlon2eastNorth 84 (new LatLon(minlat+(maxlat-minlat)/2 , 85 minlon+(maxlon-minlon)/2)), 86 oldBottomLeft = Main.proj.latlon2eastNorth 87 (new LatLon(minlat,minlon)), 88 oldTopRight = Main.proj.latlon2eastNorth 89 (new LatLon(maxlat,maxlon)), 90 bottomLeft, 91 topRight; 92 93 if(oldTopRight.north-oldBottomLeft.north < 94 oldTopRight.east-oldBottomLeft.east) 95 { 96 bottomLeft = new EastNorth 97 ( oldBottomLeft.east(), centre.north() - 98 (oldTopRight.east()-oldBottomLeft.east()/2); 99 topRight = new EastNorth 100 ( oldTopRight.east(), centre.north() + 101 (oldTopRight.east()-oldBottomLeft.east()/2); 102 } 103 else 104 { 105 bottomLeft = new EastNorth 106 ( centre.east() - 107 (oldTopRight.north()-oldBottomLeft.north()/2), 108 oldBottomLeft.north() ); 109 topRight = new EastNorth 110 ( centre.east() + 111 (oldTopRight.north()-oldBottomLeft.north()/2), 112 oldTopRight.north() ); 113 } 114 115 // scale is enPerPixel 116 double scale = (topRight.east()-bottomLeft.east())/ 117 mapView.getWidth(); 118 mv.zoomTo(centre,scale); 119 } 70 120 } 71 121
Note:
See TracChangeset
for help on using the changeset viewer.