/** * Constructs a Placemark that draws its representation at the supplied position using default {@link * PlacemarkAttributes} bundle. The displayName and label properties are empty. * * @param position The placemark's geographic position */ public Placemark(Position position) { this(position, new PlacemarkAttributes()); }
public static PlacemarkAttributes createWithImage(ImageSource imageSource) { return new PlacemarkAttributes().setImageSource(imageSource); }
/** * This factory method creates a Placemark and an associated PlacemarkAttributes bundle that draws a simple square * centered on the supplied position with the given size and color. * * @param position The geographic position where the placemark is drawn. * @param color The color of the placemark. * @param pixelSize The width and height of the placemark. * * @return A new Placemark with a PlacemarkAttributes bundle. */ public static Placemark createWithColorAndSize(Position position, Color color, int pixelSize) { return new Placemark(position, new PlacemarkAttributes().setImageColor(color).setImageScale(pixelSize)); }
public static PlacemarkAttributes createWithImageAndLeader(ImageSource imageSource) { return new PlacemarkAttributes().setImageSource(imageSource).setDrawLeader(true); }
protected static PlacemarkAttributes createPlacemarkAttributes(Resources resources, @DrawableRes int resourceId, double scale) { PlacemarkAttributes placemarkAttributes = new PlacemarkAttributes(); // Create a BitmapFactory instance with the values needed to create and recreate the symbol's bitmap //IconBitmapFactory factory = new IconBitmapFactory(resources, resourceId); //placemarkAttributes.setImageSource(ImageSource.fromBitmapFactory(factory)).setImageScale(scale); placemarkAttributes.setImageSource(ImageSource.fromResource(resourceId)).setImageScale(scale).setMinimumImageScale(0.5); return placemarkAttributes; } }
/** * Creates a placemark attributes bundle containing a MIL-STD-2525 symbol using the specified modifiers and * attributes. The ImageSource bitmap is lazily created via an ImageSource.Bitmap factory. The call to the * factory's createBitmap method made when Placemark comes into view; it's also used to recreate the bitmap if the * resource was evicted from the WorldWind render resource cache. * * @param symbolCode The 15-character SIDC (symbol identification coding scheme) code. * @param modifiers The ModifierUnit (unit) or ModifierTG (tactical graphic) modifiers collection. May be null. * @param attributes The MilStdAttributes attributes collection. May be null. * * @return A new PlacemarkAttributes bundle representing the MIL-STD-2525 symbol. */ public static PlacemarkAttributes createPlacemarkAttributes(String symbolCode, SparseArray<String> modifiers, SparseArray<String> attributes) { PlacemarkAttributes placemarkAttributes = new PlacemarkAttributes(); // Create a BitmapFactory instance with the values needed to create and recreate the symbol's bitmap SymbolBitmapFactory factory = new SymbolBitmapFactory(symbolCode, modifiers, attributes, placemarkAttributes); placemarkAttributes.setImageSource(ImageSource.fromBitmapFactory(factory)); return placemarkAttributes; }
this.placemarkAttributes = new PlacemarkAttributes(this.placemarkAttributes).setImageScale(scale * 1.2);
/** * Helper method to create vehicle placemarks. */ protected static Placemark createAutomobilePlacemark(Position position, String name, String automotiveType) { if (!automotiveIconMap.containsKey(automotiveType)) { throw new IllegalArgumentException(automotiveType + " is not valid."); } Placemark placemark = Placemark.createWithImage(position, ImageSource.fromResource(automotiveIconMap.get(automotiveType))); placemark.getAttributes().setImageOffset(Offset.bottomCenter()).setImageScale(NORMAL_IMAGE_SCALE); placemark.setHighlightAttributes(new PlacemarkAttributes(placemark.getAttributes()).setImageScale(HIGHLIGHTED_IMAGE_SCALE).setImageColor(new Color(android.graphics.Color.YELLOW))); placemark.setDisplayName(name); // The AUTOMOTIVE_TYPE property is used to exchange the vehicle type with the VehicleTypeDialog placemark.putUserProperty(AUTOMOTIVE_TYPE, automotiveType); // The select/drag controller will examine a placemark's "capabilities" to determine what operations are applicable: placemark.putUserProperty(SELECTABLE, null); placemark.putUserProperty(EDITABLE, null); placemark.putUserProperty(MOVABLE, null); return placemark; }
/** * Helper method to create airport placemarks. */ private static Placemark createAirportPlacemark(Position position, String airportName) { Placemark placemark = Placemark.createWithImage(position, ImageSource.fromResource(R.drawable.airport_terminal)); placemark.getAttributes().setImageOffset(Offset.bottomCenter()).setImageScale(NORMAL_IMAGE_SCALE); placemark.setHighlightAttributes(new PlacemarkAttributes(placemark.getAttributes()).setImageScale(HIGHLIGHTED_IMAGE_SCALE)); placemark.setDisplayName(airportName); return placemark; }
/** * Helper method to create aircraft placemarks. */ private static Placemark createAircraftPlacemark(Position position) { Placemark placemark = Placemark.createWithImage(position, ImageSource.fromResource(R.drawable.aircraft_fighter)); placemark.getAttributes().setImageOffset(Offset.bottomCenter()).setImageScale(NORMAL_IMAGE_SCALE).setDrawLeader(true); placemark.setHighlightAttributes(new PlacemarkAttributes(placemark.getAttributes()).setImageScale(HIGHLIGHTED_IMAGE_SCALE)); return placemark; }
/** * Helper method to create aircraft placemarks. The aircraft are selectable, movable, and editable. */ protected static Placemark createAircraftPlacemark(Position position, String aircraftName, String aircraftType) { if (!aircraftIconMap.containsKey(aircraftType)) { throw new IllegalArgumentException(aircraftType + " is not valid."); } Placemark placemark = Placemark.createWithImage(position, ImageSource.fromResource(aircraftIconMap.get(aircraftType))); placemark.getAttributes().setImageOffset(Offset.bottomCenter()).setImageScale(NORMAL_IMAGE_SCALE).setDrawLeader(true); placemark.getAttributes().getLeaderAttributes().setOutlineWidth(4); placemark.setHighlightAttributes(new PlacemarkAttributes(placemark.getAttributes()).setImageScale(HIGHLIGHTED_IMAGE_SCALE).setImageColor(new Color(android.graphics.Color.YELLOW))); placemark.setDisplayName(aircraftName); // The AIRCRAFT_TYPE property is used to exchange the vehicle type with the VehicleTypeDialog placemark.putUserProperty(AIRCRAFT_TYPE, aircraftType); // The select/drag controller will examine a placemark's "capabilities" to determine what operations are applicable: placemark.putUserProperty(SELECTABLE, null); placemark.putUserProperty(EDITABLE, null); placemark.putUserProperty(MOVABLE, null); return placemark; }
new PlacemarkAttributes(attributes).setMinimumImageScale(0.5)).setEyeDistanceScaling(true); placemark.setDisplayName(placemark.getPosition().toString());
this.attributes = new PlacemarkAttributes(this.attributes).setImageScale(scale * 2.0);