Package javax.microedition.location

Examples of javax.microedition.location.Coordinates


            partialLine[count - locationOfSpace - 1] = line[count];
        }

        longitude = getDouble(partialLine);

        return new Coordinates(latitude, longitude, 0);
    }
View Full Code Here


            // defined origin and radius. A Geofence can also be defined
            // as a polygon. The specified GeofenceListener will be notified
            // when the BlackBerry device enters or exits the perimeter of the
            // geofenced region.
            final Geofence geofence = new Geofence();
            final Coordinates coordinates =
                    new Coordinates(ORIGIN_LATITUDE, ORIGIN_LONGITUDE,
                            Float.NaN);
            geofence.monitorPerimeter(this, "RIM Campus", coordinates,
                    GEOFENCE_RADIUS, 0, -1);

            // Add a field to display status
            final StringBuffer strBuffer =
                    new StringBuffer("Geofence enabled for latitude ");
            strBuffer.append(coordinates.getLatitude());
            strBuffer.append(" and longitude ");
            strBuffer.append(coordinates.getLongitude());
            strBuffer.append(" with ");
            strBuffer.append(GEOFENCE_RADIUS);
            strBuffer.append(" meter radius");
            _geofenceInfoField = new LabelField(strBuffer.toString());
            add(_geofenceInfoField);
View Full Code Here

         * @see net.rim.device.api.location.GeofenceListener#perimeterEntered(String,
         *      BlackBerryLocation)
         */
        public void perimeterEntered(final String tag,
                final BlackBerryLocation location) {
            final Coordinates coordinates = location.getQualifiedCoordinates();

            // Move the map to the current location
            final MapAction mapAction = _richMapField.getMapField().getAction();
            mapAction.setCenter(new MapPoint(coordinates));

            final double lat = 100000.0 * coordinates.getLatitude();
            final double lng = 100000.0 * coordinates.getLongitude();

            // Update the status field
            final StringBuffer strBuffer = new StringBuffer("Welcome to ");
            strBuffer.append(tag);
            strBuffer.append(" Lat: ");
View Full Code Here

            add(new RichTextField("Average Speed(m/s): "
                    + Float.toString(avgSpeed), Field.NON_FOCUSABLE));

            // Display the WayPoint on a map
            final MapField map = new MapField();
            map.moveTo(new Coordinates(point._latitude, point._longitude,
                    Float.NaN));
            add(map);
        }
View Full Code Here

    /**
     * Sets up screen elements and initializes the map.
     */
    public MapFieldDemoScreen() {
        super(Manager.NO_VERTICAL_SCROLL);
        Coordinates defaultLocation;

        // Reads data from file.
        final LineReader lineReader =
                new LineReader(getClass().getResourceAsStream("/MapsData.txt"));

View Full Code Here

TOP

Related Classes of javax.microedition.location.Coordinates

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.