Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ColorMap.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ColorMap.java	(revision 29921)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ColorMap.java	(revision 29921)
@@ -0,0 +1,190 @@
+package org.openstreetmap.josm.plugins.elevation;
+
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import org.openstreetmap.josm.tools.CheckParameterUtil;
+
+/**
+ * Provides a set of color maps to map an elevation value to a color.
+ * @author Olli
+ *
+ */
+public class ColorMap {
+    private List<ColorMapEntry> colorList;
+    private String name;
+    private static HashMap<String, ColorMap> colorMaps;
+    
+    static {
+	colorMaps = new HashMap<String, ColorMap>();	
+    }
+    
+    // Private ctor to enforce use of create
+    private ColorMap() {	
+    }
+    
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    
+    /**
+     * Gets the color according to the given elevation value.
+     *
+     * @param elevation the elevation
+     * @return the color
+     */
+    public Color getColor(int elevation) {
+	// empty color map?
+	if (colorList == null || colorList.size() == 0) {
+	    return Color.white;
+	}
+	
+	// out of range?
+	if (elevation < colorList.get(0).ele) {
+	    return colorList.get(0).getColor();
+	}
+	
+	int last = colorList.size() - 1;
+	if (elevation > colorList.get(last).ele) {
+	    return colorList.get(last).getColor();
+	}
+	
+	// find elevation section
+	for (int i = 0; i < last; i++) {
+	    ColorMapEntry e1 = colorList.get(i);
+	    ColorMapEntry e2 = colorList.get(i + 1);
+	    
+	    // elevation within range?
+	    if (e1.getEle() <= elevation && e2.getEle() >= elevation) {
+		
+		// interpolate color between both
+		double val = (elevation - e1.getEle()) / (double)(e2.getEle() - e1.getEle());
+		return interpolate(e1.getColor(), e2.getColor(), val);
+	    }
+	}
+	
+	// here we should never end!
+	throw new RuntimeException("Inconsistent color map - found no entry for elevation " + elevation);
+    }
+    
+    
+    /**
+     * Gets the color map with the given name.
+     *
+     * @param name the name
+     * @return the map or <code>null</code>, if no such map exists
+     */
+    public static ColorMap getMap(String name) {
+	if (colorMaps.containsKey(name)) {
+	    return colorMaps.get(name);
+	}	
+	return null;
+    }
+    
+    /**
+     * Gets the number of available color maps. 
+     *
+     * @return the int
+     */
+    public static int size() {
+	return colorMaps != null ? colorMaps.size() : 0;
+    }
+    
+    
+    /**
+     * Gets the available color map names.
+     *
+     * @param name the name
+     * @return the map or <code>null</code>, if no such map exists
+     */
+    public static String[] getNames() {		
+	return colorMaps.keySet().toArray(new String[size()]);
+    }
+    
+    private static void registerColorMap(ColorMap newMap) {
+	CheckParameterUtil.ensureParameterNotNull(newMap);
+	colorMaps.put(newMap.getName(), newMap);
+    }
+
+    public static void unregisterColorMap(String name) {
+	if (colorMaps.containsKey(name)) {
+	    colorMaps.remove(name);
+	}
+    }
+    
+    public static Color interpolate(java.awt.Color c1, java.awt.Color c2, double ratio) {
+	double r1 = ratio;
+	// clip
+	if (r1 < 0) r1 = 0d;
+	if (r1 > 1) r1 = 1d;
+	double r2 = 1 - r1;
+
+	int r = (int) Math.round((r1 * c1.getRed()) + (r2 * c2.getRed()));
+	int g = (int) Math.round((r1 * c1.getGreen()) + (r2 * c2.getGreen()));
+	int b = (int) Math.round((r1 * c1.getBlue()) + (r2 * c2.getBlue()));
+	return new Color(r, g, b);
+    }
+
+    /**
+     * Creates a color map using the given colors/elevation values.
+     * Both arrays must have same length.
+     *
+     * @param name the name of the color map
+     * @param colors the array containing the colors
+     * @param ele the elevation values
+     * @return the color map
+     */
+    public static ColorMap create(String name, Color[] colors, int[] ele) {
+	CheckParameterUtil.ensureParameterNotNull(colors);
+	CheckParameterUtil.ensureParameterNotNull(ele);
+	
+	if (colors.length != ele.length) {
+	    throw new IllegalArgumentException("Arrays colors and ele must have same length: " + colors.length + " vs " + ele.length);
+	}
+	
+	ColorMap map = new ColorMap();
+	map.colorList = new ArrayList<ColorMap.ColorMapEntry>(); 
+	map.name = name;
+	for (int i = 0; i < ele.length; i++) {
+	    map.colorList.add(map.new ColorMapEntry(colors[i], ele[i]));
+	}
+	
+	// sort by elevation
+	Collections.sort(map.colorList);
+	
+	registerColorMap(map);
+	return map;
+    }
+    
+
+    class ColorMapEntry implements Comparable<ColorMapEntry> {
+	private int ele; // limit	
+	private Color color;
+	
+	public ColorMapEntry(Color color, int ele) {
+	    super();
+	    this.color = color;
+	    this.ele = ele;
+	}
+
+	public int getEle() {
+	    return ele;
+	}
+
+	public Color getColor() {
+	    return color;
+	}
+
+	@Override
+	public int compareTo(ColorMapEntry o) {	    
+	    return this.ele - o.ele;
+	}
+    }
+}
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ColoredElevationLayer.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ColoredElevationLayer.java	(revision 29915)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ColoredElevationLayer.java	(revision 29921)
@@ -1,6 +1,4 @@
 package org.openstreetmap.josm.plugins.elevation;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
-import java.awt.Color;
 import java.awt.Graphics2D;
 import java.awt.Point;
@@ -16,29 +14,29 @@
 import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
 import org.openstreetmap.josm.gui.layer.Layer;
-import org.openstreetmap.josm.plugins.elevation.gui.ElevationColors;
 import org.openstreetmap.josm.plugins.elevation.gui.Triangle;
 import org.openstreetmap.josm.tools.ImageProvider;
 
 public class ColoredElevationLayer extends Layer implements IEleRenderingListener {
-    private ElevationRenderer renderer;
-    
+    private GridRenderer gridRenderer;
+    private IVertexRenderer vertexRenderer;
 
     public ColoredElevationLayer(String name) {
 	super(name);
 
-	// 
-	setOpacity(0.5);
+	// make this layer transparent by 20%
+	setOpacity(0.8);
+	vertexRenderer = new SimpleVertexRenderer();
     }
 
     @Override
     public void paint(Graphics2D g, MapView mv, Bounds box) {
-	if (renderer == null) {
-	    renderer = new ElevationRenderer(getName(), box, this);
+	if (gridRenderer == null) {
+	    gridRenderer = new GridRenderer(getName(), box, this);
 	    System.out.println("Start renderer...");
-	    Main.worker.submit(renderer);
+	    Main.worker.submit(gridRenderer);
 	}
 	
-	if (renderer.getVertices().size() > 0) {
-	    BlockingDeque<EleVertex> list = renderer.getVertices();
+	if (gridRenderer.getVertices().size() > 0) {
+	    BlockingDeque<EleVertex> list = gridRenderer.getVertices();
 	    for (EleVertex eleVertex : list) {
 		Point p0 = mv.getPoint(eleVertex.get(0));
@@ -47,8 +45,6 @@
 		Triangle t = new Triangle(p0, p1, p2);
 		
-		
-		//g.setColor(Color.magenta);
-		//g.draw(t);
-		g.setColor(ElevationColors.getElevationColor(eleVertex.getEle()));
+		// obtain vertex color
+		g.setColor(vertexRenderer.getElevationColor(eleVertex));
 		g.fill(t);
 	    }
@@ -106,3 +102,10 @@
     }
 
+    public IVertexRenderer getVertexRenderer() {
+        return vertexRenderer;
+    }
+
+    public void setVertexRenderer(IVertexRenderer vertexRenderer) {
+        this.vertexRenderer = vertexRenderer;
+    }
 }
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/EleVertex.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/EleVertex.java	(revision 29915)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/EleVertex.java	(revision 29921)
@@ -107,5 +107,5 @@
 	
 	// TODO: Check for proper limit
-	return z < 75 || getArea() < (30 * 30); // = 3 * 25
+	return /*z < 75 || */getArea() < (30 * 30); // = 3 * 25
     }    
     
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java	(revision 29915)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java	(revision 29921)
@@ -289,5 +289,5 @@
 		    	double eleHgt = hgt.getElevationFromHgt(ll);
 		    	
-		    	System.out.println("Get elevation from HGT " + ll + " => " + eleHgt);
+		    	//System.out.println("Get elevation from HGT " + ll + " => " + eleHgt);
 		    	if (isValidElevation(eleHgt)) {		    	    
 		    	    return eleHgt;
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfilePlugin.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfilePlugin.java	(revision 29915)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfilePlugin.java	(revision 29921)
@@ -15,4 +15,8 @@
 package org.openstreetmap.josm.plugins.elevation;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Color;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
@@ -25,5 +29,4 @@
 import org.openstreetmap.josm.plugins.elevation.gui.ElevationProfileDialog;
 import org.openstreetmap.josm.plugins.elevation.gui.ElevationProfileLayer;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -51,6 +54,7 @@
 	    JosmAction action = new AddElevationLayerAction();
 	    
+	    createColorMaps();
+	    
 	    MainMenu.add(Main.main.menu.viewMenu, action, false, 0);
-	    
 	} catch (Exception e1) {
 	    System.err.println("Init of ElevationProfilePlugin failed: " + e1);
@@ -89,3 +93,58 @@
 	return currentLayer;
     }
+    
+    private void createColorMaps() {
+	// Data taken from http://proceedings.esri.com/library/userconf/proc98/proceed/to850/pap842/p842.htm
+	ColorMap.create("Physical_US",
+		new Color[]{
+		new Color(18,129,242),
+		new Color(113,153,89),
+		new Color(117,170,101),
+		new Color(149,190,113),
+		new Color(178,214,117),
+		new Color(202,226,149),
+		new Color(222,238,161),
+		new Color(242,238,161),
+		new Color(238,222,153),
+		new Color(242,206,133),
+		new Color(234,182,129),
+		new Color(218,157,121),
+		new Color(194,141,125),
+		new Color(214,157,145),
+		new Color(226,174,165),
+		new Color(222,186,182),
+		new Color(238,198,210),
+		new Color(255,206,226),
+		new Color(250,218,234),
+		new Color(255,222,230),
+		new Color(255,230,242),
+		new Color(255,242,255)
+		}, 
+		// elevation in meters - the page above uses feet, so these values differs slightly
+		new int[]{
+		-3000,
+		0,
+		150,
+		300,
+		450,
+		600,
+		750,
+		900,
+		1050,
+		1200,
+		1350,
+		1500,
+		1650,
+		1800,
+		1950,
+		2100,
+		2250,
+		2400,
+		2550,
+		2700,
+		2750,
+		3000		
+		}
+		);
+    }
 }
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationRenderer.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationRenderer.java	(revision 29915)
+++ 	(revision )
@@ -1,128 +1,0 @@
-package org.openstreetmap.josm.plugins.elevation;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.Component;
-import java.io.IOException;
-import java.util.List;
-import java.util.concurrent.BlockingDeque;
-import java.util.concurrent.LinkedBlockingDeque;
-
-import org.openstreetmap.josm.data.Bounds;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.gui.PleaseWaitRunnable;
-import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
-import org.openstreetmap.josm.gui.progress.ProgressMonitor;
-import org.openstreetmap.josm.io.OsmTransferException;
-import org.xml.sax.SAXException;
-
-public class ElevationRenderer extends PleaseWaitRunnable {
-    private Bounds box;
-    private IEleRenderingListener listener;
-    
-    private BlockingDeque<EleVertex> toDo = new LinkedBlockingDeque<EleVertex>();
-    private BlockingDeque<EleVertex> vertices = new LinkedBlockingDeque<EleVertex>();
-    
-    private volatile boolean stop = false;
-    
-    public ElevationRenderer(String title, Bounds box, IEleRenderingListener listener) {
-	this(title, NullProgressMonitor.INSTANCE, true, box, listener);
-    }
-
-    public ElevationRenderer(String title, boolean ignoreException, Bounds box, IEleRenderingListener listener) {
-	this(title, NullProgressMonitor.INSTANCE, ignoreException, box, listener);
-    }
-
-    public ElevationRenderer(Component parent, String title,
-	    boolean ignoreException, Bounds box) throws IllegalArgumentException {
-	super(parent, title, ignoreException);
-	
-	this.box = box;
-	initQueue();
-    }
-
-    public ElevationRenderer(String title, ProgressMonitor progressMonitor,
-	    boolean ignoreException, Bounds box, IEleRenderingListener listener) {
-	super(title, progressMonitor, ignoreException);
-
-	this.box = box;
-	this.listener = listener;
-	initQueue();
-    }
-    
-    /**
-     * Inits the 'todo' queue with the initial vertices.
-     */
-    private void initQueue() {
-	LatLon min = box.getMin();
-	LatLon max = box.getMax();
-	
-	// compute missing coordinates
-	LatLon h1 = new LatLon(min.lat(), max.lon()); 
-	LatLon h2 = new LatLon(max.lat(), min.lon());
-	
-	// compute elevation coords
-	EleCoordinate p0 = new EleCoordinate(min, ElevationHelper.getElevation(min));	
-	EleCoordinate p1 = new EleCoordinate(h1, ElevationHelper.getElevation(h1));
-	EleCoordinate p2 = new EleCoordinate(max, ElevationHelper.getElevation(max));
-	EleCoordinate p3 = new EleCoordinate(h2, ElevationHelper.getElevation(h2));
-		
-	// compute initial vertices
-	EleVertex v1 = new EleVertex(p0, p1, p2);
-	EleVertex v2 = new EleVertex(p2, p3, p0);
-	// enqueue vertices
-	toDo.add(v1);
-	toDo.add(v2);
-	
-	System.out.println("Inited queue");
-    }
-
-    public BlockingDeque<EleVertex> getVertices() {
-        return vertices;
-    }
-
-    @Override
-    protected void cancel() {
-	stop = true;
-    }
-
-    @Override
-    protected void realRun() throws SAXException, IOException,
-	    OsmTransferException {
-	
-	if (stop) return;
-	
-	super.getProgressMonitor().indeterminateSubTask(tr("Render vertices..."));
-	System.out.println("Queue size " + toDo.size());
-	// 
-	while (toDo.size() > 0) {
-	    if (stop) break;
-	    
-	    EleVertex vertex = toDo.poll();
-	    
-	    if (vertex.isFinished()) {		
-		vertices.add(vertex);
-		if (listener !=null) {
-		    listener.finished(vertex);
-		}
-	    } else {
-		List<EleVertex> newV = vertex.divide();
-		for (EleVertex eleVertex : newV) {
-		    System.out.print(".");
-		    toDo.add(eleVertex);
-		}
-	    }
-	}
-	
-	if (listener !=null) {
-	    listener.finishedAll();
-	}
-    }
-
-    @Override
-    protected void finish() {
-	// TODO Auto-generated method stub
-
-    }
-
-}
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/GridRenderer.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/GridRenderer.java	(revision 29921)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/GridRenderer.java	(revision 29921)
@@ -0,0 +1,128 @@
+package org.openstreetmap.josm.plugins.elevation;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Component;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.BlockingDeque;
+import java.util.concurrent.LinkedBlockingDeque;
+
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
+import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.io.OsmTransferException;
+import org.xml.sax.SAXException;
+
+public class GridRenderer extends PleaseWaitRunnable {
+    private Bounds box;
+    private IEleRenderingListener listener;
+    
+    private BlockingDeque<EleVertex> toDo = new LinkedBlockingDeque<EleVertex>();
+    private BlockingDeque<EleVertex> vertices = new LinkedBlockingDeque<EleVertex>();
+    
+    private volatile boolean stop = false;
+    
+    public GridRenderer(String title, Bounds box, IEleRenderingListener listener) {
+	this(title, NullProgressMonitor.INSTANCE, true, box, listener);
+    }
+
+    public GridRenderer(String title, boolean ignoreException, Bounds box, IEleRenderingListener listener) {
+	this(title, NullProgressMonitor.INSTANCE, ignoreException, box, listener);
+    }
+
+    public GridRenderer(Component parent, String title,
+	    boolean ignoreException, Bounds box) throws IllegalArgumentException {
+	super(parent, title, ignoreException);
+	
+	this.box = box;
+	initQueue();
+    }
+
+    public GridRenderer(String title, ProgressMonitor progressMonitor,
+	    boolean ignoreException, Bounds box, IEleRenderingListener listener) {
+	super(title, progressMonitor, ignoreException);
+
+	this.box = box;
+	this.listener = listener;
+	initQueue();
+    }
+    
+    /**
+     * Inits the 'todo' queue with the initial vertices.
+     */
+    private void initQueue() {
+	LatLon min = box.getMin();
+	LatLon max = box.getMax();
+	
+	// compute missing coordinates
+	LatLon h1 = new LatLon(min.lat(), max.lon()); 
+	LatLon h2 = new LatLon(max.lat(), min.lon());
+	
+	// compute elevation coords
+	EleCoordinate p0 = new EleCoordinate(min, ElevationHelper.getElevation(min));	
+	EleCoordinate p1 = new EleCoordinate(h1, ElevationHelper.getElevation(h1));
+	EleCoordinate p2 = new EleCoordinate(max, ElevationHelper.getElevation(max));
+	EleCoordinate p3 = new EleCoordinate(h2, ElevationHelper.getElevation(h2));
+		
+	// compute initial vertices
+	EleVertex v1 = new EleVertex(p0, p1, p2);
+	EleVertex v2 = new EleVertex(p2, p3, p0);
+	// enqueue vertices
+	toDo.add(v1);
+	toDo.add(v2);
+	
+	System.out.println("Inited queue");
+    }
+
+    public BlockingDeque<EleVertex> getVertices() {
+        return vertices;
+    }
+
+    @Override
+    protected void cancel() {
+	stop = true;
+    }
+
+    @Override
+    protected void realRun() throws SAXException, IOException,
+	    OsmTransferException {
+	
+	if (stop) return;
+	
+	super.getProgressMonitor().indeterminateSubTask(tr("Render vertices..."));
+	System.out.println("Queue size " + toDo.size());
+	// 
+	while (toDo.size() > 0) {
+	    if (stop) break;
+	    
+	    EleVertex vertex = toDo.poll();
+	    
+	    if (vertex.isFinished()) {		
+		vertices.add(vertex);
+		if (listener !=null) {
+		    listener.finished(vertex);
+		}
+	    } else {
+		List<EleVertex> newV = vertex.divide();
+		for (EleVertex eleVertex : newV) {
+		    System.out.print(".");
+		    toDo.add(eleVertex);
+		}
+	    }
+	}
+	
+	if (listener !=null) {
+	    listener.finishedAll();
+	}
+    }
+
+    @Override
+    protected void finish() {
+	// TODO Auto-generated method stub
+
+    }
+
+}
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java	(revision 29915)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/HgtReader.java	(revision 29921)
@@ -57,6 +57,4 @@
 	        }
 	    } 
-	    
-	    System.out.println("Get elevation from HGT file " + file);
 	    
 	    // read elevation value
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/IVertexRenderer.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/IVertexRenderer.java	(revision 29921)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/IVertexRenderer.java	(revision 29921)
@@ -0,0 +1,28 @@
+package org.openstreetmap.josm.plugins.elevation;
+
+import java.awt.Color;
+
+/**
+ * The interface IVertexRenderer.
+ * 
+ * Implementors should provide a default color map which cannot be unregistered
+ */
+public interface IVertexRenderer {
+    
+    /**
+     * Gets the color according to the given elevation.
+     *
+     * @param vertex the elevation vertex
+     * @return the elevation color
+     */
+    public Color getElevationColor(EleVertex vertex);
+    
+    /**
+     * Selects color map with the given name. If no
+     * such color map exists, the old color map is kept.
+     *
+     * @param mapToUse the map to use
+     */
+    public void selectColorMap(String name);
+   
+}
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/SimpleVertexRenderer.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/SimpleVertexRenderer.java	(revision 29921)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/SimpleVertexRenderer.java	(revision 29921)
@@ -0,0 +1,45 @@
+/*
+ * This program 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, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program.
+ * If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package org.openstreetmap.josm.plugins.elevation;
+
+import java.awt.Color;
+
+/**
+ * @author Olli
+ *
+ */
+public class SimpleVertexRenderer implements IVertexRenderer {
+    private ColorMap cMap = null;
+    
+    /**
+     * 
+     */
+    public SimpleVertexRenderer() {
+	cMap = ColorMap.getMap(ColorMap.getNames()[0]);
+    }
+
+    @Override
+    public Color getElevationColor(EleVertex vertex) {
+	return cMap.getColor((int) vertex.getEle());
+    }
+
+
+    @Override
+    public void selectColorMap(String name) {
+	// TODO Auto-generated method stub
+	
+    }
+    
+}
Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationColors.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationColors.java	(revision 29915)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationColors.java	(revision 29921)
@@ -33,5 +33,5 @@
 	public static Color EPMidBeige = new Color(227, 222, 215);
 	
-		
+	// TODO: Move to ColorMap.java or delete it	
 	static class ColorMapEntry {
 	    private int ele; // limit
@@ -52,4 +52,6 @@
 	}
 	
+	
+	
 	private static ColorMapEntry[] colors = new ColorMapEntry[]{
 		  new ColorMapEntry(new Color(0,128, 0), 0),  
@@ -62,11 +64,5 @@
 		};
 	
-	public static Color interpolate(java.awt.Color c1, java.awt.Color c2) {
-	    int r = (c1.getRed() + c2.getRed()) / 2;
-	    int g = (c1.getGreen() + c2.getGreen()) / 2;
-	    int b = (c1.getBlue() + c2.getBlue()) / 2;
-	    return new Color(r, g, b);
-	}
-	
+		
 	public static Color getElevationColor(double ele) {
 	    if (!ElevationHelper.isValidElevation(ele)) {
