google-maps-api-3

Add many routes using Google Maps Directions Service Over Query Limit

为君一笑 提交于 2019-12-25 18:36:03
问题 I have an application that requires having many (sometimes over 50) dynamic routes added to the google map. Using the DirectionsService, I am able to add right around 10 routes or so before the requests start to fail with the status of "Over Query Limit". I was wondering if anyone has encountered this situation and has found a way to deal with it. It seems that even if I pause between requests, I am still failing for anything over the first 10. Not sure if there is a request limit for a

Google Maps DistanceMatrix

时光总嘲笑我的痴心妄想 提交于 2019-12-25 18:27:06
问题 I am using Google API, what I need to do is get two different distances in miles. At the moment I have the following:- var start = arrObjLatLngs[0]; var end = arrObjLatLngs[arrObjLatLngs.length - 1]; var base = new google.maps.LatLng(52.781048888889, -1.2110222222222546); var service = new google.maps.DistanceMatrixService(); service.getDistanceMatrix( { origins: [base, base], destinations: [start, end], travelMode: google.maps.TravelMode.DRIVING, avoidHighways: false, avoidTolls: false },

Google Maps : change map marker location on dropdown

霸气de小男生 提交于 2019-12-25 18:26:04
问题 I want to change map marker position on basis of dropdown change even,What I'm doing is I get lat,long on dropdown event and want to pass these coordinates to my current marker , this is my code $("#location").change(function () { var addr = ($('#location').val()); var geocoder = new google.maps.Geocoder(); geocoder.geocode({ 'address': addr }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { alert("location : " + results[0].geometry.location.lat() + " " + results[0

Google Maps V3 autocomplete input jquery Mobile

为君一笑 提交于 2019-12-25 18:24:34
问题 I'm trying to get the autocomplete to work on a simple input text box. I have it working for one text box, but I have a second (to and from location) which it is throwing errors. My code isn't very streamlined I don't think and I'm wondering if there is a cleaner method to get this working. I think my repetitive code maybe part of the problem. The 'to' input box doesn't work and no errors are thrown. <script type="text/javascript"> $(document).on("pageinit", "#map_page", function () {

Google Maps: Custom Marker Icon - Not plotting at Center of Rectangle

99封情书 提交于 2019-12-25 18:24:15
问题 Trying to plot a rectangle area with bounds lat/lng, also plotting a marker at the center of the area, when i use the default icon of google maps which is tapering at the end, it sticks to the rectangle on zoom in /zoom out. but when using a custom icon then it does not stick to the rectangle area. please check the fiddles: Default marker: https://jsfiddle.net/8mQ6G/473/ var myPos = new google.maps.LatLng(47.56715, -122.1556); var marker = new google.maps.Marker({ position: myPos, //icon:

How do I make this script fire when I click a Fusion Tables layer?

六月ゝ 毕业季﹏ 提交于 2019-12-25 18:23:56
问题 I have a Fusion Table layer on my map. I want to make it so that when I click on the Fusion Table layer, this script fires. My code so far: gmap = new google.maps.Map(document.getElementById("map-canvas")); google.maps.event.addListener(gmap,'click',function(e){ console.log(e); }); // DONE: google.maps.event.addListener When I click a part of the map that has no Fusion Table layer on it, the script fires. But if I click a part of the Fusion Table layer, it doesn't. What do I do? 回答1: You must

Database design for Google Maps data [closed]

自古美人都是妖i 提交于 2019-12-25 18:20:39
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am developing an Android application with Google Maps where user can find nearest locations closest to them. I am at the designing stage and I am trying to figure out what I need for my database in order to

Clearing multiple direction results of a google map

99封情书 提交于 2019-12-25 18:20:12
问题 I am leveraging Google Maps V3 javascript api within Ext Js 5.0.0 framework in order to display directions on a map. Everything works fine and directions are rendered and cleared perfectly except for one test case, steps described below: Step 1.Get Directions from address 1 to address 2 (works fine and displayed on map) Step 2.Get Directions from address 3 to address 4, 5 to 6...(n-1) to n (works fine and all sets of directions are seen on map) Step 3. Run directionsDisplay.setMap(null) to

Calling json file from external sources

人走茶凉 提交于 2019-12-25 18:17:22
问题 I used this JavaScript to call my JSON data from an external source. The json data will load from server. So, what will be the script that I can get the markers from google map using the external JSON data. var map, infowindow; //// // The JSON data var json = "http://www.tripleclickstudio.com/json/file.json" $.getJSON(json,{ tags:"location", tagmode:"any", format:"json" }) function initialize() { // Giving the map som options var mapOptions = { //// }; // Creating the map map = new google

Ajax Get XML - Google Directions

自古美人都是妖i 提交于 2019-12-25 18:14:24
问题 I had the following script working two weeks ago in XAMPP, today it doesnt work. var url = 'http://maps.googleapis.com/maps/api/directions/xml?origin=Chicago,IL&destination=Los+Angeles,CA&waypoints=Joplin,MO|Oklahoma+City,OK&sensor=false'; $.ajax({ type: "GET", url: url, dataType: "xml", async: false, success: function(xml) { $(xml).find("route").each(function(){ var startaddresss = $(this).find('start_address').text(); alert(startaddresss); }); } }); If i save the XML to XAMPP and call it