Examples of PositionPair


Examples of slash.navigation.common.PositionPair

        synchronized (notificationMutex) {
            for (int i = 0; i < startPositions.length; i++) {
                // skip the very last position without successor
                if (i == positions.size() - 1 || i == startPositions.length - 1)
                    continue;
                addToQueue.put(random.nextInt(), new PositionPair(positions.get(startPositions[i]), positions.get(startPositions[i] + 1)));
            }
        }

        synchronized (insertWaypointsQueue) {
            insertWaypointsQueue.putAll(addToQueue);
        }

        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(", ");
View Full Code Here

Examples of slash.navigation.common.PositionPair

        Matcher insertWaypointsMatcher = INSERT_WAYPOINTS_PATTERN.matcher(callback);
        if (insertWaypointsMatcher.matches()) {
            Integer key = parseInt(insertWaypointsMatcher.group(2));
            List<String> coordinates = parseCoordinates(insertWaypointsMatcher.group(3));

            PositionPair pair;
            synchronized (insertWaypointsQueue) {
                pair = insertWaypointsQueue.remove(key);
            }

            if (coordinates.size() < 5 || pair == null)
                return true;

            final NavigationPosition before = pair.getFirst();
            NavigationPosition after = pair.getSecond();
            final BaseRoute route = parseRoute(coordinates, before, after);
            synchronized (notificationMutex) {
                int row = positions.indexOf(before) + 1;
                insertPositions(row, route);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.