use of org.jxmapviewer.viewer.DefaultTileFactory in project bboxdb by jnidzwetzki.
the class OSMView method createMapViewer.
/**
* Get an instance of the map viewer
* @return
*/
protected JXMapViewer createMapViewer() {
mapViewer = new JXMapViewer();
// Create a TileFactoryInfo for OpenStreetMap
final TileFactoryInfo info = new OSMTileFactoryInfo();
final DefaultTileFactory tileFactory = new DefaultTileFactory(info);
mapViewer.setTileFactory(tileFactory);
final MouseInputListener mia = new PanMouseInputListener(mapViewer);
mapViewer.addMouseListener(mia);
mapViewer.addMouseMotionListener(mia);
// Use 8 threads in parallel to load the tiles
tileFactory.setThreadPoolSize(8);
// Set the focus
showHagen();
// The KD Tree painter
final OSMOverlayPainter kdosmPainter = new OSMOverlayPainter(guiModel);
mapViewer.setOverlayPainter(kdosmPainter);
return mapViewer;
}
Aggregations