google-maps-api-3

Push Lat Lng from another function into Street View Image API

纵然是瞬间 提交于 2019-12-25 06:31:28
问题 I'm using the Google Maps JavaScript API and this solution for getting closest points on the map and displaying them. "pt" value example: 38.5803844,-121.50024189999999 Here is the code: function findClosestN(pt,numberOfResults) { var closest = []; for (var i=0; i<gmarkers.length;i++) { gmarkers[i].distance = google.maps.geometry.spherical.computeDistanceBetween(pt,gmarkers[i].getPosition()); gmarkers[i].setMap(null); closest.push(gmarkers[i]); } closest.sort(sortByDist); return closest; }

Unable to Reverse Geocode From Marker Click

半世苍凉 提交于 2019-12-25 06:26:14
问题 I wonder whether someone may be able to help me please. I'm trying to put together the reverse geocode functionality for this page, where the user clicks on a map marker and the reverse geocode is performed, populating a text field with the output address. I thought I had the issue sorted out after I received some great advice from this site, but I just can't seem to resolve the issue I have. I can populate the text fields with the marker lat and lng co-ordinates but I just can't get any

Using custom pin icon in Google maps only shows first location in loop

三世轮回 提交于 2019-12-25 06:23:29
问题 I've tried a number of things to try resolve this but I can't seem to find a solution. The problem is that only the first location is added to my map and the other places are left out. When I remove the custom pin icon, all the locations are added correctly. The line that seems to affect this is: icon: iconType[place.icon] As I said when I remove this line everything works as expected. What am I doing wrong? Code below I have a number of places defined in an object like so: var data = [ {

Highlight country around the border from your search area only

隐身守侯 提交于 2019-12-25 06:22:42
问题 I have to make a KML file from the Dutch country. What I want to do is: I want to Highlight only the countries around the border from my search area. Example: As a user searches on 'Amsterdam'. There are like 9 (Zaandam, Amstelveen, Hooftdorp, Diemen, Duivendrecht, ......) other states that are connected with Amsterdam. I want only these 9 states to have a highlight. So all I want to do is Highlight the states that are connected on the border from the user search area. Can anybody help me

How to change Google logo's href

血红的双手。 提交于 2019-12-25 05:48:06
问题 I would like to change the “Click to see this area on Google Maps” link, but I can't select the proper a tag. Thanks 回答1: You can take advantage of RobH's answer var anchors = document.getElementsByTagName('a'), l = anchors.length, i, a; for (i = 0; i < l; i++) { a = anchors[i]; if (a.href.indexOf('maps.google.com/maps?') !== -1) { // here you can manipulate the anchor a.title = ''; a.onclick = function () { return false; }; } } NOTE Remember It's against the Google Maps API ToS to remove the

Google Maps V3 Geocoding Lookup using getJSON

本小妞迷上赌 提交于 2019-12-25 05:37:16
问题 I have a question similar to here: using jquery.getJson with Google's GeoCoding HTTP Service with the exception that I'm trying to retrieve the geo-coordinates for an address without using the API key, from a client-side lookup. Everything seems to work when using this code: $.getJSON("http://maps.google.com/maps/api/geocode/json?address=202++3991+Henning+Dr+Burnaby+BC+V5C+6N5&sensor=false&callback=?", function(data, textStatus){ console.log(data); console.log(textStatus); }); However, I'm

Google Map Javascript API v3 - OVER_QUERY_LIMIT Error

五迷三道 提交于 2019-12-25 05:29:06
问题 I am displaying multiple locations in the map by iterating a for loop. After doing that few times using Google Map API v3 javascript I am getting this javascript error 回答1: This has been answered in the posting below: OVER_QUERY_LIMIT while using google maps To save you a trip: you are being throttled by the API. Batch the locations and make a single request. 来源: https://stackoverflow.com/questions/9764757/google-map-javascript-api-v3-over-query-limit-error

How to avoid runtime loading of googlemap api Javascript- phonegap?

孤者浪人 提交于 2019-12-25 05:23:12
问题 I am creating a phonegap app which uses google maps to show directions and user location. I have used the default google api by adding <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> I have observed this causes the app initialization to slow down, and sometimes even crash if connectivity is slow on the mobile device. I understand that the app will not start unless all the scripts are loaded. I tried downloading the JavaScript from the url http:/

Opening Info Window when clicking a table row

佐手、 提交于 2019-12-25 05:13:46
问题 I'm trying to load several cities' id, name, and positions from a MySQL table and then populate it into an HTML table. There's also a Google Maps with markers pointing to those cities. I want an info window to pop up on the city marker when user click one of the HTML row (tr tag). I'm using PHP, Javascript, and XML without any jQuery. My HTML: <?php $query = "SELECT id, name, lat, lng FROM city ORDER BY id"; $arrCities = mysql_query ($query); ?> <div id="gmap" style="width: 550px; height:

Getting relevant (rather then pseudo-random) results with google maps places API

拥有回忆 提交于 2019-12-25 05:04:59
问题 I read all the posts (here and elsewhere) about the Places API and still can't find a solution. I have a form in which the user can input the street and either the number or the building name (like a mall). I want to validate the info via geocode (if it's a number) or places (if it's a name) before submitting and showing the map as I need the exact address, but the Places search gives me pseudo-random results. For example: var cityCenter = new google.maps.LatLng(1.30563, 103.83751); var