1

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.

1 Answers1

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());
    }
};
Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • 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