【发布时间】:2014-11-14 10:01:35
【问题描述】:
我正在尝试将ToolTip 添加到JMapViewer 上的自定义MapMarker。但是重复搜索并没有帮助我解决这个问题。
自定义的MapMarker是:
public class MapMarkerUnit extends MapObjectImpl implements MapMarker
并且 Paint 方法覆盖是
public void paint(Graphics g, Point position, int radio) {
String filename = "marker.png";
//System.out.print(filename);
BufferedImage x = null;
try {
x = ImageIO.read(getClass().getResource(filename));
} catch (IOException ex) {
Logger.getLogger(MapMarkerUnit.class.getName()).log(Level.SEVERE, null, ex);
}
g.drawImage(x, position.x-16, position.y-37,null);
//if(getLayer()==null||getLayer().isVisibleTexts()) paintText(g, new Point(position.x+20,position.y));
}
感谢您提供的任何帮助。
【问题讨论】:
标签: java jmapviewer