public static PlacemarkAttributes createWithImage(ImageSource imageSource) { return new PlacemarkAttributes().setImageSource(imageSource); }
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; } }
public void onFinished(String vehicleType) { PlacemarksSelectDragActivity activity = (PlacemarksSelectDragActivity) getActivity(); if (activity.controller.selectedObject instanceof Placemark) { Placemark placemark = (Placemark) activity.controller.selectedObject; String currentType = (String) placemark.getUserProperty(this.vehicleKey); if (currentType.equals(vehicleType)) { return; } // Update the placemark's icon attributes and vehicle type property. ImageSource imageSource = ImageSource.fromResource(this.vehicleIcons.get(vehicleType)); placemark.putUserProperty(this.vehicleKey, vehicleType); placemark.getAttributes().setImageSource(imageSource); placemark.getHighlightAttributes().setImageSource(imageSource); // Show the change activity.getWorldWindow().requestRedraw(); } }
/** * 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; }
protected void createPlacemark(Position position, RenderableLayer layer) { Placemark placemark = new Placemark(position); placemark.getAttributes().setImageSource(ImageSource.fromResource(R.drawable.aircraft_fixwing)); placemark.getAttributes().setImageScale(2); placemark.getAttributes().setDrawLeader(true); layer.addRenderable(placemark); }
this.sightlinePlacemark = new Placemark(pos); this.sightlinePlacemark.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND); this.sightlinePlacemark.getAttributes().setImageSource(ImageSource.fromResource(R.drawable.aircraft_fixwing)); this.sightlinePlacemark.getAttributes().setImageScale(2); this.sightlinePlacemark.getAttributes().setDrawLeader(true);