public void load() {
RecordStore recordStore = null;
markers = new Vector();
routeEnds = new Vector();
for (int i = 0; i < 2; i++) {
ScreenMarker routeEnd = new ScreenMarker();
routeEnd.worldCoordinate = new WorldCoordinate();
routeEnd.worldCoordinate.latitude = Double.NaN;
routeEnd.worldCoordinate.longitude = Double.NaN;
routeEnds.addElement(routeEnd);
routeEnd.iconName = "route_point.png";
}
try {
recordStore = RecordStore.openRecordStore("MapMidlet Options", true);
if (recordStore != null && recordStore.getNumRecords() > 0) {
RecordEnumeration records = recordStore.enumerateRecords(null, null, false);
byte[] record = records.nextRecord();
ByteArrayInputStream byteStream = new ByteArrayInputStream(record);
DataInputStream dataStream = new DataInputStream(byteStream);
useFileApi = dataStream.readBoolean();
rootName = dataStream.readUTF();
String tileProvider = dataStream.readUTF();
setTileFactory(tileProvider);
debugMode = dataStream.readBoolean();
gpsUrl = dataStream.readUTF();
gpsEnabled = dataStream.readBoolean();
fadeEffect = dataStream.readBoolean();
fileReadInSeparateThread = dataStream.readBoolean();
maxRetries = dataStream.readInt();
onlineMode = dataStream.readBoolean();
center = new WorldCoordinate();
center.latitude = dataStream.readDouble();
center.longitude = dataStream.readDouble();
zoom = dataStream.readInt();
skinPath = dataStream.readUTF();
routeEndIndex = dataStream.readInt();
replaySpeed = 4;
for (int i = 0; i < 2; i++) {
ScreenMarker routeEnd = (ScreenMarker) routeEnds.elementAt(i);
routeEnd.worldCoordinate.latitude = dataStream.readDouble();
routeEnd.worldCoordinate.longitude = dataStream.readDouble();
routeEnd.visible = dataStream.readBoolean();
}
routeType = dataStream.readUTF();