![]() |
AI2 Component
(Version nb184)
|
Public Member Functions | |
Marker (MapFactory.MapFeatureContainer container) | |
String | Type () |
void | Latitude (double latitude) |
double | Latitude () |
void | Longitude (double longitude) |
double | Longitude () |
void | ImageAsset (String path) |
String | ImageAsset () |
void | StrokeColor (int argb) |
void | AnchorHorizontal (int horizontal) |
int | AnchorHorizontal () |
void | AnchorVertical (int vertical) |
int | AnchorVertical () |
void | ShowShadow (boolean show) |
boolean | ShowShadow () |
void | Width (int width) |
int | Width () |
void | WidthPercent (int pCent) |
void | Height (int height) |
int | Height () |
void | HeightPercent (int pCent) |
void | SetLocation (double latitude, double longitude) |
double | DistanceToPoint (double latitude, double longitude, boolean centroid) |
double | DistanceToPoint (double latitude, double longitude) |
double | BearingToPoint (double latitude, double longitude) |
double | BearingToFeature (MapFeature mapFeature, final boolean centroids) |
IGeoPoint | getLocation () |
void | updateLocation (double latitude, double longitude) |
![]() | |
MapFeatureBaseWithFill (MapFactory.MapFeatureContainer container, MapFeatureVisitor< Double > distanceComputation) | |
void | FillColor (int argb) |
int | FillColor () |
void | FillOpacity (float opacity) |
float | FillOpacity () |
![]() | |
void | setMap (MapFactory.MapFeatureContainer container) |
void | removeFromMap () |
void | Visible (boolean visibility) |
boolean | Visible () |
int | StrokeColor () |
void | StrokeOpacity (float opacity) |
float | StrokeOpacity () |
void | StrokeWidth (int width) |
int | StrokeWidth () |
void | Draggable (boolean draggable) |
boolean | Draggable () |
void | Title (String title) |
String | Title () |
void | Description (String description) |
String | Description () |
void | EnableInfobox (boolean enable) |
boolean | EnableInfobox () |
void | ShowInfobox () |
void | HideInfobox () |
YailList | Centroid () |
double | DistanceToFeature (MapFeature mapFeature, final boolean centroids) |
void | Click () |
void | LongClick () |
void | StartDrag () |
void | Drag () |
void | StopDrag () |
HandlesEventDispatching | getDispatchDelegate () |
final synchronized GeoPoint | getCentroid () |
final synchronized Geometry | getGeometry () |
![]() | |
void | setMap (MapFeatureContainer map) |
Protected Member Functions | |
Geometry | computeGeometry () |
![]() | |
MapFeatureBase (MapFeatureContainer container, MapFeatureVisitor< Double > distanceComputation) | |
final synchronized void | clearGeometry () |
Additional Inherited Members | |
![]() | |
static final String | ASSET_DIRECTORY = "component" |
static final int | ALIGNMENT_NORMAL = 0 |
static final int | ALIGNMENT_CENTER = 1 |
static final int | ALIGNMENT_OPPOSITE = 2 |
static final int | ACCELEROMETER_SENSITIVITY_WEAK = 1 |
static final int | ACCELEROMETER_SENSITIVITY_MODERATE = 2 |
static final int | ACCELEROMETER_SENSITIVITY_STRONG = 3 |
static final int | BUTTON_SHAPE_DEFAULT = 0 |
static final int | BUTTON_SHAPE_ROUNDED = 1 |
static final int | BUTTON_SHAPE_RECT = 2 |
static final int | BUTTON_SHAPE_OVAL = 3 |
static final int | COLOR_NONE = 0x00FFFFFF |
static final int | COLOR_BLACK = 0xFF000000 |
static final int | COLOR_BLUE = 0xFF0000FF |
static final int | COLOR_CYAN = 0xFF00FFFF |
static final int | COLOR_DKGRAY = 0xFF444444 |
static final int | COLOR_GRAY = 0xFF888888 |
static final int | COLOR_GREEN = 0xFF00FF00 |
static final int | COLOR_LTGRAY = 0xFFCCCCCC |
static final int | COLOR_MAGENTA = 0xFFFF00FF |
static final int | COLOR_ORANGE = 0xFFFFC800 |
static final int | COLOR_PINK = 0xFFFFAFAF |
static final int | COLOR_RED = 0xFFFF0000 |
static final int | COLOR_WHITE = 0xFFFFFFFF |
static final int | COLOR_YELLOW = 0xFFFFFF00 |
static final int | COLOR_DEFAULT = 0x00000000 |
static final String | DEFAULT_VALUE_COLOR_NONE = "&H00FFFFFF" |
static final String | DEFAULT_VALUE_COLOR_BLACK = "&HFF000000" |
static final String | DEFAULT_VALUE_COLOR_BLUE = "&HFF0000FF" |
static final String | DEFAULT_VALUE_COLOR_CYAN = "&HFF00FFFF" |
static final String | DEFAULT_VALUE_COLOR_DKGRAY = "&HFF444444" |
static final String | DEFAULT_VALUE_COLOR_GRAY = "&HFF888888" |
static final String | DEFAULT_VALUE_COLOR_GREEN = "&HFF00FF00" |
static final String | DEFAULT_VALUE_COLOR_LTGRAY = "&HFFCCCCCC" |
static final String | DEFAULT_VALUE_COLOR_MAGENTA = "&HFFFF00FF" |
static final String | DEFAULT_VALUE_COLOR_ORANGE = "&HFFFFC800" |
static final String | DEFAULT_VALUE_COLOR_PINK = "&HFFFFAFAF" |
static final String | DEFAULT_VALUE_COLOR_RED = "&HFFFF0000" |
static final String | DEFAULT_VALUE_COLOR_WHITE = "&HFFFFFFFF" |
static final String | DEFAULT_VALUE_COLOR_YELLOW = "&HFFFFFF00" |
static final String | DEFAULT_VALUE_COLOR_DEFAULT = "&H00000000" |
static final float | FONT_DEFAULT_SIZE = 14 |
static final int | LAYOUT_ORIENTATION_HORIZONTAL = ComponentConstants.LAYOUT_ORIENTATION_HORIZONTAL |
static final int | LAYOUT_ORIENTATION_VERTICAL = ComponentConstants.LAYOUT_ORIENTATION_VERTICAL |
static final int | SCALING_SCALE_PROPORTIONALLY = 0 |
static final int | SCALING_SCALE_TO_FIT = 1 |
static final int | TYPEFACE_DEFAULT = 0 |
static final int | TYPEFACE_SANSSERIF = 1 |
static final int | TYPEFACE_SERIF = 2 |
static final int | TYPEFACE_MONOSPACE = 3 |
static final int | LENGTH_PREFERRED = -1 |
static final int | LENGTH_FILL_PARENT = -2 |
static final int | LENGTH_UNKNOWN = -3 |
static final int | LENGTH_PERCENT_TAG = -1000 |
static final int | TOAST_LENGTH_SHORT = 0 |
static final int | TOAST_LENGTH_LONG = 1 |
static final int | DIRECTION_NORTH = 1 |
static final int | DIRECTION_NORTHEAST = 2 |
static final int | DIRECTION_EAST = 3 |
static final int | DIRECTION_SOUTHEAST = 4 |
static final int | DIRECTION_SOUTH = -1 |
static final int | DIRECTION_SOUTHWEST = -2 |
static final int | DIRECTION_WEST = -3 |
static final int | DIRECTION_NORTHWEST = -4 |
static final int | DIRECTION_NONE = 0 |
static final int | DIRECTION_MIN = -4 |
static final int | DIRECTION_MAX = 4 |
static float | SLIDER_MIN_VALUE = 10 |
static float | SLIDER_MAX_VALUE = 50 |
static float | SLIDER_THUMB_VALUE = (SLIDER_MIN_VALUE + SLIDER_MAX_VALUE) / 2.0f |
static final String | DEFAULT_VALUE_TEXT_TO_SPEECH_COUNTRY = "" |
static final String | DEFAULT_VALUE_TEXT_TO_SPEECH_LANGUAGE = "" |
![]() | |
MapFeatureContainer | container = null |
Map | map = null |
The Marker
component indicates points on a Map, such as buildings or other points of interest. Marker
s can be customized in many ways, such as using custom images from the app's assets or by changing the Marker
FillColor(int). Marker
s can also be created dynamically by calling the Map#CreateMarker(double, double) method and configured using the "Any Component" blocks.
Definition at line 50 of file Marker.java.
com.google.appinventor.components.runtime.Marker.Marker | ( | MapFactory.MapFeatureContainer | container | ) |
Creates a new Marker object contained within the container
. container
is only valid if it is a Map or FeatureCollection.
container | the container the Marker belongs to. |
Definition at line 178 of file Marker.java.
int com.google.appinventor.components.runtime.Marker.AnchorHorizontal | ( | ) |
Sets or gets the horizontal offset of the Marker
center relative to its image. Valid values are: 1
(Left), 2
(Right), or 3
(Center).
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 317 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.AnchorHorizontal | ( | int | horizontal | ) |
Sets the horizontal position of the marker image relative to the marker location. Valid values are 1 (left), 2 (right), and 3 (center).
horizontal | the new horizontal alignment of the marker image relative to its point location. |
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 299 of file Marker.java.
int com.google.appinventor.components.runtime.Marker.AnchorVertical | ( | ) |
Sets or gets the vertical offset of the Marker
center relative to its image. Valid values are: 1
(Top), 2
(Center), or 3
(Bottom).
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 343 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.AnchorVertical | ( | int | vertical | ) |
Sets the vertical position of the marker image relative to the marker location. Valid values are 1 (top), 2 (center), and 3 (bottom).
vertical | the new vertical alignment of the marker image relative to its point location. |
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 325 of file Marker.java.
double com.google.appinventor.components.runtime.Marker.BearingToFeature | ( | MapFeature | mapFeature, |
final boolean | centroids | ||
) |
Returns the bearing from the Marker
to the given map feature, in degrees from due north. If the centroids
parameter is true
{:.logic.block}, the bearing will be to the center of the map feature. Otherwise, the bearing will be computed to the point in the feature nearest the Marker
.
mapFeature | The target map feature used for computing the bearing from the Marker |
centroids | True if the centroid of the target feature should be used for the computation, otherwise false for the nearest point on the edge of the feature |
Definition at line 512 of file Marker.java.
double com.google.appinventor.components.runtime.Marker.BearingToPoint | ( | double | latitude, |
double | longitude | ||
) |
Returns the bearing from the Marker
to the given latitude
and longitude
, in degrees from due north.
latitude | |
longitude |
Definition at line 492 of file Marker.java.
|
protected |
Reimplemented from com.google.appinventor.components.runtime.MapFeatureBase.
Definition at line 533 of file Marker.java.
double com.google.appinventor.components.runtime.Marker.DistanceToPoint | ( | double | latitude, |
double | longitude | ||
) |
Compute the distance, in meters, between a Marker
and a latitude
, longitude
point.
latitude | |
longitude |
Definition at line 476 of file Marker.java.
double com.google.appinventor.components.runtime.Marker.DistanceToPoint | ( | double | latitude, |
double | longitude, | ||
boolean | centroid | ||
) |
Suppresses the blocks version of this method so that DistanceToPoint(double, double) will be provided instead. Note that this will call through to the other method in case the Marker is passed to an "Any Component" block that computes distance.
latitude | latitude of the point to compute distance to |
longitude | longitude of the point to compute distance to |
centroid | ignored–a marker and a (lat, lon) are already both points |
Reimplemented from com.google.appinventor.components.runtime.MapFeatureBase.
Definition at line 462 of file Marker.java.
IGeoPoint com.google.appinventor.components.runtime.Marker.getLocation | ( | ) |
Gets the location of the Marker.
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 517 of file Marker.java.
int com.google.appinventor.components.runtime.Marker.Height | ( | ) |
Specifies the type%
's vertical height, measured in pixels.
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 415 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.Height | ( | int | height | ) |
Specifies the type%
's vertical height, measured in pixels.
height | the new height of the marker image |
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 405 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.HeightPercent | ( | int | pCent | ) |
Specifies the type%
's vertical height as a percentage of the Screen
's Height
.
pCent | The new height, in percent, of the marker image. |
Definition at line 432 of file Marker.java.
String com.google.appinventor.components.runtime.Marker.ImageAsset | ( | ) |
Specifies the image shown for the Marker
. If set to the empty string "", then the default marker icon will be used.
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 281 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.ImageAsset | ( | String | path | ) |
Specifies the image shown for the Marker
. If set to the empty string "", then the default marker icon will be used.
path | a relative or absolute path, or a url, to an image asset to use for the marker. |
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 269 of file Marker.java.
double com.google.appinventor.components.runtime.Marker.Latitude | ( | ) |
@suppressdoc
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 227 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.Latitude | ( | double | latitude | ) |
Sets or gets the latitude of the Marker
, in degrees, with positive values representing north of the equator and negative values representing south of the equator. To update the Latitude
and Longitude(double) simultaneously, use the SetLocation(double, double) method.
latitude | the new latitude of the marker. Range: [-90, 90] |
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 212 of file Marker.java.
double com.google.appinventor.components.runtime.Marker.Longitude | ( | ) |
@suppressdoc
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 257 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.Longitude | ( | double | longitude | ) |
Sets or gets the longitude of the Marker
, in degrees, with positive values representing east of the prime meridian and negative values representing west of the prime meridian. To update the Latitude(double) and Longitude
simultaneously, use the SetLocation(double, double) method.
longitude | the new longitude of the marker. Range: [-180, 180] |
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 242 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.SetLocation | ( | double | latitude, |
double | longitude | ||
) |
Sets the location of the Marker
.
latitude | the new latitude of the marker |
longitude | the new longitude of the marker |
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 444 of file Marker.java.
boolean com.google.appinventor.components.runtime.Marker.ShowShadow | ( | ) |
Gets whether the map should render a shadow under the marker.
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 355 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.ShowShadow | ( | boolean | show | ) |
Sets whether to show a shadow under the marker.
show | show a shadow under the marker |
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 349 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.StrokeColor | ( | int | argb | ) |
@suppressdoc
argb | the outline paint color |
Reimplemented from com.google.appinventor.components.runtime.MapFeatureBase.
Definition at line 290 of file Marker.java.
String com.google.appinventor.components.runtime.Marker.Type | ( | ) |
Return the type of the map feature. For Marker, this returns the text "Marker".
Implements com.google.appinventor.components.runtime.util.MapFactory.MapFeature.
Definition at line 197 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.updateLocation | ( | double | latitude, |
double | longitude | ||
) |
Updates the location of the marker without triggering any events or a redraw. This is used to update the App Inventor object in response to a user action in the map (e.g., dragging).
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 522 of file Marker.java.
int com.google.appinventor.components.runtime.Marker.Width | ( | ) |
Specifies the horizontal width of the type%
, measured in pixels.
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 376 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.Width | ( | int | width | ) |
Specifies the horizontal width of the type%
, measured in pixels.
width | the new width of the marker image |
Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.
Definition at line 366 of file Marker.java.
void com.google.appinventor.components.runtime.Marker.WidthPercent | ( | int | pCent | ) |
Specifies the horizontal width of the type%
as a percentage of the Screen
's Width
.
pCent | the new width, in percent, of the marker image |
Definition at line 393 of file Marker.java.