Package com.mapmidlet.tile.ui

Examples of com.mapmidlet.tile.ui.ScreenMarker


    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();
View Full Code Here


            outputStream.writeInt(zoom);
            outputStream.writeUTF(skin.path);
            outputStream.writeInt(routeEndIndex);

            for (int i = 0; i < 2; i++) {
                ScreenMarker routeEnd = (ScreenMarker) routeEnds.elementAt(i);
                outputStream.writeDouble(routeEnd.worldCoordinate.latitude);
                outputStream.writeDouble(routeEnd.worldCoordinate.longitude);
                outputStream.writeBoolean(routeEnd.visible);
            }
            outputStream.writeUTF(routeType);
View Full Code Here

            JSONObject json = new JSONObject(IOTool.download(url));
            if (json.has("found")) {
                JSONArray array = json.getJSONArray("features");
                for (int i = 0; i < array.length(); i++) {
                    JSONObject feature = array.getJSONObject(i);
                    ScreenMarker result = new ScreenMarker();
                    result.name = feature.getJSONObject("properties").getString("name");
                    JSONArray coordinates = feature.getJSONObject("centroid").getJSONArray("coordinates");
                    WorldCoordinate worldCoordinate = new WorldCoordinate();
                    worldCoordinate.latitude = coordinates.getDouble(0);
                    worldCoordinate.longitude = coordinates.getDouble(1);
View Full Code Here

TOP

Related Classes of com.mapmidlet.tile.ui.ScreenMarker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.