directions

Why is google autocomplete returning undefined when using getPlace() on the input address

让人想犯罪 __ 提交于 2021-02-02 10:01:17
问题 Why is google not returning an object with a formatted address when using auto-complete and how can I get a formatted address? When I log the variable from_place it returns an object like so: but when I log to_place it returns an object with formatted_address: I realise I'm using autocomplete on the first form and that's affecting it but how do i get to not affect or give me the formatted address? // declare variables var map, infoWindow, placeSearch, autocomplete; // autocomplete form var

Google directions route - marker at midpoint

自作多情 提交于 2020-04-18 08:41:55
问题 How can I add a clickable marker in the middle of rendered route, which would then display a info window with custom data, because a info window can't be directly added to directions renderer? function loadRoute0() { var request0 = { origin: new google.maps.LatLng(46.56300788, 15.62779705), destination: new google.maps.LatLng(46.55953332, 15.62616729), travelMode: google.maps.TravelMode.WALKING }; directionsService.route(request0, function(result, status) { if (status == google.maps

Google Directions API failing to return results in iOS

烈酒焚心 提交于 2020-01-23 10:57:09
问题 I’m trying to use Google Directions API. I have the SDK all set up. I have enabled Google Maps SDK for iOS under the Services in the developer console. Below is the URL I've built to get the directions. There are two types of keys in the developer console. First I tried with the Key for iOS apps. https://maps.googleapis.com/maps/api/directions/json?origin=-37.814107,144.96328&destination=-31.953004,115.857469&key=<Key for iOS apps> But I got the error This IP, site or mobile application is

How to get polyline from Google Maps Directions Api

北城余情 提交于 2020-01-17 09:21:26
问题 I'm trying to draw a polyline using the Google Maps Directions Api, but how do I use the JSON values to make this, because in the api, there is a lot of lat and long and polylines.points like this: cxwnFtdct@JEVGLCR?PDTFNHTNNNPJPDRDN?JCHCv@i@VQTK`CkF and I don't know which one should I use, can anyone help me :) { geocoded_waypoints: [ {}, {} ], routes: [ { bounds: { northeast: { lat: 39.2846595, lng: -8.7036795 }, southwest: { lat: 38.7223249, lng: -9.1393372 } }, copyrights: "Dados do mapa

Mapbox Android: How to get directions from current location to a destination you choose?

邮差的信 提交于 2020-01-11 04:12:10
问题 Okay so I am fairly new to Mapbox, I have used GMaps prior to this but I found that Mapbox is more capable of doing what I need, the problem is I have hit a bit of a wall. I have used a combination of the examples available on their site e.g. https://www.mapbox.com/android-sdk/examples/geocoding and https://www.mapbox.com/android-sdk/examples/directions I am trying to allow the user to search a destination and then have it turned into coordinates which will be used to plot in the map. I then

Google Maps JavaScript API v3 directions capabilities

时间秒杀一切 提交于 2020-01-01 00:48:13
问题 I use Google Maps js API v3. I can show directions with waypoints based on this. What I want is getting the points of the direction. Lets say the direction line goes from Budapest to Warsaw. I want to get all latitude and longitude on that line. But I don't find any build in function or workaround for this. I don't copy code here as the tutorial works for me, I can start from that. (Of course it isn't a good idea to make lot of waypoints.) I've seen this question. It isn't solution for my

Update Location Marker and draw path on Google Maps when walking/driving in Android

不问归期 提交于 2019-12-30 03:36:04
问题 I want to create a functionality like Google Maps. I want to update my location marker whenever a person start walking/driving. I am thinking of using onLocationChange method of LocationListner but I am not sure. I also like to draw the path with updating location on the Google Maps. All suggestions are most welcome. ItemizedOverlay:- public class LocationOverlay extends ItemizedOverlay<OverlayItem>{ private List<OverlayItem> myOverlays; Path path; static int cnt = -1; public LocationOverlay

DistanceMatrix AJAX query on Google directions Service route returns error

China☆狼群 提交于 2019-12-25 16:52:27
问题 I am trying to get the JSON response of a DistanceMatrix AJAX call, after successful ("OK" status) of directionsService.route . The route is shown but it always return error on the route data. var map; function initMap() { var directionsService = new google.maps.DirectionsService; var directionsDisplay = new google.maps.DirectionsRenderer; map = new google.maps.Map(document.getElementById('map'), { center: { lat: -34.397, lng: 150.644 }, zoom: 8, }); directionsDisplay.setMap(map);

Google maps android: How do I add driving or walking directions to a specific geopoint with a button onclick?

纵饮孤独 提交于 2019-12-25 02:16:17
问题 I'm making a map for my campus and need help. Can anyone tell me how to add driving directions to a specific geopoint? I would like the user to click on a map icon on the map, bring them to a description page of that place, and then have the option to "route directions" Seems simple but I'm very new to Java and Android. 回答1: There is no support in the Android SDK for driving directions, sorry. 回答2: The easiest option would be to link out to the Google Maps application. The URL below will

Google Maps Javascript API, DirectionsService, list of countries

断了今生、忘了曾经 提交于 2019-12-24 04:09:12
问题 I am creating a route using google.maps.DirectionsService. What would be the best method to get the list of countries the route goes through? I can't find this info in the DirectionsResult https://developers.google.com/maps/documentation/javascript/reference#DirectionsResult 回答1: Each route from the routes array have a overview_path array with all the coordinates. You can geocode each of this coordinates and get the country of it (remember the limitation of geocoding calls!). Isn't the best