當前位置: 首頁>>代碼示例>>Java>>正文


Java DirectionsRenderer類代碼示例

本文整理匯總了Java中com.lynden.gmapsfx.service.directions.DirectionsRenderer的典型用法代碼示例。如果您正苦於以下問題:Java DirectionsRenderer類的具體用法?Java DirectionsRenderer怎麽用?Java DirectionsRenderer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DirectionsRenderer類屬於com.lynden.gmapsfx.service.directions包,在下文中一共展示了DirectionsRenderer類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createRoutePane

import com.lynden.gmapsfx.service.directions.DirectionsRenderer; //導入依賴的package包/類
public void createRoutePane() {
	routeVbox = addVBox("select route");
	fromLocation = new ComboBox<String>();
	fromLocation.setOnAction(λ -> map.hideDirectionsPane());
	toLocation = new ComboBox<String>();
	toLocation.setOnAction(λ -> map.hideDirectionsPane());
	final Button btn = new Button("draw");
	btn.setOnAction(e -> {
		if (toLocation.getSelectionModel().getSelectedItem() == null
				|| fromLocation.getSelectionModel().getSelectedItem() == null)
			return;
		final MyMarker to = getMarkerByTitle(toLocation.getSelectionModel().getSelectedItem()),
				from = getMarkerByTitle(fromLocation.getSelectionModel().getSelectedItem());
		directionsService.getRoute(
				new DirectionsRequest(from.lat.getLatitude() + ", " + from.lat.getLongitude(),
						to.lat.getLatitude() + ", " + to.lat.getLongitude(), TravelModes.DRIVING),
				this, new DirectionsRenderer(true, mapComponent.getMap(), directionsPane));
	});
	final Button removeBtn = new Button("remove line");
	removeBtn.setOnAction(λ -> map.hideDirectionsPane());
	routeVbox.getChildren().addAll(fromLocation, toLocation, btn, removeBtn);

}
 
開發者ID:TechnionYP5777,項目名稱:SmartCity-ParkingManagement,代碼行數:24,代碼來源:PmMap.java

示例2: getCoordinatesCalculatePathShowDirectionsAndHidePanel

import com.lynden.gmapsfx.service.directions.DirectionsRenderer; //導入依賴的package包/類
private void getCoordinatesCalculatePathShowDirectionsAndHidePanel(final Pane path_choice_pane,
                                                                   final TextField txt_from, final TextField txt_to,
                                                                   final Button btn_get_coords_find_path) {
    final String addressOrigin = txt_from.getText();
    final String addressDestination = txt_to.getText();

    final DirectionsRequest directionsRequest =
            new DirectionsRequest(addressOrigin, addressDestination, TravelModes.DRIVING);

    directionsPane = mapComponent.getDirec(); // TODO: 11/10/2017 IT HAS TO BE CLEARED!
    directionsService = new DirectionsService();
    directionsRenderer = new DirectionsRenderer(true, map, directionsPane);
    directionsService.getRoute(directionsRequest, this, directionsRenderer);

    if (!addressOrigin.equals("") || !addressDestination.equals("")) {
        path_choice_pane.setVisible(false);
        btn_get_coords_find_path.setVisible(false);
    }
}
 
開發者ID:Evegen55,項目名稱:main_carauto_board,代碼行數:20,代碼來源:GmapfxController.java


注:本文中的com.lynden.gmapsfx.service.directions.DirectionsRenderer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。