I am developing an android application using google maps api v2.The problem is google maps shows directions depending upon the road routes even if it is a open ground.For example, take these two LatLng LatLng1 : -33.891143, 151.224473LatLng2 : -33.891580, 151.225336
Hi, my current job is delivering packages for one of those big three package delivery companies. Once I deliver one package, I usually use voice-to-text to input the next one, but they're always close enough that it wants to set it to walking directions. This is really annoying because it doesn't display everything the same way.
You can calculate directions (using a variety of methods of transportation) by using the DirectionsService object. This object communicates with the Google Maps API Directions Service which receives direction requests and returns an efficient path. Travel time is the primary factor which is optimized, but other factors such as distance, number of turns and many more may be taken into account. You may either handle these directions results yourself or use the DirectionsRenderer object to render these results.
The Directions service can return multi-part directions using a series of waypoints. Directions are displayed as a polyline drawing the route on a map, or additionally as a series of textual description within a element (for example, "Turn right onto the Williamsburg Bridge ramp").
To use directions in the Maps JavaScript API, create an object of type DirectionsService and call DirectionsService.route() to initiate a request to the Directions service, passing it a DirectionsRequest object literal containing the input terms and a callback method to execute upon receipt of the response.
Consult the Google Maps Platform Coverage Details to determine to what extent a country supports directions. If you request directions for a region in which that direction type is not available, the response will return the DirectionsStatus="ZERO_RESULTS".
The available options for a directions request vary between travel modes. When requesting transit directions, the avoidHighways, avoidTolls, waypoints[] and optimizeWaypoints options will be ignored. You can specify transit specific routing options through the TransitOptions object literal.
By default, directions are calculated and displayed using the unit system of the origin's country or region. (Note: Origins expressed using latitude/longitude coordinates rather than addresses always default to metric units.) For example, a route from "Chicago, IL" to "Toronto, ONT" will display results in miles, while the reverse route will display results in kilometers. You can override this unit system by setting one explicitly within the request using one of the following UnitSystem values:
Note: This unit system setting only affects the text displayed to the user. The directions result also contains distance values, not shown to the user, which are always expressed in meters.
Initiating a directions request to the DirectionsService with the route() method requires passing a callback which executes upon completion of the service request. This callback will return a DirectionsResult and a DirectionsStatus code in the response.
The DirectionsResult contains the result of the directions query, which you may either handle yourself, or pass to a DirectionsRenderer object, which can automatically handle displaying the result on a map.
The following example calculates directions between two locations on Route 66, where the origin and destination are set by the given "start" and "end" values in the dropdown lists. The DirectionsRenderer handles display of the polyline between the indicated locations, and the placement of markers at the origin, destination, and any waypoints, if applicable.
A DirectionsRenderer not only handles display of the polyline and any associated markers, but also can handle the textual display of directions as a series of steps. To do so, call setPanel() on your DirectionsRenderer, passing it the in which to display this information. Doing so also ensures that you display the appropriate copyright information, and any warnings which may be associated with the result.
Textual directions will be provided using the browser's preferred language setting, or the language specified when loading the API JavaScript using the language parameter. (For more information, see Localization.) In the case of transit directions, the time will be displayed in the time zone at that transit stop.
When sending a directions request to the DirectionsService, you receive a response consisting of a status code, and a result, which is a DirectionsResult object. The DirectionsResult is an object literal with the following fields:
When using the Directions service to search for transit directions, the steps array will include additional Transit Specific Information in the form of a transit object. If the directions include multiple modes of transportation, detailed directions will be provided for walking or driving steps in a steps[] array. For example, a walking step will include directions from the start and end locations: "Walk to Innes Ave & Fitch St". That step will include detailed walking directions for that route in the steps[] array, such as: "Head north-west", "Turn left onto Arelious Walker", and "Turn left onto Innes Ave".
Transit directions return additional information that is not relevant for other modes of transportation. These additional properties are exposed through the TransitDetails object, returned as a property of DirectionsStep. From the TransitDetails object you can access additional information for the TransitStop, TransitLine, TransitAgency, and VehicleType objects as described below.
The following example plots walking directions to certain tourist attractions in New York City. We inspect the route's DirectionsStep to add markers for each step, and attach information to an InfoWindow with instructional text for that step.
As noted within the DirectionsRequest, you may also specify waypoints (of type DirectionsWaypoint) when calculating routes using the Directions service for walking, bicycling or driving directions. Waypoints are not available for transit directions. Waypoints allow you to calculate routes through additional locations, in which case the returned route passes through the given waypoints.
Users may modify cycling, walking or driving directions displayed using a DirectionsRenderer dynamically if they are draggable, allowing a user to select and alter routes by clicking and dragging the resulting paths on the map. You indicate whether a renderer's display allows draggable directions by setting its draggable property to true. Transit directions cannot be made draggable.
When directions are draggable, a user may select any point on the path (or waypoint) of the rendered result and move the indicated component to a new location. The DirectionsRenderer will dynamically update to show the modified path. Upon release, a transitional waypoint will be added to the map (indicated by a small white marker). Selecting and moving a path segment will alter that leg of the route, while selecting and moving a waypoint marker (including start and end points) will alter the legs of the route passing through that waypoint.
Because draggable directions are modified and rendered client-side, you may wish to monitor and handle the directions_changed event on the DirectionsRenderer to be notified when the user has modified the displayed directions.
The following code shows a trip from Perth on the west coast of Australia to Sydney on the east coast. The code monitors the directions_changed event to update the total distance of all legs of the journey.
I am trying to render combination wall and fence barrier around a cemetery so that directions supplied to a specific lat/long combination of a grave will be directed inside the cemetery on existing paths/roads. When the grave is closer to an outside road, directions given take the user to the closest place on the external road and expect the person can access the location walking from the road. In many cases this is not the case - a significant wall or fence exists that cannot be "crossed". Other times, the road is very unsafe to park on (high speed or no shoulder) and the person should be directed inside the cemetery for access. I have tried creating a barrier around most of a cemetery (Cypress Lawn Memorial Park in Colma CA) and I cannot see that rendered after 3 days ( =-122.45707&lat=37.67196&zoom=15) while I can see a barrier not far away behind a Home Depot store (to the northwest of the cemetery). Secondly, when trying directions to other nearby places with fences, the behavior doesn't seem to do what I am trying anyway. The goal is that a person is directed to enter the cemetery main entrance and the use the internal roads to get to the closest spot to the lat/long and walk the remaining distance.
The iPhone Maps app can help you get from here to there, whether you're walking, driving, or using public transportation. If you're ready to stretch your legs, follow these instructions for finding walking directions on your iPhone.
The route map appears. If you need to change the start or end location, tap the Edit button in the top-left corner and type a new start or end location in the appropriate field. The screen that appears has three icons near the top: a car, a bus, and a person walking. Directions by car is the default.
3. Click the Maps tab at the top of the page. You should now see any maps you've already saved. If you've never used Your Places before, this list may be empty.
6. Under the search field at the top of the page, click Add directions (the button looks like a Y-shaped road). You should now see an Untitled layer with fields to enter driving destinations.
7. By default, you'll get driving directions. If you are using a different mode of transportation, such as cycling or walking, click the car-shaped icon and choose how you're going to travel through the route; then click the X to close the flyout window.
df19127ead