google-maps-api-3

Display Custom Marker in Google Maps Using Relative File Path [duplicate]

夙愿已清 提交于 2019-12-23 22:17:06
问题 This question already has an answer here : Using a Relative Path in Javascript to Set Google Map Icon (1 answer) Closed 3 years ago . I am using Google's Javascript APi v.3.0 to develop a web app. I want to be able to display custom markers, but they don't show up when I try to add them. I've written a helper function in Javascript to display a custom marker: function addCustomMarker(iconFile,iconTitle,lat,lng){ var loc = new google.maps.LatLng(lat,lng); var marker = new google.maps.Marker({

Using a Google Apps API key with Distance Matrix

笑着哭i 提交于 2019-12-23 21:42:29
问题 I am using the Google Distance Matrix API and the documentation tells me I need an API key (but I can use it without one.) I'd like to be able to monitor use but I'm stumped as to how to set it up. I have a valid browser application API key from the Google Developers Console, it's new so I'm assuming it's a version 3 key. I have added valid referers in the console I have <script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script> on my page I'm using code like this function

Google Maps API v3 Hiding and showing a circle bound to a marker

一世执手 提交于 2019-12-23 21:28:56
问题 I have successfully bound a circle to my marker using google map api v3. I know this because if I make the marker dragable the circle moves as well. How can I refer to the circle if the marker is clicked. I need to show the circle if not visible or vice-versa. Here is the code to create the marker and circle var markerOptions = { title: title, icon: markerImage, shadow: markerShadow, position: latlng, map: map } var marker = new google.maps.Marker(markerOptions); // Add a Circle overlay to

Color “areas of interest” on Google Maps API?

流过昼夜 提交于 2019-12-23 20:32:47
问题 Google has just changed the maps colors scheme and it has messed up the custom colors on a site I'm working on. This is the news from their blog: Discover the action around you with the updated Google Maps Now, not much technical info there. Has anyone already found out where to change that light brown/orange-ish color for "areas of interest"? From testing here (and this link is on their dev site), the only thing that does anything to it is all , and the more specific you can go is with

How to calculate distance for each country using Google Maps API Route

青春壹個敷衍的年華 提交于 2019-12-23 19:53:11
问题 For example I have a simple rout From Warsaw, Poland To Berlin, Germany by car. Now I can calculate distance of all route (572km). How I can calculate distance for each country? Germany ~ 100km and Poland ~ 472km. I tried to detect country border using start_location for each DirectionsLeg in legs[] and detect country name by start_location . For example: getCountry(legs[0]) => 'pl' getCountry(legs[1]) => 'pl' getCountry(legs[2]) => 'pl' //border detected getCountry(legs[3]) => 'de'

is google maps api V3 requires key?

我的梦境 提交于 2019-12-23 19:13:40
问题 I developed one website in google maps api V2 , now management is saying V2 is deprecated and convert in to V3. While googling the V3 i didn't see any api key? then how it works? http://maps.googleapis.com/maps/api/js?sensor=false src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=ABQIAAAAZIdFD1WVdDZkZtynpOarChQNeNa5CKtG0-vmTH0qjucdvCYnQxSdAQEaIYCVLr1JYZPtbiF0LjTojQ" and how to convert from V2 to V3? should i develop it from scratch onwards? 回答1: Google maps api v3 doesn't need a

Fit Bounds in Google Map Render Directions

五迷三道 提交于 2019-12-23 19:10:50
问题 I am trying to render directions for 48 waypoints, but google only allows 8 waypoints to be rendered per request. so I do multiple requests (in my case 6). However, the API somehow doed fitBounds() for the last request. How can I show all the 48 waypoints in one map using fitBounds() and/or setZoom() My code is as below: - function DisplayDirection(directionList){ var interval = 8; // upper bound for usage limits in google directions API is 8 var startIndex =0; var maxmimumIndex =

drawingManager.setDrawingMode(null) causing too much recursion

丶灬走出姿态 提交于 2019-12-23 18:53:35
问题 Please check out this fiddle, http://jsfiddle.net/HoffZ/Zu55b/ Why it is causing error "too much recursion" on drawMan.setDrawingMode(null) drawMan.setDrawingMode(google.maps.drawing.OverlayType.POLYGON); google.maps.event.addListener(drawMan, 'overlaycomplete', function (event) { // When draw mode is set to null you can edit the polygon you just drawed drawMan.setDrawingMode(null); }); This is not my fiddle but I am having this exact issue in my code 回答1: I must admit that I don't quite

Google Maps API modifying page styles after loading only in Safari

最后都变了- 提交于 2019-12-23 18:32:36
问题 I am running into a strange issue. I load a page and initially the text on the whole page has an opacity of 1. Google Maps API is set to load on a timeout. After 2 seconds, the maps API loads the map, and the page styles all the sudden are modified. It's like the text on the page has been reduced in opacity ( see photos ). This issue only seems to be affecting me in Safari. Has anyone run into something similar or know of an issue or what may be causing this? The Original Before The Map Has

Google Maps API v3 MapTypeId as variable

北战南征 提交于 2019-12-23 18:26:35
问题 When setting the google map type: map.setMapTypeId(google.maps.MapTypeId.TERRAIN); Can I replace "TERRAIN" by a js variable containing the string "TERRAIN", "SATELLITE", etc? 回答1: Yes, call it like this: var mapType = "TERRAIN"; map.setMapTypeId(google.maps.MapTypeId[mapType]); 回答2: //Console output of MapTypeId google.maps.MapTypeId {ROADMAP: "roadmap", SATELLITE: "satellite", HYBRID: "hybrid", TERRAIN:"terrain"} HYBRID:"hybrid" ROADMAP:"roadmap" SATELLITE:"satellite" TERRAIN:"terrain" /