当前位置: 首页>>代码示例>>Java>>正文


Java DirectionsResult类代码示例

本文整理汇总了Java中com.lynden.gmapsfx.service.directions.DirectionsResult的典型用法代码示例。如果您正苦于以下问题:Java DirectionsResult类的具体用法?Java DirectionsResult怎么用?Java DirectionsResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DirectionsResult类属于com.lynden.gmapsfx.service.directions包,在下文中一共展示了DirectionsResult类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: directionsReceived

import com.lynden.gmapsfx.service.directions.DirectionsResult; //导入依赖的package包/类
@Override
    public void directionsReceived(DirectionsResult results, DirectionStatus status) {
        if (status.equals(DirectionStatus.OK)) {
            mapComponent.getMap().showDirectionsPane();
            LOGGER.info("Directions was found");
            DirectionsResult directionsResult = results;
            GeocodingService geocodingService = new GeocodingService();
//            LOGGER.info("SIZE ROUTES: " + directionsResult.getRoutes().size() + "\n" + "ORIGIN: " + directionsResult.getRoutes().get(0).getLegs().get(0).getStartLocation());
            geocodingService.reverseGeocode(directionsResult.getRoutes().get(0).getLegs().get(0).getStartLocation().getLatitude(), directionsResult.getRoutes().get(0).getLegs().get(0).getStartLocation().getLongitude(), this);
//            LOGGER.info("LEGS SIZE: " + directionsResult.getRoutes().get(0).getLegs().size());
//            LOGGER.info("WAYPOINTS " + directionsResult.getGeocodedWaypoints().size());
//            double d = 0;
//            for (DirectionsLeg g : directionsResult.getRoutes().get(0).getLegs()) {
//                d += g.getDistance().getValue();
//                System.out.println("DISTANCE " + g.getDistance().getValue());
//            }
//            try {
//                LOGGER.info("Distance total = " + directionsResult.getRoutes().get(0).getLegs().get(0).getDistance().getText());
//            } catch (Exception ex) {
//                LOGGER.error("ERROR: " + ex.getMessage());
//            }
        }
    }
 
开发者ID:Evegen55,项目名称:main_carauto_board,代码行数:24,代码来源:GmapfxController.java

示例2: directionsReceived

import com.lynden.gmapsfx.service.directions.DirectionsResult; //导入依赖的package包/类
@Override
public void directionsReceived(DirectionsResult results, DirectionStatus status) {
    if(status.equals(DirectionStatus.OK)){
        
        System.out.println("OK");
        
        DirectionsResult e = results;
        GeocodingService gs = new GeocodingService();
        
        System.out.println("SIZE ROUTES: " + e.getRoutes().size() + "\n" + "ORIGIN: " + e.getRoutes().get(0).getLegs().get(0).getStartLocation());
        //gs.reverseGeocode(e.getRoutes().get(0).getLegs().get(0).getStartLocation().getLatitude(), e.getRoutes().get(0).getLegs().get(0).getStartLocation().getLongitude(), this);
        System.out.println("LEGS SIZE: " + e.getRoutes().get(0).getLegs().size());
        System.out.println("WAYPOINTS " +e.getGeocodedWaypoints().size());
        /*double d = 0;
        for(DirectionsLeg g : e.getRoutes().get(0).getLegs()){
            d += g.getDistance().getValue();
            System.out.println("DISTANCE " + g.getDistance().getValue());
        }*/
        try{
            System.out.println("Distancia total = " + e.getRoutes().get(0).getLegs().get(0).getDistance().getText());
        } catch(Exception ex){
            System.out.println("ERRO: " + ex.getMessage());
        }
        System.out.println("LEG(0)");
        System.out.println(e.getRoutes().get(0).getLegs().get(0).getSteps().size());
        /*for(DirectionsSteps ds : e.getRoutes().get(0).getLegs().get(0).getSteps()){
            System.out.println(ds.getStartLocation().toString() + " x " + ds.getEndLocation().toString());
            MarkerOptions markerOptions = new MarkerOptions();
            markerOptions.position(ds.getStartLocation())
                    .title(ds.getInstructions())
                    .animation(Animation.DROP)
                    .visible(true);
            Marker myMarker = new Marker(markerOptions);
            map.addMarker(myMarker);
        }
                */
        System.out.println(renderer.toString());
    }
}
 
开发者ID:rterp,项目名称:GMapsFX,代码行数:40,代码来源:MainApp2.java

示例3: directionsReceived

import com.lynden.gmapsfx.service.directions.DirectionsResult; //导入依赖的package包/类
@Override
public void directionsReceived(DirectionsResult results, DirectionStatus status) {
    if(status.equals(DirectionStatus.OK)){
        mapComponent.getMap().showDirectionsPane();
        System.out.println("OK");
        
        DirectionsResult e = results;
        GeocodingService gs = new GeocodingService();
        
        System.out.println("SIZE ROUTES: " + e.getRoutes().size() + "\n" + "ORIGIN: " + e.getRoutes().get(0).getLegs().get(0).getStartLocation());
        //gs.reverseGeocode(e.getRoutes().get(0).getLegs().get(0).getStartLocation().getLatitude(), e.getRoutes().get(0).getLegs().get(0).getStartLocation().getLongitude(), this);
        System.out.println("LEGS SIZE: " + e.getRoutes().get(0).getLegs().size());
        System.out.println("WAYPOINTS " +e.getGeocodedWaypoints().size());
        /*double d = 0;
        for(DirectionsLeg g : e.getRoutes().get(0).getLegs()){
            d += g.getDistance().getValue();
            System.out.println("DISTANCE " + g.getDistance().getValue());
        }*/
        try{
            System.out.println("Distancia total = " + e.getRoutes().get(0).getLegs().get(0).getDistance().getText());
        } catch(Exception ex){
            System.out.println("ERRO: " + ex.getMessage());
        }
        System.out.println("LEG(0)");
        System.out.println(e.getRoutes().get(0).getLegs().get(0).getSteps().size());
        /*for(DirectionsSteps ds : e.getRoutes().get(0).getLegs().get(0).getSteps()){
            System.out.println(ds.getStartLocation().toString() + " x " + ds.getEndLocation().toString());
            MarkerOptions markerOptions = new MarkerOptions();
            markerOptions.position(ds.getStartLocation())
                    .title(ds.getInstructions())
                    .animation(Animation.DROP)
                    .visible(true);
            Marker myMarker = new Marker(markerOptions);
            map.addMarker(myMarker);
        }
                */
        System.out.println(renderer.toString());
    }
}
 
开发者ID:rterp,项目名称:GMapsFX,代码行数:40,代码来源:MainApp.java

示例4: directionsReceived

import com.lynden.gmapsfx.service.directions.DirectionsResult; //导入依赖的package包/类
@Override
public void directionsReceived(final DirectionsResult __, final DirectionStatus s) {

}
 
开发者ID:TechnionYP5777,项目名称:SmartCity-ParkingManagement,代码行数:5,代码来源:PmMap.java


注:本文中的com.lynden.gmapsfx.service.directions.DirectionsResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。