我正在尝试在JMapViewerToolTip
上添加一个自定义。但是反复搜索并没有帮助我解决这个问题。MapMarker
自定义MapMarker是:
public class MapMarkerUnit extends MapObjectImpl implements MapMarker
并且 Paint Method overide 是
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));
}
感谢您提供的任何帮助。