PageSourceSearch

https://pachamamahome.com/assets/js/gmaps/init.js

js pachamamahome.com collected 2026-10-08 02:40:59 UTC 6,464 bytes, 145 lines download raw bytes

1(function ($) {
2    "use strict";
3
4    var $maphelp = $('.ct-googleMap--accordion .ct-googleMap');
5    $(".ct-googleMap--accordion .ct-js-mapToogle").on('click', function () {
6        var $this = $(this);
7        var $map = $this.parent().find('.ct-googleMap-container');
8        $this.html($this.html() == '<i class="icons8-map-marker"></i> Hide map' ? '<i class="icons8-map-marker"></i> Show map' : '<i class="icons8-map-marker"></i> Hide map');
9
10        if ($map.height() != "0") {
11            $map.animate({height: '0px'}, 500);
12        } else {
13            $map.animate({height: $maphelp.data("height") + "px"}, 500);
14            setTimeout(function () {
15                $('html, body').animate({
16                    scrollTop: $map.offset().top - 180
17                }, 2000);
18            }, 500);
19        }
20    });
21    /* ============================================= */
22    /* ==== GOOGLE MAP ==== */
23
24    function initmap() {
25
26        if (($(".ct-googleMap").length > 0) && (typeof google === 'object' && typeof google.maps === 'object')) {
27            $('.ct-googleMap').each(function () {
28                var atcenter = "",
29                    $this = $(this),
30                    location = $this.data("location"),
31                    zoom = $this.data("zoom"),
32                    $drag = true,
33                    $marker = $this.data("marker"),
34                    $img = $this.attr('data-mapImage');
35
36                if(device.mobile() || device.tablet() || ($devicewidth < 768)){
37                    $drag = false;
38                }
39                else {
40                    $drag = true;
41                }
42                var offset = -30;
43
44                if (validatedata($this.data("offset"))) {
45                    offset = $this.data("offset");
46                }
47                if (validatedata(location)) {
48                    $this.gmap3({
49                        marker: {
50                            //latLng: [40.616439, -74.035540],
51                            address: location, options: {
52                                visible: $marker
53                            }, callback: function (marker) {
54                                atcenter = marker.getPosition();
55                            }
56                        }, map: {
57                            options: {
58                                //maxZoom:11,
59                                zoom: zoom,
60                                mapTypeId: google.maps.MapTypeId.ROADMAP, // ('ROADMAP', 'SATELLITE', 'HYBRID','TERRAIN');
61                                scrollwheel: false,
62                                disableDoubleClickZoom: false,
63                                draggable: $drag, //disableDefaultUI: true,
64                                mapTypeControlOptions: {
65                                    //mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID],
66                                    //style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
67                                    //position: google.maps.ControlPosition.RIGHT_CENTER
68                                    mapTypeIds: []
69                                }
70                            }, events: {
71                                idle: function () {
72                                    if (!$this.data('idle')) {
73                                        $this.gmap3('get').panBy(0, offset);
74                                        $this.data('idle', true);
75                                    }
76                                }
77                            }
78                        }, overlay: {
79                            address: location, options: {
80                                content:
81                                "<div class='ct-mapBox'>" +
82                                "<div class='ct-mapBox-header'>" +
83                                "<span class='ct-mapBox-image'>" +
84                                "<img src='"+$img+"'>" +
85                                "</span>" +
86                                "<span class='ct-mapBox-title'>Our location" +
87                                "</span>" +
88                                 "</div>" +
89                                "<address>" +
90                                "<strong>" +
91                                "<i class='fa fa-map-marker'>" + "</i>" +
92                                "<span>NY, Manhattan" +
93                                "</span>" +
94                                "</strong>" +
95                                "<strong>" +
96                                "<i class='fa fa-envelope'>" + "</i>" +
97                                "<span>[email protected]" +
98                                "</span>" +
99                                "</strong>" +
100                                "<strong>" +
101                                "<i class='fa fa-phone'>" + "</i>" +
102                                "<span>(+30) 1234 24 55 08" +
103                                "</span>" +
104                                "</strong>" +
105                                "<strong>" +
106                                "<i class='fa fa-clock-o'>" + "</i>" +
107                                "<span>11:00 ap - 7:00 pm" +
108                                "</span>" +
109                                "</strong>" +
110                                "</address>" +
111                                 "<span class='ct-mapBox-triangle'>" + "</span>" +
112                                "</div>"
113                                ,offset: {
114                                    y: -200, x: -150
115                                }
116                            }
117                        }
118                        //},"autofit"
119                    });
120
121                    // center on resize
122                    google.maps.event.addDomListener(window, "resize", function () {
123                        //var userLocation = new google.maps.LatLng(53.8018,-1.553);
124                        setTimeout(function () {
125                            $this.gmap3('get').setCenter(atcenter);
126                            $this.gmap3('get').panBy(0, offset);
127                        }, 400);
128
129                    });
130
131                    // set height
132                    $this.css("min-height", $this.data("height") + "px");
133                }
134
135                if ($this.parent().parent().hasClass('hidemap')) {
136                    $this.parent().animate({height: '0px'}, 500);
137                }
138
139            })
140        }
141
142    }
143
144    initmap();
145})(jQuery);

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.