1(function($) { 2 var EBGoogleMapHandler = function($scope, $) { 3 var mapid = $scope.find('.eb-map'), 4 maptype = $(mapid).data("eb-map-type"), 5 zoom = $(mapid).data("eb-map-zoom"), 6 map_lat = $(mapid).data("eb-map-lat"), 7 map_lng = $(mapid).data("eb-map-lng"), 8 //scrollwheel = $(mapid).data("eb-map-scrollwheel"), 9 gesture_handling = $(mapid).data("eb-map-gesture-handling"), 10 defaultui = $(mapid).data("eb-map-defaultui"), 11 zoomcontrol = $(mapid).data("eb-map-zoom-control"), 12 zoomcontrolposition = $(mapid).data("eb-map-zoom-control-position"), 13 maptypecontrol = $(mapid).data("eb-map-type-control"), 14 maptypecontrolstyle = $(mapid).data("eb-map-type-control-style"), 15 maptypecontrolposition = $(mapid).data("eb-map-type-control-position"), 16 streetview = $(mapid).data("eb-map-streetview-control"), 17 streetviewposition = $(mapid).data("eb-map-streetview-position"), 18 styles = ($(mapid).data("eb-map-style") != '') ? $(mapid).data("eb-map-style") : '', 19 infowindow_max_width = $(mapid).data("eb-map-infowindow-width"), 20 active_info, 21 infowindow, 22 map; 23 24 if (maptypecontrolstyle == 'DROPDOWN_MENU') { 25 maptypecontrolstyle = google.maps.MapTypeControlStyle.DROPDOWN_MENU; 26 } else if (maptypecontrolstyle == 'HORIZONTAL_BAR') { 27 maptypecontrolstyle = google.maps.MapTypeControlStyle.HORIZONTAL_BAR; 28 } else { 29 maptypecontrolstyle = google.maps.MapTypeControlStyle.DEFAULT; 30 } 31 32 if (maptypecontrolposition == 'TOP_CENTER') { 33 maptypecontrolposition = google.maps.ControlPosition.TOP_CENTER; 34 } else if (maptypecontrolposition == 'TOP_RIGHT') { 35 maptypecontrolposition = google.maps.ControlPosition.TOP_RIGHT; 36 } else if (maptypecontrolposition == 'LEFT_CENTER') { 37 maptypecontrolposition = google.maps.ControlPosition.LEFT_CENTER; 38 } else if (maptypecontrolposition == 'RIGHT_CENTER') { 39 maptypecontrolposition = google.maps.ControlPosition.RIGHT_CENTER; 40 } else if (maptypecontrolposition == 'BOTTOM_CENTER') { 41 maptypecontrolposition = google.maps.ControlPosition.BOTTOM_CENTER; 42 } else if (maptypecontrolposition == 'BOTTOM_RIGHT') { 43 maptypecontrolposition = google.maps.ControlPosition.BOTTOM_RIGHT; 44 } else if (maptypecontrolposition == 'BOTTOM_LEFT') { 45 maptypecontrolposition = google.maps.ControlPosition.BOTTOM_LEFT; 46 } else { 47 maptypecontrolposition = google.maps.ControlPosition.TOP_LEFT; 48 } 49 50 if (zoomcontrolposition == 'TOP_CENTER') { 51 zoomcontrolposition = google.maps.ControlPosition.TOP_CENTER; 52 } else if (zoomcontrolposition == 'TOP_RIGHT') { 53 zoomcontrolposition = google.maps.ControlPosition.TOP_RIGHT; 54 } else if (zoomcontrolposition == 'LEFT_CENTER') { 55 zoomcontrolposition = google.maps.ControlPosition.LEFT_CENTER; 56 } else if (zoomcontrolposition == 'RIGHT_CENTER') { 57 zoomcontrolposition = google.maps.ControlPosition.RIGHT_CENTER; 58 } else if (zoomcontrolposition == 'BOTTOM_CENTER') { 59 zoomcontrolposition = google.maps.ControlPosition.BOTTOM_CENTER; 60 } else if (zoomcontrolposition == 'BOTTOM_RIGHT') { 61 zoomcontrolposition = google.maps.ControlPosition.BOTTOM_RIGHT; 62 } else if (zoomcontrolposition == 'BOTTOM_LEFT') { 63 zoomcontrolposition = google.maps.ControlPosition.BOTTOM_LEFT; 64 } else if (zoomcontrolposition == 'TOP_LEFT') { 65 zoomcontrolposition = google.maps.ControlPosition.TOP_LEFT; 66 } else { 67 zoomcontrolposition = google.maps.ControlPosition.RIGHT_BOTTOM; 68 } 69 70 if (streetviewposition == 'TOP_CENTER') { 71 streetviewposition = google.maps.ControlPosition.TOP_CENTER; 72 } else if (streetviewposition == 'TOP_RIGHT') { 73 streetviewposition = google.maps.ControlPosition.TOP_RIGHT; 74 } else if (streetviewposition == 'LEFT_CENTER') { 75 streetviewposition = google.maps.ControlPosition.LEFT_CENTER; 76 } else if (streetviewposition == 'RIGHT_CENTER') { 77 streetviewposition = google.maps.ControlPosition.RIGHT_CENTER; 78 } else if (streetviewposition == 'BOTTOM_CENTER') { 79 streetviewposition = google.maps.ControlPosition.BOTTOM_CENTER; 80 } else if (streetviewposition == 'BOTTOM_RIGHT') { 81 streetviewposition = google.maps.ControlPosition.BOTTOM_RIGHT; 82 } else if (streetviewposition == 'BOTTOM_LEFT') { 83 streetviewposition = google.maps.ControlPosition.BOTTOM_LEFT; 84 } else if (streetviewposition == 'TOP_LEFT') { 85 streetviewposition = google.maps.ControlPosition.TOP_LEFT; 86 } else { 87 streetviewposition = google.maps.ControlPosition.RIGHT_BOTTOM; 88 } 89 90 function initMap() { 91 var myLatLng = { lat: parseFloat(map_lat), lng: parseFloat(map_lng) }; 92 93 var map = new google.maps.Map(mapid[0], { 94 center: myLatLng, 95 zoom: zoom, 96 disableDefaultUI: defaultui, 97 zoomControl: zoomcontrol, 98 zoomControlOptions: { 99 position: zoomcontrolposition 100 }, 101 mapTypeId: maptype, 102 mapTypeControl: maptypecontrol, 103 mapTypeControlOptions: { 104 style: maptypecontrolstyle, 105 position: maptypecontrolposition 106 }, 107 streetViewControl: streetview, 108 streetViewControlOptions: { 109 position: streetviewposition 110 }, 111 styles: styles, 112 gestureHandling: gesture_handling, 113 }); 114 115 var markersLocations = $(mapid).data('eb-locations'); 116 117 $.each(markersLocations, function(index, Element, content) { 118 var content = '<div class="eb-map-container"><h6>' + Element.title + '</h6><div class="eb-map-content">' + Element.content + '</div></div>'; 119 var icon = ''; 120 if (Element.pin_icon !== '') { 121 if (Element.pin_icon == 'red') { 122 icon = EB_WP_URL.plugin_url + 'assets/images/marker_red.png'; 123 } else if (Element.pin_icon == 'yellow') { 124 icon = EB_WP_URL.plugin_url + 'assets/images/marker_yellow.png'; 125 } else if (Element.pin_icon == 'blue') { 126 icon = EB_WP_URL.plugin_url + 'assets/images/marker_blue.png'; 127 } else if (Element.pin_icon == 'black') { 128 icon = EB_WP_URL.plugin_url + 'assets/images/marker_black.png'; 129 } else if (Element.pin_icon == 'white') { 130 icon = EB_WP_URL.plugin_url + 'assets/images/marker_white.png'; 131 } else if (Element.pin_icon == 'purple') { 132 icon = EB_WP_URL.plugin_url + 'assets/images/marker_purple.png'; 133 } else if (Element.pin_icon == 'green') { 134 icon = EB_WP_URL.plugin_url + 'assets/images/marker_green.png'; 135 } else if (Element.pin_icon == 'orange') { 136 icon = EB_WP_URL.plugin_url + 'assets/images/marker_orange.png'; 137 } else if (Element.pin_icon == 'grey') { 138 icon = EB_WP_URL.plugin_url + 'assets/images/marker_grey.png'; 139 } else { 140 icon = ''; 141 } 142 } 143 144 marker = new google.maps.Marker({ 145 map: map, 146 position: new google.maps.LatLng(parseFloat(Element.lat), parseFloat(Element.lng)), 147 icon: icon, 148 }); 149 150 if (Element.title !== '') { 151 addInfoWindow(marker, content) 152 } else if (Element.content !== '') { 153 addInfoWindow(marker, content) 154 } 155 156 }); 157 } 158 159 function addInfoWindow(marker, content) { 160 google.maps.event.addListener(marker, 'click', function() { 161 if (!infowindow) { 162 infowindow = new google.maps.InfoWindow({ 163 maxWidth: infowindow_max_width 164 }); 165 } 166 infowindow.setContent(content); 167 infowindow.open(map, marker); 168 }); 169 } 170 171 initMap(); 172 173 }; 174 175 // Make sure you run this code under Elementor.. 176 $(window).on('elementor/frontend/init', function() { 177 elementorFrontend.hooks.addAction('frontend/element_ready/eb-google-map-extended.default', EBGoogleMapHandler); 178 }); 179 180})(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.