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

jGoogleMaps

List of types:

CameraPosition
GoogleMap
LatLng
LatLongBounds
MapCircle
MapInfoWindow
MapOptions
MapPolygon
MapPolyline
Marker

CameraPosition

The map view is modeled as a camera looking down on a flat plane.
See this link for more information about the possible values.

Events:

None

Members:


  Initialize (Lat As Double, Lng As Double, Zoom As Int)

  Target As LatLng [read only]

  toString As String

  Zoom As Float [read only]

Members description:

Initialize (Lat As Double, Lng As Double, Zoom As Int)
Initializes the camera position with the given latitude, longitude and zoom.
Target As LatLng [read only]
Returns the location that the camera is pointing at.
toString As String
Zoom As Float [read only]
Returns the zoom level.

GoogleMap

Uses GoogleMap JavaScript V3 API to show a map inside WebView.
GoogleMap.AsPane returns a Pane which should be added to the nodes tree.
The map is only ready after Ready event is raised.
Requires Java 8+.

Events:

Ready
CameraChange (Position As CameraPosition)
Click (Point As LatLng)
CircleClick (SelectedCircle As MapCircle)
MarkerClick (SelectedMarker As Marker)
PolygonClick (SelectedPolygon As MapPolygon)
PolylineClick (SelectedPolyline As MapPolyline)

Members:


  AddCircle (Center As LatLng, Radius As Double, StrokeWidth As Float, StrokeColor As javafx.scene.paint.Paint, FillColor As javafx.scene.paint.Paint, Opacity As Double) As MapCircle

  AddInfoWindow (Content As String, Position As LatLng) As MapInfoWindow

  AddInfoWindow2 (Content As String, Position As LatLng, MaxWidth As Int) As MapInfoWindow

  AddInfoWindowToMarker (Content As String, Marker As Marker) As MapInfoWindow

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

  AddMarker2 (Lat As Double, Lon As Double, Title As String, IconUri As String) As Marker

  AddPolygon (Points As List, StrokeWidth As Float, StrokeColor As javafx.scene.paint.Paint, FillColor As javafx.scene.paint.Paint, Opacity As Double) As MapPolygon

  AddPolyline (Points As List, Width As Float, Color As javafx.scene.paint.Paint) As MapPolyline

  AsPane As ConcretePaneWrapper [read only]

  Bounds As LatLongBounds [read only]

  CameraPosition As CameraPosition [read only]

  CloseInfoWindow (InfoWindow As MapInfoWindow)

  FitBounds (bounds As LatLongBounds)

  Initialize (EventName As String, Options As MapOptions)

  Initialize2 (EventName As String, Options As MapOptions, ApiKey As String)

  IsReady As Boolean

  MAP_TYPE_HYBRID As com.lynden.gmapsfx.javascript.object.MapTypeIdEnum

  MAP_TYPE_NORMAL As com.lynden.gmapsfx.javascript.object.MapTypeIdEnum

  MAP_TYPE_SATELLITE As com.lynden.gmapsfx.javascript.object.MapTypeIdEnum

  MAP_TYPE_TERRAIN As com.lynden.gmapsfx.javascript.object.MapTypeIdEnum

  MapType As Object [write only]

  MoveCamera (NewPosition As CameraPosition)

  MoveCamera2 (NewPosition As LatLng)

  PanToBounds (bounds As LatLongBounds)

  RemoveCircle (Circle As MapCircle)

  RemoveMarker (Marker As Marker)

  RemovePolygon (Polygon As MapPolygon)

  RemovePolyline (Polyline As MapPolyline)

  Zoom As Int [write only]

Members description:

AddCircle (Center As LatLng, Radius As Double, StrokeWidth As Float, StrokeColor As javafx.scene.paint.Paint, FillColor As javafx.scene.paint.Paint, Opacity As Double) As MapCircle
Adds a circle to the map.
Center - Position of the circle center.
Radius - Circle radius.
StrokeWidth - Stroke width.
StrokeColor - Stroke color.
FillColor - Inner color.
Opacity - Inner color opacity. Value between 0 to 1.
AddInfoWindow (Content As String, Position As LatLng) As MapInfoWindow
Opens an info window with the given HTML content at the specified position.
AddInfoWindow2 (Content As String, Position As LatLng, MaxWidth As Int) As MapInfoWindow
Opens an info window with the given HTML content at the specified position. It cannot be larger than MaxWidth (in pixels).
AddInfoWindowToMarker (Content As String, Marker As Marker) As MapInfoWindow
Opens an info window with the given HTML content above the specified marker.
AddMarker (Lat As Double, Lon As Double, Title As String) As Marker
Adds a marker to the map.
AddMarker2 (Lat As Double, Lon As Double, Title As String, IconUri As String) As Marker
Adds a marker to the map with a custom icon.
The IconUri must point to an online image or an image from the assets folder.
In the later case the custom icon will only appear in Release mode.
Example:
gmap.AddMarker2(10, 10, "This is a test", _
     File.GetUri(File.DirAssets, "SomeIcon.png"))
AddPolygon (Points As List, StrokeWidth As Float, StrokeColor As javafx.scene.paint.Paint, FillColor As javafx.scene.paint.Paint, Opacity As Double) As MapPolygon
Adds a polygon to the map.
Points - A list or array of LatLng points.
StrokeWidth - Stroke width.
StrokeColor - Stroke color.
FillColor - Inner color.
Opacity - Inner color opacity. Value between 0 to 1.
AddPolyline (Points As List, Width As Float, Color As javafx.scene.paint.Paint) As MapPolyline
Adds a polyline to the map.
Points - A list or array of LatLng points.
Width - Line width.
Color - Line color.
AsPane As ConcretePaneWrapper [read only]
Returns the pane that holds the map.
Bounds As LatLongBounds [read only]
Returns the LatLongBounds of the visual area. It is recommended to read Bounds only inside the CameraChange event because its values may be incorrect otherwise.
CameraPosition As CameraPosition [read only]
Returns the current camera position.
CloseInfoWindow (InfoWindow As MapInfoWindow)
Closes the specified info window.
FitBounds (bounds As LatLongBounds)
Moves the map to ensure the given bounds fit within the viewport.
Note that the Google Maps API will add a margin around these bounds.
Initialize (EventName As String, Options As MapOptions)
Initializes the map. The Ready event will be raised when the map is ready.
EventName - Sets the subs that will handle the events.
Options - MapOptions object. Pass Null for the default options.
Initialize2 (EventName As String, Options As MapOptions, ApiKey As String)
Similar to Initialize. Allows setting the
api key.
Example: map.Initialize2("map", Null, "AIzattttttt_tttttttthGujrM")
IsReady As Boolean
Returns True when the map is ready.
MAP_TYPE_HYBRID As com.lynden.gmapsfx.javascript.object.MapTypeIdEnum
MAP_TYPE_NORMAL As com.lynden.gmapsfx.javascript.object.MapTypeIdEnum
MAP_TYPE_SATELLITE As com.lynden.gmapsfx.javascript.object.MapTypeIdEnum
MAP_TYPE_TERRAIN As com.lynden.gmapsfx.javascript.object.MapTypeIdEnum
MapType As Object [write only]
Sets the map type. The value should be one of the MAP_TYPE constants.
MoveCamera (NewPosition As CameraPosition)
Moves the camera position.
MoveCamera2 (NewPosition As LatLng)
Moves the camera position.
PanToBounds (bounds As LatLongBounds)
Pans the map by the minimum amount necessary to contain the given LatLongBounds. It makes no guarantee where on the map the bounds will be, except that as much of the bounds as possible will be visible.
RemoveCircle (Circle As MapCircle)
Removes the specified circle from the map.
RemoveMarker (Marker As Marker)
Removes the specified marker from the map.
RemovePolygon (Polygon As MapPolygon)
Removes the specified polygon from the map.
RemovePolyline (Polyline As MapPolyline)
Removes the specified polyline from the map.
Zoom As Int [write only]
Sets the zoom level.

LatLng

Holds latitude and longitude values.

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)
Initializes a new object.
IsInitialized As Boolean
Latitude As Double [read only]
Returns the latitude value.
Longitude As Double [read only]
Returns the longitude value.

LatLongBounds


Events:

None

Members:


  Initialize (NorthEast As LatLng, SouthWest As LatLng)

  IsInitialized As Boolean

  NorthEast As LatLng [read only]

  SouthWest As LatLng [read only]

Members description:

Initialize (NorthEast As LatLng, SouthWest As LatLng)
IsInitialized As Boolean
NorthEast As LatLng [read only]
SouthWest As LatLng [read only]

MapCircle


Events:

None

Members:


  Bounds As LatLongBounds [read only]

  Center As LatLng

  IsInitialized As Boolean

  Radius As Double

  Visible As Boolean

Members description:

Bounds As LatLongBounds [read only]
Gets the circle bounds.
Center As LatLng
Gets or sets the circle center.
IsInitialized As Boolean
Radius As Double
Gets or sets the circle radius.
Visible As Boolean
Gets or sets whether this circle is visible.

MapInfoWindow


Events:

None

Members:


  Content As String

  IsInitialized As Boolean

  Position As LatLng

Members description:

Content As String
Gets or sets the HTML content of this info window.
IsInitialized As Boolean
Position As LatLng
Gets or sets the position of this info window.

MapOptions

MapOptions is passed to GoogleMap.Initialize method.
It allows you to choose which controls will be available.

Events:

None

Members:


  MapTypeControl As Boolean

  OverviewMapControl As Boolean

  PanControl As Boolean

  ScrollWheel As Boolean

  StreetViewControl As Boolean

  ZoomControl As Boolean

Members description:

MapTypeControl As Boolean
OverviewMapControl As Boolean
PanControl As Boolean
ScrollWheel As Boolean
StreetViewControl As Boolean
ZoomControl As Boolean

MapPolygon


Events:

None

Members:


  IsInitialized As Boolean

  Visible As Boolean

Members description:

IsInitialized As Boolean
Visible As Boolean
Gets or sets whether this polygon is visible.

MapPolyline


Events:

None

Members:


  IsInitialized As Boolean

  Visible As Boolean

Members description:

IsInitialized As Boolean
Visible As Boolean
Gets or sets whether this polyline is visible.

Marker


Events:

None

Members:


  IsInitialized As Boolean

  Position As LatLng [write only]

  Title As String [write only]

  Visible As Boolean

Members description:

IsInitialized As Boolean
Position As LatLng [write only]
Sets the marker position.
Title As String [write only]
Sets the marker title.
Visible As Boolean
Gets or sets whether the marker is visible.
Top