text: !function(){"use strict";document.addEventListener("DOMContentLoaded",(function(){var t=[24.9983469,121.5810358],e=L.map("map",{attributionControl:!0,zoomControl:!0});L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(e);var o=L.icon({iconUrl:"https://letswritetw.github.io/letswrite-leaflet-osm-locate/dist/dot.svg",iconSize:[16,16]}),n=L.marker(t,{icon:o,title:"跟 <a> 的 title 一樣",opacity:1}).addTo(e);function a(t){var e=document.querySelectorAll(".js-panto");Array.prototype.forEach.call(e,(function(e){e.addEventListener("click",(function(e){e.preventDefault();var o=e.target.dataset.to.split(","),n=e.target.textContent,a=document.getElementById("flyTo").checked;L.popup().setLatLng(o).setContent("".concat(n)).openOn(t),a?t.flyTo(o):t.panTo(o)}))}))}function c(t){var e=document.querySelectorAll(".js-panby");Array.prototype.forEach.call(e,(function(e){e.addEventListener("click",(function(e){e.preventDefault();var o=50*e.target.dataset.times,n=[o,o];t.panBy(n)}))}))}e.locate({setView:!0,watch:!0,maxZoom:18,enableHighAccuracy:!0}),e.on("locationerror",(function(o){console.log("e",o),window.alert("無法判斷您的所在位置，無法使用此功能。預設地點將為 台北市動物園"),e.setView(t,18),a(e),c(e)})),e.on("locationfound",(function(t){console.log("e",t),n.setLatLng(t.latlng),a(e),c(e)}))}))}();