map-directions

Changing titles of endpoint markers in a Google Maps route

亡梦爱人 提交于 2020-01-17 04:36:06
问题 I have a simple test webpage, which displays driving directions: It works well, but my problem is that the start and end markers of the shown route have the meaningless titles "A" and "B". I would like to use ReverseGeocoding to fetch the titles of the 2 route endpoints. So I have prepared the following code and the addresses are fetched correctly and are printed out using console.log : <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta

Default to map view when opening Google Map directions link on mobile web

不想你离开。 提交于 2020-01-15 04:45:48
问题 Is there a query parameter I can use to default a mobile Google Maps directions link to the map view instead of the text view? Open this link on mobile, or change browser user-agent to a mobile one: https://maps.google.com/maps?dirflg=w&saddr=51.52732134995272,-0.10802237782646251&daddr=7%20Clerkenwell%20Close,%20Clerkenwell,%20EC1R%200DY The view defaults to the first image here, but i want it to default to the second one (you can manually toggle between the two views using the icon 2nd from

Google Directions Map not loading on iPad Landscape orientation

若如初见. 提交于 2020-01-03 00:50:26
问题 I'm having problems in loading the map in iPad Landscape (in Portrait everything works fine). EDIT: I found an issue related with the fact that the map element is "pushed" down after the directions element aparently because of a lack of space when I reduce the height. I tried to get the elements fluids but it's still pushed down. Landscape (PROBLEM): When I rotate the iPad to Portrait (OK): The Code: Script: var _directionsService = new google.maps.DirectionsService(); var _directionsDisplay

Is there a way to override the Google Directions service zoom values?

落花浮王杯 提交于 2020-01-02 03:19:10
问题 I'm using the code below to get the route between two points: directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } } It's working fine, but I don't want to change my map position and zoom level when drawing route. So when I call the code above with different latitude and longitude values, I would like my map position and zoom level to be maintained. Any idea? 回答1: When you create the

Google Maps API - Midpoint along route [duplicate]

落爺英雄遲暮 提交于 2020-01-01 06:03:10
问题 This question already has an answer here : Midpoint of route in google maps (1 answer) Closed 3 years ago . I've been playing around with the Google Maps/Google directions API. Does anyone have an inkling on how I might be able to find the mid-point along a route, not the geographic midpoint. Ideally I'd like to find the lat and long values of this midpoint. Any thoughts? I'm a bit stumped and hoping I may be able to find a suggestion without going crazy trying to find the answer myself. 回答1:

Use one waypoint as destination in Gmaps Api

孤街醉人 提交于 2019-12-31 05:30:46
问题 I'm using gmaps Api to make a route for a person who have to visit a list of markets (my waypoints) to take note of their stocks. I'm using the user's house location for the origin of the route and the location of the markets as my waypoints. The problem is that I don't know which waypoint is the route's destination because I set the property optimization = true when call the the direction service, but the api needs a destination to trace the route. What I need is a way to tell the api to use

How to show Google Maps Directions in tabs or div that has display:none

孤人 提交于 2019-12-24 12:34:32
问题 When I'm loading a Google Map (v3) with Directions into a div that is hidden from the user, the resulting map is not zoomed and centered correctly. I tried firing a resize event but that did only partially solve the problem. Usually when loading a map with directions, the API automatically finds the optimal view (ie. zoom level and center) as to show the entire journey. Any ideas what I'm doing wrong? Please see JsFiddle <button id="show">Show</button> <div id="a"> <div id="map_wrapper" style

Display Label for Each Waypoint Pin on Google Map API

痞子三分冷 提交于 2019-12-23 09:36:28
问题 I'm trying to add a label for each waypoint along the route, but I'm not quite sure how I should approach it. After doing some research, I understand that you can add a custom pin with label, but that's when I drop each pin manually. How can I do this for direction? 回答1: If you want to get access to markers from DirectionsRenderer request that need a hack because there is not official way to do this from google map api. There is a way around, here is an example I made: https://jsfiddle.net

How to draw route between two points in MapFragment using Google Maps Android API

柔情痞子 提交于 2019-12-21 03:00:47
问题 My target is to complete the following tasks in one single class. I want to give direction between two pointers (current location & prefixed location in navigation drawer) in Google Android Map API. Is it possible or do I need Directions API? Can't direction be done in Android Maps API itself? My goal is to use only one activity or java file for all tasks like fetch current location and show the destination pointer in map (which I have done). Now I want to give the route for these two