Mercurial > hg > batmud > gmap2
changeset 93:2324a519ebec gmap2
Cosmetic cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 16 Oct 2011 02:21:54 +0300 |
parents | 45907866e3a9 |
children | 887eef05e215 |
files | map.js |
diffstat | 1 files changed, 15 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/map.js Sun Oct 16 02:21:30 2011 +0300 +++ b/map.js Sun Oct 16 02:21:54 2011 +0300 @@ -36,26 +36,31 @@ map.setCenter(proj.fromPixelToLatLng(new GPoint(8556,8664), 6), 3, custommap); -function checkCoords(cx, cy, cxmin, cymin, cxmax, cymax, cname) { - if (cx > cxmin && cx < cxmax && cy > cymin && cy < cymax) { +function checkCoords(cx, cy, cxmin, cymin, cxmax, cymax, cname) +{ + if (cx > cxmin && cx < cxmax && cy > cymin && cy < cymax) return {x: cx + cxmin, y: cy + cymin, name: cname}; - } else { + else return null; - } } -google.maps.Event.addListener(map, "mousemove", function(point) { - var p = proj.fromLatLngToPixel(point,7); - tx = Math.round((p.x-16383)/2)-1; - ty = Math.round((p.y-16383)/2)-1; + +google.maps.Event.addListener(map, "mousemove", +function(point) +{ + var p = proj.fromLatLngToPixel(point, 7); + tx = Math.round((p.x - 16383) / 2) - 1; + ty = Math.round((p.y - 16383) / 2) - 1; xx = tx; yy = ty; cont = "Deep Sea"; - for (i = 0; i < continents.length; i++) { + for (i = 0; i < continents.length; i++) + { var c = continents[i]; - if (c != null && tx > c[1] && tx < c[3] && ty > c[2] && ty < c[4]) { + if (c != null && tx > c[1] && tx < c[3] && ty > c[2] && ty < c[4]) + { cont = c[0]; xx = tx - c[1]; yy = ty - c[2]; @@ -67,4 +72,3 @@ document.getElementById("ycoord").innerHTML = yy; document.getElementById("continent").innerHTML = cont; }); -