Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java	(revision 28660)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java	(revision 29531)
@@ -232,9 +232,9 @@
 
             // Position image at the right graphical place
-            EastNorth center = Main.map.mapView.getCenter();
-            EastNorth leftop = Main.map.mapView.getEastNorth( 0, 0 );
+            EastNorth center = mv.getCenter();
+            EastNorth leftop = mv.getEastNorth( 0, 0 );
             // Number of pixels for one unit in east north space.
             // This is the same in x- and y- direction.
-            double pixel_per_en = ( Main.map.mapView.getWidth() / 2.0 ) / ( center.east() - leftop.east() );
+            double pixel_per_en = ( mv.getWidth() / 2.0 ) / ( center.east() - leftop.east() );
 
             //     This is now the offset in screen pixels
@@ -258,5 +258,5 @@
 
             // Draw additional rectangle for the active pic layer
-            if ( Main.map.mapView.getActiveLayer() == this ) {
+            if ( mv.getActiveLayer() == this ) {
                 g.setColor( new Color( 0xFF0000 ) );
                 g.drawRect(
