google-maps-api-3

Reverse Geocode On Google Maps api v3

こ雲淡風輕ζ 提交于 2019-12-31 04:40:07
问题 I wonder whether someone may be able to help me please. I using the code shown below to correctly plot markers retrieved from a MySQL database on a Google Map. <script type="text/javascript"> //Sample code written by August Li var icon = new google.maps.MarkerImage("images/location-marker-2.png") new google.maps.Point(16, 32); var center = null; var map = null; var bounds = new google.maps.LatLngBounds(); function addMarker(lat, lng, info) { var pt = new google.maps.LatLng(lat, lng); bounds

Finding streets (get their coordinates) and calculating distances between markers

社会主义新天地 提交于 2019-12-31 04:18:05
问题 I have trouble finding any information on how to use the API to: Search for streets and get some clickable results that returns a LatLng object or something (at least coordinates). So If I search for a street and click on a result, I'll pan to that street (for example). How can I calculate distance between markers? and possibly, draw lines between them. All I get is the API but no guides so it's fairly hard figuring out what types to use. 回答1: Here is a fiddle showing how this can be achieved

Google Maps API v3 + Foundation 4 Reveal modal not displaying properly

倾然丶 夕夏残阳落幕 提交于 2019-12-31 02:55:13
问题 Before we begin I just want to make clear that I have already read the following SO articles top to bottom, tried to replicate the solution, and so far cannot. Google Map API in Foundation reveal modal not displaying properly Google Map API inside a Reveal Modal not showing fully How to use google.maps.event.trigger(map, 'resize') As well as Zurb's Foundation Issue List here - > https://github.com/zurb/foundation/issues My issue seems to be identical, and I even checked his source code at

Google API V3 multiple infowindows plus close on click

陌路散爱 提交于 2019-12-31 02:09:12
问题 I figured out how to have multiple markers with info windows but they do not close when you click another marker, I believe it is because I am creating a new info window for each marker, any help would be appreciated. <script type="text/javascript"> var map ; function initialize() { var latlng = new google.maps.LatLng(53.063165, -3.205390); var myOptions = { zoom: 6, center: latlng, mapTypeId: google.maps.MapTypeId.SATELLITE, zoomControl: false, mapTypeControl: false, mapTypeControlOptions: {

using addDomListener with googlemaps not working

佐手、 提交于 2019-12-31 00:59:26
问题 I've built markers for a googlemap by querying a database in php, then sending the data to an addMarker function. For each marker, there are 0 to an unknown number of "violations." I've put the violations for each marker into an array (called violations) and sent it to the addMarker function as well. What I'd like to do is have a link for each violation. When you click the link, you see the details (a table) for that violation. The table initially is display:none. But when you click the link,

map.setCenter() function is not working properly

泄露秘密 提交于 2019-12-30 18:28:08
问题 Here's code... <script src="http://maps.google.com/maps/api/js?sensor=false"></script> <script> var geocoder; var map; function initialize() { geocoder = new google.maps.Geocoder(); var address = "new delhi"; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var latitude = results[0].geometry.location.lat(); var longitude = results[0].geometry.location.lng(); alert(latitude); alert(longitude); map.setCenter(new GLatLng(latitude

How to put a infowindow on polyline in Google Maps v3?

只愿长相守 提交于 2019-12-30 17:31:28
问题 I want to know how to show infowindow on polyline in using Google Maps Api V3 ? and to appear in the middle of the polyline ?! 回答1: Firstly you will need to calculate the middle/center of the polyline. This has been discussed and answered here; https://stackoverflow.com/a/9090409/787921 Then you will have to open the infowindow; var infowindow = new google.maps.InfoWindow({ content: "infowindow text content"}); infowindow.setPosition(midLatLng); infowindow.open(map); 回答2: find the middle

total distance and time for all waypoints in google maps v3

こ雲淡風輕ζ 提交于 2019-12-30 15:43:14
问题 I have the following code for directions from google maps apiv3. This part is working good. If i have waypoints in my trip, at the top of each trip, it is showing the time as well as distance for the trip. I used a variable totadistance to add the distance from all the legs but, it does nothing. I do not see a alert message when i run the application. I want to see the total time and distance for all the trips. How can i get that information? function calcRoute(startaddr, endaddr) { var start

total distance and time for all waypoints in google maps v3

孤者浪人 提交于 2019-12-30 15:43:07
问题 I have the following code for directions from google maps apiv3. This part is working good. If i have waypoints in my trip, at the top of each trip, it is showing the time as well as distance for the trip. I used a variable totadistance to add the distance from all the legs but, it does nothing. I do not see a alert message when i run the application. I want to see the total time and distance for all the trips. How can i get that information? function calcRoute(startaddr, endaddr) { var start

google map api v3 - how to limit number of polygon lines and force closure at the 5 click?

梦想的初衷 提交于 2019-12-30 11:41:30
问题 i have this code <script> function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8 }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var drawingManager = new google.maps.drawing.DrawingManager({ drawingMode: google.maps.drawing.OverlayType.MARKER, drawingControl: true, drawingControlOptions: { position: google.maps.ControlPosition.TOP_CENTER, drawingModes: [ google.maps.drawing.OverlayType.POLYGON ] },