当前位置: 首页>>代码示例>>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;未经允许,请勿转载。