/
gomap.js
47 lines (42 loc) · 1.02 KB
/
gomap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// When locator icon in datatable is clicked, go to that spot on the map
$(document).on("click", ".go-map", function(e) {
e.preventDefault();
$el = $(this);
var lat = $el.data("lat");
var long = $el.data("long");
var name = $el.data("name");
Shiny.onInputChange("goto", {
lat: lat,
lng: long,
name: name,
nonce: Math.random()
});
});
var reset_size = function() {
$("div.outer").css("top", $("nav.navbar-static-top").height());
if ($(window).width() <= 940) {
$("#github_ribbon").hide();
} else {
$("#github_ribbon").show();
}
};
// resize the window size of the map
$(window).resize(function(){
reset_size();
});
// better loading panel
$(document).ready(function(){
$("#loading-content").show();
});
$(document).ready(function() {
$('.navbar-collapse').on('shown.bs.collapse', function() {
reset_size();
});
$('.navbar-collapse').on('hidden.bs.collapse', function() {
reset_size();
});
});
$(window).load(function(){
$("#loading-content").fadeOut(1500);
reset_size();
});