Last active
December 10, 2015 23:28
-
-
Save binux/4509285 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var marker = new google.maps.Marker({ | |
position: new google.maps.LatLng(Z.d().h.getCenter().Ya, Z.d().h.getCenter().Za), | |
draggable: true, | |
map: Z.d().h | |
}); | |
var STEP = 0.000163; | |
function goto(a,b) { | |
GOTO_a = a; GOTO_b = b; | |
} | |
function do_goto() { | |
var a = GOTO_a, b = GOTO_b; | |
var ca = marker.getPosition().Ya, | |
cb = marker.getPosition().Za; | |
if (Math.abs(ca-a) < 0.000001 && Math.abs(cb-b) < 0.000001) | |
return ; | |
if (Math.abs(a-ca) < STEP) { | |
ca = a; | |
} else { | |
ca += (a-ca) > 0 ? STEP : -STEP; | |
} | |
if (Math.abs(b-cb) < STEP) { | |
cb = b; | |
} else { | |
cb += (b-cb) > 0 ? STEP : -STEP; | |
} | |
marker.setPosition(new google.maps.LatLng(ca, cb)); | |
} | |
window.setInterval(do_goto, 1000); | |
function send(a, b) { | |
console.log(a, b); | |
var data = { | |
latitude: a, | |
longitude: b | |
} | |
$.getJSON('http://localhost:9292/adb/geo_location?callback=?', data, function() { | |
$('#plexts').append('<div class="plext"><div class="pl_timestamp">'+(new Date()).getHours()+':'+(new Date()).getMinutes()+'</div><div class="pl_content pl_player"><span class="ALIENS">System: </span>'+'Location: '+a+', '+b+'</div></div>'); | |
$('#plext_container').scrollTop($('#plext_container')[0].scrollHeight); | |
}); | |
} | |
google.maps.event.addListener(Z.d().h, 'rightclick', function(event) { | |
goto(event.latLng.Ya, event.latLng.Za); | |
}); | |
google.maps.event.addListener(marker, 'position_changed', function() { | |
send(marker.getPosition().Ya, marker.getPosition().Za); | |
}); | |
_Ld = Ld; | |
Ld = function(a) { | |
_Ld(a); | |
google.maps.event.addListener(a.F, "rightclick", function(){ | |
goto(a.c.Hb, a.c.Ib); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment