AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.Marker Class Reference
Inheritance diagram for com.google.appinventor.components.runtime.Marker:
com.google.appinventor.components.runtime.MapFeatureBaseWithFill com.google.appinventor.components.runtime.util.MapFactory.MapMarker com.google.appinventor.components.runtime.MapFeatureBase com.google.appinventor.components.runtime.util.MapFactory.HasFill com.google.appinventor.components.runtime.util.MapFactory.MapFeature com.google.appinventor.components.runtime.util.MapFactory.HasFill com.google.appinventor.components.runtime.util.MapFactory.HasStroke com.google.appinventor.components.runtime.util.MapFactory.MapFeature com.google.appinventor.components.runtime.util.MapFactory.HasStroke com.google.appinventor.components.runtime.Component com.google.appinventor.components.runtime.Component

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)
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.MapFeatureBaseWithFill
 MapFeatureBaseWithFill (MapFactory.MapFeatureContainer container, MapFeatureVisitor< Double > distanceComputation)
 
void FillColor (int argb)
 
int FillColor ()
 
void FillOpacity (float opacity)
 
float FillOpacity ()
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.MapFeatureBase
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 ()
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.util.MapFactory.MapFeature
void setMap (MapFeatureContainer map)
 

Protected Member Functions

Geometry computeGeometry ()
 
- Protected Member Functions inherited from com.google.appinventor.components.runtime.MapFeatureBase
 MapFeatureBase (MapFeatureContainer container, MapFeatureVisitor< Double > distanceComputation)
 
final synchronized void clearGeometry ()
 

Additional Inherited Members

- Static Public Attributes inherited from com.google.appinventor.components.runtime.Component
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 = ""
 
- Protected Attributes inherited from com.google.appinventor.components.runtime.MapFeatureBase
MapFeatureContainer container = null
 
Map map = null
 

Detailed Description

The Marker component indicates points on a Map, such as buildings or other points of interest. Markers can be customized in many ways, such as using custom images from the app's assets or by changing the Marker FillColor(int). Markers 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.

Constructor & Destructor Documentation

◆ Marker()

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.

Parameters
containerthe container the Marker belongs to.

Definition at line 178 of file Marker.java.

Member Function Documentation

◆ AnchorHorizontal() [1/2]

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.

◆ AnchorHorizontal() [2/2]

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).

Parameters
horizontalthe 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.

◆ AnchorVertical() [1/2]

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.

◆ AnchorVertical() [2/2]

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).

Parameters
verticalthe 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.

◆ BearingToFeature()

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.

Parameters
mapFeatureThe target map feature used for computing the bearing from the Marker
centroidsTrue 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
Returns
The bearing in degrees east of due north

Definition at line 512 of file Marker.java.

◆ BearingToPoint()

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.

Parameters
latitude
longitude
Returns

Definition at line 492 of file Marker.java.

◆ computeGeometry()

Geometry com.google.appinventor.components.runtime.Marker.computeGeometry ( )
protected

Reimplemented from com.google.appinventor.components.runtime.MapFeatureBase.

Definition at line 533 of file Marker.java.

◆ DistanceToPoint() [1/2]

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.

Parameters
latitude
longitude
Returns

Definition at line 476 of file Marker.java.

◆ DistanceToPoint() [2/2]

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.

Parameters
latitudelatitude of the point to compute distance to
longitudelongitude of the point to compute distance to
centroidignored–a marker and a (lat, lon) are already both points
Returns
the distance in meters from the marker to the given (lat, lon)

Reimplemented from com.google.appinventor.components.runtime.MapFeatureBase.

Definition at line 462 of file Marker.java.

◆ getLocation()

IGeoPoint com.google.appinventor.components.runtime.Marker.getLocation ( )

Gets the location of the Marker.

Returns
the (latitude, longitude) of the marker's position as a IGeoPoint.

Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.

Definition at line 517 of file Marker.java.

◆ Height() [1/2]

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.

◆ Height() [2/2]

void com.google.appinventor.components.runtime.Marker.Height ( int  height)

Specifies the type%'s vertical height, measured in pixels.

Parameters
heightthe new height of the marker image

Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.

Definition at line 405 of file Marker.java.

◆ HeightPercent()

void com.google.appinventor.components.runtime.Marker.HeightPercent ( int  pCent)

Specifies the type%'s vertical height as a percentage of the Screen's Height.

Parameters
pCentThe new height, in percent, of the marker image.

Definition at line 432 of file Marker.java.

◆ ImageAsset() [1/2]

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.

◆ ImageAsset() [2/2]

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.

Parameters
patha 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.

◆ Latitude() [1/2]

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.

◆ Latitude() [2/2]

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.

Parameters
latitudethe 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.

◆ Longitude() [1/2]

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.

◆ Longitude() [2/2]

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.

Parameters
longitudethe 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.

◆ SetLocation()

void com.google.appinventor.components.runtime.Marker.SetLocation ( double  latitude,
double  longitude 
)

Sets the location of the Marker.

Parameters
latitudethe new latitude of the marker
longitudethe new longitude of the marker

Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.

Definition at line 444 of file Marker.java.

◆ ShowShadow() [1/2]

boolean com.google.appinventor.components.runtime.Marker.ShowShadow ( )

Gets whether the map should render a shadow under the marker.

Returns
true if the marker should have a shadow, otherwise false.
Deprecated:
See the deprecation message for ShowShadow(boolean).

Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.

Definition at line 355 of file Marker.java.

◆ ShowShadow() [2/2]

void com.google.appinventor.components.runtime.Marker.ShowShadow ( boolean  show)

Sets whether to show a shadow under the marker.

Parameters
showshow a shadow under the marker
Deprecated:
This isn't guaranteed to be supported on multiple platforms so it was deprecated prior to official release. Some apps developed using earlier versions of Maps on test servers may reference this property, but it may be removed in a future version of App Inventor.

Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.

Definition at line 349 of file Marker.java.

◆ StrokeColor()

void com.google.appinventor.components.runtime.Marker.StrokeColor ( int  argb)

@suppressdoc

Parameters
argbthe outline paint color

Reimplemented from com.google.appinventor.components.runtime.MapFeatureBase.

Definition at line 290 of file Marker.java.

◆ Type()

String com.google.appinventor.components.runtime.Marker.Type ( )

Return the type of the map feature. For Marker, this returns the text "Marker".

Returns
the type of the feature

Implements com.google.appinventor.components.runtime.util.MapFactory.MapFeature.

Definition at line 197 of file Marker.java.

◆ updateLocation()

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).

Parameters
latitudeNew latitude of the Marker
longitudeNew longitude of the Marker

Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.

Definition at line 522 of file Marker.java.

◆ Width() [1/2]

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.

◆ Width() [2/2]

void com.google.appinventor.components.runtime.Marker.Width ( int  width)

Specifies the horizontal width of the type%, measured in pixels.

Parameters
widththe new width of the marker image

Implements com.google.appinventor.components.runtime.util.MapFactory.MapMarker.

Definition at line 366 of file Marker.java.

◆ WidthPercent()

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.

Parameters
pCentthe new width, in percent, of the marker image

Definition at line 393 of file Marker.java.


The documentation for this class was generated from the following file: