bnbweb/themes/vr/web/js/jquery.tinyMap-3.4.9.min.js

62 lines
29 KiB
JavaScript
Raw Permalink Normal View History

2022-11-14 15:49:28 +00:00
/*
MIT License
*/
window.gMapsCallback=function(){$(window).trigger("gMapsCallback")};
(function(g,t,q,I){function z(a){var b;if(a instanceof Array)for(b=0;b<a.length;b+=1)z(a[b]);else if("object"===typeof a)for(b in a)if("string"!==typeof a[b])z(a[b]);else if(/^google\.map/gi.test(a[b])){var d=a[b].split(".");4===d.length&&(a[b]=google.maps[d[2]][d[3]])}}function r(a,b,d){var c={lat:"",lng:""},e=/^[+-]?\d+(\.\d+)?$/;if("string"===typeof a||Array.isArray(a)){var f=Array.isArray(a)?a:a.toString().replace(/\s+/,"").split(",");if(2===f.length)e.test(f[0])&&e.test(f[1])&&(c.lat=f[0],c.lng=
f[1]);else return a}else if("object"===typeof a){if("function"===typeof a.lat)return a;a.hasOwnProperty("x")&&a.hasOwnProperty("y")?(c.lat=a.x,c.lng=a.y):a.hasOwnProperty("lat")&&a.hasOwnProperty("lng")&&(c.lat=a.lat,c.lng=a.lng)}"undefined"===typeof d&&(c.lat=parseFloat(c.lat,10)+(Math.random()-.5)/5E3,c.lng=parseFloat(c.lng,10)+(Math.random()-.5)/5E3);return!0===b?new google.maps.LatLng(c.lat,c.lng):c}function x(a){var b=a.hasOwnProperty("css")?a.css.toString():"";this.setValues(a);this.span=g("<span/>").css({position:"relative",
left:"-50%",top:"0","white-space":"nowrap"}).addClass(b);this.div=g("<div/>").css({position:"absolute",display:"none"});this.span.appendTo(this.div)}function A(a,b){var d=this,c=g.extend({},H,b);d.idleOnceCount=!1;d.map=null;d._markers=[];d._markersCluster=[];d._clusters={};d._bounds={};d._labels=[];d._polylines=[];d._polygons=[];d._circles=[];d._kmls=[];d._directions=[];d._directionsMarkers=[];d._places=[];d.container=a;d.options=c;d.googleMapOptions={};d.interval=parseInt(d.options.interval,10)||
200;g(t).on("gMapsCallback",function(){d.init()});g(this.container).html(c.loading);return d.init()}var D=!1,E=!1,F=!1,G=!1,y={language:"zh-TW",callback:"gMapsCallback",api:"https://maps.googleapis.com/maps/api/js",clusterer:"https://cdn.essoduke.org/js/tinyMap/markerclusterer.js",withLabel:"https://cdn.essoduke.org/js/tinyMap/markerwithlabel.js",OMS:"https://cdn.essoduke.org/js/tinyMap/oms.min.js"},H={autoLocation:!1,center:[24,121],infoWindowAutoClose:!0,interval:200,loading:"\u8b80\u53d6\u4e2d&hellip;",
notFound:"\u627e\u4e0d\u5230\u67e5\u8a62\u7684\u5730\u9ede",zoom:8},B={},B={greyscale:[{featureType:"all",stylers:[{saturation:-100},{gamma:.5}]}]};A.prototype={VERSION:"3.4.6",formatSize:function(a){return Array.isArray(a)&&2===a.length?new google.maps.Size(a[0],a[1]):a},formatPoint:function(a){return Array.isArray(a)&&2===a.length?new google.maps.Point(a[0],a[1]):a},overlay:function(a){a=this.map;var b=this.options;try{this.idleOnceCount||(this.kml(a,b),this.directionService(a,b),this.placeMarkers(a,
b),this.drawPolyline(a,b),this.drawPolygon(a,b),this.drawCircle(a,b),this.streetView(a,b),this.places(a,b),this.geoLocation(a,b),this.idleOnceCount=!0)}catch(d){console.error(d)}finally{google.maps.event.trigger(a,"resize")}},bindEvents:function(a,b){var d=this,c={};switch(typeof b){case "function":google.maps.event.clearListeners(a,"click");google.maps.event.addListener(a,"click",b);break;case "object":for(c in b)"function"===typeof b[c]?"created"===c?b[c].call(a):(google.maps.event.clearListeners(a,
c),google.maps.event.addListener(a,c,b[c])):b[c].hasOwnProperty("func")&&"function"===typeof b[c].func?b[c].hasOwnProperty("once")&&!0===b[c].once?google.maps.event.addListenerOnce(a,c,b[c].func):(google.maps.event.clearListeners(a,c),google.maps.event.addListener(a,c,b[c].func)):"function"===typeof b[c]&&(google.maps.event.clearListeners(a,c),google.maps.event.addListener(a,c,b[c]))}a.hasOwnProperty("defaultInfoWindow")&&(google.maps.event.clearListeners(a,"click"),google.maps.event.addListener(a,
"click",function(){var b;if(d.options.hasOwnProperty("infoWindowAutoClose")&&!0===d.options.infoWindowAutoClose)for(b=0;b<d._markers.length;b+=1){var c=d._markers[b];c.hasOwnProperty("infoWindow")&&"function"===typeof c.infoWindow.close&&c.infoWindow.close()}a.infoWindow.open(d.map,a)}))},kml:function(a,b){var d={url:"",map:a,preserveViewport:!1,suppressInfoWindows:!1},c={},e;if(b.hasOwnProperty("kml"))if("string"===typeof b.kml)d.url=b.kml,c=new google.maps.KmlLayer(d),this._kmls.push(c);else if(Array.isArray(b.kml))for(e=
0;e<b.kml.length;e+=1)"string"===typeof b.kml[e]?(d.url=b.kml[e],c=new google.maps.KmlLayer(d)):"object"===typeof b.kml[e]&&(d=g.extend({},d,b.kml[e]),c=new google.maps.KmlLayer(d),d.hasOwnProperty("event")&&this.bindEvents(c,d.event)),this._kmls.push(c)},drawPolyline:function(a,b){var d={},c=[],e={},f={},h={},h={},k=[],l=[],n=0,h={},h={},m=0,u=function(a,b){if(b===google.maps.DirectionsStatus.OK){for(m=0;m<a.routes[0].overview_path.length;m+=1)l.push(a.routes[0].overview_path[m]);e.setPath(l);"function"===
typeof d.getDistance&&(f=a.routes[0].legs[0].distance,d.getDistance.call(this,f))}};if(b.hasOwnProperty("polyline")&&Array.isArray(b.polyline))for(n=0;n<b.polyline.length;n+=1)if(d=b.polyline[n],d.hasOwnProperty("coords")&&Array.isArray(d.coords)){k=new google.maps.MVCArray;for(m=0;m<d.coords.length;m+=1)h=d.coords[m],h=r(h,!0,!1),"function"===typeof h.lat&&k.push(h);h=g.extend({},{strokeColor:d.color||"#FF0000",strokeOpacity:d.opacity||1,strokeWeight:d.width||2},d);e=new google.maps.Polyline(h);
this._polylines.push(e);if(2<k.getLength())for(m=0;m<k.length;m+=1)0<m&&k.length-1>m&&c.push({location:k.getAt(m),stopover:!1});d.hasOwnProperty("event")&&this.bindEvents(e,d.event);d.hasOwnProperty("snap")&&!0===d.snap?(h=new google.maps.DirectionsService,h.route({origin:k.getAt(0),waypoints:c,destination:k.getAt(k.length-1),travelMode:google.maps.DirectionsTravelMode.DRIVING},u)):(e.setPath(k),google.maps.hasOwnProperty("geometry")&&google.maps.geometry.hasOwnProperty("spherical")&&"function"===
typeof google.maps.geometry.spherical.computeDistanceBetween&&(f=google.maps.geometry.spherical.computeDistanceBetween(k.getAt(0),k.getAt(k.length-1)),"function"===typeof d.getDistance&&d.getDistance.call(this,f)));e.setMap(a)}},drawPolygon:function(a,b){var d,c;if(b.hasOwnProperty("polygon")&&Array.isArray(b.polygon))for(c=0;c<b.polygon.length;c+=1){var e=[];if(b.polygon[c].hasOwnProperty("coords")){for(d=0;d<b.polygon[c].coords.length;d+=1){var f=b.polygon[c].coords[d];f=r(f,!0,!1);"function"===
typeof f.lat&&e.push(f)}d=g.extend({},{path:e,strokeColor:b.polygon[c].color||"#FF0000",strokeOpacity:1,strokeWeight:b.polygon[c].width||2,fillColor:b.polygon[c].fillcolor||"#CC0000",fillOpacity:.35},b.polygon[c]);e=new google.maps.Polygon(d);this._polygons.push(e);e.setMap(a);d.hasOwnProperty("event")&&this.bindEvents(e,d.event)}}},drawCircle:function(a,b){var d={},c;if(b.hasOwnProperty("circle")&&Array.isArray(b.circle))for(c=0;c<b.circle.length;c+=1){var e=b.circle[c];var f=g.extend({map:a,strokeColor:e.color||
"#FF0000",strokeOpacity:e.opacity||.8,strokeWeight:e.width||2,fillColor:e.fillcolor||"#FF0000",fillOpacity:e.fillopacity||.35,radius:e.radius||10,zIndex:100,id:e.hasOwnProperty("id")?e.id:""},e);e.hasOwnProperty("center")&&(d=r(e.center,!0,!1),f.center=d);"function"===typeof d.lat&&(f=new google.maps.Circle(f),this._circles.push(f),e.hasOwnProperty("event")&&this.bindEvents(f,e.event))}},markerIcon:function(a){var b={};if(a.hasOwnProperty("icon")){b=a.icon;if("string"===typeof a.icon)return a.icon;
a.icon.hasOwnProperty("url")&&(b.url=a.icon.url);a.icon.hasOwnProperty("size")&&Array.isArray(a.icon.size)&&2===a.icon.size.length&&(b.size=this.formatSize(a.icon.size));a.icon.hasOwnProperty("scaledSize")&&Array.isArray(a.icon.scaledSize)&&2===a.icon.scaledSize.length&&(b.scaledSize=this.formatSize(a.icon.scaledSize));a.icon.hasOwnProperty("anchor")&&Array.isArray(a.icon.anchor)&&2===a.icon.anchor.length&&(b.anchor=this.formatPoint(a.icon.anchor))}return b},processMarker:function(a,b,d,c,e){var f=
this;a=f.get("marker");var h={},k={},l={};c.hasOwnProperty("position")&&("function"===typeof c.getPosition&&f._bounds.extend(c.position),d.hasOwnProperty("markerFitBounds")&&!0===d.markerFitBounds&&a.length===d.marker.length&&b.fitBounds(f._bounds));"undefined"===typeof c.infoWindow&&(c.infoWindow=new google.maps.InfoWindow({content:c.text}));c.hasOwnProperty("text")&&(c.infoWindow.setContent(c.text),c.hasOwnProperty("event")&&c.event.hasOwnProperty("click")||(c.defaultInfoWindow=!0),f.bindEvents(c,
c.event),c.hasOwnProperty("infoWindowOptions")&&(l=g.extend({},{content:c.infoWindowOptions.hasOwnProperty("content")?c.infoWindowOptions.content:c.text},c.infoWindowOptions),c.infoWindow.setOptions(l),l.hasOwnProperty("event")&&"undefined"!==typeof l.event&&f.bindEvents(c.infoWindow,l.event)));e||(!c.hasOwnProperty("cluster")||c.hasOwnProperty("cluster")&&!0===c.cluster)&&"function"===typeof f._clusters.addMarker&&f._clusters.addMarker(c);if(d.hasOwnProperty("markerWithLabel")&&!0===d.markerWithLabel||
c.hasOwnProperty("newLabel")&&c.newLabel)k={id:c.id,text:c.newLabel,map:b,css:c.hasOwnProperty("newLabelCSS")?c.newLabelCSS.toString():""},f.get({label:[c.id]},function(a){a.label.length?a.label.forEach(function(a){a.text=c.newLabel;g(a.span).addClass(c.newLabelCSS);a.bindTo("position",c);a.draw()}):(h=new x(k),h.bindTo("position",c),f._labels.push(h),h.set("visible",c.showLabel),"object"===typeof h&&!0===d.markerCluster&&google.maps.event.addListener(c,"map_changed",function(){"function"===typeof h.setMap&&
h.set("visible",null!==c.getMap())}))});f.bindEvents(c,c.event)},markerControl:function(){var a=this,b=a.options,d={css:"",label:"\u8acb\u9078\u64c7&hellip;",infoWindow:!0,panTo:!0,onChange:""};if(b.hasOwnProperty("markerControl")){if("string"===typeof b.markerControl)var c=g(b.markerControl.toString());else c=b.markerControl.hasOwnProperty("container")?g(b.markerControl.container):g(b.markerControl),d=g.extend({},d,b.markerControl);c.length&&a.get("marker",function(b){var e=['<select class="marker-list-control">',
"<option>"+d.label+"</option>"];b.forEach(function(a){"undefined"!==typeof a.infoWindow&&a.infoWindow.close();e.push('<option value="'+a.id+'" data-marker-id="'+a.id+'">'+(a.title?a.title:a.id)+"</option>")});e.push("</select>");c.on("change.tinyMap","select",function(){var b=g(this);a.close("marker");this.value.length&&a.get({marker:[this.value]},function(c){c.marker.length&&"undefined"!==c.marker[0]&&(c=c.marker[0],!0===d.infoWindow&&"undefined"!==typeof c.infoWindow&&"function"===typeof c.infoWindow.open&&
c.infoWindow.open(a.map,c),!0===d.panTo&&a.map.panTo(c.getPosition()),"function"===typeof d.onChange&&d.onChange.call(b,c))})}).html(e.join(""));"string"===typeof d.css&&c.find("select").addClass(d.css)})}},placeMarkers:function(a,b,d,c){var e=this,f={},h={maxZoom:null,gridSize:60},k=Array.isArray(b.marker)?b.marker:[],l={},n=!1;"undefined"!==typeof c&&Array.isArray(c)&&c.length&&(k=c);e.options.hasOwnProperty("markerCluster")&&"function"===typeof MarkerClusterer&&(h=g.extend({},h,b.markerCluster),
e._clusters=new MarkerClusterer(a,[],h),h.hasOwnProperty("event")&&e.bindEvents(e._clusters,h.event));e.options.hasOwnProperty("enableOMS")&&"function"===typeof OverlappingMarkerSpiderfier&&(n=!0);n&&(l=new OverlappingMarkerSpiderfier(a,{markersWontHide:!0}),l.addListener("click",function(b){b.hasOwnProperty("oms")&&b.infoWindow.setContent(b.oms);b.infoWindow.open(a,b)}),l.addListener("spiderfy",function(a){}),l.addListener("unspiderfy",function(a){}));var m=k.length;k.forEach(function(c,k){var h=
r(c.addr,!0),u=e.markerIcon(c),v=!0,C=!1,q={},w={},t="undefined"!==typeof c.id?c.id:c.addr.toString().replace(/\s/g,""),p={id:t,map:a,animation:null,showLabel:!0},p=g.extend({},p,c);"modify"===d&&t&&e.get({marker:[t]},function(a){!Array.isArray(a.marker)||!a.marker.length||c.hasOwnProperty("forceInsert")&&!0===c.forceInsert||(c=g.extend(a.marker[0],c),"function"===typeof e._clusters.removeMarker&&e._clusters.removeMarker(a.marker[0]),v=!1,C=!0)});c.hasOwnProperty("title")&&(p.title=c.title.toString().replace(/<([^>]+)>/g,
""));g.isEmptyObject(u)||(p.icon=u);c.hasOwnProperty("animation")&&"string"===typeof c.animation&&(p.animation=google.maps.Animation[c.animation.toUpperCase()]);"string"===typeof h?(f=new google.maps.Geocoder,f.geocode({address:h},function(f,h){h===google.maps.GeocoderStatus.OVER_QUERY_LIMIT?setTimeout(function(){e.placeMarkers(m,a,b,d,[c])},e.interval*(k+1)):h===google.maps.GeocoderStatus.OK&&(!v&&C?("function"===typeof c.setPosition&&(c.setPosition(f[0].geometry.location),p.hasOwnProperty("title")&&
c.setTitle(p.title),p.hasOwnProperty("icon")&&c.setIcon(p.icon)),w=c):(p.position=f[0].geometry.location,q=b.hasOwnProperty("markerWithLabel")&&!0===b.markerWithLabel?"function"===typeof MarkerWithLabel?new MarkerWithLabel(p):new google.maps.Marker(p):new google.maps.Marker(p),e._markers.push(q),w=q),n&&l.addMarker(w),e.processMarker(m,a,b,w,d))})):(!v&&C?("function"===typeof c.setPosition&&h.lat()&&h.lng()&&c.setPosition(h),p.hasOwnProperty("title")&&c.setTitle(p.title),p.hasOwnProperty("icon")&&
c.setIcon(p.icon),w=c):(p.position=h,q=b.hasOwnProperty("markerWithLabel")&&!0===b.markerWithLabel?"function"===typeof MarkerWithLabel?new MarkerWithLabel(p):new google.maps.Marker(p):new google.maps.Marker(p),e._markers.push(q),w=q,n&&l.addMarker(w)),e.processMarker(m,a,b,w,d))});b.hasOwnProperty("markerWithLabel")&&g.isNumeric(b.markerWithLabel)&&function(){e.clear("label");var c=a.getCenter(),b=[];e.get("marker",function(d){d.forEach(function(a){1E3>google.maps.geometry.spherical.computeDistanceBetween(a.getPosition(),
c)&&b.push(a)});b&&b.forEach(function(c){var b={id:c.id,text:c.newLabel,map:a,css:c.hasOwnProperty("newLabelCSS")?c.newLabelCSS.toString():""},b=new x(b);b.bindTo("position",c);b.set("visible",c.showLabel);e._labels.push(b)})})}.apply(e,arguments);e.markerControl()},directionService:function(a,b){var d=this,c=new google.maps.DirectionsService;Array.isArray(b.direction)&&b.direction.forEach(function(b){if("undefined"!==typeof b.from&&"undefined"!==typeof b.to){var e={},h=new google.maps.DirectionsRenderer,
k=g.extend({},{infoWindow:new google.maps.InfoWindow,map:d.map},b),l=[],n=[],m=[];e.origin=r(b.from,!0,!1);e.destination=r(b.to,!0,!1);e.travelMode=b.hasOwnProperty("travel")&&google.maps.TravelMode[b.travel.toString().toUpperCase()]?google.maps.TravelMode[b.travel.toString().toUpperCase()]:google.maps.TravelMode.DRIVING;b.hasOwnProperty("panel")&&g(b.panel).length&&(k.panel=g(b.panel).get(0));b.hasOwnProperty("requestExtra")&&b.requestExtra&&(e=g.extend({},e,b.requestExtra));b.hasOwnProperty("optimize")&&
(e.optimizeWaypoints=b.optimize);b.hasOwnProperty("waypoint")&&Array.isArray(b.waypoint)&&(b.waypoint.forEach(function(a){var b={stopover:!0};"string"===typeof a||Array.isArray(a)?b.location=r(a,!0):a.hasOwnProperty("location")&&(b.location=r(a.location,!0),b.stopover=a.hasOwnProperty("stopover")?a.stopover:!0);n.push(a.text||a.toString());a.hasOwnProperty("icon")&&m.push(a.icon.toString());l.push(b)}),e.waypoints=l);c.route(e,function(c,f){f===google.maps.DirectionsStatus.OK&&(c.routes.forEach(function(f,
h){b.hasOwnProperty("renderAll")&&!0===b.renderAll&&!0===e.provideRouteAlternatives&&new google.maps.DirectionsRenderer({map:a,directions:c,routeIndex:h});var g=f.legs,l="",u="",v={};b.hasOwnProperty("fromText")&&(l=g[0].start_address=b.fromText);b.hasOwnProperty("toText")&&(1===g.length?g[0].end_address=b.toText:g[g.length-1].end_address=b.toText,u=b.toText);b.hasOwnProperty("icon")&&(k.suppressMarkers=!0,b.icon.hasOwnProperty("from")&&"string"===typeof b.icon.from&&d.directionServiceMarker(g[0].start_location,
{icon:b.icon.from,text:l},k.infoWindow,b),b.icon.hasOwnProperty("to")&&"string"===typeof b.icon.to&&d.directionServiceMarker(g[g.length-1].end_location,{icon:b.icon.to,text:u},k.infoWindow,b));for(l=1;l<g.length;l+=1)b.hasOwnProperty("icon")&&(b.icon.hasOwnProperty("waypoint")&&"string"===typeof b.icon.waypoint?v.icon=b.icon.waypoint:"string"===typeof m[l-1]&&(v.icon=m[l-1]),v.text=n[l-1],d.directionServiceMarker(g[l].start_location,v,k.infoWindow,b))}),d.bindEvents(h,b.event),h.setOptions(k),h.setDirections(c),
d._directions.push(h))})}})},directionServiceMarker:function(a,b,d,c){var e=this,f={},h=g.extend({},{position:a,map:e.map,id:c.hasOwnProperty("id")?c.id:""},b),k=new google.maps.Marker(h);h.hasOwnProperty("text")&&(f=function(){d.setPosition(a);d.setContent(h.text);d.open(e.map,k)});e._directionsMarkers.push(k);e.bindEvents(k,f)},getDirectionsInfo:function(){var a=[];this.get("direction",function(b){b.forEach(function(b,c){var d=b.getDirections();d.hasOwnProperty("routes")&&"undefined"!==typeof d.routes[0]&&
"undefined"!==typeof d.routes[0].legs&&(a[c]=[],d.routes[0].legs.forEach(function(b,d){a[c].push({from:b.start_address,to:b.end_address,distance:b.distance,duration:b.duration})}))})});return a},streetView:function(a,b){var d=b.hasOwnProperty("streetViewObj")?b.streetViewObj:{};if("function"===typeof a.getStreetView){if(d.hasOwnProperty("position")){var c=r(d.position,!0,!1);d.position="object"===typeof c?a.getCenter():c}else d.position=a.getCenter();d.hasOwnProperty("pov")&&(d.pov=g.extend({},{heading:0,
pitch:0,zoom:1},d.pov));c=a.getStreetView();c.setOptions(d);d.hasOwnProperty("event")&&this.bindEvents(c,d.event);d.hasOwnProperty("visible")&&c.setVisible(d.visible)}},places:function(a,b){var d=this,c={},c=b.hasOwnProperty("places")?b.places:{},e=g.extend({location:a.getCenter(),radius:100},c);e.location=r(e.location,!0,!1);"undefined"!==typeof google.maps.places&&(c=new google.maps.places.PlacesService(a),c.nearbySearch(e,function(b,c){c===google.maps.places.PlacesServiceStatus.OK&&(d._places.push(b),
e.hasOwnProperty("createMarker")&&!0===e.createMarker&&b.forEach(function(b){b.hasOwnProperty("geometry")&&d._markers.push(new google.maps.Marker({map:a,position:b.geometry.location}))}),e.hasOwnProperty("callback")&&"function"===typeof e.callback&&e.callback.call(b))}))},geoLocation:function(a,b){try{var d=this,c={},e=navigator.geolocation;e&&(b.hasOwnProperty("geolocation")&&(c=g.extend({},{maximumAge:6E5,timeout:3E3,enableHighAccuracy:!1},b.geolocation)),!0===b.autoLocation||"function"===typeof b.autoLocation?
this.watchid=e.watchPosition(function(c){"undefined"!==typeof c&&"coords"in c&&"latitude"in c.coords&&"longitude"in c.coords&&(a.panTo(new google.maps.LatLng(c.coords.latitude,c.coords.longitude)),"function"===typeof b.autoLocation&&b.autoLocation.call(d,c))},function(a){console.error(a)},c):e.clearWatch(this.watchid))}catch(f){}},panTo:function(a){var b=this.map,d={},c={};null!==b&&"undefined"!==typeof b&&(d=r(a,!0,!1),"string"===typeof d?(c=new google.maps.Geocoder,c.geocode({address:d},function(a,
c){c===google.maps.GeocoderStatus.OK&&"function"===typeof b.panTo&&Array.isArray(a)&&a.length?a[0].hasOwnProperty("geometry")&&b.panTo(a[0].geometry.location):console.error(c)})):"function"===typeof b.panTo&&b.panTo(d));return g(this.container)},close:function(a,b){var d=this.get(a),c={},e="";d.hasOwnProperty("map")&&delete d.map;Array.isArray(d)?c[a]=d:c=d;try{for(e in c)Array.isArray(c[e])&&c[e].forEach(function(a){a.hasOwnProperty("infoWindow")&&"function"===typeof a.infoWindow.close&&a.infoWindow.close()});
"function"===typeof b&&b.call(this)}catch(f){console.warn(f)}finally{return g(this.container)}},clear:function(a,b){function d(a,b){"function"===typeof a.setMap&&f._directionsMarkers[b].setMap(null)}function c(a){"direction"===m&&(h.forEach(d),f._directionsMarkers.filter(function(a){return"undefined"!==typeof a}));"function"===typeof a.set&&a.set("visible",!1);"function"===typeof a.setMap&&a.setMap(null);-1!==f[n].indexOf(a)&&delete f[n][f[n].indexOf(a)]}function e(a){return"undefined"!==typeof a}
var f=this,h=f._directionsMarkers,k=f.get(a),l={},n="",m="";"undefined"!==typeof k&&"undefined"!==typeof k.map&&delete k.map;Array.isArray(k)?l[a]=k:l=k;try{for(m in l)Array.isArray(l[m])&&(n="_"+m.toString().toLowerCase()+"s",l[m].forEach(c),f[n]=f[n].filter(e));"function"===typeof b&&b.call(this)}catch(u){console.warn(u)}finally{return g(f.container)}},get:function(a,b){function d(b){var d=c[k].indexOf(b);(0===a[h].length||-1!==a[h].indexOf(d)||"undefined"!==typeof b.id&&0<b.id.length&&-1!==b.id.indexOf(a[h]))&&
f[h].push(b)}var c=this,e=[],f={},h={},k="",g="",n=0;"undefined"===typeof a&&(a={marker:[],label:[],polygon:[],polyline:[],circle:[],direction:[],kml:[],cluster:[],bound:[]});try{if("string"===typeof a)if(-1!==a.indexOf(","))for(e=a.replace(/\s/gi,"").split(","),n=0;n<e.length;n+=1)g=e[n].toString().toLowerCase(),"map"===g?f[g]=c.map:(k="_"+g+"s",f[g]=c[k]);else"map"===a.toString().toLowerCase()?f=c.map:(k="_"+a.toString().toLowerCase()+"s",f=c[k]);else{for(h in a)Array.isArray(a[h])&&(k="_"+h.toString().toLowerCase()+
"s",Array.isArray(c[k])&&(f[h]=[],c[k].forEach(d)));f.map=c.map}"function"===typeof b&&b.call(this,f);return f}catch(m){console.error(m)}finally{return f}},modify:function(a){var b=[],d=[["kml","kml"],["marker","placeMarkers"],["direction","directionService"],["polyline","drawPolyline"],["polygon","drawPolygon"],["circle","drawCircle"],["streetView","streetView"],["markerFitBounds","markerFitBounds"],["places","places"],["autoLocation","geoLocation"]],c,e=this.map;if("undefined"!==typeof a){for(c=
0;c<d.length;c+=1)a.hasOwnProperty(d[c][0])&&b.push(d[c][1]);if(null!==e){if(b.length)for(c=0;c<b.length;c+=1)"function"===typeof this[b[c]]&&("streetView"===b[c]&&(a.streetViewObj=a.streetView,delete a.streetView),this[b[c]](e,a,"modify"));else e.setOptions(a);a.hasOwnProperty("event")&&this.bindEvents(e,a.event);google.maps.event.trigger(e,"resize")}}return g(this.container)},query:function(a,b){var d=this,c=new google.maps.Geocoder,e=r(a,!1,!0),f={};"string"===typeof e?f.address=e:f={location:{lat:parseFloat(e.lat,
10),lng:parseFloat(e.lng,10)}};c.geocode(f,function(c,e){try{if(e===google.maps.GeocoderStatus.OVER_QUERY_LIMIT)setTimeout(function(){d.query(a,b)},d.interval);else if(e===google.maps.GeocoderStatus.OK&&Array.isArray(c)){if(0<c.length&&c[0].hasOwnProperty("geometry"))if("function"===typeof b)b.call(d,c[0]);else return c[0]}else console.error("Geocoder Error Code: "+e)}catch(l){console.error(l)}})},destroy:function(){var a=g(this.container);a.length&&g.removeData(this.container,"tinyMap");return a.empty()},
getKML:function(a){var b=g.extend({},{marker:!0,polyline:!0,polygon:!0,circle:!0,direction:!0,download:!1},a),d="<Placemark> <name><![CDATA[#NAME#]]\x3e</name> <Snippet></Snippet> <description><![CDATA[]]\x3e</description> <styleUrl>#style1</styleUrl> <ExtendedData></ExtendedData> #DATA# </Placemark>".split(" "),c="<Placemark> <styleUrl>#style1</styleUrl> <name><![CDATA[#NAME#]]\x3e</name> <Polygon> <tessellate>1</tessellate> <extrude>1</extrude> <altitudeMode>clampedToGround</altitudeMode> <outerBoundaryIs> <LinearRing> <coordinates>#LATLNG#</coordinates> </LinearRing> </outerBoundaryIs> </Polygon> </Placemark>".split(" "),
e="",f="",h="",k="",l="";a="";this.get("marker,polyline,polygon,circle,direction",function(a){var g="";!0===b.marker&&"undefined"!==typeof a.marker&&a.marker.forEach(function(a){g=[a.getPosition().lng(),a.getPosition().lat()].join();e+=d.join("").replace(/#NAME#/gi,"Markers").replace(/#DATA#/gi,"<Point><coordinates>#LATLNG#,0.000000</coordinates></Point>".replace(/#LATLNG#/gi,g))});!0===b.polyline&&"undefined"!==typeof a.polyline&&a.polyline.forEach(function(a){g="";a.getPath().getArray().forEach(function(a){g+=
[a.lng(),a.lat(),"0.000000\n"].join()});f+=d.join("").replace(/#NAME#/gi,"Polylines").replace(/#DATA#/gi,"<LineString><tessellate>1</tessellate><coordinates>#LATLNG#</coordinates></LineString>".replace(/#LATLNG#/gi,g))});!0===b.polygon&&"undefined"!==typeof a.polygon&&a.polygon.forEach(function(a){g="";a.getPath().getArray().forEach(function(a){g+=[a.lng(),a.lat(),"0.000000\n"].join()});h+=c.join("").replace(/#NAME#/gi,"Polygons").replace(/#LATLNG#/gi,g)});!0===b.circle&&"undefined"!==typeof a.circle&&
a.circle.forEach(function(a){g="";var b=Math.PI/180,d=180/Math.PI,d=a.getRadius()/6378137*d,b=d/Math.cos(a.getCenter().lat()*b),e;for(e=0;65>e;e+=1){var f=e/32*Math.PI;var h=a.getCenter().lng()+b*Math.cos(f);f=a.getCenter().lat()+d*Math.sin(f);g+=[h,f,"0.000000\n"].join()}k+=c.join("").replace(/#NAME#/gi,"Circles").replace(/#LATLNG#/gi,g)});!0===b.direction&&"undefined"!==typeof a.direction&&a.direction.forEach(function(a){a=a.getDirections();a.hasOwnProperty("routes")&&Array.isArray(a.routes)&&"undefined"!==
typeof a.routes[0]&&"undefined"!==typeof a.routes[0].legs&&Array.isArray(a.routes[0].legs)&&a.routes[0].legs.forEach(function(a){Array.isArray(a.steps)&&a.steps.forEach(function(a){g="";Array.isArray(a.path)&&a.path.forEach(function(a){g+=[a.lng(),a.lat(),"0.000000\n"].join()});l+=d.join("").replace(/#NAME#/gi,"Directions").replace(/#DATA#/gi,"<LineString><tessellate>1</tessellate><coordinates>#LATLNG#</coordinates></LineString>".replace(/#LATLNG#/gi,g))})})})});a='<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.2"><Document><name><![CDATA[jQuery tinyMap Plugin]]\x3e</name><description><![CDATA[]]\x3e</description><Style id="style1"><PolyStyle><color>50F05A14</color><colorMode>normal</colorMode><fill>1</fill><outline>1</outline></PolyStyle><IconStyle><Icon><href>https://maps.google.com/mapfiles/kml/paddle/grn-circle_maps.png</href></Icon></IconStyle></Style>#PLACEMARKS#</Document></kml>'.replace(/#NAME#/gi,
"").replace(/#PLACEMARKS#/gi,e+f+h+k+l);if(!0===b.download)t.open("data:application/vnd.google-earth.kml+xml;charset=utf-8;base64,"+t.btoa(t.decodeURIComponent(t.encodeURIComponent(a))));else return a},init:function(){var a=this,b={},d={},d=g.extend({},y),c=d.api.split("?")[0],e="",b={},f={};try{delete d.api,delete d.clusterer,delete d.withLabel,d=g.param(d)}catch(k){}D||"undefined"!==typeof t.google||(b=q.createElement("script"),b.setAttribute("src",[c,d].join("?")),(q.getElementsByTagName("head")[0]||
q.documentElement).appendChild(b),D=!0,b=null);if("object"===typeof t.google){z(a.options);!E&&a.options.hasOwnProperty("markerCluster")&&!1!==a.options.markerCluster&&"undefined"===typeof MarkerClusterer&&(b=q.createElement("script"),b.setAttribute("src",y.clusterer),(q.getElementsByTagName("head")[0]||q.documentElement).appendChild(b),E=!0,b=null);!F&&a.options.hasOwnProperty("markerWithLabel")&&!0===a.options.markerWithLabel&&"undefined"===typeof MarkerWithLabel&&(b=q.createElement("script"),b.setAttribute("src",
y.withLabel),(q.getElementsByTagName("head")[0]||q.documentElement).appendChild(b),F=!0,b=null);!G&&a.options.hasOwnProperty("enableOMS")&&"undefined"===typeof OverlappingMarkerSpiderfier&&(b=q.createElement("script"),b.setAttribute("src",y.OMS),(q.getElementsByTagName("head")[0]||q.documentElement).appendChild(b),G=!0,b=null);a._bounds=new google.maps.LatLngBounds;x.prototype=new google.maps.OverlayView;x.prototype.onAdd=function(){var a=this;null!==a.div&&(a.div.appendTo(g(a.getPanes().overlayLayer)),
a.listeners=[google.maps.event.addListener(a,"visible_changed",function(){a.draw()}),google.maps.event.addListener(a,"position_changed",function(){a.draw()}),google.maps.event.addListener(a,"visible_changed",function(){a.draw()}),google.maps.event.addListener(a,"clickable_changed",function(){a.draw()}),google.maps.event.addListener(a,"text_changed",function(){a.draw()}),google.maps.event.addListener(a,"zindex_changed",function(){a.draw()})])};x.prototype.draw=function(){var a=this.getProjection(),
b={};try{null!==this.div&&a&&((b=a.fromLatLngToDivPixel(this.get("position")))&&this.div.css({left:b.x+"px",top:b.y+"px",display:this.get("visible")?"block":"none"}),this.text&&this.span.html(this.text.toString()))}catch(n){console.error(n)}};x.prototype.onRemove=function(){g(this.div).remove();this.div=null};for(f in a.options)a.options.hasOwnProperty(f)&&(b=a.options[f],/ControlOptions/g.test(f)&&b.hasOwnProperty("position")&&"string"===typeof b.position&&(a.options[f].position=google.maps.ControlPosition[b.position.toUpperCase()]));
a.googleMapOptions=a.options;a.options.hasOwnProperty("streetView")&&(a.googleMapOptions.streetViewObj=a.options.streetView,delete a.googleMapOptions.streetView);a.googleMapOptions.center=r(a.options.center,!0,!1);a.options.hasOwnProperty("styles")&&("string"===typeof a.options.styles&&B.hasOwnProperty(a.options.styles)?a.googleMapOptions.styles=B[a.options.styles]:Array.isArray(a.options.styles)&&(a.googleMapOptions.styles=a.options.styles));if("string"===typeof a.options.center)d=new google.maps.Geocoder,
d.geocode({address:a.options.center},function(b,c){try{c===google.maps.GeocoderStatus.OVER_QUERY_LIMIT?setTimeout(function(){a.init()},a.interval):c===google.maps.GeocoderStatus.OK&&Array.isArray(b)?0<b.length&&b[0].hasOwnProperty("geometry")&&(a.googleMapOptions.center=b[0].geometry.location,a.map=new google.maps.Map(a.container,a.googleMapOptions),h="undefined"!==typeof a.options.event?a.options.event:{},a.mapIdleEvent(h)):(e=(a.options.notFound||c).toString(),a.container.innerHTML=g("<div/>").text(e).html(),
console.error("Geocoder Error Code: "+c))}catch(n){console.error(n)}});else{a.map=new google.maps.Map(a.container,a.googleMapOptions);var h="undefined"!==typeof a.options.event?a.options.event:{};a.mapIdleEvent(h)}}},mapIdleEvent:function(a){var b=this;a.hasOwnProperty("idle")?"undefined"!==a.idle.func&&"function"===typeof a.idle.func&&"undefined"!==typeof a.idle.once?!0===a.idle.once?google.maps.event.addListenerOnce(b.map,"idle",function(){b.overlay();a.idle.func.apply(this,arguments);delete a.idle}):
google.maps.event.addListener(b.map,"idle",function(){b.overlay();a.idle.func.apply(this,arguments)}):"function"===typeof a.idle&&google.maps.event.addListener(b.map,"idle",function(){b.overlay();a.idle.apply(this,arguments)}):google.maps.event.addListenerOnce(b.map,"idle",function(){b.overlay()});b.bindEvents(b.map,a)}};g.fn.tinyMapConfigure=function(a){y=g.extend(y,a)};g.fn.tinyMap=function(a){var b={},d=[],c=arguments;return"string"===typeof a?(this.each(function(){b=g.data(this,"tinyMap");b instanceof
A&&"function"===typeof b[a]&&(d=b[a].apply(b,Array.prototype.slice.call(c,1)))}),"undefined"!==typeof d?d:this):this.each(function(){g.data(this,"tinyMap")||g.data(this,"tinyMap",new A(this,a))})}})(window.jQuery||{},window,document);