Skip to content

Instantly share code, notes, and snippets.

View here-devblog-gists's full-sized avatar

here-devblog-gists

  • HERE Technologies
View GitHub Profile
...
/* Define Waypoints for the route
* The first one being current location
* Select the rest from the ResultList
* */
routePlan.addWaypoint(new RouteWaypoint(currentLocation));
for (DiscoveryResult item : s_ResultList) {
var platform = new H.service.Platform({
app_id: '{YOUR_APP_ID}', // // <-- ENTER YOUR APP ID HERE
app_code: '{YOUR_APP_CODE}', // <-- ENTER YOUR APP CODE HERE
});
var defaultLayers = platform.createDefaultLayers();
var mapContainer = document.getElementById('map-container');
var map = new H.Map(
mapContainer,
...
searchRequest.addReference("yelp");
...
...
m_mapRoute = new MapRoute(routeResults.get(0).getRoute());
/* Show the maneuver number on top of the route */
m_mapRoute.setManeuverNumberVisible(true);
...
...
coreRouter.calculateRoute(routePlan,
new Router.Listener<List<RouteResult>, RoutingError>() {
@Override
public void onProgress(int i) {
/* The calculation progress can be retrieved in this callback. */
}
...
...
/* Calculate the shortest route available. */
routeOptions.setRouteType(RouteOptions.Type.SHORTEST);
/* Calculate 1 route. */
routeOptions.setRouteCount(1);
/* Finally set the route option */
routePlan.setRouteOptions(routeOptions);
...
...
routeOptions.setTransportMode(RouteOptions.TransportMode.PEDESTRIAN);
...
...
s_ResultList = discoveryResultPage.getItems();
for (DiscoveryResult item : s_ResultList) {
/*
* Add a marker for each result of PlaceLink type.
*/
if (item.getResultType() == DiscoveryResult.ResultType.PLACE) {
PlaceLink placeLink = (PlaceLink) item;
...
m_map = m_mapFragment.getMap();
m_map.setPedestrianFeaturesVisible(EnumSet.of
(PedestrianFeature.CROSSWALK,
PedestrianFeature.STAIRS,
PedestrianFeature.BRIDGE,
PedestrianFeature.TUNNEL));
// setting the center of the map to Berlin
m_map.setCenter(new GeoCoordinate(52.505229, 13.44915),
Map.Animation.NONE);
...
posManager = PositioningManager.getInstance();
PositioningManager.getInstance();
...