本文整理汇总了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());
// }
}
}
示例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());
}
}
示例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());
}
}
示例4: directionsReceived
import com.lynden.gmapsfx.service.directions.DirectionsResult; //导入依赖的package包/类
@Override
public void directionsReceived(final DirectionsResult __, final DirectionStatus s) {
}