PageSourceSearch

https://estdelasomme.fr/wp-content/plugins/wwp-vc-gmaps/include/core/js/wwp-gmaps-init.js?ver=6.8.3

js estdelasomme.fr collected 2026-10-02 13:17:10 UTC 32,056 bytes, 689 lines download raw bytes

1var location_name = '';
2
3jQuery(document).ready(function()
4{
5    var all_markers = [];
6
7    var Base64 = {
8
9        _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
10
11        encode : function (input)
12        {
13            var output = "";
14            var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
15            var i = 0;
16
17            input = Base64._utf8_encode(input);
18
19            while (i < input.length)
20            {
21                chr1 = input.charCodeAt(i++);
22                chr2 = input.charCodeAt(i++);
23                chr3 = input.charCodeAt(i++);
24                enc1 = chr1 >> 2;
25                enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
26                enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
27                enc4 = chr3 & 63;
28
29                if (isNaN(chr2))
30                {
31                    enc3 = enc4 = 64;
32
33                }
34                else if (isNaN(chr3))
35                {
36                    enc4 = 64;
37                }
38
39                output = output +
40                    this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
41                    this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
42            }
43            return output;
44        },
45
46        decode : function (input)
47        {
48            var output = "";
49            var chr1, chr2, chr3;
50            var enc1, enc2, enc3, enc4;
51            var i = 0;
52
53            input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
54
55            while (i < input.length)
56            {
57                enc1 = this._keyStr.indexOf(input.charAt(i++));
58                enc2 = this._keyStr.indexOf(input.charAt(i++));
59                enc3 = this._keyStr.indexOf(input.charAt(i++));
60                enc4 = this._keyStr.indexOf(input.charAt(i++));
61                chr1 = (enc1 << 2) | (enc2 >> 4);
62                chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
63                chr3 = ((enc3 & 3) << 6) | enc4;
64                output = output + String.fromCharCode(chr1);
65
66                if (enc3 != 64)
67                {
68                    output = output + String.fromCharCode(chr2);
69                }
70
71                if (enc4 != 64)
72                {
73                    output = output + String.fromCharCode(chr3);
74                }
75            }
76            output = Base64._utf8_decode(output);
77            return output;
78        },
79
80        _utf8_encode : function (string)
81        {
82
83            string = string.replace(/\r\n/g,"\n");
84
85            var utftext = "";
86
87            for (var n = 0; n < string.length; n++)
88            {
89                var c = string.charCodeAt(n);
90
91                if (c < 128)
92                {
93                    utftext += String.fromCharCode(c);
94                }
95
96                else if((c > 127) && (c < 2048))
97                {
98                    utftext += String.fromCharCode((c >> 6) | 192);
99                    utftext += String.fromCharCode((c & 63) | 128);
100                }
101                else
102                {
103                    utftext += String.fromCharCode((c >> 12) | 224);
104                    utftext += String.fromCharCode(((c >> 6) & 63) | 128);
105                    utftext += String.fromCharCode((c & 63) | 128);
106                }
107            }
108
109            return utftext;
110        },
111
112        _utf8_decode : function (utftext)
113        {
114            var string = "";
115            var i = 0;
116            var c = c1 = c2 = 0;
117
118            while ( i < utftext.length )
119            {
120                c = utftext.charCodeAt(i);
121
122                if (c < 128)
123                {
124                    string += String.fromCharCode(c);
125                    i++;
126                }
127
128                else if((c > 191) && (c < 224))
129                {
130                    c2 = utftext.charCodeAt(i+1);
131                    string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
132                    i += 2;
133                }
134
135                else
136                {
137                    c2 = utftext.charCodeAt(i+1);
138                    c3 = utftext.charCodeAt(i+2);
139                    string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
140                    i += 3;
141                }
142            }
143
144            return string;
145        }
146
147    };
148
149    function getBool(val)
150    {
151        var num = +val;
152        return !isNaN(num) ? !!num : !!String(val).toLowerCase().replace(!!0,'');
153    }
154
155    function addInfoWindow(map, marker, message)
156    {
157        var infoWindow = new google.maps.InfoWindow(
158        {
159            content: message
160        });
161
162        google.maps.event.addListener(marker, "click", function ()
163        {
164            infoWindow.open(map, marker);
165        });
166    }
167
168    function showLocationName(latlng, location_name_id, callback)
169    {
170        var geocoder = new google.maps.Geocoder,
171            location_name = '';
172
173        geocoder.geocode({'location': latlng}, function(results, status)
174        {
175            if(status === 'OK')
176            {
177                if (results[1])
178                {
179                    location_name = results[1].formatted_address;
180                }
181            }
182            else
183            {
184                if(status === "OVER_QUERY_LIMIT")
185                {
186                    setTimeout(function()
187                    {
188                        showLocationName(latlng, location_name_id, callback);
189                    }, 100);
190                }
191            }
192
193            callback(location_name, location_name_id);
194        });
195    }
196
197    function setMarkers(map, places, markers_cluster, all_markers, mapID, showLocationsBelowMap, showLocationImage, showLocationAddress, locationStyling)
198    {
199        var bounds = new google.maps.LatLngBounds();
200
201        for (var i = 0; i < places.length; i++)
202        {
203            var place = places[i],
204                image = "",
205                location_name_id = '';
206
207            if(place['pin_path'])
208            {
209                image = {
210                    url: place['pin_path'],
211                    size: new google.maps.Size(place['pin_width'], place['pin_height']),
212                    origin: new google.maps.Point(0,0),
213                    anchor: new google.maps.Point(place['pin_width']/2, place['pin_height'])
214                };
215            }
216
217            var myLatLng = new google.maps.LatLng(place['lat'], place['lng']),
218                marker = new google.maps.Marker(
219                {
220                    position: myLatLng,
221                    icon: image,
222                    map: map,
223                    zIndex: 1
224                });
225
226            if(showLocationsBelowMap === "yes")
227            {
228                var latlng = {lat: parseFloat(place['lat']), lng: parseFloat(place['lng'])};
229                location_name_id = mapID+'-'+i;
230
231
232
233                var show_location_image = '',
234                    show_location_address = '';
235
236                if(showLocationImage === "yes")
237                {
238                    show_location_image = '<div class="marker-location-image"><img src="'+place['pin_path']+'"></div>';
239                }
240
241                if(showLocationAddress === "yes")
242                {
243                    show_location_address = '<div class="marker-location-name"><span class="add-location-name-'+location_name_id+'"></span></div>';
244                }
245
246                var add_location_styling_class = '';
247
248                if(locationStyling == 'rounded_border')
249                {
250                    add_location_styling_class = 'marker-location-rounded';
251                }
252
253                if(locationStyling == 'square_border')
254                {
255                    add_location_styling_class = 'marker-location-square';
256                }
257
258
259                jQuery('#wwp-gmaps-locations-'+mapID).append('<div class="marker-location-wrapper '+add_location_styling_class+'"><a class="marker-location-link" data-mapid="'+mapID+'" data-markerid="' + i + '" href="#">'+show_location_image+show_location_address+'</a></div>');
260
261                if(place['marker_friendly_name'] === '')
262                {
263                    showLocationName(latlng, location_name_id, function (result, location_name_id)
264                    {
265                        if(result)
266                        {
267                            jQuery('.add-location-name-' + location_name_id).html(result);
268                        }
269                    });
270                }
271                else
272                {
273                    jQuery('.add-location-name-' + location_name_id).html(place['marker_friendly_name']);
274                }
275                
276                all_markers[mapID].push(marker);
277            }
278
279            markers_cluster.push(marker);
280
281            if(place['animation'] == "DROP")
282            {
283                marker.setAnimation(google.maps.Animation.DROP);
284            }
285            else
286            {
287                marker.setAnimation(google.maps.Animation.BOUNCE);
288
289            }
290
291            bounds.extend(marker.position);
292
293            if(decodeURIComponent(place['description']) !== "")
294            {
295                addInfoWindow(map, marker, Base64.decode(place['description']));
296            }
297        }
298
299        map.fitBounds(bounds);
300    }
301
302    function addLockBtn(map)
303    {
304        var draggable_icon_class = "";
305
306        if (map.get("draggable") == false)
307        {
308            draggable_icon_class = "fa fa-lock";
309        }
310        else
311        {
312            draggable_icon_class = "fa fa-unlock";
313        }
314
315        var lock_btn = jQuery('<div class="lock-button-gmaps"><i class="fa '+draggable_icon_class+'"></i></div>');
316
317        lock_btn.bind("click", function()
318        {
319            if (map.get("draggable"))
320            {
321                map.set("draggable", false);
322                jQuery(".lock-button-gmaps i").removeClass("fa-unlock");
323                jQuery(".lock-button-gmaps i").addClass("fa-lock");
324            }
325            else
326            {
327                map.set("draggable", true);
328                jQuery(".lock-button-gmaps i").removeClass("fa-lock");
329                jQuery(".lock-button-gmaps i").addClass("fa-unlock");
330            }
331        });
332
333        return lock_btn[0];
334    }
335
336    jQuery('.wwp-vc-gmaps-map').each(function()
337    {
338        var instance = jQuery(this).data('instance');
339        setGMAPS(instance);
340    });
341
342
343    function setGMAPS(instance)
344    {
345        var settingObj = window[instance];
346
347        var markers_cluster = [];
348
349        all_markers[settingObj.mapID] = [];
350
351        var custom_map_styles =
352        {
353            apple_maps: [{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"color":"#f7f1df"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#d0e3b4"}]},{"featureType":"landscape.natural.terrain","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"poi.business","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"poi.medical","elementType":"geometry","stylers":[{"color":"#fbd3da"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#bde6ab"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffe15f"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#efd151"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.local","elementType":"geometry.fill","stylers":[{"color":"black"}]},{"featureType":"transit.station.airport","elementType":"geometry.fill","stylers":[{"color":"#cfb2db"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#a2daf2"}]}],
354            light_gray: [{"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16}]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2}]}],
355            dark: [{"featureType":"all","elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#000000"},{"lightness":40}]},{"featureType":"all","elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#000000"},{"lightness":16}]},{"featureType":"all","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":17},{"weight":1.2}]},{"featureType":"landscape","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"landscape","elementType":"labels.icon","stylers":[{"saturation":"-100"},{"lightness":"-54"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"on"},{"lightness":"0"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":21}]},{"featureType":"poi","elementType":"labels.icon","stylers":[{"saturation":"-89"},{"lightness":"-55"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":16}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":19}]},{"featureType":"transit.station","elementType":"labels.icon","stylers":[{"visibility":"on"},{"saturation":"-100"},{"lightness":"-51"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":17}]}],
356            neutral_blue: [{"featureType":"water","elementType":"geometry","stylers":[{"color":"#193341"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#2c5a71"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#29768a"},{"lightness":-37}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#3e606f"},{"weight":2},{"gamma":0.84}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"weight":0.6},{"color":"#1a3541"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#2c5a71"}]}],
357            orange_ocean: [{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2f2f2"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#edc200"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#000000"}]},{"featureType":"road.highway","elementType":"labels.text.stroke","stylers":[{"color":"#ffffff"},{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#f5a301"},{"visibility":"on"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#000000"}]},{"featureType":"water","elementType":"labels.text.stroke","stylers":[{"visibility":"off"}]}],
358            magenta: [{"featureType":"all","elementType":"geometry.stroke","stylers":[{"visibility":"simplified"}]},{"featureType":"administrative","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"labels","stylers":[{"visibility":"simplified"},{"color":"#a31645"}
358]},{"featureType":"landscape","elementType":"all","stylers":[{"weight":"3.79"},{"visibility":"on"},{"color":"#ffecf0"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"visibility":"on"}]},{"featureType":"landscape","elementType":"geometry.stroke","stylers":[{"visibility":"on"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"simplified"},{"color":"#a31645"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"saturation":"0"},{"lightness":"0"},{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"poi.business","elementType":"all","stylers":[{"visibility":"simplified"},{"color":"#d89ca8"}]},{"featureType":"poi.business","elementType":"geometry","stylers":[{"visibility":"on"}]},{"featureType":"poi.business","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"saturation":"0"}]},{"featureType":"poi.business","elementType":"labels","stylers":[{"color":"#a31645"}]},{"featureType":"poi.business","elementType":"labels.icon","stylers":[{"visibility":"simplified"},{"lightness":"84"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#d89ca8"},{"visibility":"on"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#fedce3"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"off"}]}],
359            flat_map: [{"featureType":"all","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape","elementType":"all","stylers":[{"visibility":"on"},{"color":"#f3f4f4"}]},{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"weight":0.9},{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#83cead"}]},{"featureType":"road","elementType":"all","stylers":[{"visibility":"on"},{"color":"#ffffff"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"on"},{"color":"#fee379"}]},{"featureType":"road.arterial","elementType":"all","stylers":[{"visibility":"on"},{"color":"#fee379"}]},{"featureType":"water","elementType":"all","stylers":[{"visibility":"on"},{"color":"#7fc8ed"}]}],
360            winter: [{"stylers":[{"hue":"#007fff"},{"saturation":89}]},{"featureType":"water","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative.country","elementType":"labels","stylers":[{"visibility":"off"}]}],
361        };
362
363        var streetview_control_position = google.maps.ControlPosition.RIGHT_BOTTOM;
364        var zoom_control_position = google.maps.ControlPosition.RIGHT_BOTTOM;
365        var map_type_control_position = google.maps.ControlPosition.LEFT_TOP;
366
367        // Streetview Control
368        if(settingObj.streetview_control_position === 'TOP_LEFT')
369        {
370            streetview_control_position = google.maps.ControlPosition.TOP_LEFT;
371        }
372
373        if(settingObj.streetview_control_position === 'TOP_CENTER')
374        {
375            streetview_control_position = google.maps.ControlPosition.TOP_CENTER;
376        }
377
378        if(settingObj.streetview_control_position === 'TOP_RIGHT')
379        {
380            streetview_control_position = google.maps.ControlPosition.TOP_CENTER;
381        }
382
383        if(settingObj.streetview_control_position === 'BOTTOM_LEFT')
384        {
385            streetview_control_position = google.maps.ControlPosition.BOTTOM_LEFT;
386        }
387
388        if(settingObj.streetview_control_position === 'BOTTOM_RIGHT')
389        {
390            streetview_control_position = google.maps.ControlPosition.BOTTOM_RIGHT;
391        }
392
393        if(settingObj.streetview_control_position === 'LEFT_TOP')
394        {
395            streetview_control_position = google.maps.ControlPosition.LEFT_TOP;
396        }
397
398        if(settingObj.streetview_control_position === 'LEFT_CENTER')
399        {
400            streetview_control_position = google.maps.ControlPosition.LEFT_CENTER;
401        }
402
403        if(settingObj.streetview_control_position === 'LEFT_BOTTOM')
404        {
405            streetview_control_position = google.maps.ControlPosition.LEFT_BOTTOM;
406        }
407
408        if(settingObj.streetview_control_position === 'RIGHT_TOP')
409        {
410            streetview_control_position = google.maps.ControlPosition.RIGHT_TOP;
411        }
412
413        if(settingObj.streetview_control_position === 'RIGHT_CENTER')
414        {
415            streetview_control_position = google.maps.ControlPosition.RIGHT_CENTER;
416        }
417
418        if(settingObj.streetview_control_position === 'RIGHT_BOTTOM')
419        {
420            streetview_control_position = google.maps.ControlPosition.RIGHT_BOTTOM;
421        }
422
423        // Zoom Control
424        if(settingObj.zoom_control_position === 'TOP_LEFT')
425        {
426            zoom_control_position = google.maps.ControlPosition.TOP_LEFT;
427        }
428
429        if(settingObj.zoom_control_position === 'TOP_CENTER')
430        {
431            zoom_control_position = google.maps.ControlPosition.TOP_CENTER;
432        }
433
434        if(settingObj.zoom_control_position === 'TOP_RIGHT')
435        {
436            zoom_control_position = google.maps.ControlPosition.TOP_CENTER;
437        }
438
439        if(settingObj.zoom_control_position === 'BOTTOM_LEFT')
440        {
441            zoom_control_position = google.maps.ControlPosition.BOTTOM_LEFT;
442        }
443
444        if(settingObj.zoom_control_position === 'BOTTOM_RIGHT')
445        {
446            zoom_control_position = google.maps.ControlPosition.BOTTOM_RIGHT;
447        }
448
449        if(settingObj.zoom_control_position === 'LEFT_TOP')
450        {
451            zoom_control_position = google.maps.ControlPosition.LEFT_TOP;
452        }
453
454        if(settingObj.zoom_control_position === 'LEFT_CENTER')
455        {
456            zoom_control_position = google.maps.ControlPosition.LEFT_CENTER;
457        }
458
459        if(settingObj.zoom_control_position === 'LEFT_BOTTOM')
460        {
461            zoom_control_position = google.maps.ControlPosition.LEFT_BOTTOM;
462        }
463
464        if(settingObj.zoom_control_position === 'RIGHT_TOP')
465        {
466            zoom_control_position = google.maps.ControlPosition.RIGHT_TOP;
467        }
468
469        if(settingObj.zoom_control_position === 'RIGHT_CENTER')
470        {
471            zoom_control_position = google.maps.ControlPosition.RIGHT_CENTER;
472        }
473
474        if(settingObj.zoom_control_position === 'RIGHT_BOTTOM')
475        {
476            zoom_control_position = google.maps.ControlPosition.RIGHT_BOTTOM;
477        }
478
479        // Map Type
480        if(settingObj.map_type_control_position === 'TOP_LEFT')
481        {
482            map_type_control_position = google.maps.ControlPosition.TOP_LEFT;
483        }
484
485        if(settingObj.map_type_control_position === 'TOP_CENTER')
486        {
487            map_type_control_position = google.maps.ControlPosition.TOP_CENTER;
488        }
489
490        if(settingObj.map_type_control_position === 'TOP_RIGHT')
491        {
492            map_type_control_position = google.maps.ControlPosition.TOP_CENTER;
493        }
494
495        if(settingObj.map_type_control_position === 'BOTTOM_LEFT')
496        {
497            map_type_control_position = google.maps.ControlPosition.BOTTOM_LEFT;
498        }
499
500        if(settingObj.map_type_control_position === 'BOTTOM_RIGHT')
501        {
502            map_type_control_position = google.maps.ControlPosition.BOTTOM_RIGHT;
503        }
504
505        if(settingObj.map_type_control_position === 'LEFT_TOP')
506        {
507            map_type_control_position = google.maps.ControlPosition.LEFT_TOP;
508        }
509
510        if(settingObj.map_type_control_position === 'LEFT_CENTER')
511        {
512            map_type_control_position = google.maps.ControlPosition.LEFT_CENTER;
513        }
514
515        if(settingObj.map_type_control_position === 'LEFT_BOTTOM')
516        {
517            map_type_control_position = google.maps.ControlPosition.LEFT_BOTTOM;
518        }
519
520        if(settingObj.map_type_control_position === 'RIGHT_TOP')
521        {
522            map_type_control_position = google.maps.ControlPosition.RIGHT_TOP;
523        }
524
525        if(settingObj.map_type_control_position === 'RIGHT_CENTER')
526        {
527            map_type_control_position = google.maps.ControlPosition.RIGHT_CENTER;
528        }
529
530        if(settingObj.map_type_control_position === 'RIGHT_BOTTOM')
531        {
532            map_type_control_position = google.maps.ControlPosition.RIGHT_BOTTOM;
533        }
534
535        var map_types = (settingObj.map_name_show).split(",");
536        var mapOptions =
537        {
538            scrollwheel: false,
539            draggable: getBool(settingObj.draggable),
540            fullscreenControl: getBool(settingObj.fullscreenControl),
541            streetViewControl: getBool(settingObj.streetViewControl),
542            streetViewControlOptions:
543            {
544                position: streetview_control_position
545            },
546            zoomControl: getBool(settingObj.zoomControl),
547            zoomControlOptions:
548            {
549                position: zoom_control_position
550            },
551            mapTypeControl: getBool(settingObj.mapTypeControl),
552            mapTypeControlOptions:
553            {
554                mapTypeIds: map_types,
555                position: map_type_control_position
556            }
557        };
558
559        var map = new google.maps.Map(document.getElementById(settingObj.mapID), mapOptions);
560
561        map.setMapTypeId(google.maps.MapTypeId.HYBRID);
562
563        if(settingObj.custom_map_style === 'custom')
564        {
565            var customStyledMap = new google.maps.StyledMapType(JSON.parse(Base64.decode(settingObj.styles)), { name: settingObj.map_name });
566            map.mapTypes.set('map_style', customStyledMap);
567            map.setMapTypeId('map_style');
568
569        }
570        else
571        {
572            var predefinedStyledMap = new google.maps.StyledMapType(custom_map_styles[settingObj.custom_map_style], { name: settingObj.map_name });
573            map.mapTypes.set("map_style", predefinedStyledMap);
574            map.setMapTypeId("map_style");
575        }
576
577        var places = jQuery.parseJSON(settingObj.add_places);
578
579        setMarkers(map, places, markers_cluster, all_markers, settingObj.mapID, settingObj.show_locations_below_map, settingObj.show_location_marker, settingObj.show_location_address, settingObj.show_location_styling);
580
581        if(settingObj.enable_marker_clustering === "yes")
582        {
583            var mcOptions =
584            {
585                imagePath: settingObj.marker_clustering_images_path
586            };
587
588            var mc = new MarkerClusterer(map, markers_cluster, mcOptions);
589        }
590
591        if(settingObj.draggingControl === "true")
592        {
593            if(settingObj.dragging_control_position === 'TOP_LEFT')
594            {
595                map.controls[google.maps.ControlPosition.TOP_LEFT].push(addLockBtn(map));
596            }
597
598            if(settingObj.dragging_control_position === 'TOP_CENTER')
599            {
600                map.controls[google.maps.ControlPosition.TOP_CENTER].push(addLockBtn(map));
601            }
602
603            if(settingObj.dragging_control_position === 'TOP_RIGHT')
604            {
605                map.controls[google.maps.ControlPosition.TOP_RIGHT].push(addLockBtn(map));
606            }
607
608            if(settingObj.dragging_control_position === 'BOTTOM_LEFT')
609            {
610                map.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(addLockBtn(map));
611            }
612
613            if(settingObj.dragging_control_position === 'BOTTOM_RIGHT')
614            {
615                map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(addLockBtn(map));
616            }
617
618            if(settingObj.dragging_control_position === 'LEFT_TOP')
619            {
620                map.controls[google.maps.ControlPosition.LEFT_TOP].push(addLockBtn(map));
621            }
622
623            if(settingObj.dragging_control_position === 'LEFT_CENTER')
624            {
625                map.controls[google.maps.ControlPosition.LEFT_CENTER].push(addLockBtn(map));
626            }
627
628            if(settingObj.dragging_control_position === 'LEFT_BOTTOM')
629            {
630                map.controls[google.maps.ControlPosition.LEFT_BOTTOM].push(addLockBtn(map));
631            }
632
633            if(settingObj.dragging_control_position === 'RIGHT_TOP')
634            {
635                map.controls[google.maps.ControlPosition.RIGHT_TOP].push(addLockBtn(map));
636            }
637
638            if(settingObj.dragging_control_position === 'RIGHT_CENTER')
639            {
640                map.controls[google.maps.ControlPosition.RIGHT_CENTER].push(addLockBtn(map));
641            }
642
643            if(settingObj.dragging_control_position === 'RIGHT_BOTTOM')
644            {
645                map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(addLockBtn(map));
646            }
647        }
648
649        if(settingObj.transitLayer === "true")
650        {
651            var transitLayer = new google.maps.TransitLayer();
652            transitLayer.setMap(map);
653        }
654
655        if(settingObj.trafficLayer === "true")
656        {
657            var trafficlayer = new google.maps.TrafficLayer();
658            trafficlayer.setMap(map);
659        }
660
661        if(settingObj.bicyclingLayer === "true")
662        {
663            var bicyclinglayer = new google.maps.BicyclingLayer();
664            bicyclinglayer.setMap(map);
665        }
666
667        if(settingObj.disable_auto_zoom === "false")
668        {
669            var listener = google.maps.event.addListener(map, "idle", function()
670            {
671                if (map.getZoom() > parseInt(settingObj.zoom))
672                {
673                    map.setZoom(parseInt(settingObj.zoom));
674                }
675
676                google.maps.event.removeListener(listener);
677            });
678        }
679
680        jQuery(document).on("click", ".marker-location-link", function(e)
681        {
682            e.preventDefault();
683
684            google.maps.event.trigger(all_markers[jQuery(this).data('mapid')][jQuery(this).data('markerid')], 'click');
685        });
686    }
687
688
689});

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.