google-maps-api-3

Google Maps Android Studio - how disable the map controls?

房东的猫 提交于 2020-06-23 08:53:25
问题 I'm working in Android Studio with MapsActivity. Everything works fine, but how do I disable the map controls that show up on top of the Google map? Here is my code: public class MapsActivity extends FragmentActivity { private GoogleMap mMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); setUpMapIfNeeded(); } @Override protected void onResume() { super.onResume(); setUpMapIfNeeded(); } private void

CORS error when using await import() with Google API

烂漫一生 提交于 2020-06-17 13:20:16
问题 Why I get a CORS error: Access to script at 'https://maps.googleapis.com/maps/api/js' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. When I try to import dynamically Google Maps API in my JavaScript : await import('https://maps.googleapis.com/maps/api/js') But not when I do it in my HTML : <script defer src="https://maps.googleapis.com/maps/api/js"></script> Any idea would be really appreciate it. Note : if I

Incorrect path using encoded polyline from Google Directions API in Static Maps

霸气de小男生 提交于 2020-06-16 19:08:06
问题 I'm trying to use an encoded polyline from Google's Direction API and display it in a Google Static Map image. When I use the encoded polyline in the Static Map the path is displayed incorrectly - it starts in the correct place, and has the correct general path, but is skewed from the expected results. As an example, I've made a request for rail directions from Bern to Zurich Airport. The API returns the following encoded polyline: }sp}Gmrkl@m@wIiAaB_BaA}IcCmLoFqG_DuFkAyN[mEiBqN}MqFsLqUoxAyG{

Get distance to closest highway using Google Maps API

独自空忆成欢 提交于 2020-05-28 06:54:13
问题 I dont think there's a simple way to get the distance to the closest highway using Google maps' API, does someone have an idea how this could be done? Can you search for highway ramps, and then calculate the distance using DistanceMatrix? 来源: https://stackoverflow.com/questions/44957729/get-distance-to-closest-highway-using-google-maps-api

Get distance to closest highway using Google Maps API

孤街浪徒 提交于 2020-05-28 06:52:10
问题 I dont think there's a simple way to get the distance to the closest highway using Google maps' API, does someone have an idea how this could be done? Can you search for highway ramps, and then calculate the distance using DistanceMatrix? 来源: https://stackoverflow.com/questions/44957729/get-distance-to-closest-highway-using-google-maps-api

Plot latitude longitude from CSV in Python 3.6

谁说胖子不能爱 提交于 2020-05-25 08:05:31
问题 I'm trying to plot a large number of latitude longitude values from a CSV file on a map, having this format (first column and second column): I'm using python 3.6 (apparently some libraries like Basemap doesn't operate on this version). How can I do that? 回答1: If you are just looking at plotting the point data as a scatterplot, is as simple as import matplotlib.pyplot as plt plt.scatter(x=df['Longitude'], y=df['Latitude']) plt.show() If you want to plot the points on the map, it's getting

Google Map API V3 how to draw walking path like GoogleMaps web applications?

时光总嘲笑我的痴心妄想 提交于 2020-05-24 04:22:51
问题 In my application I draw driving route from origin to destination using code like this: directionsStartService.route(start_request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); etc... I added a new features to show intersectionPoints to path that user can do by walking, but I need to draw this paths like this: https://www.google.it/maps/dir/Via+Giuseppe+Moruzzi,+1,+I-56124+Pisa+PI,+Italia/Dipartimento+di+Chimica+e

How to display a specific city on Google Maps API?

拜拜、爱过 提交于 2020-05-17 08:33:08
问题 I searched a lot on the web and I found similar question, but unfortunately no one has solved the problem, so I opened my own question hoping someone with a solution. Essentially I want display a specific city, in this case Milan located in Italy. I successfully initialized the map: var myMap; var myLatlng = new google.maps.LatLng(45.4627123, 9.1075212,12); function initialize() { var mapOptions = { zoom: 13, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP, scrollwheel: false }

how to execute google maps event “bounds_changed” only once

▼魔方 西西 提交于 2020-05-17 06:33:47
问题 How do I tell the google map event "bounds_change" to only work when the map is initially loaded, and not after user change? 回答1: from the documentation addListenerOnce(instance:Object, eventName:string, handler:function(?)) Return Value: MapsEventListener Like addListener, but the handler removes itself after handling the first event. google.maps.event.addListenerOnce(map,'bounds_changed', function() {}); 来源: https://stackoverflow.com/questions/30601828/how-to-execute-google-maps-event

google maps js api blocks ui when adding markers

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-16 22:41:06
问题 I have a problem with google maps on mobile browsers. The project I'm working on requires about 500 markers to be shown on a map, but when adding them, the ui freezes. I'm using markerclusterer to add markers, and performance is fine once the markers are on the page. Is there a way to add the markers asynchronously, or to pause adding markers once the user starts scrolling? This is the code we're using: var mcOptions = { gridSize: 50, maxZoom: 15, zoomOnClick: false }; var mc = new