internet explorer - Problems displaying google heat map -
hope can me below code. i'm having issues getting heatmap load in chrome load in ie (after refresh) hope can provide me a/some pointers check im new google maps, js , json :-)
thank you!
<!doctype html> <html> <head> <title>phone home</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px } </style> <script type="text/javascript" src="../src/markerclusterer.js"></script> <script type="text/javascript" src="../src/jquery.js"></script> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=geometry,visualization&key=****"></script> <script> var map,heatmap; var markers = []; var xmlhttp = new xmlhttprequest(); var url = "../src/et.json"; function initialize() { // create simple map. map = new google.maps.map(document.getelementbyid('map-canvas'), { zoom: 3, center: new google.maps.latlng(0,0) }); getmarkers(url); heatmap = new google.maps.visualization.heatmaplayer({ data: markers }); heatmap.setmap(map); } function getmarkers(url){ xmlhttp.onreadystatechange = function() { if (xmlhttp.readystate == 4 && xmlhttp.status == 200) { var myarr = json.parse(xmlhttp.responsetext); loadmarkers(myarr); } } xmlhttp.open("get", url, true); xmlhttp.send(); function loadmarkers(arr) { var out = ""; var i; for(i = 0; < arr.length; i++) { var latlng = new google.maps.latlng(arr[i].latitude,arr[i].longitude); var marker = new google.maps.marker({ position: latlng }); markers.push(latlng); } } } google.maps.event.adddomlistener(window, 'load', initialize); </script> </head> <body> <div id="map-canvas"></div> </body> </html>
Comments
Post a Comment