PageSourceSearch

https://www.zotterusa.com/wp-content/cache/min/1/wp-content/plugin…/assets/js/zotter-sf-map.js?ver=1789814018

js zotterusa.com collected 2026-10-07 08:02:35 UTC 5,071 bytes, 16 lines download raw bytes

1(function(){'use strict';window.zotterSfMap={map:null,markers:[],clusterer:null,infoWindow:null,stores:[],selectedId:null,onSelect:null,container:null,bottomSheet:null,init(container,bottomSheet,onSelect){this.container=container;this.bottomSheet=bottomSheet;this.onSelect=onSelect;if(!window.google||!google.maps||!container){return}
2this.map=new google.maps.Map(container,{center:{lat:39.8283,lng:-98.5795},zoom:4,mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!0,});this.infoWindow=new google.maps.InfoWindow()},centerOn(lat,lng,zoom){if(!this.map){return}
3this.map.panTo({lat,lng});if(typeof zoom==='number'){this.map.setZoom(zoom)}},setStores(stores,selectedId,searchCenter){this.stores=stores||[];this.selectedId=selectedId||null;this.clearMarkers();this.createMarkers();if(this.stores.length){this.fitBoundsToStores(searchCenter)}else if(searchCenter&&typeof searchCenter.lat==='number'&&typeof searchCenter.lng==='number'){this.centerOn(searchCenter.lat,searchCenter.lng,10)}
4if(this.selectedId){this.focusStore(this.selectedId,!0,{preserveBounds:!0})}},clearMarkers(){this.markers.forEach((marker)=>marker.setMap(null));this.markers=[];if(this.clusterer&&typeof this.clusterer.clearMarkers==='function'){this.clusterer.clearMarkers();this.clusterer=null}},createMarkers(){const icon={url:window.zotterSfConfig?.markerUrl||'',scaledSize:new google.maps.Size(32,42),anchor:new google.maps.Point(16,42),};const useClusterer=!!(window.markerClusterer&&typeof window.markerClusterer.MarkerClusterer==='function');this.markers=this.stores.map((store)=>{const marker=new google.maps.Marker({position:{lat:store.lat,lng:store.lng},map:useClusterer?null:this.map,title:store.name,icon:icon.url?icon:undefined,});marker.storeId=store.id;marker.addListener('click',()=>{if(typeof this.onSelect==='function'){this.onSelect(store.id,!1)}
5this.openInfoWindow(store,marker);this.renderBottomSheet(store)});return marker});if(useClusterer){this.clusterer=new window.markerClusterer.MarkerClusterer({map:this.map,markers:this.markers,})}else if(window.MarkerClusterer){this.clusterer=new window.MarkerClusterer(this.map,this.markers,{imagePath:'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m',})}},fitBoundsToStores(searchCenter){if(!this.map||!this.stores.length){return}
6const bounds=new google.maps.LatLngBounds();this.stores.forEach((store)=>{if(typeof store.lat==='number'&&typeof store.lng==='number'){bounds.extend({lat:store.lat,lng:store.lng})}});if(searchCenter&&typeof searchCenter.lat==='number'&&typeof searchCenter.lng==='number'){bounds.extend({lat:searchCenter.lat,lng:searchCenter.lng})}
7if(this.stores.length===1&&!searchCenter){const store=this.stores[0];this.map.setCenter({lat:store.lat,lng:store.lng});this.map.setZoom(12);return}
8const padding={top:64,right:64,bottom:64,left:64};this.map.fitBounds(bounds,padding);google.maps.event.addListenerOnce(this.map,'bounds_changed',()=>{const zoom=this.map.getZoom();if(typeof zoom!=='number'){return}
9if(zoom>15){this.map.setZoom(15)}else if(this.stores.length===1&&zoom<10){this.map.setZoom(10)}})},focusStore(storeId,openWindow,options){const store=this.stores.find((item)=>item.id===storeId);const marker=this.markers.find((item)=>item.storeId===storeId);const preserveBounds=options&&options.preserveBounds;if(!store||!marker||!this.map){return}
10this.selectedId=storeId;if(!preserveBounds){this.map.panTo({lat:store.lat,lng:store.lng});if(this.map.getZoom()<12){this.map.setZoom(12)}}
11if(openWindow){this.openInfoWindow(store,marker)}
12this.renderBottomSheet(store)},openInfoWindow(store,marker){if(!this.infoWindow){return}
13const content=document.createElement('div');content.className='zotter-sf-info-window';const title=document.createElement('h3');title.textContent=store.name||'';content.appendChild(title);const address=document.createElement('p');address.textContent=store.address||'';content.appendChild(address);const actions=document.createElement('div');actions.className='zotter-sf-info-actions';const directions=document.createElement('a');directions.className='zotter-sf-btn zotter-sf-btn-secondary';directions.href=window.zotterSfList.getDirectionsUrl(store);directions.target='_blank';directions.rel='noopener';directions.textContent=window.zotterSfConfig?.i18n?.getDirections||'Get Directions';actions.appendChild(directions);if(store.phone){const call=document.createElement('a');call.className='zotter-sf-btn zotter-sf-btn-primary';call.href=`tel:${store.phone.replace(/\s+/g, '')}`;call.textContent=window.zotterSfConfig?.i18n?.call||'Call';actions.appendChild(call)}
13
14content.appendChild(actions);this.infoWindow.setContent(content);this.infoWindow.open(this.map,marker)},renderBottomSheet(store){if(!this.bottomSheet||window.innerWidth>=768){return}
15this.bottomSheet.hidden=!1;while(this.bottomSheet.firstChild){this.bottomSheet.removeChild(this.bottomSheet.firstChild)}
16const card=window.zotterSfList.createCard(store,store.id);this.bottomSheet.appendChild(card)},hideBottomSheet(){if(this.bottomSheet){this.bottomSheet.hidden=!0}},}})()

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.