PageSourceSearch

https://dehgardi.ir/js/CustomMap.js

js dehgardi.ir collected 2026-10-02 23:51:26 UTC 5,094 bytes, 151 lines download raw bytes

1var map = L.map('map', {
2    'center': [0, 0],
3    'zoom': 0,
4    'animate': true,
5    
6    'pan': {
7        'duration': 10
8    },
9    'zoomControl': false,
10    zoomAnimation: true,
11    fadeAnimation: true,
12}).setView([32.4206525, 53.68237500000001], 6); /*32.30737392999161, 54.32661124021261*/
13
14mapLink =
15    '<a href="http://openstreetmap.org">OpenStreetMap</a>';
16L.tileLayer(
17    'https://tile.openstreetmap.de/{z}/{x}/{y}.png'  
18    , {
19        attribution: 'Dehgardi.ir',
20        maxZoom: 18,
21    }).addTo(map);
22
23//Search box menu
24$(".search-input-box").autocomplete({
25    source: function (request, response) {
26        var TypeSearch = $('input[name=searchtype]:checked').val();
27        $(".clear-icon-box").hide();
28        $(".search-icon-box").css("visibility", "hidden");
29        $(".lds-ring").show();
30        $(".remove-slide").click();
31
32        $.ajax({
33            url: "/Home/SearchTextBoxMap",
34            type: "GET",
35            data:
36            {
37                term: request.term,
38                TypeSearch: TypeSearch
39            },
40            success: function (data) {
41
42                var item = '';
43
44                if (data.length == 0) {
45                    item += '<div class="result-item">' +
46                        '<span class="result-item-text" style="text-align: center !important; width: 100% !important; margin: 0 !important;">موردی یافت نشد</span>' +
47                        '</div>';
48                }
49
50                for (var i = 0; i < data.length; i++) {
51                    item += '<div class="result-item" onClick="SelectSearchItem(' +
52                        data[i].placeId + ', \'' + data[i].name + '\')">' +
53                        '<span class="result-item-text">' + data[i].locationName + ' - ' + data[i].name +'</span>' +
54                                '<img src="/images/place_grey.png" alt="place-icon" class="result-item-img" />' +
55                            '</div>';
56                }
57
58                $(".search-box").css("border-radius", "8px 8px 0 0");
59                $(".lds-ring").hide();
60                $(".search-icon-box").css("visibility", "visible");
61                $(".search-information-box").hide();
62                $(".search-result-partial").html(item);
63                $(".search-result-box").show();
64            }
65        });
66    },
67    minLength: 2
68});
69
70$(".search-input-box").keyup(function () {
71    if ($(this).val() == '') {
72        $(".search-box").css("border-radius", "8px");
73        $(".search-result-box").hide();
74        $(".search-information-box").hide();
75        $(".clear-icon-box").hide();
76        $(".search-icon-box").show();
77        $(".remove-slide").click();
78    }
79})
80var hid = 0;
81$(".searchImg").click(function () {
82    if (hid == 0) {
83        $(".search").hide(1000);
84        hid++;
85    } else {
86        $(".search").show(1000);
87        hid = 0;
88    }
89})
90function SelectSearchItem(Id, name) {
91    //loader and disabled input Id,int TypeSearch
92    var TypeSearch = $('input[name=searchtype]:checked').val();
93    $(".search-icon-box").hide();
94    $(".lds-ring").show();
95    $(".search-input-box").attr("disabled", true);
96    $(".search-box").css("background-color", "#ededed");
97    $.ajax({
98        url: "/Home/SearchInformationBoxMap",
99        data: { Id: Id, TypeSearch: TypeSearch },
100        type: "GET",
101        success: function (data) {
102            $(".search-info-load").html(data);
103            $(".lds-ring").hide();
104            $(".search-input-box").val(name);
105            $(".search-result-box").hide();
106            $(".search-information-box").show();
107            $(".search-icon-box").hide();
108            $(".clear-icon-box").show();
109            $(".search-input-box").attr("disabled", false);
110            $(".search-box").css("background-color", "#fff");
111
112        }, error: function () {
113
114            $(".lds-ring").show();
115            $(".search-icon-box").show();
116            $(".search-input-box").attr("disabled", false);
117            $(".search-box").css("background-color", "#fff");
118        }
119    })
120}
121
122function GetPlacePictures(placeId) {
123    DisplayShow(placeId);
124}
125
126$(".clear-icon-box").click(function () {
127    $(".clear-icon-box").hide();
128    $(".search-input-box").val('');
129    $(".search-icon-box").show();
130    $(".search-information-box").hide();
131    $(".search-box").css("border-radius", "8px");
132    $(".search-input-box").attr("disabled", false);
133    $(".search-box").css("background-color", "#fff");
134    $(".remove-slide").click();
135    if (existMarker != undefined) {
136        map.removeLayer(existMarker);
137    }
138})
139
140//$(".search-input-box").on('focus', function () {
141//    $(".search-type-box").show("slide", { direction: "right" }, 500);
142//})
143
144//// search type box show and hide
145//$("#map").click(function (event) {
146//    if ($(event.target).hasClass('search-type-box')) {
147//        return;
148//    } else {
149//        $(".search-type-box").hide("slide", { direction: "right" }, 500);
150//    }
151//});

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.