google-maps-api-3

Google maps change marker color based on xml value

五迷三道 提交于 2021-01-29 21:22:49
问题 Based on this tutorial https://developers.google.com/maps/documentation/javascript/mysql-to-maps about markers using a mysql database. I have the following response: <?xml version="1.0" encoding="ISO-8859-1"?> <markers> <marker id="1" lng="151.171936" lat="-33.861034" address="580 Darling Street, Rozelle, NSW" name="Love.Fish" color="green"/> <marker id="2" lng="151.174469" lat="-33.898113" address="76 Wilford Street, Newtown, NSW" name="Young Henrys" color="green"/> <marker id="3" lng="151

TypeError: b.lat is not a function - Heatmap Layer

♀尐吖头ヾ 提交于 2021-01-29 13:24:27
问题 I'm stuck trying to figure out why I'm getting the above issue for my heat-layer. The answers I've seen on while seatching address improper LatLng setup, however my marker's LatLng array work just fine. I've tried adding weights as well even though the api say it's optional. var map; function initMap(resultSet) { map = new google.maps.Map(document.getElementById('maps'), { center: { lat: 40.8173, lng: -96.7005 }, zoom: 16, mapTypeId: 'satellite' });` var labels = []; var locations = []; for

HTML link to location on KML layer

泄露秘密 提交于 2021-01-29 08:10:10
问题 I am trying to add links on my webpage to different locations on my google map. The map is two different kml files, one of the two is displayed to the user based on their zoom level. I have tried the traditional ways to add a link to a location in javascript but the link doesnt work. This is what I have right now: google.maps.KmlMouseEvent.latlng(bathrooms_link, 'click', function(){ var bath = new google.maps.LatLng(38.04851723912264, -84.59609386082468); }); map.panTo(bath); 回答1: You can't

Mootools breaks Google maps streetview - black screen

白昼怎懂夜的黑 提交于 2021-01-29 04:10:05
问题 Including the mootools.min.js in the Maps JavaScript API Hello World example causes the street view feature to fail rendering street images. I'm working with Joomla and mootools gets loaded prior to my code getting inserted. I reduced the problem until I was working with the HelloWorld example provided in the documentation. My local version of mootools is 1.4.5. I've tested it with the hosted 1.45 as well as the latest version 1.6.0. <!DOCTYPE html> <html> <head> <title>Simple Map</title>

Mootools breaks Google maps streetview - black screen

蹲街弑〆低调 提交于 2021-01-29 04:04:46
问题 Including the mootools.min.js in the Maps JavaScript API Hello World example causes the street view feature to fail rendering street images. I'm working with Joomla and mootools gets loaded prior to my code getting inserted. I reduced the problem until I was working with the HelloWorld example provided in the documentation. My local version of mootools is 1.4.5. I've tested it with the hosted 1.45 as well as the latest version 1.6.0. <!DOCTYPE html> <html> <head> <title>Simple Map</title>

Unexplained extra Polyline drawn - Google Maps API v3

两盒软妹~` 提交于 2021-01-29 03:26:49
问题 I have a strange scenario with regards to a Polyline that is being drawn on the map. Before I post the code, I'll first demonstrate what happens when I make use of the normal direction services (Both calculates the resulting disctance the same = Total Distance: 62.734 km ): Now, when I draw the directions myself - this straight line appears out of nowhere: Code snippet: <script type="text/javascript"> var markers = [ { "lat": '-26.2036247253418', "lng": '28.0086193084717' } , { "lat": '-26

The KML file included in google drive that does not recognize

久未见 提交于 2021-01-28 18:22:14
问题 I have tried Displaying KML files in my google Maps application. I used google map api documentation for that. when I load my HTML file, it show only google map. I think this problem about KML file. How do i fix it ..? I have upload KML file into my google drive and I share it as "anyone with the link can edit". However Google Maps API's example is working...!! this is the code :- <script> var map; var src = 'https://drive.google.com/open?id=0B5oAxCVEQK5uZ0tJcFBDaGRfajg'; function initialize(

Google Maps infowindow close event not working

浪尽此生 提交于 2021-01-28 18:14:37
问题 I have create an infowindow in google maps as: var setInfoWindow = function() { infoWindowOpen = true; return new google.maps.InfoWindow({ content: businessAddress }); } This is the open event for infowindow. It is working google.maps.event.addListener(marker, 'click', function() { if(!infoWindowOpen) { setInfoWindow().open(map,marker); currentMark = this; } }); This is the close event for infowindow. It is not working google.maps.event.addListener(infowindow,'closeclick',function(){ var

Google Maps Javascript v3 Polyline click event

风流意气都作罢 提交于 2021-01-28 12:03:59
问题 I'm trying to make display a map with a number of routes laid out as polylines. When a polyline is clicked I want to display data specific to that line. Associating data with a line isn't a problem, but no matter which line is clicked the data displayed is associated with the most recent line drawn, as if each new polyline overwrites the last. I have a database which contains a link to a gpx file, a link to a video, type of route (which indicates the colour) and some other stuff. The line is

Google Maps Polyline click between points

心已入冬 提交于 2021-01-28 11:46:06
问题 Using Google Maps api 3, I have a polyline with a click event. I need to find out between which two points in the path the user has clicked. Ideally the index of the points. Below is a sample page mostly taken direct from google docs, but added the click event. The actual app has much more complex polylines. Is there are way to do this? Many thanks <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <title>Polylines</title>