當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。