return pngfile.toString();
}
+ public void initAndFinishMapAsync (final AltosSiteMapTile tile, final Point offset) {
+ Thread thread = new Thread() {
+ public void run() {
+ initMap(offset);
+ finishTileLater(tile, offset);
+ }
+ };
+ thread.start();
+ }
+
public void setBaseLocation(double lat, double lng) {
for (Point k : mapTiles.keySet()) {
AltosSiteMapTile tile = mapTiles.get(k);
initMaps(lat, lon);
scrollRocketToVisible(pt(lat, lon));
}
- public void show(final AltosState state, final int crc_errors) {
+ public void show(final AltosState state, final AltosListenerState listener_state) {
// if insufficient gps data, nothing to update
if (!state.gps.locked && state.gps.nsat < 4)
return;
Point2D.Double ref, lref;
ref = translatePoint(pt, tileCoordOffset(offset));
lref = translatePoint(last_pt, tileCoordOffset(offset));
- tile.show(state, crc_errors, lref, ref);
+ tile.show(state, listener_state, lref, ref);
if (0 <= ref.x && ref.x < px_size)
if (0 <= ref.y && ref.y < px_size)
in_any = true;
lref = translatePoint(last_pt, tileCoordOffset(offset));
AltosSiteMapTile tile = createTile(offset);
- tile.show(state, crc_errors, lref, ref);
- initMap(offset);
- finishTileLater(tile, offset);
+ tile.show(state, listener_state, lref, ref);
+ initAndFinishMapAsync(tile, offset);
}
scrollRocketToVisible(pt);
if (mapTiles.containsKey(offset))
continue;
AltosSiteMapTile tile = createTile(offset);
- initMap(offset);
- finishTileLater(tile, offset);
+ initAndFinishMapAsync(tile, offset);
}
}
}