google-maps-api-3

After changing page in jquery mobile, google map loads just partly

好久不见. 提交于 2020-01-01 19:19:11
问题 I've got home page in jquery mobile that has link to another page where map is all over the screen with header on top. When I go to that link with the map, the map loads just partly (as you can see on screenshot) and when I try to move it, it jumps back. As you can see the canvas is properly loaded, because down there is google map logo and Terms of use. What is wrong with that? One fact: When I refresh the map page (not starting on home page) or when I resize the browser window when I'm on

Avoiding vertex drag maps api v3

感情迁移 提交于 2020-01-01 19:13:51
问题 Very simple. I want to avoid the dragging of the first and last vertices. I've tried using dragstart event, but apparently polyline doesn't listen to that one. I've managed to do something with set_at. I have the last position stored, when set_at is called, I check the index of that vertex, and then set the latLng for that vertex to the old one. This was only possible using setAt function which fires the event again. So a created a ignoreNextEvent flag, so It won't go for an infinite loop.

Google map API v.3 find nearest point from one point to point on polyline

孤街浪徒 提交于 2020-01-01 19:07:13
问题 I`ve got a map with a polyline. The server will responds me with a LatLng point on a map. I need to check if the point from the server situated on a polyline edge. If not, i need to find the nearest point on the polyline and place a marker on the nearest point on the polyline. For example, if the server responds me with a point A, i need to place a marker to a point B. I find a good library http://wtp2.appspot.com/cSnapToRouteDemo.html, but this library is for Google API ver. 2, and i'm using

adding sound to an array of markers - google map javascript

丶灬走出姿态 提交于 2020-01-01 18:58:29
问题 I am new here so I know I don't have any credibility. I am an artist and new to programming so I understand if no one will take this on. I am posting this on the off chance that this is an easy question. -S This is the code (mostly from the google developer site) to create multiple markers. It works fine and creates a custom icon for each marker. Each marker should play a different audio file when clicked (right now only the last marker created does). I would also like to change the icon when

google maps - using map.fitBounds (bounds);

三世轮回 提交于 2020-01-01 17:25:29
问题 I have the following code (Bottom), it's javascript embedded in php to create my google map with a bunch of markers. So I want to set the zoom to a level where it will show all my markers. I understand I need this code: var latlngbounds = new google.maps.LatLngBounds(); for (var i = 0; i < latlng.length; i++) { latlngbounds.extend(latlng[i]); } map.fitBounds(latlngbounds); To set the boundary, but I can't figure out where I should put this or what changes I need to make to the code I'm using

How to convert to Google encoded polyline algorithm format?

让人想犯罪 __ 提交于 2020-01-01 15:52:38
问题 The encoded polyline format for Google maps stores lat/lon information as well as zoom levels. I have a huge text file with lat/lon pairs that i want to convert to this format and for different sections of polylines (i.e. i need to perform a batch conversion) Does anyone know of a code that performs this operation ? 回答1: The definitive reference to encoding and decoding polylines is by Professor Mark McClure, at http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/ It contains

How to convert to Google encoded polyline algorithm format?

柔情痞子 提交于 2020-01-01 15:52:07
问题 The encoded polyline format for Google maps stores lat/lon information as well as zoom levels. I have a huge text file with lat/lon pairs that i want to convert to this format and for different sections of polylines (i.e. i need to perform a batch conversion) Does anyone know of a code that performs this operation ? 回答1: The definitive reference to encoding and decoding polylines is by Professor Mark McClure, at http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/ It contains

Google Maps API dropdown list, zoom to marker

梦想的初衷 提交于 2020-01-01 15:07:21
问题 I am using Google Maps API v3, I have a simple map with a few markers. I also have a pull down list. I need the least amount of code to make this work. I would like to select a marker in the pull down list and have the marker selected pan to it. I have tried everything as well as look online and I find things close, but nothing is working so far, very frustrated so far. Pls Help! here is the snippet: I need to figure out how to make this work <!DOCTYPE html> <!-- saved from url=(0014)about

Add a point to expand polygon without appending it in Google Maps?

无人久伴 提交于 2020-01-01 11:58:11
问题 I'm building a polygon in Google Maps through markers that can be dragged to reshape it. So, when there are 3 markers, the polygon is drawn, and further markers are appended in the shape, expanding it. That's fine when the user just want to follow a simple clockwise/counterclockwise pattern, but when he wants to expand the polygon through one of its edges, instead it will append the marker, twisting itself. Here in this example, if we add markers 1, 2 and 3, it will be drawn a simple triangle

How can I get x and y number at every click event on Google Maps?

孤人 提交于 2020-01-01 11:26:19
问题 I want to retrieve x/y coordinates at every click-event on Google Maps. Could someone help me please? 回答1: google.maps.event.addListener(map, "click", function (e) { document.form1.waypointLog.value = e.latLng.lat().toFixed(6) + ' |' + e.latLng.lng().toFixed(6); }); Source: https://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/3f4329e3a20e7b0b You can also check: http://forums.gpsreview.net/viewtopic.php?t=3632 来源: https://stackoverflow.com/questions/8766116/how-can-i-get