- All Implemented Interfaces:
javafx.css.Styleable,javafx.event.EventTarget
- Direct Known Subclasses:
ClusteredGoogleMapView
public class GoogleMapView
extends javafx.scene.layout.AnchorPane
- Author:
- Rob Terpilowski
-
Property Summary
Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible -
Nested Class Summary
Nested Classes Modifier and Type Class Description classGoogleMapView.MapLibraryLoadBridgeclassGoogleMapView.MyEventDispatcher -
Field Summary
Fields Modifier and Type Field Description protected CyclicBarrierbarrierprotected DirectionsPanedirecprotected booleandisableDoubleClickprotected static StringGOOGLE_MAPS_API_LINKprotected static StringGOOGLE_MAPS_API_VERSIONprotected booleaninitializedprotected Stringkeyprotected Stringlanguageprotected GoogleMapmapprotected List<MapComponentInitializedListener>mapInitializedListenersprotected List<MapReadyListener>mapReadyListenersprotected Stringregionprotected JavaFxWebEnginewebengineprotected javafx.scene.web.WebViewwebview -
Constructor Summary
Constructors Constructor Description GoogleMapView()GoogleMapView(boolean debug)GoogleMapView(String mapResourcePath)Allows for the creation of the map using external resources from another jar for the html page and markers.GoogleMapView(String mapResourcePath, boolean debug)Creates a new map view and specifies if the FireBug pane should be displayed in the WebViewGoogleMapView(String language, String key)Creates a new map view and specifies the display language and API key.GoogleMapView(String mapResourcePath, String language, String key, boolean debug)Creates a new map view and specifies the display language and API key.GoogleMapView(String mapResourcePath, String language, String region, String key, boolean debug)Creates a new map view and specifies the display language and API key. -
Method Summary
Methods inherited from class javafx.scene.layout.AnchorPane
clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBottomAnchor, getLeftAnchor, getRightAnchor, getTopAnchor, layoutChildren, setBottomAnchor, setLeftAnchor, setRightAnchor, setTopAnchorMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.Parent
getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
-
Field Details
-
GOOGLE_MAPS_API_LINK
- See Also:
- Constant Field Values
-
GOOGLE_MAPS_API_VERSION
- See Also:
- Constant Field Values
-
language
-
region
-
key
-
webview
protected javafx.scene.web.WebView webview -
webengine
-
initialized
protected boolean initialized -
barrier
-
mapInitializedListeners
-
mapReadyListeners
-
map
-
direc
-
disableDoubleClick
protected boolean disableDoubleClick
-
-
Constructor Details
-
GoogleMapView
public GoogleMapView() -
GoogleMapView
public GoogleMapView(boolean debug) -
GoogleMapView
Allows for the creation of the map using external resources from another jar for the html page and markers. The map html page must be sourced from the jar containing any marker images for those to function.The html page is, at it's simplest: null
<!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <title>My Map</title> <style> html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> </head> <body> <div id="map-canvas"></div> </body> </html>If you store this file in your project jar, under my.gmapsfx.project.resources as mymap.html then you should call using "/my/gmapsfx/project/resources/mymap.html" for the mapResourcePath.
Your marker images should be stored in the same folder as, or below the map file. You then reference them using relative notation. If you put them in a subpackage "markers" you would create your MarkerOptions object as follows: null
myMarkerOptions.position(myLatLong) .title("My Marker") .icon("markers/mymarker.png") .visible(true);- Parameters:
mapResourcePath-
-
GoogleMapView
Creates a new map view and specifies if the FireBug pane should be displayed in the WebView- Parameters:
mapResourcePath-debug- true if the FireBug pane should be displayed in the WebView.
-
GoogleMapView
Creates a new map view and specifies the display language and API key.- Parameters:
language- map display language, null for defaultkey- Google Maps API key or null
-
GoogleMapView
Creates a new map view and specifies the display language and API key.- Parameters:
mapResourcePath-language- map display language, null for defaultkey- Google Maps API key or nulldebug- true if the FireBug pane should be displayed in the WebView.
-
GoogleMapView
public GoogleMapView(String mapResourcePath, String language, String region, String key, boolean debug)Creates a new map view and specifies the display language and API key.If you are specifying your own HTML page for mapResourcePath in a jar of your own then you should include a script element to pull in the Google Maps API with any API keys, language and region parameters.
- Parameters:
mapResourcePath-language- map display language, null for defaultregion-key- Google Maps API key or nulldebug- true if the FireBug pane should be displayed in the WebView.
-
-
Method Details
-
getHtmlFile
-
setKey
-
setZoom
public void setZoom(int zoom) -
setCenter
public void setCenter(double latitude, double longitude) -
getMap
-
createMap
-
createMap
-
createMap
-
createMap
-
internal_createMap
-
internal_createMap
-
getDirec
-
addMapInitializedListener
-
removeMapInitializedListener
-
addMapReadyListener
-
removeReadyListener
-
fromLatLngToPoint
-
panBy
public void panBy(double x, double y) -
isDisableDoubleClick
public boolean isDisableDoubleClick() -
setDisableDoubleClick
public void setDisableDoubleClick(boolean disableDoubleClick) -
setInitialized
protected void setInitialized(boolean initialized) -
fireMapInitializedListeners
protected void fireMapInitializedListeners() -
fireMapReadyListeners
protected void fireMapReadyListeners() -
executeJavascript
-
getJavascriptMethod
-
checkInitialized
protected void checkInitialized() -
getWebview
public javafx.scene.web.WebView getWebview()
-