Skip to content

Commit 2be0432

Browse files
xssfoxTheSkorm
authored andcommitted
fix some location load quirks from switching to loading in splash
1 parent 9806a47 commit 2be0432

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

js/app.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ function load_hash(no_refresh) {
158158
});
159159

160160
if (wvar["box"] != def["box"]){
161-
console.log("box change detected")
162161
if(!def["box"]){
163162
$(".flatpage").hide()
164163
} else {
@@ -219,6 +218,14 @@ for(var idx in params) {
219218

220219
// loads the tracker interface
221220
function trackerInit() {
221+
// update current position if we geolocation is available
222+
if(currentPosition) updateCurrentPosition(currentPosition.lat, currentPosition.lon);
223+
224+
if (currentPosition && manual_pan == false){
225+
coords = [currentPosition.lat, currentPosition.lon]
226+
zoomLevel = 9;
227+
map.setView(coords, zoomLevel, {animate: false});
228+
}
222229
$('#loading,#settingsbox,#aboutbox,#chasebox').hide(); // welcome screen
223230
$('header,#main').show(); // interface elements
224231
checkSize();
@@ -665,7 +672,6 @@ $(window).ready(function() {
665672
var visible_box = $(".flatpage:visible");
666673
if (visible_box.length > 0){
667674
wvar.box = visible_box[0].id
668-
console.log(wvar.box)
669675
} else {
670676
wvar.box = null
671677
}

js/sondehub.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -867,13 +867,6 @@ function load() {
867867
zoomLevel = 5;
868868
}
869869

870-
// load location from browser position if possible
871-
if (currentPosition){
872-
console.log(currentPosition)
873-
coords = [currentPosition.lat, currentPosition.lon]
874-
zoomLevel = 9;
875-
}
876-
877870
//initialize map object
878871
map = new L.map(document.getElementById('map'), {
879872
zoom: zoomLevel,
@@ -988,8 +981,6 @@ function load() {
988981

989982
L.control.predictionontrol({ position: 'topleft' }).addTo(map);
990983

991-
// update current position if we geolocation is available
992-
if(currentPosition) updateCurrentPosition(currentPosition.lat, currentPosition.lon);
993984

994985
//Receiver canvas
995986
receiverCanvas = new L.LayerGroup();
@@ -4207,10 +4198,7 @@ function refreshSingleNew(serial) {
42074198
clearTimeout(periodical_focus_new);
42084199
ajax_inprogress_single_new = false;
42094200
// check if we have been redirected for history - if not we can also fetch that if it exists
4210-
console.log("completed first call")
4211-
console.log(xhr.responseURL)
42124201
if (xhr.responseURL.includes(newdata_url)){
4213-
console.log("getting extra history")
42144202
$.ajax({
42154203
type: "GET",
42164204
url: "https://sondehub-history.s3.amazonaws.com/serial/"+ encodeURIComponent(serial) +".json.gz",

0 commit comments

Comments
 (0)