Deeplinking complex route in Here WeGo - here-api

For our use case, we need a turn-by-turn navigation on a mobile device but using a custom route.
Please let me know if the following usage scenario is possible:
Given an array of points (lat/long) that the route needs to pass through, get a route using CalculateRoute.
Create a deeplink for HERE WeGo (e.g. iOS) using the sequence of waypoints obtained in step #1
Navigate turn by turn in HERE WeGo along the route
So far I was successful in #1 but could not create a deeplink with the same route for HERE WeGo. When I create a link, the app simplifies the route to only include origin and destination points and omits all "via" points.
Would appreciate advice on this.

In general passing the waypoints one after the other should open the route with the intermediate points (at least on wego.here.com) , not so sure if this work out of the box in HERE WE Go https://developer.here.com/documentation/deeplink-web/dev_guide/topics/share-route.html

Related

HERE API - Need to get the coordinates of all route waypoints

I need to get the coordinates of all route points through the CURL - in the HERE API documentation, I did not click on how to do it. Tell me what you need to create a request or give a link to the HERE documentation
With HERE Routing v8 API, you can get the route shape by specifying return=polyline in the query parameters, as shown in this guide.
Keep in mind however, that this returns a so-called "flexible polyline", which is an encoded representation of the route shape coordinates. It looks like this:
"polyline": "BGwynmkDu39wZvBtFAA3InfAAvHrdAAvHvbAAoGzF0FnGoGvHsOvRAA8L3NAAkSnVAAoGjIsEzFAAgFvHkDrJAAwHrJoVvb0ezoBAAjInVAA3N_iBAAzJ_Z"
You can use a decoder to get the coordinates. Here is a JS implementation of the decoder. The heremaps/flexible-polyline contains implementations in several other languages.

Drag route anywhere using Maps API

I want to write an application that gives me the exact route of a subway.
When you use Google Maps it just connects two stops linearly, but not the actual way.
Is there a way to move a route anywhere on a map without being bound to roads?
If there's any solution (doesn't have to be with the Google Maps API) please let me know.
Edit:
Example
Google shows the train route like the brown line, but the train actually drives the blue line. What I would like to do is get the blue line so that I can get the coordinates of the route and calculate the curves and elevation.
I know that I could add like 50 waypoint and get get a "fake" route with them, but I would like to have it automatic and not done by hand.
To show the transit directions (subway, bus, tram, etc.) Google Maps uses the data provided by transit agencies in the form of GTFS feeds. This is a responsibility of the agency to provide a detailed shape of the route for the transport according to the GTFS specification. You can have a look at GTFS documentation to figure out how does it work:
https://developers.google.com/transit/gtfs/
https://developers.google.com/transit/gtfs/reference/#general_transit_feed_specification_reference
I hope this helps.

How to detect current Geo location and save in variable in asp.net

I'm developing an asp.net web app and i need to detect the current Geo location and save it to a variable and than show to user its current place name and through this I will guide the user to where he want to go, and than user will in put the destination and I will guide that what the root will be suitable for him and I will provide full detail.
I'm getting its current location but don't how to show to user by displaying on label or in textbox.
I don't know where to start this.
If you are able to access the current geolocation of the user then you need to do the following things-
Get Destination
Now you need to get the destination name from the user using some mode of text input or, speech to text etc.
Geo Code destination
Now you need a good geocoding API to get the coordinate of the destination that user has entered. You can use google's geocoding API. It is available for both client(JavaScript) and server(C#, Java, PHP -etc) side. All you need is an API key.
Find Route
Now you have to find the route between the two coordinates (your current location and destination coordinates). Google provides a direction API for the same. Again you can implement this both on the client or, server side (I will prefer client side to reduce the load on the server end). This API returns a long polyline string which can be decoded into a list of coordinates to plot the route on the map. It also returns a list of maneuver data containing the direction info and road names etc. This maneuver info will help you to direct your user to the destination at the time of navigation.
Plotting the route
Now is the time to add a map canvas to your application and then plot the route to it. You can now use the list of coordinates that you decoded from the polyline to draw a polygon on the map. See this below screenshot from one of my application where I drew the path on the map and also marked all the maneuver points on the path.
Navigation
Well, now you are almost done. Now you can start navigating to the destination. Now use whatever mechanism you use to get the user location periodically and then update it as a marker (you can use a car's icon) on the map and then whenever you reach (calculate the distance) a maneuver point show user the maneuver message like "Turn right"/"Turn left"/"Continue straight for 100 meter" -etc.
If you are stuck with getting the current user's location then you can use HTML5 to get devices location using the network.
Hope this is helpful for you.

Google Directions API (Transit mode) returns only one alternative route per request

I have built an small application which calls the Google Directions API in Transit mode. It works - nevertheless it returns only one possible route, so it shows no alternatives. Usually I expect 3-4 options to choose from.
Example:
http://maps.googleapis.com/maps/api/directions/json?origin=bieberstrasse,+dusseldorf&destination=norf,+neuss&sensor=false&mode=transit&departure_time=1399399424
The returned JSON structure has the expected "routes" array, but this array always has only one element. I have tried it with addresses in Brazil and Germany - it doesn't matter the country, I only get one single route.
Did I miss some parameter? Could someone help me with it?
If you want alternative routes, specify the request parameter alternatives=true:
http://maps.googleapis.com/maps/api/directions/json?alternatives=true&origin=bieberstrasse,+dusseldorf&destination=norf,+neuss&sensor=false&mode=transit&departure_time=1399399424

Is there a way to get a pastable link from Google Maps Directions Service?

When we use maps.google.com, there's a way to 'Send' the current directions searched via email. One could also copy-paste a unique URL - even shorten it.
Is there a way to get this through the JavaScript API (v3)?
You could generate the directions and store it in the database - after that you can generate a link to recall the route, and shorten it with the Google URL Shortener API
The API doesn't do this, because if you have start and end locations in order to get directions, it's quite easy to construct a url yourself:
http://maps.google.com/?q=from:A to:B (encoded if necessary)
If you want to use your map to show the route, then you will need to implement your own system of querystring parameters and handle those in your map page.

Resources