When using JMapViewer, is there any way to automatically display lat/lon grid lines? The JMapViewer.setTileGridVisible
method is unfortunately not the same thing. I know it's possible to do it manually, but then I have to figure out when to display what resolutions, etc. Sounds like a pain.
Asked
Active
Viewed 298 times
1
1 Answers
1
As an alternative, you can override mouseMoved()
in DefaultMapController
using the approach shown here. In the handler, you can update a label or set a tooltip, for example:
new DefaultMapController(map) {
@Override
public void mouseMoved(MouseEvent e) {
map.setToolTipText(map.getPosition(e.getPoint()).toString());
}
};
-
I apparently need a more obvious indicator. For now, I've subclassed `JMapViewer`, overridden the `paint`, and drew some strings on the edges. I might paint the grid lines when I have more time to figure it out. – Jun 10 '13 at 23:29