google-maps-api-3

Google maps javascript API V3 key disabled on certain computers

99封情书 提交于 2020-01-17 07:05:10
问题 I have come across a weird behaviour of the google maps javascript api v3. I have included the api on my website using the api key I generated in the developers console like so: <script src="http://maps.googleapis.com/maps/api/js?key=MYKEY" type="text/javascript"></script> When I now access the site it works without a problem. The access is logged in the google developers console as it should be. I can also access the map via my android phone and on the computers at my university. All those

How do I get a pin on Google Maps using location from a variable? [closed]

╄→尐↘猪︶ㄣ 提交于 2020-01-17 05:18:10
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I want to place the pins on my Google Maps map with a variable containing the location, when I make one like this, my pin works. var imageDriver =

How I can left align the google maps

こ雲淡風輕ζ 提交于 2020-01-17 04:58:31
问题 How to left align the google maps, I mean the marker positions. Here is my JS function showGoogleMaps() { var latLng = new google.maps.LatLng(position[0], position[1]); var mapOptions = { zoom: 16, zoomControl:false, mapTypeControl:false, streetViewControl: false, // hide the yellow Street View pegman scaleControl: true, // allow users to zoom the Google Map mapTypeId:ROADMAP, center: latLng, scrollwheel: false, styles: styles }; map = new google.maps.Map(document.getElementById('googlemaps')

Upgrading google maps api with mapstraction in Rails 3

試著忘記壹切 提交于 2020-01-17 04:45:06
问题 I'm trying to upgrade an app into Rails 3. The app requires a map that can be edited and it has been using google maps and mapstraction. When I upgraded to rails 3 the map stopped showing up and I figured that's because it needed to be updated from google maps api v2 to v3. I've been trying to use this tutorial to upgrade it but because the app is using mapstraction I've been having difficulty getting it to work. Initially, this was in the html: <script src="http://maps.google.com/maps?file

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

Google Maps V3: Infowindows not resizing to fit information

北慕城南 提交于 2020-01-17 03:27:07
问题 Problem I have a API V3 map, with a content window for each marker. The content of the infowindow stretches across multiple lines, but the infowindow does not resize to fit it all, causing an iframe-like scroll to appear. I have looked at the setContent() method in the API which according to some posts on the API V3 mailing list should correct the issue. However, it looks like I've been putting into the wrong place thus causing the map not to load. Infowindow content is populated from a field

Google Maps API V3 Indicate multiple markers in same location by different icon

孤街醉人 提交于 2020-01-17 02:54:07
问题 I'm working through all the code examples and have a page working that displays multiple markers. I have an array of locations and sometimes I have multiple markers with the same location. Only the top one displays, which is fine, but I want to indicate that there more markers hidden by changing the icon This bit works: for (i = 0; i < locations.length; i++) { marker = new gm.Marker({ position: new gm.LatLng(locations[i][1], locations[i][2]), map: map, icon: MarkerImg, }); } I don't seem to

google.loader.ClientLocation returning emply strings for adress items

匆匆过客 提交于 2020-01-17 01:48:06
问题 Why Google API Loader Client adress location is returning an empty string for a working country for years?. The object is here but adresses items are empty. After API key. google.load("maps",'3',{other_params:'sensor=true'}); google.setOnLoadCallback(function() { if (google.loader.ClientLocation) { google.loader.ClientLocation.address.city is "" google.loader.ClientLocation.address.region is "" google.loader.ClientLocation.address.country_code is "" google.loader.ClientLocation.latitude is OK

How to remove information from info window (on a KmlLayer)

大憨熊 提交于 2020-01-16 19:39:13
问题 I am working with a Google Map API and I have imported a kml layer into my code.My problem is that I don't know how to remove the 'Unknown Point Feature' information from the info window. Any suggestions? here is a screenshot of what I am talking about: This is my code for importing the kml file: var AI_url = 'https://drive.google.com/uc?export=download&id=0B2KR4Lz3foYEeEtfR0laWWM0LVk' var AI_options = { preserveViewport: true, map: map }; var AI_layer = new google.maps.KmlLayer(AI_url, AI

javascript google map empty gray background when zoomed to zero

為{幸葍}努か 提交于 2020-01-16 08:41:15
问题 Am using google map javascript for my hybrid webview app. When i zoom out map till 0 , it will show gray area while map tiles will be on center of the screen. Is there any way i can fix this to avoid the gray area? I have tried using map tile image for background but is noticeable when you move map. I have also tried setting minZoom to 2 , but still if i scroll map the gray area will be visible. Or is it possible to prevent scrolling map area when zoom is '2`? MinZoom default MinZoom 2 I