/** * This factory method creates a Placemark and an associated PlacemarkAttributes bundle that draws the given image * centered on the supplied position. * * @param position The geographic position with the placemark is drawn. * @param imageSource The object containing the image that is drawn. * * @return A new Placemark with a PlacemarkAttributes bundle. */ public static Placemark createWithImage(Position position, ImageSource imageSource) { return new Placemark(position, PlacemarkAttributes.createWithImage(imageSource)); }
if (fields[NA3].startsWith("US") && fields[USE].equals("49")) { // display USA Civilian/Public airports Position pos = Position.fromDegrees(Double.parseDouble(fields[LAT]), Double.parseDouble(fields[LON]), 0); layer.addRenderable(new Placemark(pos, attrs[attrIndex++ % attrs.length]));
Placemark drone = new Placemark( Position.fromDegrees(32.4520, 63.44553, 3000), MilStd2525.getPlacemarkAttributes("SFAPMFQM--GIUSA", modifiers, null)); modifiers.put(ModifiersUnits.Q_DIRECTION_OF_MOVEMENT, "90"); modifiers.put(ModifiersUnits.AJ_SPEED_LEADER, "0.1"); Placemark launcher = new Placemark( Position.fromDegrees(32.4014, 63.3894, 0), MilStd2525.getPlacemarkAttributes("SHGXUCFRMS----G", modifiers, null)); modifiers.put(ModifiersUnits.V_EQUIP_TYPE, "MACHINE GUN"); modifiers.put(ModifiersUnits.W_DTG_1, "30140000ZSEP97"); // Date/Time Group Placemark machineGun = new Placemark( Position.fromDegrees(32.3902, 63.4161, 0), MilStd2525.getPlacemarkAttributes("SFGPEWRH--MTUSG", modifiers, null));
/** * 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)); }
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); }
/** * Called by doInBackground(); creates place icons from places collection and adds them to the places layer. */ private void createPlaceIcons() { publishProgress("Creating place icons..."); for (Place place : this.places) { // Create and configure a Placemark for this place, using a PlaceLevelOfDetailSelector to // dynamically set the PlacemarkAttributes. Placemark placemark = new Placemark(place.position, null, place.name); placemark.setLevelOfDetailSelector(new PlaceLevelOfDetailSelector(getResources(), place)); placemark.setEyeDistanceScaling(true); placemark.setEyeDistanceScalingThreshold(PlaceLevelOfDetailSelector.LEVEL_1_DISTANCE); // On a background thread, we can add Placemarks to a RenderableLayer that is // NOT attached to the WorldWindow. If the layer was attached to the WorldWindow // then we'd have to do this on the UI thread. Later, we'll add the layer to // WorldWindow on the UI thread in the onPostExecute() method. this.placeLayer.addRenderable(placemark); this.numPlacesCreated++; } } }
Placemark origin = new Placemark(Position.fromDegrees(0, 0, 1e5), PlacemarkAttributes.createWithImageAndLeader(ImageSource.fromResource(R.drawable.airport)), "Origin"); Placemark northPole = new Placemark(Position.fromDegrees(90, 0, 1e5), PlacemarkAttributes.createWithImageAndLeader(ImageSource.fromResource(R.drawable.airport_terminal)), "North Pole"); Placemark southPole = new Placemark(Position.fromDegrees(-90, 0, 0), PlacemarkAttributes.createWithImage(ImageSource.fromResource(R.drawable.airplane)), "South Pole"); Placemark antiMeridian = new Placemark(Position.fromDegrees(0, 180, 0), PlacemarkAttributes.createWithImage(ImageSource.fromResource(R.drawable.ic_menu_home)), "Anti-meridian"); Position pos = Position.fromDegrees(lat, lon, 0); Placemark placemark = new Placemark(pos, new PlacemarkAttributes(attributes).setMinimumImageScale(0.5)).setEyeDistanceScaling(true); placemark.setDisplayName(placemark.getPosition().toString());
Placemark airplane = new Placemark( Position.fromDegrees(34.260, -119.2, 5000), PlacemarkAttributes.createWithImageAndLeader(ImageSource.fromResource(R.drawable.aircraft_fixwing)).setImageScale(1.5)); Placemark airport = new Placemark( Position.fromDegrees(34.200, -119.208, 0), PlacemarkAttributes.createWithImage(ImageSource.fromResource(R.drawable.airport_terminal)).setImageOffset(Offset.bottomCenter()).setImageScale(2), Placemark wildfire = new Placemark( Position.fromDegrees(34.300, -119.25, 0), PlacemarkAttributes.createWithImage(ImageSource.fromBitmap(bitmap)).setImageOffset(Offset.bottomCenter()));
this.sightline.setOccludeAttributes(blockedRegions); this.sightline.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND); this.sightlinePlacemark = new Placemark(pos); this.sightlinePlacemark.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND); this.sightlinePlacemark.getAttributes().setImageSource(ImageSource.fromResource(R.drawable.aircraft_fixwing));