Android Programming Press on the image to return to the main documentation page.

iGoogleMaps

List of types:

CameraPosition
GoogleMap
LatLng
MapUiSettings
Marker
Polyline

CameraPosition

The map view is modeled as a camera looking down on a flat plane.

Events:

None

Members:


  Bearing As Double [read only]

  Initialize (Lat As Double, Lon As Double, Zoom As Float)

  Initialize2 (Lat As Double, Lon As Double, Zoom As Float, Bearing As Float, Tilt As Float)

  IsInitialized As Boolean

  Tag As Object

  Target As LatLng [read only]

  Tilt As Double [read only]

  Zoom As Float [read only]

Members description:

Bearing As Double [read only]
Returns the direction the camera points at.
Initialize (Lat As Double, Lon As Double, Zoom As Float)
Initializes the CameraPosition object.
Initialize2 (Lat As Double, Lon As Double, Zoom As Float, Bearing As Float, Tilt As Float)
Initializes the CameraPosition object.
IsInitialized As Boolean
Tests whether this object was initialized.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.
Target As LatLng [read only]
Returns the location that the camera is pointing at.
Tilt As Double [read only]
Returns the tilt level.
Zoom As Float [read only]
Returns the zoom level.

GoogleMap

GoogleMap is a View that shows an interactive map.

Events:

CameraChange (Position As CameraPosition)
Click (Point As LatLng)
MarkerClick (SelectedMarker As Marker) As Boolean 'Return True to consume the click
MarkerDragged (SelectedMarker As Marker)
InfoWindowClick (SelectedMarker As Marker)
Click
LongClick

Members:


  AddMarker (Lat As Double, Lon As Double, Title As String) As Marker

  AddMarker2 (Lat As Double, Lon As Double, Title As String, Color As Int) As Marker

  AddMarker3 (Lat As Double, Lon As Double, Title As String, Image As Object) As Marker

  AddPolyline As Polyline

  Alpha As Float

  AnimateCamera (NewPosition As CameraPosition)

  BringToFront

  CalcRelativeKeyboardHeight (KeyboardHeight As Double) As Double

  CameraPosition As CameraPosition [read only]

  Clear

  Color As Int

  GetOpenSourceLicenseInfo As String

  GetUiSettings As MapUiSettings

  Height As Float

  Initialize (EventName As String, ApiKey As String)

  IsFocused As Boolean [read only]

  IsInitialized As Boolean

  Left As Float

  MAP_TYPE_HYBRID As Int [read only]

  MAP_TYPE_NONE As Int [read only]

  MAP_TYPE_NORMAL As Int [read only]

  MAP_TYPE_SATELLITE As Int [read only]

  MAP_TYPE_TERRAIN As Int [read only]

  MapType As Int

  MoveCamera (NewPosition As CameraPosition)

  MyLocation As LatLng [read only]

  MyLocationEnabled As Boolean

  Parent As ViewWrapper [read only]

  RemoveViewFromParent

  RequestFocus As Boolean

  ResignFocus As Boolean

  SendToBack

  SetAlphaAnimated (DurationMS As Int, Alpha As Float)

  SetBorder (Width As Float, Color As Int, CornerRadius As Float)

  SetColorAnimated (DurationMS As Int, BackgroundColor As Int)

  SetLayoutAnimated (DurationMS As Int, DampingRatio As Float, Left As Float, Top As Float, Width As Float, Height As Float)

  SetParallaxEffect (Vertical As Int, Horizontal As Int)

  SetShadow (Color As Int, OffsetX As Float, OffsetY As Float, Opacity As Float, StaticRect As Boolean)

  SizeToFit

  Tag As Object

  TintColor As Int

  Top As Float

  TrafficEnabled As Boolean

  UserInteractionEnabled As Boolean

  Visible As Boolean

  Width As Float

Members description:

AddMarker (Lat As Double, Lon As Double, Title As String) As Marker
Adds a marker to the map and returns the new Marker object.
AddMarker2 (Lat As Double, Lon As Double, Title As String, Color As Int) As Marker
Adds a marker to the map and returns the new Marker object.
AddMarker3 (Lat As Double, Lon As Double, Title As String, Image As Object) As Marker
Adds a marker to the map and returns the new Marker object.
AddPolyline As Polyline
Adds an empty Polyline to the map.
Alpha As Float
Gets or sets the view's alpha level. 0 - transparent, 1 (default) - fully opaque.
AnimateCamera (NewPosition As CameraPosition)
Moves the camera to the new position.
BringToFront
Brings the view to front.
CalcRelativeKeyboardHeight (KeyboardHeight As Double) As Double
Calculates the keyboard top point relative to the current view.
CameraPosition As CameraPosition [read only]
Gets the current camera position.
Clear
Clears all overlay objects.
Color As Int
Gets or sets the view's background color.
GetOpenSourceLicenseInfo As String
Returns the requires attribution text.
GetUiSettings As MapUiSettings
Returns the MapUISettings object.
Height As Float
Gets or sets the view's height.
Initialize (EventName As String, ApiKey As String)
Initializes the map. ApiKey must match the key in Google developers console.
IsFocused As Boolean [read only]
Returns true if the view is focused.
IsInitialized As Boolean
Tests whether this object was initialized.
Left As Float
Gets or sets the view's left position.
MAP_TYPE_HYBRID As Int [read only]
MAP_TYPE_NONE As Int [read only]
MAP_TYPE_NORMAL As Int [read only]
MAP_TYPE_SATELLITE As Int [read only]
MAP_TYPE_TERRAIN As Int [read only]
MapType As Int
Gets or sets the map type. The value should be one of the MAP_TYPE constants.
MoveCamera (NewPosition As CameraPosition)
Immediately moves the camera to the new position.
MyLocation As LatLng [read only]
Gets the current user location. Returns an uninitialized LatLng object if location is not available.
MyLocationEnabled As Boolean
Gets or sets whether the user location will be displayed.
Parent As ViewWrapper [read only]
Returns the views parent. The returned view can be uninitialized (if there is no parent).
RemoveViewFromParent
Removes the view from its parent (same as B4A View.RemoveView method).
RequestFocus As Boolean
Tries to set the focus on the current view. Returns True if the focus was set. Most views are not focusable.
When a text view is focused the keyboard is shown.
ResignFocus As Boolean
Removes the focus from the current view. Removing the focus from a text view will hide the keyboard.
SendToBack
Sends the view to the back.
SetAlphaAnimated (DurationMS As Int, Alpha As Float)
Animates the view's alpha level.
DurationMS - Animation duration measured in milliseconds.
Alpha - The new alpha level (0 - transparent, 1 - fully opaque).
SetBorder (Width As Float, Color As Int, CornerRadius As Float)
Sets the view's border width, color and corner radius.
Note that the corner radius should be 0 if the view should show a shadow as well.
SetColorAnimated (DurationMS As Int, BackgroundColor As Int)
Animates the view's background color.
DurationMS - Animation duration measured in milliseconds.
BackgroundColor - The new background color.
Note that Labels do not support this type of animation.
SetLayoutAnimated (DurationMS As Int, DampingRatio As Float, Left As Float, Top As Float, Width As Float, Height As Float)
Animates the view's layout.
DurationMS - Animation duration measured in milliseconds. Set to 0 to change the layout immediately.
DampingRatio - If smaller than 1 then a spring effect will be applied to the animation. The minimum value should be 0.1.
Set to 1 for no spring effect.
Left, Top, Width and Height - The new layout.
SetParallaxEffect (Vertical As Int, Horizontal As Int)
Adds a parallax effect to the view. The view will slightly move when the device is tilted.
Vertical - Vertical offset. Can be a positive or negative value.
Horizontal - Horizontal offset. Can be a positive or negative value.
SetShadow (Color As Int, OffsetX As Float, OffsetY As Float, Opacity As Float, StaticRect As Boolean)
Adds a shadow to to the view. The border corners radius should be set to 0 when adding shadows.
Colors - The shadow color.
OffsetX, OffsetY - The horizontal and vertical offsets.
Opacity - Sets the shadow opacity: 0 - transparent, 1 - opaque.
StaticRect - (optimization parameter) Set this parameter to True if the view's size is constant.
SizeToFit
Resizes the view to make it fit its content.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.
TintColor As Int
Gets or sets the view's tint color. Some views use this color to change their appearance.
Top As Float
Gets or sets the view's top position.
TrafficEnabled As Boolean
Gets or sets whether traffic data will be displayed (if it is available).
UserInteractionEnabled As Boolean
Gets or sets whether the user can interact with this view. True by default.
Visible As Boolean
Gets or sets whether the view is visible.
Width As Float
Gets or sets the view's width.

LatLng


Events:

None

Members:


  Initialize (Latitude As Double, Longitude As Double)

  IsInitialized As Boolean

  Latitude As Double [read only]

  Longitude As Double [read only]

Members description:

Initialize (Latitude As Double, Longitude As Double)
IsInitialized As Boolean
Latitude As Double [read only]
Longitude As Double [read only]

MapUiSettings


Events:

None

Members:


  AllGesturesEnabled As Boolean

  CompassEnabled As Boolean

  IsInitialized As Boolean

  MyLocationButtonEnabled As Boolean

  RotateGesturesEnabled As Boolean

  ScrollGesturesEnabled As Boolean

  Tag As Object

  TiltGesturesEnabled As Boolean

  ZoomGesturesEnabled As Boolean

Members description:

AllGesturesEnabled As Boolean
(write only) Enabled or disables all the gestures.
CompassEnabled As Boolean
Gets or sets whether the compass button is visible.
IsInitialized As Boolean
Tests whether this object was initialized.
MyLocationButtonEnabled As Boolean
Gets or sets whether the MyLocation button is visible.
RotateGesturesEnabled As Boolean
Gets or sets whether rotation gestures are enabled.
ScrollGesturesEnabled As Boolean
Gets or sets whether scrolling gestures are enabled.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.
TiltGesturesEnabled As Boolean
Gets or sets whether tilt gestures are enabled.
ZoomGesturesEnabled As Boolean
Gets or sets whether zoom gestures are enabled.

Marker

A marker icon placed on the map. Call GoogleMap.AddMarker to add a marker.

Events:

None

Members:


  Draggable As Boolean

  IsInitialized As Boolean

  Opacity As Float

  Position As LatLng

  Remove

  Snippet As String

  Tag As Object

  Title As String

Members description:

Draggable As Boolean
Gets or sets whether the user can drag the marker. The default value is false.
IsInitialized As Boolean
Tests whether this object was initialized.
Opacity As Float
Gets or sets the opacity (0 - transparent, 1 - fully opaque).
Position As LatLng
Gets or sets the marker position.
Remove
Removes the marker from the map.
Snippet As String
Gets or sets the snippet text.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.
Title As String
Gets or sets the title.

Polyline

A series of lines added to the map.
Call GoogleMap.AddPolyline to create this object.

Events:

None

Members:


  Color As Int

  Geodesic As Boolean

  IsInitialized As Boolean

  Points As List

  Remove

  Tag As Object

  Width As Float

  ZIndex As Int

Members description:

Color As Int
Gets or sets the lines color.
Geodesic As Boolean
Gets or sets whether the line segments are geodesic lines (shortest path on the earth surface) or straight lines (default).
IsInitialized As Boolean
Tests whether this object was initialized.
Points As List
Gets or sets the list of points. Each item in the list should be a LatLng object.
Remove
Removes the Polyline from the map.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.
Width As Float
Gets or sets the line stroke width.
ZIndex As Int
Gets or sets the line Z index.
Top