google-maps-api-3

Loading Google Maps API via AJAX, console error

梦想与她 提交于 2019-12-21 18:05:32
问题 I'm building a fully dynamic website using jquery/javascript, ajax and php. When I click on a navigation link, the browser opens that page using ajax. So basically all pages are loaded within the same index.php. If I go to 'Location' tab, where I have a google map, it will load the Google Maps script dynamically (adding a script tag to the body). <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&callback=initialize"></script> This script is loaded

MapKit - Make route line follow streets when map zoomed in

自古美人都是妖i 提交于 2019-12-21 17:46:51
问题 I wrote simple application which draws route between two locations on MapKit. I am using Google Map API. I used resources I found online and here's the code I am using to make request to Google: _httpClient = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"http://maps.googleapis.com/"]]; [_httpClient registerHTTPOperationClass: [AFJSONRequestOperation class]]; [_httpClient setDefaultHeader:@"Accept" value:@"application/json"]; NSMutableDictionary *parameters = [[NSMutableDictionary

Googlemap api v3 slower than api v2?

自闭症网瘾萝莉.ら 提交于 2019-12-21 17:46:42
问题 I am in the midst of converting old googlemap v2 code to v3 and it looks if v3 is much slower than v2? Most of my code change is just replacing G with google.maps. (GMarker to google.maps.Marker) Any tips or tricks how to speed things up?? 回答1: The solution might be as simple as experimenting with different versions of the v3 API by trying v=3.4 and v=3.5 in your links that load the API like so: <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&v=3.5"><

Compute the distance between polyline (route) and marker in Google Maps API v3

守給你的承諾、 提交于 2019-12-21 17:44:49
问题 Is there any convenient way to compute the direct (shortest) distance between Polyline (the route generated by Google Directions) and markers that are NOT situated on that polyline? The only way I found out is to cycle through Polyline.getPath() vertices manually to calculate the shortest distance but it seems to be a bit harsh: var path = routes[0].overview_path; for (var i = 0; i < data.points.length; i++) { var latLngA = new LatLng(data.points[i].lat, data.points[i].lng); var shortest

Prevent horizontal world-wrapping of overlays in GMap v3

一曲冷凌霜 提交于 2019-12-21 17:38:31
问题 I'm trying to make a map that doesn't wrap horizontally, using the Google Maps API V3. So instead repeating the map side-by-side again and again, I want to show it only once. I got that to work by providing a custom getTileUrl function for google.maps.ImageMapType But when I add overlays (like markers or polygons), those still are repeated horizontally. How can I stop the overlays from being repeated horizontally? Edit Here's an image demonstrating the problem: I was thinking of somehow

How to get image from Google static map API

自闭症网瘾萝莉.ら 提交于 2019-12-21 17:29:19
问题 I use this code to generate static images from Google API, but I have too many requests, so sometimes I get overuse from Google. string latlng = location.Latitude + "," + location.Longitude; string path = "http://maps.googleapis.com/maps/api/staticmap?center=" + latlng + "&zoom=16&size=200x200&maptype=roadmap&markers=color:blue%7Clabel:S%7C" + latlng + "&sensor=false"; Is it possible to call this from C# to generate and save images? I can't find way to get an image object. 回答1: using

Google map js api version 3 infowindow glitch

帅比萌擦擦* 提交于 2019-12-21 16:17:15
问题 I am developing an application which uses google maps api v3 to show markers and infowindows. Well, I have N markers stored within an array and a global infowindow used to show some information. The infowindow contents are shown simply by clicking a marker, created in this way: /* global js stuff */ var g_map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var g_current_popup = new google.maps.InfoWindow({ content: "" }); var g_markers = []; /* create marker function

How to detect enter and exit streetView in Google Maps API v3

折月煮酒 提交于 2019-12-21 14:58:39
问题 Is there a way to detect when a user enters and exits StreetView in Google Maps under API v3? I want to trigger an existing 'Hide Menu' function when the user enters StreetView (as the menu isn't relevant) and then re-show the menu when they exit. 回答1: Observe the visible_changed -event of the streetView, the visible -property will be true or false (open or closed) function initialize() { var mapOptions = { center: new google.maps.LatLng(52.5498783, 13.425209), zoom: 8 }; var map = new google

Get Home/office address from google maps

夙愿已清 提交于 2019-12-21 12:43:05
问题 I have an map based android app and am providing functionality to login using gmail account. Now, Google maps on the device has saved home and office address of the user. Is it possible to get this data without user having to input it? 回答1: You can geocode the addresses with Google Geocoding API . Depending of what you want, you can get an XML or JSON response by calling http://maps.google.com/maps/api/geocode/json?address=ADRESS HERE Where all the spaces of the address must be replaced by +

Out of memory error when using Google Maps API

不羁的心 提交于 2019-12-21 12:19:00
问题 I have an application here that has a feature of showing a POI on the map. It's only one POI and it is only drawn when it's actually within the visible screen area. It works perfectly for a while but if I play around zooming in and out and dragging, it will eventually crash. According to Logcat, the reason is always an OutOfMemory error. At first, I thought it was a bug on the Google Maps API. After some researching and seeing some Romain Guy posts, I was kind of convinced that I had done