PageSourceSearch

https://essays.discount/wp-content/themes/listingpro/assets/js/lp-gps.js

js essays.discount collected 2026-10-06 13:17:28 UTC 2,146 bytes, 83 lines download raw bytes

1/* lp gps  */
2
3var geocoderr;
4
5function lpGetGpsLocName(lpcalback){
6	if (navigator.geolocation) {
7		navigator.geolocation.getCurrentPosition(function(position){
8			var clat = position.coords.latitude;
9			var clong = position.coords.longitude;
10			jpCodeLatLng(clat,clong, function(citynamevalue){
11			  lpcalback(citynamevalue);
12			});
13		});
14		
15	} else { 
16		alert("Geolocation is not supported by this browser.");
17	}
18		
19}
20
21function lpgeocodeinitialize() {
22    geocoderr = new google.maps.Geocoder();
23}
24
25function jpCodeLatLng(lat, lng, lpcitycallback) {
26	
27	var geocoder;
28    geocoder = new google.maps.Geocoder();
29    var latlng = new google.maps.LatLng(lat, lng);
30	
31	geocoder.geocode(
32        {'latLng': latlng}, 
33        function(results, status) {
34            if (status == google.maps.GeocoderStatus.OK) {
35                if (results[0]) {
36                    var add= results[0].formatted_address ;
37                    var  value=add.split(",");
38
39                    count=value.length;
40                    country=value[count-1];
41                    state=value[count-2];
42                    city=value[count-3];
43					lpcitycallback(city);
44                }
45                else  {
46                    console.log("address not found");
47                }
48            }
49            else {
50                console.log("Geocoder failed due to: " + status);
51            }
52        }
53    );
54	
55	/* latlng 	 = new google.maps.LatLng(lat, lng),
56		geocoderrr = new google.maps.Geocoder();
57		geocoderrr.geocode({'latLng': latlng}, function(results, status) {
58			if (status == google.maps.GeocoderStatus.OK) {
59				console.log(results);
60				if (results[1]) {
61					for (var i = 0; i < results.length; i++) {
62						if (results[i].types[0] === "locality") {
63							var city = results[i].address_components[0].short_name;
64							var state = results[i].address_components[2].short_name;
65							lpcitycallback(city);
66						}
67					}
68				}
69				else {console.log("No reverse geocode results.")}
70			}
71			else {console.log("Geocoder failed: " + status)}
72		}); */
73    
74}
75  
76  
77  /* test call */
78  
79  jQuery(document).ready(function(){
80	lpgeocodeinitialize();
81  });
82  
83 

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.