PageSourceSearch

https://www.linthwerk.ch/media/com_phocamaps/js/administrator/coordinates.js

js linthwerk.ch collected 2026-10-02 12:38:19 UTC 2,053 bytes, 83 lines download raw bytes

1
2function setPMGPSLongitude(inputValue) {
3	longitudeValue = convertPMGPS(inputValue, 'longitude');
4	window.top.document.forms.adminForm.elements.gpslongitude.value = longitudeValue;
5}
6function setPMGPSLatitude(inputValue) {
7	latitudeValue = convertPMGPS(inputValue, 'latitude');
8	window.top.document.forms.adminForm.elements.gpslatitude.value = latitudeValue;
9}
10
11function setPMGPSLongitudeJForm(inputValue) {
12	longitudeValue = convertPMGPS(inputValue, 'longitude');
13	if (window.parent) window.parent.phocaSelectMap_jform_gpslongitude(longitudeValue);
14}
15
16function setPMGPSLatitudeJForm(inputValue) {
17	latitudeValue = convertPMGPS(inputValue, 'latitude');
18	if (window.parent) window.parent.phocaSelectMap_jform_gpslatitude(latitudeValue);
19}
20
21function convertPMGPS(inputValue, type) {
22	var status		= 1;
23	var cAbs		= 0;
24	var vAbs		= 1000000000;
25	var degree		= 0;
26	var minute		= 0;
27	var second		= 0;
28	var gpsValue	= '';
29	var degrees		= 180;
30	var potc		= '';
31	var ms			= 60;
32	
33	if (type == 'longitude') {
34		degrees	= 180;
35	}
36	
37	if (type == 'latitude') {
38		degrees	= 90;
39	}
40
41	if(isNaN(inputValue)) {
42		return '';
43	}
44	
45	if(inputValue < 0) {
46		status = -1;
47	}
48	
49	cAbs = Math.abs(Math.round(vAbs * inputValue));
50
51	if(cAbs > (vAbs * degrees)) {
52		return '';
53	}
54
55	degree = status * Math.floor(cAbs/vAbs);
56	minute = Math.floor(ms * ((cAbs/vAbs) - Math.floor(cAbs/vAbs)));
57	second = ms * Math.floor(vAbs * ((ms * ((cAbs/vAbs) - Math.floor(cAbs/vAbs))) - Math.floor(ms * ((cAbs/vAbs) - Math.floor(cAbs/vAbs)))) ) / vAbs;
58	
59	second = Math.round(second * 1000)/1000;
60	
61	if (degree < 0) {
62		if (type == 'longitude') {
63			potc = 'W';
64		}
65		if (type == 'latitude') {
66			potc = 'S';
67		}
68	} 
69	if (degree > 0) {
70		if (type == 'longitude') {
71			potc = 'E';
72		}
73		if (type == 'latitude') {
74			potc = 'N';
75		}
76	}
77	gpsValue = Math.abs(degree) + '\u00b0' + '\u0020' + minute + '\u0027' + '\u0020' + second + '\u0022' + potc;
78
79	//status = 1;
80
81	return gpsValue;
82}
83/* utf-8 test ěščřžýáíé */

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.