com.lynden.gmapsfx.GoogleMapView Java Examples

The following examples show how to use com.lynden.gmapsfx.GoogleMapView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DialogTestModule.java    From WorkbenchFX with Apache License 2.0 6 votes vote down vote up
private void initDialogParts() {
  // create the data to show in the CheckListView
  final ObservableList<String> libraries = FXCollections.observableArrayList();
  libraries.addAll("WorkbenchFX", "PreferencesFX", "CalendarFX", "FlexGanttFX", "FormsFX");

  // Create the CheckListView with the data
  checkListView = new CheckListView<>(libraries);

  // initialize map for dialog
  mapView = new GoogleMapView();
  mapView.addMapInializedListener(this);

  // initialize favorites dialog separately
  favoriteLibrariesDialog =
      WorkbenchDialog.builder("Select your favorite libraries", checkListView, Type.INPUT)
          .onResult(buttonType -> {
            if (ButtonType.CANCEL.equals(buttonType)) {
              System.err.println("Dialog was cancelled!");
            } else {
              System.err.println("Chosen favorite libraries: " +
                  checkListView.getCheckModel().getCheckedItems().stream().collect(
                      Collectors.joining(", ")));
            }
          }).build();
}
 
Example #2
Source File: PokeMateUI.java    From PokeMate with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void start(final Stage stage) throws Exception {
    stage.setTitle("Pokemate UI");
    stage.setOnCloseRequest(t -> {
        Platform.exit();
        System.exit(0);
    });
    //This needs to be set to the resources directory, however, it is not play along nicely.
    mapComponent = new GoogleMapView("/map.html");
    mapComponent.addMapInializedListener(this);
    mapComponent.getWebview().getEngine().setOnAlert((WebEvent<String> event) -> {
    });
    BorderPane bp = new BorderPane();
    bp.setCenter(mapComponent);
    Scene scene = new Scene(bp);
    stage.setScene(scene);
    stage.setWidth(1100);
    stage.setHeight(674);
    ClassLoader classloader = Thread.currentThread().getContextClassLoader();
    stage.getIcons().add(new Image(classloader.getResourceAsStream("icon.png")));
    stage.show();
}
 
Example #3
Source File: MapPane.java    From FXMaps with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Constructs a new {@code MapPane}
 */
MapPane() {
    setPrefWidth(1000);
    setPrefHeight(780);
    
    getChildren().add(contentPane);
    
    mapComponent = new GoogleMapView(); 
    contentPane.setCenter(mapComponent);
    
    contextMenu = getContextMenu();
    contextMenu.hideOnEscapeProperty().set(true);
    
    mapComponent.getWebView().setOnMousePressed(e -> {
        if(e.isPrimaryButtonDown()) {
            contextMenu.hide();
            refresh();
        }
    });
    
    directionsPane = new DirectionsPane();
    directionsPane.setPrefWidth(200);
    setDirectionsVisible(false);
    
    
}
 
Example #4
Source File: MapsView.java    From WorkbenchFX with Apache License 2.0 5 votes vote down vote up
public MapsView() {
  getStyleClass().add("module-background");
  // initialize map
  mapView = new GoogleMapView();
  mapView.addMapInializedListener(this);
  getChildren().add(mapView);
}
 
Example #5
Source File: MapDrawer.java    From WorkbenchFX with Apache License 2.0 5 votes vote down vote up
public MapDrawer() {
  // initialize map for dialog
  mapView = new GoogleMapView();
  mapView.addMapInializedListener(this);
  getChildren().add(mapView);
  VBox.setVgrow(mapView, Priority.ALWAYS);
}
 
Example #6
Source File: ManegerMap.java    From SmartCity-ParkingManagement with Apache License 2.0 4 votes vote down vote up
public void SetMapComponent(final GoogleMapView mapComponent) {
	mapComponent.addMapInializedListener(this);
	this.mapComponent = mapComponent;
}