我想要一个添加ToolTip到自定义MapMarker的JMapViewer。但是,取消搜索并不能帮助我解决这个问题。
自定义MapMarker为:
public class MapMarkerUnit extends MapObjectImpl implements MapMarker
Run Code Online (Sandbox Code Playgroud)
绘制方法的覆盖是
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));
}
Run Code Online (Sandbox Code Playgroud)
感谢您提供的任何帮助。