Файл: assets/plugins/markerclusterer/1.0.1/src/gmap.admin.min.js
Строк: 216
<?php
/*!
* CIFullCalendar v2.6.1
* Docs & License: http://sirdre.com/apps/cifullcalendar/docs/
* (c) 2015 sirdre
*/
!function(e){"use strict";if("function"==typeof define&&define.amd)define(["jquery","MarkerClusterer"],e);else if("object"==typeof exports)e(require("jquery"),require("google.maps.Geocoder"));else{if("undefined"==typeof google.maps.Geocoder)throw"CIFullCalendar requires Gmaps to be loaded first";if("undefined"==typeof MarkerClusterer)throw"CIFullCalendar requires MarkerClusterer to be loaded first";if("undefined"==typeof jQuery)throw"CIFullCalendar requires jQuery to be loaded first";e(jQuery,MarkerClusterer)}}(function(e,t){function r(e){var r={mapTypeId:google.maps.MapTypeId.ROADMAP};s=new google.maps.Map(document.getElementById("gmapsCanvas2"),r);var n="admin/home/get_marker?category="+e,u=[],p=[],c="";a(n,function(e,r){if(!o(r)){for(var n=0;n<r.length;++n){c=r[n];var a=new google.maps.LatLng(parseFloat(c.markers_lat),parseFloat(c.markers_lng));u=new google.maps.Marker({map:s,icon:l+""+c.markers_logo,position:a,title:c.markers_name}),d.extend(u.position),u.addListener("click",function(e,t){return function(){i.setContent('<h4><a href="'+r[t].markers_url+'" target="_blank">'+r[t].markers_name+"</a></h4><p>"+r[t].markers_desc+"</p><p><b>"+r[t].markers_address+"</b><br/><i>"+r[t].markers_lat+" , "+r[t].markers_lng+" </i></p><p><b>"+r[t].username+"</b></p>"),i.open(s,this)}}(u,n)),p.push(u)}new t(s,p)}s.fitBounds(d),s.panToBounds(d)});var m={name:"gStyle"},f=[{featureType:"road",elementType:"all",stylers:[{visibility:"on"}]}],g=new google.maps.StyledMapType(f,m);s.mapTypes.set("gStyle",g),s.setMapTypeId("gStyle")}function o(e){var t=typeof e;return"undefined"===t||("object"===t?null===e||0===Object.keys(e).length:[!1,0,"","0"].indexOf(e)>=0)}function n(t){t.lengthComputable&&e("progress").attr({value:t.loaded,max:t.total})}function a(t,r){function o(){a()}function a(){4===u.readyState?(e("#loading").show(),n(4===u.readyState),(200===u.status||304===u.status||1223===u.status)&&r(u)):e("#loading").hide()}function s(){var e=void 0;if(u.response?e=u.response:"text"!==u.responseType&&u.responseType||(e=u.responseText||u.responseXML),p)try{e=JSON.parse(e)}catch(t){}return e}function i(e){clearTimeout(f),e instanceof Error||(e=new Error(""+(e||"Unknown Error"))),e.statusCode=0,r(e,g)}function d(e){var t=u.headers;if(!e)return t;for(var r=e.split("rn"),o=0;o<r.length;o++){var n=r[o],a=n.indexOf(": ");if(a>0){var s=n.substring(0,a);n.substring(a,2);if(!u.setRequestHeader)throw new Error("Headers cannot be set on object");for(s in t)t.hasOwnProperty(s)&&u.setRequestHeader(s,t[s])}}return t}function l(){if(!m){var e;clearTimeout(f),e=void 0===u.status?200:1223===u.status?204:u.status;var o=g,n=null;0!==e?(o={body:s(),statusCode:e,method:y,headers:{},url:t,rawRequest:u},u.getAllResponseHeaders&&(o.headers=d(u.getAllResponseHeaders()))):n=new Error("Internal Error"),r(n,o.body)}}var u,p=!0;if("undefined"==typeof r)try{u=new XMLHttpRequest}catch(c){throw new Error("argument missing")}(window.XMLHttpRequest||window.document||window.ActiveXObject)&&(u=new XMLHttpRequest);var m,f,g={body:void 0,headers:{},statusCode:0,method:y,url:t,rawRequest:u},y=u.method="GET",w=s(),h=u.headers,v=0;return p&&"GET"!==y&&"HEAD"!==y&&(h["content-type"]||h["Content-Type"]||(h["Content-Type"]="application/json")||(h["Access-Control-Allow-Methods"]="GET")||(h["Access-Control-Allow-Origin"]="*"),w=JSON.stringify()),u.onreadystatechange=o,u.onload=l,u.onerror=i,u.onprogress=a,u.ontimeout=i,u.open(y,t,!0),v>0&&(f=setTimeout(function(){m=!0,u.abort("timeout");var e=new Error("timeout");e.code="ETIMEDOUT",i(e)},v)),u.send(w),u}var s,i=(new google.maps.Geocoder,new google.maps.InfoWindow),d=new google.maps.LatLngBounds,l=window.location.protocol+"//"+window.location.host+"/"+window.location.pathname.replace("index.php/admin","")+"assets/img/pin/";window.location.protocol+"//"+window.location.host+window.location.pathname.replace("admin/maplist","")+"/maplist";r(),e("#marker_category").change(function(){var t=e("#marker_category option:selected").val();r(t)}),a("admin/home/get_category",function(t,r){if(!o(r))for(var n=0;n<r.length;n++)e("#marker_category").append("<option value="+r[n].category_id+">"+r[n].category_name+" ("+r[n].count+")</option>")})});
?>