I'm using google map direction API in our application. Map with directions working well with traveling modes like Driving,Walking,Transit and Bicycling. But it not showing flight directions when we enter two cities from different countries. So for showing flight directions what should i do? Please help.
There is no FLIGHT TravelMode in the Google Maps Javascript API v3.
google.maps.TravelMode constants
The valid travel modes that can be specified in a DirectionsRequest as well as the travel modes returned in a DirectionsStep.
BICYCLING Specifies a bicycling directions request.
DRIVING Specifies a driving directions request.
TRANSIT Specifies a transit directions request.
WALKING Specifies a walking directions request.
One option would be to draw a normal or geodesic Polyline between the two airports.
Related
Using HERE Maps Api, for a geographic coordinate (lat, lng), I would like to find address information for the nearest routable road. Information that includes:
Address (street, house number, city, postal code, country)
Bearing/Heading of the road (0 to 360 degrees from True North)
How can I achieve this through HERE Maps API?
So far, this is what I have been able to achieve:
Calling the calculate Route API with identical start and end endpoints and mode=car will force the API to snap to the nearest routable point. This step is necessary for when the input coordinates are for a pedestrian street.
Using the nearest routable point coordinates, I can call reverse GeoCode API and I will be able to find the address information I need.
The next step is where I'm currently stuck. I'm able to find information like direction=NW, however I can't find the ~exact bearing in grad, for example bearing=265.
Is this achievable? Are 3 steps really necessary or is there a HERE Maps API endpoint that can provide all of this?
You can use the Fleet Telematics API to get the headings value for a particular road. Read more about the api here - https://developer.here.com/documentation/platform-data/topics/quick-start-view-map-data.html
You can also look at the field explanationshere - https://tcs.ext.here.com/pde/layer?region=WEU&release=19111&url_root=pde.api.here.com&layer=ADAS_ATTRIB_FC1
HEADINGS Horizontal road heading [10^-3 degree] at coordinate points along the link, when driving from Reference Node. Comma separated. Each value is relative to the previous. No values here for the ref/nonref nodes, because they are in the separate fields REFNODE_LINKCURVHEADS and NREFNODE_LINKCURVHEADS.
I would like to use Google Directions Api on 'DRIVING' mode, but I want to know the best route driving a bus and not a car.
I'm not talking about 'TRANSIT' mode. I don't want to take a bus but drive it.
Does anybody know if that option is possible?
As geocodezip mentioned in the comments, that functionality is just not possible.
If you choose to set the mode property within the Direction Service API to 'DRIVING', GM will assume you want standard driving directions for a motor vehicle (car).
Here's an extract from their documentation concerning possible travel modes for the Directions Service API:
The following travel modes are currently supported:
DRIVING (Default) standard driving directions using the road network.
BICYCLING bicycling directions via bicycle paths & preferred streets.
TRANSIT directions via public transit routes.
WALKING walking directions via pedestrian paths & sidewalks.
So to answer your question. No, unlike the TRANSIT option, there's no way to specify a form of vehicle you would like to use within the 'DRIVING' option of the Direction Service API.
But that might change one day.
So I want to find different walking routes where the start and end destination is the same. So If I as a user choose 5km, maps would show me routes that are about 5km long and start and ends at the same location. I have looked through the (messy) maps apis but haven't managed to find any endpoints for doing this.
You can do something like that by adding waypoints. So for a 5km walk you could generate a random point within 2.5 km of your start/end point and add it as a waypoint when generating directions.
Edit:
In addition you may try using the Geometry library in the Google Maps API. There is a computeOffset function which returns the LatLng resulting from moving a distance from an origin in the specified heading (expressed in degrees clockwise from north). This way you can add some waypoints relative to the start/end point. Or in close proximity to the random first waypoint.
https://developers.google.com/maps/documentation/javascript/directions#Waypoints
I am developing a website in ASP.NET in which I need accurate coordinates of properties and populate their markers on Google Maps. I read the Google Maps API documentation and it doesn't accept business names or house numbers. So if I add 5 properties on Moseley Road with postal code WR2 6NJ, they all receive the same coordinates at the beginning of the road, where as they're all separate properties with separate coordinates, for example: Arthur Amos Associates Ltd, Moseley Farms etc.
How can I increase the accuracy so each address gets it's own coordinates? I tried the ROOFTOP and street_address parameters but they didn't help. Do I need to get Google Maps API for Work to get this level of accuracy?
Thanks.
I am working with a security company that has a patrol car travel around a neighborhood. Every 30 seconds, they record a GPS coordinate/point which I can download and use. I'm trying to map a 'path of travel' for the patrol vehicle using Google Maps API.
I understand how to map (marker) all the points using the Google Maps v3 API. I also understand how I can do a driving route between a few points using directionsService. According to Google and StackOverflow, the maximum number of waypoints is 26.
The problem is that I have dozens of these points (1 hour = 120 points). I can't just draw a polyline between the points because I need it to show the path of travel on the actual street - not as the crow flies between 2 points. Also, I don't have 10K to purchase an Enterprise license.
Any ideas on how this might be accomplished or am I SOL? Can you draw 120 multiple 'routes' on the same map? Speed is not important here.
Thanks,
Mike
Can you draw 120 multiple 'routes' on the same map?
You can. When you want to draw the routes by using the DirectionsRenderer you must use a separate DirectionsRenderer-instance for each route.
Another approach: request the routes via the DirectionsService, but use a custom Polyline to draw the route. Each time you get a new route you'll only have to push the points of the new route to the path of the polyline.