PageSourceSearch

https://www.mecha.com.my/cdn/shop/t/18/assets/map-section.js?v=84119091522764176751762491231

js mecha.com.my collected 2026-10-10 02:37:12 UTC 4,915 bytes, 2 lines download raw bytes

1window.theme=window.theme||{},theme.Maps=(function(){var config={zoom:14},apiStatus=null,mapsToLoad=[],errors={addressNoResults:theme.strings.addressNoResults,addressQueryLimit:theme.strings.addressQueryLimit,addressError:theme.strings.addressError,authError:theme.strings.authError},selectors={section:'[data-section-type="map"]',map:"[data-map]",mapOverlay:"[data-map-overlay]"},classes={mapError:"map-section--load-error",errorMsg:"map-section__error errors text-center"};window.gm_authFailure=function(){Shopify.designMode&&(document.querySelector(selectors.section).classList.add(classes.mapError),document.querySelector(selectors.map).remove(),document.querySelector(selectors.mapOverlay).insertAdjacentHTML("afterend",'<div class="'+classes.errorMsg+'">'+theme.strings.authError+"</div>"))};function Map(container){this.map=container.querySelector(selectors.map),this.map&&(this.key=this.map.dataset.apiKey,typeof this.key!="undefined"&&(apiStatus==="loaded"?this.createMap():(mapsToLoad.push(this),apiStatus!=="loading"&&(apiStatus="loading",typeof window.google=="undefined"&&theme.Helpers.getScript("https://maps.googleapis.com/maps/api/js?key="+this.key).then(function(){apiStatus="loaded",initAllMaps()})))))}function initAllMaps(){mapsToLoad.forEach(function(map){map.createMap()})}function geolocate(map){return new Promise(function(resolve,reject){var geocoder=new google.maps.Geocoder,address=map.dataset.addressSetting;geocoder.geocode({address:address},function(results,status2){status2!==google.maps.GeocoderStatus.OK&&reject(status2),resolve(results)})})}return Map.prototype=Object.assign({},Map.prototype,{createMap:function(){return geolocate(this.map).then(function(results){var stylesArr;document.querySelector(selectors.section)&&(config.map_style=document.querySelector(selectors.section).getAttribute("data-map_style")),config.map_style=="dark"?stylesArr=[{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:"geometry",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#000000"},{lightness:21}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:17}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:29},{weight:.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:"water",elementType:"geometry",stylers:[{color:"#000000"},{lightness:17}]}]:stylesArr=[{featureType:"all",elementType:"labels.text",stylers:[{color:"#878787"}]},{featureType:"all",elementType:"labels.text.stroke",stylers:[{visibility:"off"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f9f5ed"}]},{featureType:"road.highway",elementType:"all",stylers:[{color:"#f5f5f5"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"all",stylers:[{color:"#aee0f4"}]}];var mapOptions={zoom:config.zoom,center:results[0].geometry.location,draggable:!1,clickableIcons:!1,scrollwheel:!1,disableDoubleClickZoom:!0,disableDefaultUI:!0,styles:stylesArr},map=this.map=new google.maps.Map(this.map,mapOptions),center=this.center=map.getCenter(),marker=new google.maps.Marker({map:map,position:map.getCenter()});google.maps.event.addDomListener(window,"resize",theme.Helpers.debounce(function(){google.maps.event.trigger(map,"resize"),map.setCenter(center)}.bind(this),250))}.bind(this)).catch(function(){var errorMessage;switch(status){case"ZERO_RESULTS":errorMessage=errors.addressNoResults;break;case"OVER_QUERY_LIMIT":errorMessage=errors.addressQueryLimit;break;case"REQUEST_DENIED":errorMessage=errors.authError;break;default:errorMessage=errors.addressError;break}Shopify.designMode&&(this.map.parentNode.classList.add(classes.mapError),this.map.parentNode.innerHTML='<div class="'+classes.errorMsg+'">'+errorMessage+"</div>")}.bind(this))},onUnload:function(){this.map&&google.maps.event.clearListeners(this.map,"resize")}}),Map})(),document.addEventListener("DOMContentLoaded",function(){var sections=new theme.Sections;sections.register("map",theme.Maps)});
2//# sourceMappingURL=/cdn/shop/t/18/assets/map-section.js.map?v=84119091522764176751762491231

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.