Package slash.navigation.common

Examples of slash.navigation.common.SimpleNavigationPosition


        }

    });

    private NavigationPosition asPosition(double longitude, double latitude) {
        return new SimpleNavigationPosition(longitude, latitude);
    }
View Full Code Here


            return null;
        return new BoundingBox(asPosition(boundingBox.getNorthEast()), asPosition(boundingBox.getSouthWest()));
    }

    private static NavigationPosition asPosition(PositionType positionType) {
        return new SimpleNavigationPosition(positionType.getLongitude(), positionType.getLatitude());
    }
View Full Code Here

        assertEquals(null, service.getLocationFor(90.0, 90.0));
    }

    @Test
    public void getPositionFor() throws IOException {
        NavigationPosition expected = new SimpleNavigationPosition(10.2004684, 50.0010183, 0.0, "B\u00fchlstra\u00dfe, 97506 Grafenrheinfeld, Germany");
        NavigationPosition actual = service.getPositionFor("B\u00fchlstra\u00dfe, 97506 Grafenrheinfeld, Germany");
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }

    @Test
    public void getPositionsFor() throws IOException {
        NavigationPosition expected = new SimpleNavigationPosition(10.2004684, 50.0010183, 0.0, "B\u00fchlstra\u00dfe, 97506 Grafenrheinfeld, Germany");
        List<NavigationPosition> actual = service.getPositionsFor("B\u00fchlstra\u00dfe, 97506 Grafenrheinfeld, Germany");
        assertEquals(asList(expected), actual);
    }
View Full Code Here

    private List<NavigationPosition> extractAdresses(List<GeocodeResponse.Result> responses) {
        List<NavigationPosition> result = new ArrayList<>(responses.size());
        for (GeocodeResponse.Result response : responses) {
            GeocodeResponse.Result.Geometry.Location location = response.getGeometry().getLocation();
            result.add(new SimpleNavigationPosition(location.getLng().doubleValue(), location.getLat().doubleValue(),
                    0.0d, response.getFormattedAddress()));
        }
        return result;
    }
View Full Code Here

    protected abstract String getCallbacks();

    private NavigationPosition getLastMapCenter() {
        double latitude = preferences.getDouble(CENTER_LATITUDE_PREFERENCE, 35.0);
        double longitude = preferences.getDouble(CENTER_LONGITUDE_PREFERENCE, -25.0);
        return new SimpleNavigationPosition(longitude, latitude);
    }
View Full Code Here

        if (tokenizer.countTokens() != 2)
            return null;

        String latitude = tokenizer.nextToken();
        String longitude = tokenizer.nextToken();
        return new SimpleNavigationPosition(parseDouble(longitude), parseDouble(latitude));
    }
View Full Code Here

    public boolean isMapViewInitialized() {
        return isMapViewAvailable() && mapView.isInitialized();
    }

    public NavigationPosition getMapCenter() {
        return isMapViewAvailable() ? mapView.getCenter() : new SimpleNavigationPosition(-41.0, 41.0);
    }
View Full Code Here

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class BoundingBoxTest {
    private NavigationPosition asPosition(double longitude, double latitude) {
        return new SimpleNavigationPosition(longitude, latitude);
    }
View Full Code Here

        file2.getFragment().add(file2fragment);
        datasourceType.getFile().add(file2);

        FileType file3 = new FileType();
        file3.setUri("file3uri" + id);
        file3.setBoundingBox(asBoundingBoxType(new BoundingBox(new SimpleNavigationPosition(1.0, 2.0), new SimpleNavigationPosition(3.0, 4.0))));
        file3.getChecksum().add(createChecksumType(3L, CALENDARF3, "file3"));
        FragmentType fileType3fragment1 = new FragmentType();
        fileType3fragment1.setKey("fragment1key");
        fileType3fragment1.getChecksum().add(createChecksumType(31L, CALENDARF3F1, "file3 fragment1"));
        file3.getFragment().add(fileType3fragment1);
        FragmentType fileType3fragment2 = new FragmentType();
        fileType3fragment2.setKey("fragment2key");
        fileType3fragment2.getChecksum().add(createChecksumType(32L, CALENDARF3F2, "file3 fragment2"));
        file3.getFragment().add(fileType3fragment2);
        datasourceType.getFile().add(file3);

        MapType map = new MapType();
        map.setUri("mapuri" + id);
        map.setBoundingBox(asBoundingBoxType(new BoundingBox(new SimpleNavigationPosition(1.0, 2.0), new SimpleNavigationPosition(3.0, 4.0))));
        map.getChecksum().add(createChecksumType(100L, CALENDARM, "map"));
        FragmentType mapfragment = new FragmentType();
        mapfragment.setKey("fragmentkey" + id);
        mapfragment.getChecksum().add(createChecksumType(101L, CALENDARMF, "map fragment"));
        map.getFragment().add(mapfragment);
View Full Code Here

TOP

Related Classes of slash.navigation.common.SimpleNavigationPosition

Copyright © 2018 www.massapicom. 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.