Last active
December 11, 2015 15:28
-
-
Save binux/4620963 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 _map = R; | |
var rectangle = new google.maps.Rectangle({ | |
bounds: _map.getBounds(), | |
editable: true, | |
map: _map | |
}); | |
function message(msg) { | |
$('#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>'+msg+'</div></div>'); | |
$('#plext_container').scrollTop($('#plext_container')[0].scrollHeight); | |
} | |
google.maps.event.addListener(rectangle, 'bounds_changed', function() { | |
var a = rectangle.getBounds(); | |
message([Math.floor(a.getSouthWest().lat() * 1e6), Math.floor(a.getSouthWest().lng() * 1e6), | |
Math.floor(a.getNorthEast().lat() * 1e6), Math.floor(a.getNorthEast().lng() * 1e6)]); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment