Package net.rim.device.api.lbs.maps.model

Examples of net.rim.device.api.lbs.maps.model.MapPoint


          //get current location - 4 tries or bust - in case of invalid fix
              BlackBerryLocation myLocation = getGeolocation(4);
         
              // Show location.
              if (myLocation != null){
                currSelection = new MapPoint(myLocation.getQualifiedCoordinates());
                PeerPoint point = new PeerPoint(myLocation.getQualifiedCoordinates().getLatitude(), myLocation.getQualifiedCoordinates().getLongitude());
                point.setAccuracy(MathUtilities.round(myLocation.getQualifiedCoordinates().getHorizontalAccuracy()));
               
                //auto zoom to point
                map.getAction().setCenterAndZoom(point);
               
                //add the point with accuracy circle
                map.getModel().add(point);
               
               
              }else{
                if (_ops != null){
                  double lat = Double.parseDouble((String) _ops.getField("lat"));
                  double lon = Double.parseDouble((String) _ops.getField("lon"));
                  int zoom = Integer.parseInt((String) _ops.getField("zoom"));
                  //get default location from options
                  map.getAction().setCenterAndZoom( new MapPoint( lat, lon ), zoom );
                }else{
                  //default location (ottawa with high zoom level)
                  map.getAction().setCenterAndZoom( new MapPoint( 45.417, -75.7 ), 10 );
                }
              }
        }
        catch (Exception e) {
          throw new RuntimeException(e.getMessage());
View Full Code Here


            final String lat = _editFieldLatitude.getText().trim();
            final String lon = _editFieldLongitude.getText().trim();

            if (lat.length() > 0 && lon.length() > 0) {
                try {
                    final MapPoint origin =
                            new MapPoint(Float.parseFloat(lat), Float
                                    .parseFloat(lon));
                    final AdminChoice choice =
                            (AdminChoice) _choiceField.getChoice(_choiceField
                                    .getSelectedIndex());
View Full Code Here

            final String lon = _editFieldLongitude.getText().trim();
            if (lat.length() > 0 && lon.length() > 0) {
                // Check if this is to be a blocking request
                final boolean blocking = _blockingCheckbox.getChecked();

                final MapPoint origin =
                        new MapPoint(Float.parseFloat(lat), Float
                                .parseFloat(lon));

                final MapDimensions dim =
                        new MapDimensions(origin, MAP_WIDTH, MAP_HEIGHT,
                                ZOOM_LEVEL, ROTATION);
View Full Code Here

        if (attached) {
            // Set the location of the map to some random
            // location and set zoom to 5 (this zoom level
            // will be overriden by this application's
            // RestrictedMapAction class).
            _map.getMapField().getAction().setCenterAndZoom(new MapPoint(0, 0),
                    5);
        }
    }
View Full Code Here

                final MapAction mapAction =
                        _richMapField.getMapField().getAction();

                // Set center of map near to desired origin and zoom to desired
                // level
                mapAction.setCenterAndZoom(new MapPoint(ORIGIN_LATITUDE,
                        ORIGIN_LONGITUDE), ZOOM_LEVEL);

                _richMapField.setFocus();
            }
        }
View Full Code Here

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

                    (int) (100000.0 * location.getQualifiedCoordinates()
                            .getLongitude());

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

            // Update the status field
            final StringBuffer strBuffer = new StringBuffer(tag);
            strBuffer.append(": Good bye, come again!");
            strBuffer.append(" Lat: ");
View Full Code Here

        private void addDataToMap() {
            // Polygon will be rendered solid white with a black border if we
            // don't change the style.
            final MapPoint[] points = new MapPoint[6];
            points[0] = new MapPoint(ORIGIN_LATITUDE, ORIGIN_LONGITUDE);
            points[1] =
                    new MapPoint(ORIGIN_LATITUDE - 0.05,
                            ORIGIN_LONGITUDE + 0.05);
            points[2] =
                    new MapPoint(ORIGIN_LATITUDE - 0.1,
                            ORIGIN_LONGITUDE + 0.025);
            points[3] =
                    new MapPoint(ORIGIN_LATITUDE - 0.1,
                            ORIGIN_LONGITUDE - 0.025);
            points[4] =
                    new MapPoint(ORIGIN_LATITUDE - 0.05,
                            ORIGIN_LONGITUDE - 0.05);

            // Close the polygon
            points[5] = new MapPoint(ORIGIN_LATITUDE, ORIGIN_LONGITUDE);

            final MapSimplePolygon poly = new MapSimplePolygon(points);
            poly.setStyleId("poly");
            _bigMap.getModel().add(poly, "Polygon", true);
View Full Code Here

            if (attached) {
                final MapAction mapAction = _bigMap.getMapField().getAction();

                // Set the location of both the big map and the PIP map
                mapAction.setCenter(new MapPoint(43.47483, -80.53919));

                mapAction.setZoom(ZOOM_LEVEL);
                _bigMap.setFocus();
            }
        }
View Full Code Here

            final String name, final String description) {
        super(lat, lon, name, description);

        _eventManager = new MappableEventManager();

        _mapPointOldState = new MapPoint(lat, lon);
    }
View Full Code Here

TOP

Related Classes of net.rim.device.api.lbs.maps.model.MapPoint

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.