Mercurial > hg > batmud > gmap2
changeset 174:d68af0d5b924 gmap2
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 11 Mar 2014 22:32:46 +0200 |
parents | fa0a8bb7fcfd |
children | a1a725a9541d |
files | markers.js |
diffstat | 1 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/markers.js Tue Mar 11 21:22:59 2014 +0200 +++ b/markers.js Tue Mar 11 22:32:46 2014 +0200 @@ -17,7 +17,8 @@ var pmapMIndex = 0; var pmapBIndex = 0; var pmapBuiltin = []; -var pmapSideBuiltinHTML = ""; +var pmapSideBuiltinHTML, pmapSidePublicHTML, pmapSidePrivateHTML; +var pmapInfoWindow; function pmapMyClick(i) @@ -55,8 +56,8 @@ pmapBIndex++; } -// if (mclass == "private") side_private_html += '<a href="javascript:pmapMyClick(' + pmapMIndex + ')">' + name + '</a><br>'; -// if (mclass == "public") side_public_html += '<a href="javascript:pmapMyClick(' + pmapMIndex + ')">' + name + '</a><br>'; + if (mclass == "private") pmapSidePrivateHTML += '<a href="javascript:pmapMyClick(' + pmapMIndex + ')">' + name + '</a><br>'; + if (mclass == "public") pmapSidePublicHTML += '<a href="javascript:pmapMyClick(' + pmapMIndex + ')">' + name + '</a><br>'; pmapMarkers[pmapMIndex++] = marker; return marker; @@ -99,10 +100,16 @@ function pmapLoadMarkers() { + pmapInfoWindow = new google.maps.InfoWindow; + // + // Parse regular markers from JSON + // XDownloadUrl("markers.json", function(data, responseCode) { var markers = JSON.parse(data); pmapSideBuiltinHTML = ""; + pmapSidePublicHTML = ""; + pmapSidePrivateHTML = ""; for (var nid = 0; nid < markers.length; nid++) { @@ -123,7 +130,7 @@ }); // - // Parse tradelane markers from another XML + // Parse tradelane markers from another JSON // XDownloadUrl("tradelane.json", function(data,responseCode) { @@ -156,7 +163,6 @@ { var pt = points[npt]; coords.push(pmapMapCoordsToLatLng(new google.maps.Point(pt["x"] * 2 + 1, pt["y"] * 2 + 1), 7)); -// coords.push(new google.maps.Point(pt["x"]*2 + 1, pt["y"]*2 + 1)); } // Create new polyline and add it to map overlay