2024-10-08 09:52:04 -05:00
|
|
|
(()=>{"use strict";var e={652:(e,t,n)=>{var s=n(440),r=n(430),a=n(211),i=n(413),o=n(999),l=n(302);document.addEventListener("DOMContentLoaded",(()=>{m()}));const c=["Land Features","Bay","Channel","Cove","Dam","Delta","Gulf","Lagoon","Lake","Ocean","Reef","Reservoir","Sea","Sound","Strait","Waterfall","Wharf","Amusement Park","Historical Monument","Landmark","Tourist Attraction","Zoo","College","Beach","Campground","Golf Course","Harbor","Nature Reserve","Other Parks and Outdoors","Park","Racetrack","Scenic Overlook","Ski Resort","Sports Center","Sports Field","Wildlife Reserve","Airport","Ferry","Marina","Pier","Port","Resort","Postal","Populated Place"].join(","),u="#txtAddress",d="#ToggleFullScreen",h="#btnGetGps",m=()=>{document.querySelector(u).addEventListener("focus",(e=>{e.target.select()})),(0,a.Fx)(b),document.querySelector("#NavigateMenu").addEventListener("click",S),document.querySelector("#NavigateRefresh").addEventListener("click",C),document.querySelector("#NavigateNext").addEventListener("click",T),document.querySelector("#NavigatePrevious").addEventListener("click",x),document.querySelector("#NavigatePlay").addEventListener("click",I),document.querySelector(d).addEventListener("click",y);const e=document.querySelector(h);e.addEventListener("click",O),navigator.geolocation||(e.style.display="none"),document.querySelector("#divTwc").addEventListener("mousemove",(()=>{document.fullscreenElement&&D()})),window.addEventListener("resize",E),E.wasFull=!1,document.querySelector(u).addEventListener("keydown",(e=>{"Enter"===e.code&&t()})),document.querySelector("#btnGetLatLng").addEventListener("click",(()=>t())),document.addEventListener("keydown",M),document.addEventListener("touchmove",(e=>{document.fullscreenElement&&e.preventDefault()})),$(u).devbridgeAutocomplete({serviceUrl:"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest",deferRequestBy:300,paramName:"text",params:{f:"json",countryCode:"USA",category:c,maxSuggestions:10},dataType:"json",transformResult:e=>({suggestions:e.suggestions.map((e=>({value:e.text,data:e.magicKey})))}),minChars:3,showNoSuggestionNotice:!0,noSuggestionNotice:"No results found. Please try a different search string.",onSelect(e){f(e,this)},width:490});const t=()=>{const e=$(u).devbridgeAutocomplete();return e.suggestions[0]&&$(e.suggestionsContainer.children[0]).trigger("click"),!1},n=(0,o.J)(),s=n.latLonQuery&&n.latLon,r=n.latLonQuery??localStorage.getItem("latLonQuery"),i=n.latLon??localStorage.getItem("latLon"),m=localStorage.getItem("latLonFromGPS")&&!s;if(r&&i&&!m){document.querySelector(u).value=r,b(JSON.parse(i))}m&&O(),l.A.kiosk.value="true"===n["settings-kiosk-checkbox"];const g=n["settings-kiosk-checkbox"]??localStorage.getItem("play");null!==g&&"true"!==g||N("navButton","play"),document.querySelector("#btnClearQuery").addEventListener("click",(()=>{document.querySelector("#spanCity").innerHTML="",document.querySelector("#spanState").innerHTML="",document.querySelector("#spanStationId").innerHTML="",document.querySelector("#spanRadarId").innerHTML="",document.querySelector("#spanZoneId").innerHTML="",document.querySelector("#chkAutoRefresh").checked=!0,localStorage.removeItem("autoRefresh"),localStorage.removeItem("play"),N("navButton","play"),localStorage.removeItem("latLonQuery"),localStorage.removeItem("latLon"),localStorage.removeItem("latLonFromGPS"),document.querySelector(h).classList.remove("active")})),document.querySelector("#container").addEventListener("swiped-left",(()=>k("left"))),document.querySelector("#container").addEventListener("swiped-right",(()=>k("right")))},f=async(e,t)=>{if(t.previousSuggestionValue===e.value)return;const n=(await(0,s.Pq)("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find",{data:{text:e.value,magicKey:e.data,f:"json"}})).locations[0];n?(localStorage.removeItem("latLonFromGPS"),document.querySelector(h).classList.remove("active"),g(n.feature.geometry)):console.error("An unexpected error occurred. Please try a different search string.")},g=(e,t)=>{const n={lat:(0,i.X4)(e.y,4),lon:(0,i.
|