50d49
< var endkeys='';
56,57d54
< var gsmlat=80, gsmlong=-170;
< var latis=-999, longis=-999;
61,80c58,59
< try {
< wasthisso=('' + window.orientation).replace(/^0$/g, 'portrait'); //"portrait";
< } catch (ehgfg) {
< wasthisso='';
< }
< if (wasthisso == '') {
< try {
< wasthisso='' + screen.orientation.type; //"portrait";
< } catch (hgfg) {
< wasthisso=('' + window.orientation).replace(/^0$/g, 'portrait'); //"portrait";
< }
< }
< //alert(wasthisso);
< var hdone=false;
< if (wasthisso.indexOf('ortrait') != -1) { // thanks to https://stackoverflow.com/questions/50690191/window-innerheight-returning-wrong-value-in-ios-11
< if (eval('0' + document.documentElement.clientWidth) >= eval('0' + window.innerWidth)) {
< screenwidth=eval('' + document.documentElement.clientWidth);
< screenheight=eval('' + document.documentElement.clientHeight);
< hdone=true;
< } else {
---
> wasthisso='' + (screen.msOrientation || screen.mozOrientation || (screen.orientation || {}).type); //"portrait";
> if (wasthisso == 'portrait') {
82,86d60
< }
< if (!hdone) {
< if (eval('0' + document.documentElement.clientHeight) > eval('0' + window.innerHeight)) {
< screenheight=eval('' + document.documentElement.clientHeight);
< } else {
88,89d61
< }
< }
91,95d62
< if (eval('0' + document.documentElement.clientWidth) >= eval('0' + window.innerHeight)) {
< screenwidth=eval('' + document.documentElement.clientWidth);
< screenheight=eval('' + document.documentElement.clientHeight);
< hdone=true;
< } else {
97,101d63
< }
< if (!hdone) {
< if (eval('0' + document.documentElement.clientHeight) > eval('0' + window.innerWidth)) {
< screenheight=eval('' + document.documentElement.clientHeight);
< } else {
103,104d64
< }
< }
106,107d65
< // alert(wasthisso + ' ' + screenwidth + 'x' + screenheight);
< if (1 == 6) {
112d69
< }
145,153d101
< if (Math.abs(latis - al) <= 5) {
< if (acircleoflatitude == '') {
< if (('' + latis).split('.0')[0].slice(-1) == '0') {
< bcircleoflatitude+=' ' + (('' + latis).replace('-','') + (('' + latis).substring(0,1) == '-' ? 'S' : 'N')).replace(/^90N$/g,' North Pole').replace(/^90S$/g,' South Pole').replace(/^0N$/g,' Equator').replace(/^0S$/g,' Equator').replace(/S$/g,'°S').replace(/N$/g,'°N') + '
';
< } else {
< bcircleoflatitude+=' ' + (('' + latis).replace('-','') + (('' + latis).substring(0,1) == '-' ? 'S' : 'N')).replace(/^90N$/g,' North Pole').replace(/^90S$/g,' South Pole').replace(/^0N$/g,' Equator').replace(/^0S$/g,' Equator').replace(/S$/g,'°S').replace(/N$/g,'°N') + '
';
< }
< }
< }
170,178d117
< if (Math.abs(longis - am) <= 5) {
< if (ameridian == '') {
< if (('' + longis).split('.0')[0].slice(-1) == '0') {
< bmeridian+=' ' + (('' + longis).replace('-','') + (('' + longis).substring(0,1) == '-' ? 'W' : 'E')).replace(/^0E$/g,' Greenwich
Meridian').replace(/^180E/g,' International
Date
Line').replace(/^180W/g,'International
Date
Line').replace('E','°E').replace('W','°W') + '
';
< } else {
< bmeridian+=' ' + (('' + longis).replace('-','') + (('' + longis).substring(0,1) == '-' ? 'W' : 'E')).replace(/^0E$/g,' Greenwich
Meridian').replace(/^180E/g,' International
Date
Line').replace(/^180W/g,'International
Date
Line').replace('E','°E').replace('W','°W') + '
';
< }
< }
< }
206,214d144
< if (Math.abs(latis - al) <= 5) {
< if (acircleoflatitude == '') {
< if (('' + latis).split('.0')[0].slice(-1) == '0') {
< bcircleoflatitude+=' ' + (('' + latis).replace('-','') + (('' + latis).substring(0,1) == '-' ? 'S' : 'N')).replace(/^90N$/g,' North Pole').replace(/^90S$/g,' South Pole').replace(/^0N$/g,' Equator').replace(/^0S$/g,' Equator').replace(/S$/g,'°S').replace(/N$/g,'°N') + '
';
< } else {
< bcircleoflatitude+=' ' + (('' + latis).replace('-','') + (('' + latis).substring(0,1) == '-' ? 'S' : 'N')).replace(/^90N$/g,' North Pole').replace(/^90S$/g,' South Pole').replace(/^0N$/g,' Equator').replace(/^0S$/g,' Equator').replace(/S$/g,'°S').replace(/N$/g,'°N') + '
';
< }
< }
< }
231,239d160
< if (Math.abs(longis - am) <= 5) {
< if (ameridian == '') {
< if (('' + longis).split('.0')[0].slice(-1) == '0') {
< bmeridian+=' ' + (('' + longis).replace('-','') + (('' + longis).substring(0,1) == '-' ? 'W' : 'E')).replace(/^0E$/g,' Greenwich
Meridian').replace(/^180E/g,' International
Date
Line').replace(/^180W/g,'International
Date
Line').replace('E','°E').replace('W','°W') + '
';
< } else {
< bmeridian+=' ' + (('' + longis).replace('-','') + (('' + longis).substring(0,1) == '-' ? 'W' : 'E')).replace(/^0E$/g,' Greenwich
Meridian').replace(/^180E/g,' International
Date
Line').replace(/^180W/g,'International
Date
Line').replace('E','°E').replace('W','°W') + '
';
< }
< }
< }
255,259c176
< document.getElementById('myimg').onclick=function() { askfor=prompt('Earth Scanner - RJM Programming - February, 2024 ... ' + String.fromCharCode(10) + 'Thanks to https://github.com/nvkelso/natural-earth-raster/blob/master/50m_rasters/HYP_50M_SR_W/HYP_50M_SR_W.README.html ... ' + String.fromCharCode(10) + 'Currently top left of screen is (Longitude,Latitude) ' + '(' + eval(-180 + xp * 360 / 100) + ',' + eval(90 - yp * 180 / 100) + ') and bottom right is (' + eval(-180 + screenlong + xp * 360 / 100) + ',' + eval(90 - screenlat - yp * 180 / 100) + ') and around the middle is (' + eval(-180 + eval(screenlong / 2) + xp * 360 / 100) + ',' + eval(90 - eval(screenlat / 2) - yp * 180 / 100) + ').' + String.fromCharCode(10) + 'Where do you want middle of screen to be in terms of Longitude,Latitude? Suffix with space to show meridians and/or prefix with space to not show meridians.', ''); if (askfor.replace('(','').replace(')','').indexOf(',') != -1) {
< ameridian='';
< acircleoflatitude='';
< enforcedlong=false;
< enforcedxp=-999; } };
---
> document.getElementById('myimg').onclick=function() { askfor=prompt('Earth Scanner - RJM Programming - February, 2024 ... ' + String.fromCharCode(10) + 'Thanks to https://github.com/nvkelso/natural-earth-raster/blob/master/50m_rasters/HYP_50M_SR_W/HYP_50M_SR_W.README.html ... ' + String.fromCharCode(10) + 'Currently top left of screen is (Longitude,Latitude) ' + '(' + eval(-180 + xp * 360 / 100) + ',' + eval(90 - yp * 180 / 100) + ') and bottom right is (' + eval(-180 + screenlong + xp * 360 / 100) + ',' + eval(90 - screenlat - yp * 180 / 100) + ') and around the middle is (' + eval(-180 + eval(screenlong / 2) + xp * 360 / 100) + ',' + eval(90 - eval(screenlat / 2) - yp * 180 / 100) + ').' + String.fromCharCode(10) + 'Where do you want middle of screen to be in terms of Longitude,Latitude? Prefix with space to show meridians and/or suffix with space to not show meridians.', ''); };
264c181
< if (askfor.substring(0,1) == ' ') {
---
> if (askfor.slice(-1) == ' ') {
267,273c184,185
< ameridian='';
< acircleoflatitude='';
< bmeridian='';
< bcircleoflatitude='';
< document.getElementById('dstyle').innerHTML=endkeys;
< if (askfor.trim() == '') { askfor='-180,90'; }
< } else if (askfor.slice(-1) == ' ') {
---
> }
> if (askfor.substring(0,1) == ' ') {
290c202
< if (eval(latforce - screenlat / 2) < -90 && acircleoflatitude == '') {
---
> if (eval(latforce - screenlat / 2) < -90) {
293c205
< if (eval(eval(longforce - screenlong / 2) % screenlong) != 0 && ameridian == '') {
---
> if (eval(eval(longforce - screenlong / 2) % screenlong) != 0) {
317c229
< if (endlinedone) {
---
> if (endofline) {
353c265
< checklls(eval(-180 + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100), eval(90 - yp * 180 / 100), eval(-180 + screenlong + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100), eval(90 - screenlat - yp * 180 / 100));
---
> checklls(eval(-180 + xp * 360 / 100), eval(90 - yp * 180 / 100), eval(-180 + screenlong + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100), eval(90 - screenlat - yp * 180 / 100));
362d273
< endkeys=startkeys;
367c278
< one=eval(-180 + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100);
---
> one=eval(-180 + xp * 360 / 100);
375c286
< prevone=one; //eval(-180 + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100);
---
> prevone=one; //eval(-180 + xp * 360 / 100);
402d312
< //alert('Eenforcedxp=' + enforcedxp);
428c338
< checklls(eval(-180 + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100), eval(90 - yp * 180 / 100), eval(-180 + screenlong + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100), eval(90 - screenlat - yp * 180 / 100), "window.scrollTo(" + eval((enforcedxp > -990 ? enforcedxp : (xp - 0)) * eval('' + document.getElementById('myimg').width) / 100) + "," + eval(yp * eval('' + document.getElementById('myimg').height) / 100) + ")");
---
> checklls(eval(-180 + xp * 360 / 100), eval(90 - yp * 180 / 100), eval(-180 + screenlong + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100), eval(90 - screenlat - yp * 180 / 100), "window.scrollTo(" + eval((enforcedxp > -990 ? enforcedxp : (xp - 0)) * eval('' + document.getElementById('myimg').width) / 100) + "," + eval(yp * eval('' + document.getElementById('myimg').height) / 100) + ")");
437c347
< prevone=eval(-180 + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100);
---
> prevone=eval(-180 + xp * 360 / 100);
450,458c360
< if (document.getElementById('mydl')) {
< document.getElementById('mydl').style.display='none';
< acircleoflatitude='';
< }
< if (document.getElementById('mydm')) {
< document.getElementById('mydm').style.display='none';
< ameridian='';
< }
< rightchecklls(eval(-180 + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100), eval(90 - yp * 180 / 100), eval(-180 + screenlong + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100), eval(90 - screenlat - yp * 180 / 100), "window.scrollTo(" + eval((enforcedxp > -990 ? enforcedxp : (xp - 0)) * eval('' + document.getElementById('myimg').width) / 100) + "," + eval(yp * eval('' + document.getElementById('myimg').height) / 100) + ")");
---
> rightchecklls(eval(-180 + xp * 360 / 100), eval(90 - yp * 180 / 100), eval(-180 + screenlong + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100), eval(90 - screenlat - yp * 180 / 100), "window.scrollTo(" + eval((enforcedxp > -990 ? enforcedxp : (xp - 0)) * eval('' + document.getElementById('myimg').width) / 100) + "," + eval(yp * eval('' + document.getElementById('myimg').height) / 100) + ")");
470c372
< one=eval(-180 + (enforcedxp > -990 ? enforcedxp : xp) * 360 / 100);
---
> one=eval(-180 + xp * 360 / 100);
516,517c418,419
< latis=location.search.split('latitude=')[1] ? decodeURIComponent(location.search.split('latitude=')[1].split('&')[0]) : '';
< longis=location.search.split('longitude=')[1] ? decodeURIComponent(location.search.split('longitude=')[1].split('&')[0]) : '';
---
> var latis=location.search.split('latitude=')[1] ? decodeURIComponent(location.search.split('latitude=')[1].split('&')[0]) : '';
> var longis=location.search.split('longitude=')[1] ? decodeURIComponent(location.search.split('longitude=')[1].split('&')[0]) : '';
524c426
< acircleoflatitude=' ' + (('' + latis).replace('-','') + (('' + latis).substring(0,1) == '-' ? 'S' : 'N')).replace(/^90N$/g,' North Pole').replace(/^90S$/g,' South Pole').replace(/^0N$/g,' Equator').replace(/^0S$/g,' Equator').replace(/S$/g,'°S').replace(/N$/g,'°N') + '
';
---
> acircleoflatitude='
';
526c428
< acircleoflatitude=' ' + (('' + latis).replace('-','') + (('' + latis).substring(0,1) == '-' ? 'S' : 'N')).replace(/^90N$/g,' North Pole').replace(/^90S$/g,' South Pole').replace(/^0N$/g,' Equator').replace(/^0S$/g,' Equator').replace(/S$/g,'°S').replace(/N$/g,'°N') + '
';
---
> acircleoflatitude='
';
534c436
< ameridian=' ' + (('' + longis).replace('-','') + (('' + longis).substring(0,1) == '-' ? 'W' : 'E')).replace(/^0E$/g,' Greenwich
Meridian').replace(/^180E/g,' International
Date
Line').replace(/^180W/g,'International
Date
Line').replace('E','°E').replace('W','°W') + '
';
---
> ameridian='
';
536c438
< ameridian=' ' + (('' + longis).replace('-','') + (('' + longis).substring(0,1) == '-' ? 'W' : 'E')).replace(/^0E$/g,' Greenwich
Meridian').replace(/^180E/g,' International
Date
Line').replace(/^180W/g,'International
Date
Line').replace('E','°E').replace('W','°W') + '
';
---
> ameridian='
';
545c447
<