Skip to content

Commit

Permalink
Merge branch 'not-only-for-kaios-browser'
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Nov 13, 2020
2 parents 5df6fc7 + 5a00c40 commit 7a6b24d
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 107 deletions.
117 changes: 63 additions & 54 deletions application/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ let storage_name;

$(document).ready(function() {



//welcome message
$('div#message div').text("Welcome");
setTimeout(function() {
Expand Down Expand Up @@ -75,39 +73,6 @@ $(document).ready(function() {

L.control.scale({ position: 'topright', metric: true, imperial: false }).addTo(map);

////////////////////
////RULER///////////
///////////////////
var ruler_activ = "";

function ruler() {

if (ruler_activ == "") {
L.control.ruler().addTo(map);

}

if (ruler_activ === true) {
$("div.leaflet-ruler").remove();

ruler_activ = false
navigator.spatialNavigationEnabled = false;
L.control.ruler().remove();
$("div.leaflet-ruler").removeClass("leaflet-ruler-clicked")

return false;
} else {
L.control.ruler().remove();

navigator.spatialNavigationEnabled = true;

ruler_activ = true
$("div.leaflet-ruler").addClass("leaflet-ruler-clicked")
return false;
}


}
////////////////////
////MAPS////////////
///////////////////
Expand Down Expand Up @@ -312,6 +277,39 @@ $(document).ready(function() {



////////////////////
////RULER///////////
///////////////////
var ruler_activ = "";

function ruler() {

if (ruler_activ == "") {
L.control.ruler().addTo(map);

}

if (ruler_activ === true) {
$("div.leaflet-ruler").remove();

ruler_activ = false
navigator.spatialNavigationEnabled = false;
L.control.ruler().remove();
$("div.leaflet-ruler").removeClass("leaflet-ruler-clicked")

return false;
} else {
L.control.ruler().remove();

navigator.spatialNavigationEnabled = true;

ruler_activ = true
$("div.leaflet-ruler").addClass("leaflet-ruler-clicked")
return false;
}


}


/////////////////////////
Expand Down Expand Up @@ -362,7 +360,7 @@ $(document).ready(function() {

//set filename by user imput
function saveMarker() {
user_imput("open", moment().format("DD.MM.YYYY, HH:MM"));
user_input("open", moment().format("DD.MM.YYYY, HH:MM"));
}

let filename;
Expand Down Expand Up @@ -508,7 +506,7 @@ $(document).ready(function() {
$("#marker-target-cross").animate({
width: "50px",
height: "50px"
}, 3000, function() {});
}, 2000, function() {});


elem.style.opacity = "1"
Expand Down Expand Up @@ -619,9 +617,13 @@ $(document).ready(function() {
}
if (option == "save_marker") {
toaster('Marker saved', 2000);
L.marker([current_lat, current_lng]).addTo(map);
map.setView([current_lat, current_lng], 13);

var markerOptions = {
keyboard: true
}
L.marker([current_lat, current_lng], markerOptions).addTo(map);

map.setView([current_lat, current_lng], 13);
$('div#finder').css('display', 'none');
windowOpen = "map";
}
Expand Down Expand Up @@ -741,15 +743,12 @@ $(document).ready(function() {
save_delete_marker("save_marker")

}
//let marker_count = -1;
let marker_array = [];
if (item_value == "marker") {
if (param == "add-marker") {
//to know it is not the current position
marker_latlng = true;

marker_count++

marker_lng = Number($(document.activeElement).data('lng'));
marker_lat = Number($(document.activeElement).data('lat'));

Expand Down Expand Up @@ -853,25 +852,37 @@ $(document).ready(function() {

function coordinations(param) {
let update_view;
if (param == "show") {
getLocation("update_marker");
if ($("div#coordinations").css("display") == "none") {
$("div#finder").css("display", "none");
$("div#coordinations").css("display", "block");
//getLocation("update_marker");
update_view = setInterval(() => {
if (current_lat != "" && current_lng != "") {

$('div#coordinations div#lat').text("Lat " + current_lat.toFixed(5));
$('div#coordinations div#lng').text("Lng " + current_lng.toFixed(5));
$('div#coordinations div#altitude').text("alt " + current_alt);
$('div#coordinations div#heading').text("heading " + current_heading);
if (current_alt) {
$('div#coordinations div#altitude').text("alt " + current_alt);
} else {
$('div#coordinations div#altitude').text("alt no data");
}
if (current_heading) {
$('div#coordinations div#heading').text("heading " + current_heading);

} else {
$('div#coordinations div#heading').text("heading no data");

}

}
}, 1000);

$("div#finder").css("display", "none");
$("div#coordinations").css("display", "block");
windowOpen = "coordinations";

return true;

}

if (param == "hide") {
if ($("div#coordinations").css("display") == "block") {
$("div#coordinations").css("display", "none");
windowOpen = "map";
clearInterval(update_view);
Expand Down Expand Up @@ -939,7 +950,6 @@ $(document).ready(function() {
if (zoom_level < 6) {
step = 1;
return step;
console.log(step)
}
if (zoom_level > 6) {
step = 0.1;
Expand All @@ -955,7 +965,6 @@ $(document).ready(function() {
step = 0.0001;
}
return step;
console.log(step)


}
Expand Down Expand Up @@ -1206,7 +1215,7 @@ $(document).ready(function() {


if (windowOpen == "user-input") {
user_imput("close")
user_input("close")
return false;
}
break;
Expand All @@ -1223,7 +1232,7 @@ $(document).ready(function() {

}
if (windowOpen == "user-input") {
filename = user_imput("return")
filename = user_input("return")
save_delete_marker("save_marker")

}
Expand Down
58 changes: 6 additions & 52 deletions application/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ div#marker-target-cross {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 900;
z-index: 1000;
opacity: 0;
animation: infinite;
animation-duration: 3s;
Expand Down Expand Up @@ -335,69 +335,23 @@ div#coordinations {
z-index: 1000;
left: 0;
top: 0;
background: black;
background: none;
color: white;
font-size: 14px;
padding: 5px 10px 50px 5px;
display: none;
overflow: hidden;
}

div#coordinations div#button-set {
position: fixed!Important;
bottom: 0px;
height: 30px;
background: black;
}

div#coordinations div#button-set div div#close {
background: black;
color: white;
font-size: 14px;
padding: 3px;
min-width: 100px;
}

div#coordinations div#button-set div div#share {
background: black;
color: white;
font-size: 14px;
padding: 3px 10px 3px 3px;
text-align: right;
min-width: 70px;
}

div#coordinations div#lat {
div#coordinations div {
background: black;
color: white;
font-size: 14px;
padding: 3px;
}

div#coordinations div#lng {
background: black;
color: white;
font-size: 14px;
padding: 3px;
}

div#coordinations div#altitude {
background: black;
color: white;
font-size: 14px;
padding: 3px;
}


/* KaiOS portrait devices (240x320) */

@media only screen and (orientation: portrait) {
/* styles */
}

div#coordinations div#lat {}

/* KaiOS landscape devices (320x240) */
div#coordinations div#lng {}

@media screen and (orientation: landscape) {
/* styles */
}
div#coordinations div#altitude {}
2 changes: 1 addition & 1 deletion application/assets/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function toaster(text, time) {

let wp;

function user_imput(param, file_name) {
function user_input(param, file_name) {
if (param == "open") {
$("div#user-input").animate({ bottom: "0px" }, 1000, "linear");
$("div#user-input input").focus();
Expand Down
Binary file modified build/osm-map.zip
100644 → 100755
Binary file not shown.

0 comments on commit 7a6b24d

Please sign in to comment.