insertWaypointsExecutor.execute(new Runnable() {
public void run() {
for (Integer key : addToQueue.keySet()) {
PositionPair pair = addToQueue.get(key);
NavigationPosition origin = pair.getFirst();
NavigationPosition destination = pair.getSecond();
StringBuilder buffer = new StringBuilder();
buffer.append(mode).append("({");
buffer.append("origin: new google.maps.LatLng(").append(origin.getLatitude()).append(",").append(origin.getLongitude()).append("), ");
buffer.append("destination: new google.maps.LatLng(").append(destination.getLatitude()).append(",").append(destination.getLongitude()).append("), ");
buffer.append("travelMode: google.maps.DirectionsTravelMode.").append(mapViewCallback.getTravelMode().getName().toUpperCase()).append(", ");
buffer.append("avoidFerries: ").append(mapViewCallback.isAvoidFerries()).append(", ");
buffer.append("avoidHighways: ").append(mapViewCallback.isAvoidHighways()).append(", ");
buffer.append("avoidTolls: ").append(mapViewCallback.isAvoidTolls()).append(", ");
buffer.append("region: \"").append(Locale.getDefault().getCountry().toLowerCase()).append("\"}, ");