PageSourceSearch

https://pet911.ru/js/geocoderNominatim.js?v=1780488715

js pet911.ru collected 2026-09-29 15:27:57 UTC 2,318 bytes, 72 lines download raw bytes

1Nominatin = {
2    reverseGeocode: function (lat,lng,options) {
3        options = options || {};
4        // var link = 'https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat='+lat+'&lon='+lng;
5        var link = 'https://nominatim.openstreetmap.org/reverse';
6        return $.ajax({
7            url: link,
8            type: 'GET',
9            dataType: 'json',
10            timeout: options.timeout || 0,
11            data: {
12                format: "jsonv2",
13                addressdetails: 1,
14                countrycodes: nominatimCountryCode,
15                'accept-language': nominatimLang,
16                lat: lat,
17                lon: lng
18            }
19        });
20    },
21
22    getFormattedAddress: function (data) {
23        let ret = [];
24        if (data.address) {
25            if (data.address.road){
26                ret.push(data.address.road);
27            }
28            if (data.address.house_number){
29                ret.push(data.address.house_number);
30            }
31
32            if (data.address.village) {
33                ret.push(data.address.village);
34            }else if (data.address.town) {
35                ret.push(data.address.town);
36            } else if (data.address.city){
37                ret.push(data.address.city);
38            } else if (data.address.municipality) {
39                ret.push(data.address.municipality);
40            } else if (data.address.hamlet) {
41                ret.push(data.address.hamlet);
42            }
43
44            if (ret.length < 2 && data.address.state) {
45                if (ret.length === 0 || data.address.state != ret[0]) {
46                    ret.push(data.address.state);
47                }
48            }
49        }
50        let res = ret.join(', ');
51        if (res.length < 1) {
52            res = data.display_name;
53        }
54        return res;
55    },
56
57    getCity: function (data) {
58        let ret = '';
59        if (data.address) {
60            if (data.address.village) {
61                ret = (data.address.village);
62            }else if (data.address.town) {
63                ret = (data.address.town);
64            } else if (data.address.city){
65                ret = (data.address.city);
66            } else if (data.address.municipality) {
67                ret = (data.address.municipality);
68            }
69        }
70        return ret;
71    }
72};

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.