google-maps-api-3

Google Direction API and Google Maps App showing different routes for same destination

核能气质少年 提交于 2020-01-10 06:06:25
问题 I am working on an app in which I have to show shortest route. I am using Google Direction API but the result is different from Google Maps app for same destination and travel mode. https://maps.googleapis.com/maps/api/directions/json?origin=19.107163,72.862375&destination=19.106995400000002,72.8643029&sensor=false&mode=driving&alternatives=true&key=XXXXXXXXXXXXXXXXXX Since alternative is true I am already using shortest route from available routes (response). Note : - When I enter lat lng of

How To Display Multiple Markers Coordinates Stored In Firebase Database On Google Maps

此生再无相见时 提交于 2020-01-10 05:57:41
问题 I am trying to get the coordinates that are saved in the firebase real-time database and display them on a map using the google maps API. This is the code I have so far. Right now it opens and shows the users current location using the html5 geolocation API and it syncs the lat and long coordinates to the firebase real-time database using Geofire. I don't know how to retrieve these points and have multiple points on the google map at the same time showing different users locations. If anyone

how to filter address according country and city in google maps autocomplete address api

China☆狼群 提交于 2020-01-10 05:39:05
问题 How to filter address according country and city in google maps autocomplete address api. i am able to address filter according country but i am not able to address filter according country and city. I am using following code:- var autocompleteFrom; $(document).ready(function () { var options = { types: ['geocode'], componentRestrictions: { country: "IL" } }; var inputFrom = document.getElementById('Address'); autocompleteFrom = new google.maps.places.Autocomplete(inputFrom, options); google

Move marker with gps in google map android

我怕爱的太早我们不能终老 提交于 2020-01-09 19:47:46
问题 I want to make move of the marker in GOOGLE MAP while gps location changes just like in UBER app. I have found some solutions but unable to solve my issue. The solutions are 1 and 2 Below is my onLocationChange() method public void onLocationChanged(Location location) { double lattitude = location.getLatitude(); double longitude = location.getLongitude(); mLastLocation = location; if (mCurrLocationMarker != null) { mCurrLocationMarker.remove(); } //Place current location marker LatLng latLng

Google Maps API: get two locations distance and plot on map

做~自己de王妃 提交于 2020-01-09 12:04:32
问题 I am new at Google Maps. I want to the get distance from one place to another place and plot it on a map. e.g: Place1 and Place2 Distance - xxx Km (xx miles) and plot it on map. Please take a look. 回答1: Use the geometry library computeDistanceBetween() function. If you don't have the coordinates, use the Geocoder to get them. Example (based off of the example in the documentation) 来源: https://stackoverflow.com/questions/13542052/google-maps-api-get-two-locations-distance-and-plot-on-map

How to get total driving distance with Google Maps API V3?

ⅰ亾dé卋堺 提交于 2020-01-09 06:49:03
问题 I used to be able to get it like this: directionsService.route(directionsRequest, function(directionsResult, directionsStatus) { var directionsRenderer = new google.maps.DirectionsRenderer({ directions: directionsResult, map: map }); $('#distance').text(directionsResult.trips[0].routes[0].distance.text) $('#duration').text(directionsResult.trips[0].routes[0].duration.text) }) But it looks like they changed their API on me! Looks like trips is no longer there, and routes only gives you a bunch

How to get total driving distance with Google Maps API V3?

霸气de小男生 提交于 2020-01-09 06:48:03
问题 I used to be able to get it like this: directionsService.route(directionsRequest, function(directionsResult, directionsStatus) { var directionsRenderer = new google.maps.DirectionsRenderer({ directions: directionsResult, map: map }); $('#distance').text(directionsResult.trips[0].routes[0].distance.text) $('#duration').text(directionsResult.trips[0].routes[0].duration.text) }) But it looks like they changed their API on me! Looks like trips is no longer there, and routes only gives you a bunch

Custom Google Map API V3 Zoom Buttons

余生颓废 提交于 2020-01-09 04:26:07
问题 How can I customize the google maps api (v3 javascript) zoom buttons to my own image. 回答1: I am late at the party, but here is my two cents. You have basically two options: Option 1: You either create the controls using HTML/CSS yourself, which you can then place over the map to the correct position using position absolute or similar means. Even though this works in production, I don't like this, because your HTML/CSS for the element doesn't load at the same time than the map is displayed.

Display world map with no repeats

梦想与她 提交于 2020-01-08 22:13:32
问题 I'm currently using the Google Maps API for the first time. Essentially I wish to have the map zoomed out so that the whole world is displayed with no overlap (e.g. bits of a certain country are not repeated on either side of the map). The closest I have found to my requirements is this SO question: Google Maps API V3: Show the whole world However, the top answer on this question does not provide the full code required. I have used the starter example from Google as the base for my HTML: <

how can you share location same like whatsapp in android with chooser dialog?

安稳与你 提交于 2020-01-08 01:50:28
问题 I want "share location" functionality same like whatsapp in my current application. Now to open chooser dialog i used below mentioned code. public static void showFileChooser(Activity activity, Fragment fragment, boolean isAllowMultiple) { try { File imageStorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "demo"); if (!imageStorageDir.exists()) { imageStorageDir.mkdirs(); } File file = new File(imageStorageDir + File.separator + "i" + String