-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdom-ready.js
More file actions
44 lines (37 loc) · 1.16 KB
/
dom-ready.js
File metadata and controls
44 lines (37 loc) · 1.16 KB
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
$(document).ready(function() {
var map = initialize();
var container = $('.container');
$('#toggle_sidebar').toggle(
function(){
container.addClass('open');
$("#map_canvas").css({height:$(".contents").height()}).css({width:$(".contents").width()});
}, function(){
container.removeClass('open');
$("#map_canvas").css({height:$(".contents").height()}).css({width:$(".contents").width()});
});
$('.sidebar input').checked = false;
$('.sidebar input').live("change", function(){
var options = {
feed: $(this).attr("data-layer-url"),
name: $(this).attr("data-layer-name"),
type: $(this).attr("data-layer-type")
};
if (this.checked) {
if (options.type === "cameras") {
addPennDOTCameras(map);
} else if (options.type === "points") {
addPointSet(options, map);
} else {
addLayer(options, map);
}
} else {
if (options.name === "penndot-cameras") {
removePennDOTCameras(map);
} else if (options.type === "points") {
removePointSet(options, map);
} else {
removeLayer(options, map);
}
}
})
});