Top Fields Constructors Methods
com.dlsc.gmapsfx.javascript.object

public Class DirectionsPane

extends JavascriptObject
Class Inheritance
Imports
com.dlsc.gmapsfx.javascript.JavascriptObject, com.dlsc.gmapsfx.javascript.event.EventHandlers, .GFXEventHandler, .MapStateEventType, .StateEventHandler, .UIEventHandler, .UIEventType, javafx.beans.property.IntegerProperty, .ReadOnlyObjectProperty, .ReadOnlyObjectWrapper, .SimpleIntegerProperty, javafx.beans.value.ObservableValue, javafx.geometry.Point2D, netscape.javascript.JSObject

Author
Andre

Field Summary

Modifier and TypeField and Description
private ReadOnlyObjectWrapper<LatLong>
protected static String
private final EventHandlers
private boolean
protected MapOptions
private boolean
private boolean
private IntegerProperty
Inherited from com.dlsc.gmapsfx.javascript.JavascriptObject:
jsObjectobjectCounterpeerRegistryruntimevariableName

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
addStateEventHandler(MapStateEventType
Type of the event to register against.
type
,
StateEventHandler
Handler that will be called when the event occurs.
h
)

Adds a handler for a state type event on the map.

public void
addUIEventHandler(UIEventType
Type of the event to register against.
type
,
UIEventHandler
Handler that will be called when the event occurs.
h
)

Adds a handler for a mouse type event on the map.

public void
addUIEventHandler(JavascriptObject
The object that the event should be registered on.
obj
,
UIEventType
Type of the event to register against.
type
,
UIEventHandler
Handler that will be called when the event occurs.
h
)

Adds a handler for a mouse type event on the map.

public final ReadOnlyObjectProperty<LatLong>
public void
public Point2D
fromLatLngToPoint(LatLong loc)

Returns the screen point for the provided LatLong.

public LatLongBounds
getBounds()

Returns the LatLongBounds of the visual area.

public LatLong
public double
public LatLong
public Projection
public int
private int
private void
internalSetZoom(int zoom)

public void
panBy(double
delta x value in pixels.
x
,
double
delta y value in pixels.
y
)

Pans the map by the supplied values.

private String

Returns:

Callback key that Javascript will use to find this handler.
registerEventHandler
(GFXEventHandler
Event handler to be registered.
h
)

Registers an event handler in the repository shared between Javascript and Java.

public void
public void
public void
setCenter(LatLong latLong)

public void
setHeading(double heading)

public void
public void
setZoom(int zoom)

public IntegerProperty
Inherited from com.dlsc.gmapsfx.javascript.JavascriptObject:
checkBooleancheckIntegercheckUndefinedgetJSObjectgetNextVariableNamegetPropertygetPropertygetVariableNameinvokeJavascriptinvokeJavascriptinvokeJavascriptReturnValueinvokeJavascriptReturnValueisMemberDefinedsetPropertysetPropertysetProperty

Field Detail

centerback to summary
private ReadOnlyObjectWrapper<LatLong> center
divArgback to summary
protected static String divArg
jsHandlersback to summary
private final EventHandlers jsHandlers
mapPromptedZoomChangeback to summary
private boolean mapPromptedZoomChange
optionsback to summary
protected MapOptions options
registeredOnJSback to summary
private boolean registeredOnJS
userPromptedZoomChangeback to summary
private boolean userPromptedZoomChange
zoomback to summary
private IntegerProperty zoom

Constructor Detail

DirectionsPaneback to summary
public DirectionsPane()
DirectionsPaneback to summary
public DirectionsPane(MapOptions mapOptions)

Method Detail

addStateEventHandlerback to summary
public void addStateEventHandler(MapStateEventType type, StateEventHandler h)

Adds a handler for a state type event on the map.

We could allow this to handle any state event by adding a parameter JavascriptObject obj, but we would then need to loosen up the event type and either accept a String value, or fill an enum with all potential state events.

Parameters
type:MapStateEventType

Type of the event to register against.

h:StateEventHandler

Handler that will be called when the event occurs.

addUIEventHandlerback to summary
public void addUIEventHandler(UIEventType type, UIEventHandler h)

Adds a handler for a mouse type event on the map.

Parameters
type:UIEventType

Type of the event to register against.

h:UIEventHandler

Handler that will be called when the event occurs.

addUIEventHandlerback to summary
public void addUIEventHandler(JavascriptObject obj, UIEventType type, UIEventHandler h)

Adds a handler for a mouse type event on the map.

Parameters
obj:JavascriptObject

The object that the event should be registered on.

type:UIEventType

Type of the event to register against.

h:UIEventHandler

Handler that will be called when the event occurs.

centerPropertyback to summary
public final ReadOnlyObjectProperty<LatLong> centerProperty()
fitBoundsback to summary
public void fitBounds(LatLongBounds bounds)
fromLatLngToPointback to summary
public Point2D fromLatLngToPoint(LatLong loc)

Returns the screen point for the provided LatLong.

Note

Unexpected results can be obtained if this method is called as a result of a zoom change, as the zoom event is fired before the bounds are updated, and bounds need to be used to obtain the answer!

One workaround is to only operate off bounds_changed events.

getBoundsback to summary
public LatLongBounds getBounds()

Returns the LatLongBounds of the visual area.

Note

on zoom changes the bounds are reset after the zoom event is fired, which can cause unexpected results.

getCenterback to summary
public LatLong getCenter()
getHeadingback to summary
public double getHeading()
getLatLongback to summary
public LatLong getLatLong()
getProjectionback to summary
public Projection getProjection()
getZoomback to summary
public int getZoom()
internalGetZoomback to summary
private int internalGetZoom()
internalSetZoomback to summary
private void internalSetZoom(int zoom)
panByback to summary
public void panBy(double x, double y)

Pans the map by the supplied values.

Parameters
x:double

delta x value in pixels.

y:double

delta y value in pixels.

registerEventHandlerback to summary
private String registerEventHandler(GFXEventHandler h)

Registers an event handler in the repository shared between Javascript and Java.

Parameters
h:GFXEventHandler

Event handler to be registered.

Returns:String

Callback key that Javascript will use to find this handler.

removeMapShapeback to summary
public void removeMapShape(MapShape shape)
removeMarkerback to summary
public void removeMarker(Marker marker)
setCenterback to summary
public void setCenter(LatLong latLong)
setHeadingback to summary
public void setHeading(double heading)
setMapTypeback to summary
public void setMapType(MapTypeIdEnum type)
setZoomback to summary
public void setZoom(int zoom)
zoomPropertyback to summary
public IntegerProperty zoomProperty()