Index: /applications/editors/josm/plugins/smed2/src/s57/S57val.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/s57/S57val.java	(revision 29171)
+++ /applications/editors/josm/plugins/smed2/src/s57/S57val.java	(revision 29172)
@@ -1052,5 +1052,5 @@
 		keys.put(Att.VALMXR, new S57key(Conv.F, null)); keys.put(Att.VALNMR, new S57key(Conv.F, null)); keys.put(Att.VALSOU, new S57key(Conv.F, null));
 		keys.put(Att.VERACC, new S57key(Conv.F, null)); keys.put(Att.VERCLR, new S57key(Conv.F, null)); keys.put(Att.VERCCL, new S57key(Conv.F, null));
-		keys.put(Att.VERCOP, new S57key(Conv.F, null)); keys.put(Att.VERCSA, new S57key(Conv.F, null)); keys.put(Att.VERDAT, new S57key(Conv.E, null));
+		keys.put(Att.VERCOP, new S57key(Conv.F, null)); keys.put(Att.VERCSA, new S57key(Conv.F, null)); keys.put(Att.VERDAT, new S57key(Conv.E, Verdat));
 		keys.put(Att.VERLEN, new S57key(Conv.F, null)); keys.put(Att.WATLEV, new S57key(Conv.E, Watlev)); keys.put(Att.CAT_TS, new S57key(Conv.E, Cat_ts));
 		keys.put(Att.PUNITS, new S57key(Conv.E, Punits)); keys.put(Att.NINFOM, new S57key(Conv.S, null)); keys.put(Att.NOBJNM, new S57key(Conv.S, null));
@@ -1134,33 +1134,46 @@
 		return "";
 	}
-	
-	public static Enum<?> enumValue(String val, Att att) {           // Convert OSeaM attribute value string to OSeaM enumeration
+
+	public static Enum<?> enumValue(String val, Att att) { // Convert OSeaM attribute value string to OSeaM enumeration
 		EnumMap<?, ?> map = keys.get(att).map;
 		Enum<?> unkn = null;
-		for (Object item : map.keySet()) {
-			if (unkn == null) unkn = (Enum<?>)item;
-			if (((S57enum)map.get(item)).val.equals(val))
-				return (Enum<?>)item;
+		if (map != null) {
+			for (Object item : map.keySet()) {
+				if (unkn == null)
+					unkn = (Enum<?>) item;
+				if (((S57enum) map.get(item)).val.equals(val))
+					return (Enum<?>) item;
+			}
 		}
 		return unkn;
 	}
-	
-	public static AttVal convertValue(String val, Att att) {         // Convert OSeaM attribute value string to OSeaM value struct
+
+	public static AttVal convertValue(String val, Att att) { 				// Convert OSeaM attribute value string to OSeaM value struct
 		switch (keys.get(att).conv) {
 		case A:
 		case S:
-			return new AttVal(att, keys.get(att).conv, val);
+			return new AttVal(att, Conv.S, val);
 		case E:
-				return new AttVal(att, keys.get(att).conv, enumValue(val, att));
+			return new AttVal(att, Conv.E, enumValue(val, att));
 		case L:
-			ArrayList list = new ArrayList();
+			ArrayList<Enum<?>> list = new ArrayList<Enum<?>>();
 			for (String item : val.split(";")) {
 				list.add(enumValue(item, att));
 			}
-			return new AttVal(att, keys.get(att).conv, list);
+			return new AttVal(att, Conv.L, list);
 		case I:
-			return new AttVal(att, keys.get(att).conv, Integer.parseInt(val));
+			try {
+				long i = Long.parseLong(val);
+				return new AttVal(att, Conv.I, i);
+			} catch (Exception e) {
+				break;
+			}
 		case F:
-			return new AttVal(att, keys.get(att).conv, Float.parseFloat(val));
+			try {
+				double f = Double.parseDouble(val);
+				return new AttVal(att, Conv.F, f);
+			} catch (Exception e) {
+				break;
+			}
 		}
 		return new AttVal(att, keys.get(att).conv, null);
Index: plications/editors/josm/plugins/smed2/src/seamap/Map.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/Map.java	(revision 29171)
+++ 	(revision )
@@ -1,160 +1,0 @@
-/* Copyright 2012 Malcolm Herring
- *
- * This is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.
- */
-
-package seamap;
-
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.HashMap;
-
-import s57.S57att;
-import s57.S57att.*;
-import s57.S57obj;
-import s57.S57obj.*;
-import s57.S57val;
-import s57.S57val.*;
-
-public class Map {
-
-	public enum Fflag {
-		UNKN, NODE, WAY, AREA
-	}
-
-	public class AttItem {
-		Conv conv;
-		Object val;
-
-		AttItem(Conv iconv, Object ival) {
-			conv = iconv;
-			val = ival;
-		}
-	}
-
-	public class Feature {
-		public Fflag flag;
-		public long refs;
-		public Obj type;
-		public EnumMap<Att, AttItem> atts;
-		public EnumMap<Obj, HashMap<Integer, EnumMap<Att, AttItem>>> objs;
-
-		Feature() {
-			flag = Fflag.UNKN;
-			refs = 0;
-			type = Obj.UNKOBJ;
-			atts = new EnumMap<Att, AttItem>(Att.class);
-			objs = new EnumMap<Obj, HashMap<Integer, EnumMap<Att, AttItem>>>(Obj.class);
-		}
-	}
-
-	public class Coord {
-		double lat;
-		double lon;
-
-		Coord(double ilat, double ilon) {
-			lat = ilat;
-			lon = ilon;
-		}
-	}
-
-	public HashMap<Long, Coord> nodes;
-	public HashMap<Long, ArrayList<Long>> ways;
-	public HashMap<Long, ArrayList<Long>> mpolys;
-	public HashMap<Long, Feature> features;
-
-	private Feature feature;
-	private ArrayList<Long> list;
-
-	public Map() {
-		nodes = new HashMap<Long, Coord>();
-		ways = new HashMap<Long, ArrayList<Long>>();
-		mpolys = new HashMap<Long, ArrayList<Long>>();
-		feature = new Feature();
-		features = new HashMap<Long, Feature>();
-	}
-
-	public void addNode(long id, double lat, double lon) {
-		nodes.put(id, new Coord(lat, lon));
-		feature = new Feature();
-		feature.refs = id;
-		feature.flag = Fflag.NODE;
-	}
-
-	public void addWay(long id) {
-		list = new ArrayList<Long>();
-		ways.put(id, list);
-		feature = new Feature();
-		feature.refs = id;
-		feature.flag = Fflag.WAY;
-	}
-
-	public void addMpoly(long id) {
-		list = new ArrayList<Long>();
-		mpolys.put(id, list);
-	}
-
-	public void addToWay(long node) {
-		list.add(node);
-	}
-
-	public void addToMpoly(long way, boolean outer) {
-		if (outer)
-			list.add(0, way);
-		else
-			list.add(way);
-	}
-
-	public void tagsDone() {
-		if (feature.type != Obj.UNKOBJ) {
-			if ((feature.flag == Fflag.WAY) && (list.size() > 0) && (list.get(0) == list.get(list.size() - 1))) {
-				feature.flag = Fflag.AREA;
-			}
-			features.put(feature.refs, feature);
-		}
-	}
-
-	public void addTag(String key, String val) {
-		String subkeys[] = key.split(":");
-		if ((subkeys.length > 1) && subkeys[0].equals("seamark")) {
-			Obj obj = S57obj.enumType(subkeys[1]);
-			if ((subkeys.length > 2) && (obj != Obj.UNKOBJ)) {
-				int idx = 0;
-				Att att = Att.UNKATT;
-				try {
-					idx = Integer.parseInt(subkeys[2]);
-					if (subkeys.length == 4) {
-						att = s57.S57att.enumAttribute(subkeys[3], obj);
-					}
-				} catch (Exception e) {
-					att = S57att.enumAttribute(subkeys[2], obj);
-				}
-				HashMap<Integer, EnumMap<Att, AttItem>> items = feature.objs.get(obj);
-				if (items == null) {
-					items = new HashMap<Integer, EnumMap<Att, AttItem>>();
-					feature.objs.put(obj, items);
-				}
-				EnumMap<Att, AttItem> atts = items.get(idx);
-				if (atts == null) {
-					atts = new EnumMap<Att, AttItem>(Att.class);
-				}
-				AttVal attval = S57val.convertValue(val, att);
-				atts.put(att, new AttItem(attval.conv, attval.val));
-			} else {
-				if (subkeys[1].equals("type")) {
-					feature.type = S57obj.enumType(val);
-				} else {
-					Att att = S57att.enumAttribute(subkeys[1], Obj.UNKOBJ);
-					if (att != Att.UNKATT) {
-						AttVal attval = S57val.convertValue(val, att);
-						feature.atts.put(att, new AttItem(attval.conv, attval.val));
-					}
-				}
-			}
-		}
-	}
-}
Index: /applications/editors/josm/plugins/smed2/src/seamap/Rules.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/Rules.java	(revision 29171)
+++ /applications/editors/josm/plugins/smed2/src/seamap/Rules.java	(revision 29172)
@@ -10,5 +10,103 @@
 package seamap;
 
+import s57.S57obj.Obj;
+import seamap.SeaMap.Feature;
+
 public class Rules {
 
+	public static void MainRules (SeaMap map) {
+		for (Feature feature : map.features.get(Obj.SLCONS)) shoreline(feature);
+		for (Feature feature : map.features.get(Obj.PIPSOL)) pipelines(feature);
+		for (Feature feature : map.features.get(Obj.CBLSUB)) cables(feature);
+		for (Feature feature : map.features.get(Obj.PIPOHD)) pipelines(feature);
+		for (Feature feature : map.features.get(Obj.CBLOHD)) cables(feature);
+		for (Feature feature : map.features.get(Obj.TSEZNE)) separation(feature);
+		for (Feature feature : map.features.get(Obj.TSSCRS)) separation(feature);
+		for (Feature feature : map.features.get(Obj.TSSRON)) separation(feature);
+		for (Feature feature : map.features.get(Obj.TSELNE)) separation(feature);
+		for (Feature feature : map.features.get(Obj.TSSLPT)) separation(feature);
+		for (Feature feature : map.features.get(Obj.TSSBND)) separation(feature);
+		for (Feature feature : map.features.get(Obj.SNDWAV)) areas(feature);
+		for (Feature feature : map.features.get(Obj.OSPARE)) areas(feature);
+		for (Feature feature : map.features.get(Obj.FAIRWY)) areas(feature);
+		for (Feature feature : map.features.get(Obj.DRGARE)) areas(feature);
+		for (Feature feature : map.features.get(Obj.RESARE)) areas(feature);
+		for (Feature feature : map.features.get(Obj.SPLARE)) areas(feature);
+		for (Feature feature : map.features.get(Obj.SEAARE)) areas(feature);
+		for (Feature feature : map.features.get(Obj.OBSTRN)) obstructions(feature);
+		for (Feature feature : map.features.get(Obj.UWTROC)) obstructions(feature);
+		for (Feature feature : map.features.get(Obj.MARCUL)) areas(feature);
+		for (Feature feature : map.features.get(Obj.WTWAXS)) waterways(feature);
+		for (Feature feature : map.features.get(Obj.RECTRC)) transits(feature);
+		for (Feature feature : map.features.get(Obj.NAVLNE)) transits(feature);
+		for (Feature feature : map.features.get(Obj.HRBFAC)) harbours(feature);
+		for (Feature feature : map.features.get(Obj.ACHARE)) harbours(feature);
+		for (Feature feature : map.features.get(Obj.ACHBRT)) harbours(feature);
+		for (Feature feature : map.features.get(Obj.LOKBSN)) locks(feature);
+		for (Feature feature : map.features.get(Obj.LKBSPT)) locks(feature);
+		for (Feature feature : map.features.get(Obj.GATCON)) locks(feature);
+		for (Feature feature : map.features.get(Obj.DISMAR)) distances(feature);
+		for (Feature feature : map.features.get(Obj.HULKES)) ports(feature);
+		for (Feature feature : map.features.get(Obj.CRANES)) ports(feature);
+		for (Feature feature : map.features.get(Obj.LNDMRK)) landmarks(feature);
+		for (Feature feature : map.features.get(Obj.MORFAC)) moorings(feature);
+		for (Feature feature : map.features.get(Obj.NOTMRK)) notices(feature);
+		for (Feature feature : map.features.get(Obj.SMCFAC)) marinas(feature);
+		for (Feature feature : map.features.get(Obj.BRIDGE)) bridges(feature);
+		for (Feature feature : map.features.get(Obj.LITMAJ)) lights(feature);
+		for (Feature feature : map.features.get(Obj.LITMIN)) lights(feature);
+		for (Feature feature : map.features.get(Obj.LIGHTS)) lights(feature);
+		for (Feature feature : map.features.get(Obj.SISTAT)) signals(feature);
+		for (Feature feature : map.features.get(Obj.SISTAW)) signals(feature);
+		for (Feature feature : map.features.get(Obj.CGUSTA)) signals(feature);
+		for (Feature feature : map.features.get(Obj.RDOSTA)) signals(feature);
+		for (Feature feature : map.features.get(Obj.RADSTA)) signals(feature);
+		for (Feature feature : map.features.get(Obj.RSCSTA)) signals(feature);
+		for (Feature feature : map.features.get(Obj.PILBOP)) signals(feature);
+		for (Feature feature : map.features.get(Obj.WTWGAG)) gauges(feature);
+		for (Feature feature : map.features.get(Obj.OFSPLF)) platforms(feature);
+		for (Feature feature : map.features.get(Obj.WRECKS)) wrecks(feature);
+		for (Feature feature : map.features.get(Obj.LITVES)) floats(feature);
+		for (Feature feature : map.features.get(Obj.LITFLT)) floats(feature);
+		for (Feature feature : map.features.get(Obj.BOYINB)) floats(feature);
+		for (Feature feature : map.features.get(Obj.BOYLAT)) buoys(feature);
+		for (Feature feature : map.features.get(Obj.BOYCAR)) buoys(feature);
+		for (Feature feature : map.features.get(Obj.BOYISD)) buoys(feature);
+		for (Feature feature : map.features.get(Obj.BOYSAW)) buoys(feature);
+		for (Feature feature : map.features.get(Obj.BOYSPP)) buoys(feature);
+		for (Feature feature : map.features.get(Obj.BOYWTW)) buoys(feature);
+		for (Feature feature : map.features.get(Obj.BCNLAT)) beacons(feature);
+		for (Feature feature : map.features.get(Obj.BCNCAR)) beacons(feature);
+		for (Feature feature : map.features.get(Obj.BCNISD)) beacons(feature);
+		for (Feature feature : map.features.get(Obj.BCNSAW)) beacons(feature);
+		for (Feature feature : map.features.get(Obj.BCNSPP)) beacons(feature);
+		for (Feature feature : map.features.get(Obj.BCNWTW)) beacons(feature);
+	}
+	
+	private static void shoreline(Feature feature) {}
+	private static void pipelines(Feature feature) {}
+	private static void cables(Feature feature) {}
+	private static void separation(Feature feature) {}
+	private static void areas(Feature feature) {}
+	private static void obstructions(Feature feature) {}
+	private static void waterways(Feature feature) {}
+	private static void transits(Feature feature) {}
+	private static void harbours(Feature feature) {}
+	private static void locks(Feature feature) {}
+	private static void distances(Feature feature) {}
+	private static void ports(Feature feature) {}
+	private static void landmarks(Feature feature) {}
+	private static void moorings(Feature feature) {}
+	private static void notices(Feature feature) {}
+	private static void marinas(Feature feature) {}
+	private static void bridges(Feature feature) {}
+	private static void lights(Feature feature) {}
+	private static void floats(Feature feature) {}
+	private static void signals(Feature feature) {}
+	private static void wrecks(Feature feature) {}
+	private static void gauges(Feature feature) {}
+	private static void platforms(Feature feature) {}
+	private static void buoys(Feature feature) {}
+	private static void beacons(Feature feature) {}
+
 }
Index: /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java	(revision 29172)
+++ /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java	(revision 29172)
@@ -0,0 +1,167 @@
+/* Copyright 2012 Malcolm Herring
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.
+ */
+
+package seamap;
+
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.HashMap;
+
+import s57.S57att;
+import s57.S57att.*;
+import s57.S57obj;
+import s57.S57obj.*;
+import s57.S57val;
+import s57.S57val.*;
+
+public class SeaMap {
+
+	public enum Fflag {
+		UNKN, NODE, WAY, AREA
+	}
+
+	public class AttItem {
+		Conv conv;
+		Object val;
+
+		AttItem(Conv iconv, Object ival) {
+			conv = iconv;
+			val = ival;
+		}
+	}
+
+	public class Feature {
+		public Fflag flag;
+		public long refs;
+		public Obj type;
+		public EnumMap<Att, AttItem> atts;
+		public EnumMap<Obj, HashMap<Integer, EnumMap<Att, AttItem>>> objs;
+
+		Feature() {
+			flag = Fflag.UNKN;
+			refs = 0;
+			type = Obj.UNKOBJ;
+			atts = new EnumMap<Att, AttItem>(Att.class);
+			objs = new EnumMap<Obj, HashMap<Integer, EnumMap<Att, AttItem>>>(Obj.class);
+		}
+	}
+
+	public class Coord {
+		double lat;
+		double lon;
+
+		Coord(double ilat, double ilon) {
+			lat = ilat;
+			lon = ilon;
+		}
+	}
+
+	public HashMap<Long, Coord> nodes;
+	public HashMap<Long, ArrayList<Long>> ways;
+	public HashMap<Long, ArrayList<Long>> mpolys;
+	public EnumMap<Obj, ArrayList<Feature>> features;
+	public double minlat;
+	public double minlon;
+	public double maxlat;
+	public double maxlon;
+
+	private Feature feature;
+	private ArrayList<Long> list;
+
+	public SeaMap() {
+		nodes = new HashMap<Long, Coord>();
+		ways = new HashMap<Long, ArrayList<Long>>();
+		mpolys = new HashMap<Long, ArrayList<Long>>();
+		feature = new Feature();
+		features = new EnumMap<Obj, ArrayList<Feature>>(Obj.class);
+	}
+
+	public void addNode(long id, double lat, double lon) {
+		nodes.put(id, new Coord(lat, lon));
+		feature = new Feature();
+		feature.refs = id;
+		feature.flag = Fflag.NODE;
+	}
+
+	public void addWay(long id) {
+		list = new ArrayList<Long>();
+		ways.put(id, list);
+		feature = new Feature();
+		feature.refs = id;
+		feature.flag = Fflag.WAY;
+	}
+
+	public void addMpoly(long id) {
+		list = new ArrayList<Long>();
+		mpolys.put(id, list);
+	}
+
+	public void addToWay(long node) {
+		list.add(node);
+	}
+
+	public void addToMpoly(long way, boolean outer) {
+		if (outer)
+			list.add(0, way);
+		else
+			list.add(way);
+	}
+
+	public void tagsDone() {
+		if (feature.type != Obj.UNKOBJ) {
+			if ((feature.flag == Fflag.WAY) && (list.size() > 0) && (list.get(0) == list.get(list.size() - 1))) {
+				feature.flag = Fflag.AREA;
+			}
+			if (features.get(feature.type) == null) {
+				features.put(feature.type, new ArrayList<Feature>());
+			}
+			features.get(feature.type).add(feature);
+		}
+	}
+
+	public void addTag(String key, String val) {
+		String subkeys[] = key.split(":");
+		if ((subkeys.length > 1) && subkeys[0].equals("seamark")) {
+			Obj obj = S57obj.enumType(subkeys[1]);
+			if ((subkeys.length > 2) && (obj != Obj.UNKOBJ)) {
+				int idx = 0;
+				Att att = Att.UNKATT;
+				try {
+					idx = Integer.parseInt(subkeys[2]);
+					if (subkeys.length == 4) {
+						att = s57.S57att.enumAttribute(subkeys[3], obj);
+					}
+				} catch (Exception e) {
+					att = S57att.enumAttribute(subkeys[2], obj);
+				}
+				HashMap<Integer, EnumMap<Att, AttItem>> items = feature.objs.get(obj);
+				if (items == null) {
+					items = new HashMap<Integer, EnumMap<Att, AttItem>>();
+					feature.objs.put(obj, items);
+				}
+				EnumMap<Att, AttItem> atts = items.get(idx);
+				if (atts == null) {
+					atts = new EnumMap<Att, AttItem>(Att.class);
+				}
+				AttVal attval = S57val.convertValue(val, att);
+				if (attval.val != null) atts.put(att, new AttItem(attval.conv, attval.val));
+			} else {
+				if (subkeys[1].equals("type")) {
+					feature.type = S57obj.enumType(val);
+				} else {
+					Att att = S57att.enumAttribute(subkeys[1], Obj.UNKOBJ);
+					if (att != Att.UNKATT) {
+						AttVal attval = S57val.convertValue(val, att);
+						if (attval.val != null) feature.atts.put(att, new AttItem(attval.conv, attval.val));
+					}
+				}
+			}
+		}
+	}
+}
Index: /applications/editors/josm/plugins/smed2/src/smed2/MapImage.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/smed2/MapImage.java	(revision 29172)
+++ /applications/editors/josm/plugins/smed2/src/smed2/MapImage.java	(revision 29172)
@@ -0,0 +1,65 @@
+package smed2;
+
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+
+import javax.swing.Action;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.imagery.ImageryInfo;
+import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
+import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener;
+import org.openstreetmap.josm.gui.layer.ImageryLayer;
+
+import seamap.SeaMap;
+import symbols.Symbols;
+import symbols.Buoys;
+
+public class MapImage extends ImageryLayer implements ZoomChangeListener {
+
+	private SeaMap mapdata;
+	private int zoom;
+	
+	public MapImage(ImageryInfo info, SeaMap map) {
+		super(info);
+		MapView.addZoomChangeListener(this);
+	}
+	
+	@Override
+	public void destroy() {
+		MapView.removeZoomChangeListener(this);
+		super.destroy();
+	}
+	
+	@Override
+	public Action[] getMenuEntries() {
+		return null;
+	}
+
+	@Override
+	public String getToolTipText() {
+		return null;
+	}
+
+	@Override
+	public void visitBoundingBox(BoundingXYVisitor arg0) {
+	}
+
+	@Override
+	public void paint(Graphics2D g2, MapView mv, Bounds bb) {
+		double scale = Symbols.symbolScale[zoom]*Math.pow(2, (zoom-12));
+		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
+		Symbols.drawSymbol(g2, Buoys.Pillar, scale, 768, 768, null, null);
+		g2.drawString(String.valueOf(zoom), 768, 800);
+	}
+
+	@Override
+	public void zoomChanged() {
+		Bounds bounds = Main.map.mapView.getRealBounds();
+		zoom = ((int)Math.min(18, Math.max(9, Math.round(Math.floor(Math.log(4096/bounds.asRect().width)/Math.log(2))))));
+	}
+
+}
Index: /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java	(revision 29171)
+++ /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java	(revision 29172)
@@ -12,6 +12,6 @@
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener;
-import org.openstreetmap.josm.gui.layer.ImageryLayer;
-import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener;
+import org.openstreetmap.josm.gui.layer.*;
 import org.openstreetmap.josm.data.SelectionChangedListener;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
@@ -21,5 +21,5 @@
 
 import s57.S57dat;
-import seamap.Map;
+import seamap.SeaMap;
 
 import panels.PanelMain;
@@ -33,6 +33,6 @@
 	private boolean isOpen = false;
 	public static PanelMain panelMain = null;
-	public ImageryLayer rendering;
-	public Map map = null;
+	public MapImage rendering;
+	public SeaMap map = null;
 	public Collection<OsmPrimitive> data = null;
 
@@ -120,5 +120,5 @@
 		frame.add(panelS57);
 		// System.out.println("hello");
-		rendering = ImageryLayer.create(new ImageryInfo("OpenSeaMap"));
+		rendering = new MapImage(new ImageryInfo("OpenSeaMap"), map);
 		Main.main.addLayer(rendering);
 	}
@@ -127,4 +127,5 @@
 		if (isOpen) {
 			Main.main.removeLayer(rendering);
+			MapView.removeEditLayerChangeListener(this);
 			frame.setVisible(false);
 			frame.dispose();
@@ -157,7 +158,6 @@
 
 	void reMap() {
-		map = new Map();
+		map = new SeaMap();
 		for (OsmPrimitive osm : data) {
-			System.out.println(osm);
 			if ((osm instanceof Node) || (osm instanceof Way)) {
 				if (osm instanceof Node) {
@@ -182,4 +182,3 @@
 		}
 	}
-
 }
