From a453712c960f8e4fca22b4695a1bc96d133820b8 Mon Sep 17 00:00:00 2001 From: Mick Staugaard Date: Mon, 7 Mar 2011 17:21:06 -0800 Subject: [PATCH] better IE support --- public/index.html | 18 ++++++---- public/test.html | 83 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 7 deletions(-) create mode 100644 public/test.html diff --git a/public/index.html b/public/index.html index ce117f0..f7c8d54 100644 --- a/public/index.html +++ b/public/index.html @@ -34,18 +34,22 @@ }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); - overlays.push(new HeatMapOverlay(map, {fade: 0.01})); - //overlays.push(new ImageOverlay(map, {src: 'heart.png', fade: 0.1})); - //overlays.push(new MarkerOverlay(map, {maxMarkers: 50})); + + if (document.createElement("canvas").getContext) { + overlays.push(new HeatMapOverlay(map, {fade: 0.01})); + } else { + overlays.push(new MarkerOverlay(map, {maxMarkers: 50})); + }; - var ws = null + var ws = null; function liveMapConnect() { - console.log('connecting...'); + //console.log('connecting...'); ws = new WebSocket("ws://chat.zende.sk:9999/"); ws.onmessage = function(e) { + //alert(e); var data = JSON.parse(e.data); for (var i = 0; i < overlays.length; i++) { overlays[i].addDot(data[0], data[1]); @@ -53,11 +57,11 @@ }; ws.onclose = function() { - console.log("socket closed"); + //alert("socket closed"); }; ws.onopen = function() { - console.log("connected..."); + //alert("connected..."); }; }; diff --git a/public/test.html b/public/test.html new file mode 100644 index 0000000..2c03e04 --- /dev/null +++ b/public/test.html @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + +

+ Heat Map + Markers + Hearts +

+

+ + \ No newline at end of file