[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: ct-gm-widget.js
(function ($) { /** * @param $scope The Widget wrapper element as a jQuery element * @param $ The jQuery alias */ var WidgetCustomGMHandler = function ($scope, $) { $scope.find(".map-render").each(function () { /* map type */ var map_type; switch ($(this).attr('data-type')) { case 'HYBRID': map_type = google.maps.MapTypeId.HYBRID; break; case 'SATELLITE': map_type = google.maps.MapTypeId.SATELLITE; break; case 'TERRAIN': map_type = google.maps.MapTypeId.TERRAIN; break; default: map_type = google.maps.MapTypeId.ROADMAP; break; } /* get controls */ var controls = $.parseJSON(decodeURIComponent($(this) .attr('data-controls'))); /* get style */ style = $.parseJSON(decodeURIComponent(($(this) .attr('data-template')))); var mapOptions = { zoom: parseInt($(this).attr('data-zoom')), center: new google.maps.LatLng(51.505858, -0.123633), mapTypeId: map_type, scrollwheel: controls.scrollwheel, panControl: controls.pancontrol, zoomControl: controls.zoomcontrol, scaleControl: controls.scalecontrol, mapTypeControl: controls.maptypecontrol, streetViewControl: controls.streetviewcontrol, overviewMapControl: controls.overviewmapcontrol, styles: style }; var map = new google.maps.Map($(this).get(0), mapOptions); /* map center */ if ($(this).attr('data-coordinate').length > 0) { var coordinate = $(this).attr('data-coordinate') .split(','); if (coordinate.length == 2) { map.setCenter(new google.maps.LatLng( coordinate[0], coordinate[1])); } } else { if ($(this).attr('data-address').length > 0) { $.getJSON('https://maps.google.com/maps/api/geocode/json?address=' + $(this).attr('data-address') + '', function (data) { console.log(data); var lat = data.results[0].geometry.location.lat; var lng = data.results[0].geometry.location.lng; map.setCenter(new google.maps.LatLng(lat, lng)); }); } } /* marker */ var locations = $.parseJSON(decodeURIComponent($(this).attr('data-marker'))); if (locations.markerlist != undefined) { locations.markerlist = $.parseJSON(decodeURIComponent((locations.markerlist))); if (Array.isArray(locations.markerlist)) { for (var i = 0; i < locations.markerlist.length; i++) { var item = {}; if(locations.markerlist[i].title != '' || locations.markerlist[i].desc != ''){ item.markerdesc = '<div class="info-content"><h5>'; if(locations.markerlist[i].title != ''){ item.markerdesc += locations.markerlist[i].title; } item.markerdesc += '</h5><span>'; if(locations.markerlist[i].desc != ''){ item.markerdesc += locations.markerlist[i].desc; } item.markerdesc += '</span></div>'; } item.markercoordinate = locations.markerlist[i].coordinate; if(locations.markerlist[i].icon != undefined){ item.markericon = locations.markerlist[i].icon; } markerRender(map, item); } } } if (locations.markercoordinate != undefined) { markerRender(map, locations); } /* */ function markerRender(map, locations) { "use strict"; var location = locations.markercoordinate .split(','); if (location.length == 2) { var myLatLng = new google.maps.LatLng( location[0], location[1]); var mk = { position: myLatLng, map: map, optimized: false } if (locations.markericon != undefined) { mk.icon = { url: locations.markericon }; } google.maps.event.addListenerOnce(map, 'idle', function () { setTimeout(function () { $('img[usemap="#gmimap0"]').wrap("<div class='marker-icon'></div>"); }, 200); }); var marker = new google.maps.Marker(mk); if (locations.markerdesc != undefined) { var infowindow = new google.maps.InfoWindow( { content: locations.markerdesc, maxWidth: controls.infowidth, }); if (controls.infoclick) { google.maps.event.addListener(marker, 'click', function () { infowindow .open(map, marker); }); } else { infowindow.open(map, marker); } } } } }); }; // Make sure you run this code under Elementor. $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/ct_google_map.default', WidgetCustomGMHandler); }); })(jQuery);
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.81 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002