2gis-maps
Version:
Interactive 2GIS maps API, based on Leaflet
7 lines (6 loc) • 630 kB
JavaScript
/*
Maps api created at 2GIS. Build on Leaflet.
(c) 2013-2016, 2GIS
*/
!function(){function t(e,o,i){function n(s,a){if(!o[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(r)return r(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=o[s]={exports:{}};e[s][0].call(c.exports,function(t){var o=e[s][1][t];return n(o||t)},c,c.exports,t,e,o,i)}return o[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}return t}()({1:[function(_dereq_,module,exports){(function(process){(function(){function toPoint(t,e,o){return t instanceof DG.Point?t:DG.Util.isArray(t)?new DG.Point(t[0],t[1]):void 0===t||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new DG.Point(t.x,t.y):new DG.Point(t,e,o)}"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(t,e){"use strict";if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof t)throw new TypeError(t+" is not a function");var o,i,n=this.length>>>0,r=!1;for(1<arguments.length&&(i=e,r=!0),o=0;n>o;++o)this.hasOwnProperty(o)&&(r?i=t(i,this[o],o,this):(i=this[o],r=!0));if(!r)throw new TypeError("Reduce of empty array with no initial value");return i}),Array.prototype.forEach||(Array.prototype.forEach=function(t,e){"use strict";var o,i;if(null==this)throw new TypeError("this is null or not defined");var n,r=Object(this),s=r.length>>>0;if("[object Function]"!=={}.toString.call(t))throw new TypeError(t+" is not a function");for(arguments.length>=2&&(o=e),i=0;i<s;)i in r&&(n=r[i],t.call(o,n,i,r)),i++}),Object.keys||(Object.keys=function(){"use strict";var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=o.length;return function(n){if("object"!=typeof n&&("function"!=typeof n||null===n))throw new TypeError("Object.keys called on non-object");var r,s,a=[];for(r in n)t.call(n,r)&&a.push(r);if(e)for(s=0;s<i;s++)t.call(n,o[s])&&a.push(o[s]);return a}}()),Array.prototype.some||(Array.prototype.some=function(t){"use strict";if(void 0===this||null===this)throw new TypeError;var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var i=arguments.length>=2?arguments[1]:void 0,n=0;n<o;n++)if(n in e&&t.call(i,e[n],n,e))return!0;return!1}),Array.prototype.map||(Array.prototype.map=function(t){"use strict";if(void 0===this||null===this)throw new TypeError;var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var i=new Array(o),n=arguments.length>=2?arguments[1]:void 0,r=0;r<o;r++)r in e&&(i[r]=t.call(n,e[r],r,e));return i}),Array.prototype.filter||(Array.prototype.filter=function(t){"use strict";if(void 0===this||null===this)throw new TypeError;var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var i=[],n=arguments.length>=2?arguments[1]:void 0,r=0;r<o;r++)if(r in e){var s=e[r];t.call(n,s,r,e)&&i.push(s)}return i}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),o=this,i=function(){},n=function(){return o.apply(this instanceof i&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return i.prototype=this.prototype,n.prototype=new i,n}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){if(void 0===this||null===this)throw new TypeError('"this" is null or not defined');var o=this.length>>>0;for(e=+e||0,Math.abs(e)===1/0&&(e=0),e<0&&(e+=o,e<0&&(e=0));e<o;e++)if(this[e]===t)return e;return-1}),"function"!=typeof Promise&&!function(){var t,e,o,i;!function(){var n={},r={};t=function(t,e,o){n[t]={deps:e,callback:o}},i=o=e=function(t){function o(e){if("."!==e.charAt(0))return e;for(var o=e.split("/"),i=t.split("/").slice(0,-1),n=0,r=o.length;n<r;n++){var s=o[n];if(".."===s)i.pop();else{if("."===s)continue;i.push(s)}}return i.join("/")}if(i._eak_seen=n,r[t])return r[t];if(r[t]={},!n[t])throw new Error("Could not find module "+t);for(var s,a=n[t],u=a.deps,l=a.callback,c=[],h=0,d=u.length;h<d;h++)"exports"===u[h]?c.push(s={}):c.push(e(o(u[h])));var m=l.apply(this,c);return r[t]=s||m}}(),t("promise/all",["./utils","exports"],function(t,e){"use strict";function o(t){var e=this;if(!i(t))throw new TypeError("You must pass an array to all.");return new e(function(e,o){function i(t){return function(e){r(t,e)}}function r(t,o){a[t]=o,0===--u&&e(a)}var s,a=[],u=t.length;0===u&&e([]);for(var l=0;l<t.length;l++)s=t[l],s&&n(s.then)?s.then(i(l),o):r(l,s)})}var i=t.isArray,n=t.isFunction;e.all=o}),t("promise/asap",["exports"],function(t){"use strict";function e(){return function(){process.nextTick(n)}}function o(){var t=0,e=new u(n),o=document.createTextNode("");return e.observe(o,{characterData:!0}),function(){o.data=t=++t%2}}function i(){return function(){l.setTimeout(n,1)}}function n(){for(var t=0;t<c.length;t++){var e=c[t],o=e[0],i=e[1];o(i)}c=[]}function r(t,e){var o=c.push([t,e]);1===o&&s()}var s,a="undefined"!=typeof window?window:{},u=a.MutationObserver||a.WebKitMutationObserver,l=window,c=[];s="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?e():u?o():i(),t.asap=r}),t("promise/config",["exports"],function(t){"use strict";function e(t,e){return 2!==arguments.length?o[t]:void(o[t]=e)}var o={instrument:!1};t.config=o,t.configure=e}),t("promise/polyfill",["./promise","./utils","exports"],function(t,e,o){"use strict";function i(){var t;t="undefined"!=typeof window&&window.document?window:self;var e="Promise"in t&&"resolve"in t.Promise&&"reject"in t.Promise&&"all"in t.Promise&&"race"in t.Promise&&function(){var e;return new t.Promise(function(t){e=t}),r(e)}();e||(t.Promise=n)}var n=t.Promise,r=e.isFunction;o.polyfill=i}),t("promise/promise",["./config","./utils","./all","./race","./resolve","./reject","./asap","exports"],function(t,e,o,i,n,r,s,a){"use strict";function u(t){if(!k(t))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof u))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],l(t,this)}function l(t,e){function o(t){p(e,t)}function i(t){f(e,t)}try{t(o,i)}catch(n){i(n)}}function c(t,e,o,i){var n,r,s,a,u=k(o);if(u)try{n=o(i),s=!0}catch(l){a=!0,r=l}else n=i,s=!0;m(e,n)||(u&&s?p(e,n):a?f(e,r):t===T?p(e,n):t===E&&f(e,n))}function h(t,e,o,i){var n=t._subscribers,r=n.length;n[r]=e,n[r+T]=o,n[r+E]=i}function d(t,e){for(var o,i,n=t._subscribers,r=t._detail,s=0;s<n.length;s+=3)o=n[s],i=n[s+e],c(e,o,i,r);t._subscribers=null}function m(t,e){var o,i=null;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(b(e)&&(i=e.then,k(i)))return i.call(e,function(i){return!!o||(o=!0,void(e!==i?p(t,i):_(t,i)))},function(e){return!!o||(o=!0,void f(t,e))}),!0}catch(n){return!!o||(f(t,n),!0)}return!1}function p(t,e){t===e?_(t,e):m(t,e)||_(t,e)}function _(t,e){t._state===z&&(t._state=O,t._detail=e,v.async(g,t))}function f(t,e){t._state===z&&(t._state=O,t._detail=e,v.async(y,t))}function g(t){d(t,t._state=T)}function y(t){d(t,t._state=E)}var v=t.config,b=(t.configure,e.objectOrFunction),k=e.isFunction,w=(e.now,o.all),x=i.race,L=n.resolve,P=r.reject,D=s.asap;v.async=D;var z=void 0,O=0,T=1,E=2;u.prototype={constructor:u,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(t,e){var o=this,i=new this.constructor(function(){});if(this._state){var n=arguments;v.async(function(){c(o._state,i,n[o._state-1],o._detail)})}else h(this,i,t,e);return i},"catch":function(t){return this.then(null,t)}},u.all=w,u.race=x,u.resolve=L,u.reject=P,a.Promise=u}),t("promise/race",["./utils","exports"],function(t,e){"use strict";function o(t){var e=this;if(!i(t))throw new TypeError("You must pass an array to race.");return new e(function(e,o){for(var i,n=0;n<t.length;n++)i=t[n],i&&"function"==typeof i.then?i.then(e,o):e(i)})}var i=t.isArray;e.race=o}),t("promise/reject",["exports"],function(t){"use strict";function e(t){var e=this;return new e(function(e,o){o(t)})}t.reject=e}),t("promise/resolve",["exports"],function(t){"use strict";function e(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=this;return new e(function(e){e(t)})}t.resolve=e}),t("promise/utils",["exports"],function(t){"use strict";function e(t){return o(t)||"object"==typeof t&&null!==t}function o(t){return"function"==typeof t}function i(t){return"[object Array]"===Object.prototype.toString.call(t)}var n=Date.now||function(){return(new Date).getTime()};t.objectOrFunction=e,t.isFunction=o,t.isArray=i,t.now=n}),e("promise/polyfill").polyfill()}(),_dereq_("leaflet"),_dereq_("html5shiv");var oldDG=window.DG,DG=new(function(){var t=function(){},e=function(){};return e.prototype=L,t.prototype=new e,t}());for(var prop in oldDG)oldDG.hasOwnProperty(prop)&&"undefined"==typeof DG[prop]&&(DG[prop]=oldDG[prop]);window.__dgApi__=window.__dgApi__||{},DG.version=window.__dgApi__.version,DG.Icon.Default.imagePath="../img/vendors/leaflet",DG.Map.include({addHandler:function(t,e){if(!e)return this;var o=this.options[t],i=o===Object(o)?o:null,n=this[t]=new e(this,i);return this._handlers.push(n),o&&n.enable(),this}}),DG.Map.addInitHook(function(){DG.Browser.touchEnabled||DG.DomUtil.addClass(this._container,"no-touch")}),window.DG=DG,module.exports=DG;var handlers=window.__dgApi__.callbacks||[],chain=Promise.resolve();handlers.forEach(function(t){chain=chain.then(t[0],t[1])}),DG.then=function(t,e){return chain.then(t,e)},chain["catch"](function(t){console.error(t)}),DG.plugin=function(t){var e,o=new RegExp(/.js$/i),i=new RegExp(/.css$/i);return new Promise(function(n){function r(){e--,0===e&&n()}function s(t){var e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("src",t),e.onload=function(){r()},e.onerror=function(){r()},e.onreadystatechange=function(){"complete"!==e.readyState&&"loaded"!==e.readyState||r()},document.getElementsByTagName("head")[0].appendChild(e)}function a(t){var e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",t),document.getElementsByTagName("head")[0].appendChild(e),r()}function u(t){return o.test(t)}function l(t){return i.test(t)}function c(t){u(t)?s(t):l(t)?a(t):e--}DG.Util.isArray(t)&&(e=t.length,t.forEach(function(t){c(t)})),"string"==typeof t&&(e=1,c(t))})},DG.Wkt={},DG.Wkt.toGeoJSON=function(t){function e(e){var o=t.substring(_).match(e);return o?(_+=o[0].length,o[0]):null}function o(t){return t&&f.match(/\d+/)&&(t.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+f}}),t}function i(){e(/^\s*/)}function n(){i();for(var t,o=0,n=[],r=[n],s=n;t=e(/^(\()/)||e(/^(\))/)||e(/^(\,)/)||e(/^[-+]?([0-9]*\.[0-9]+|[0-9]+)/);){if("("===t)r.push(s),s=[],r[r.length-1].push(s),o++;else if(")"===t){if(s=r.pop(),o--,0===o)break}else","===t?(s=[],r[r.length-1].push(s)):s.push(parseFloat(t));i()}return r.length=0,0!==o?null:n}function r(){for(var t,o,n=[];o=e(/^[-+]?([0-9]*\.[0-9]+|[0-9]+)/)||e(/^(\,)/);)","===o?(n.push(t),t=[]):(t||(t=[]),t.push(parseFloat(o))),i();return t&&n.push(t),n.length?n:null}function s(){if(!e(/^(point)/i))return null;if(i(),!e(/^(\()/))return null;var t=r();return i(),e(/^(\))/)?{type:"Point",coordinates:t[0]}:null}function a(){if(!e(/^(multipoint)/i))return null;i();var t=n();return i(),{type:"MultiPoint",coordinates:t}}function u(){if(!e(/^(multilinestring)/i))return null;i();var t=n();return i(),{type:"MultiLineString",coordinates:t}}function l(){if(!e(/^(linestring)/i))return null;if(i(),!e(/^(\()/))return null;var t=r();return e(/^(\))/)?{type:"LineString",coordinates:t}:null}function c(){return e(/^(polygon)/i)?(i(),{type:"Polygon",coordinates:n()}):null}function h(){return e(/^(multipolygon)/i)?(i(),{type:"MultiPolygon",coordinates:n()}):null}function d(){var t,o=[];if(!e(/^(geometrycollection)/i))return null;if(i(),!e(/^(\()/))return null;for(;t=m();)o.push(t),i(),e(/^(\,)/),i();return e(/^(\))/)?{type:"GeometryCollection",geometries:o}:null}function m(){return s()||l()||c()||a()||u()||h()||d()}DG.Util.isArray(t)&&(t=t[0]);var p=t.split(";");t=p.pop();var _=0,f=(p.shift()||"").split("=").pop();return o(m())},DG.Wkt.geoJsonLayer=function(t,e){return DG.geoJson(DG.Wkt.toGeoJSON(t),e)},DG.Wkt._coordsToLatLngs=function(t){return DG.Util.isArray(t)&&!DG.Util.isArray(t[0])?[DG.GeoJSON.coordsToLatLng(t)]:t.map(function(t){return DG.Wkt._coordsToLatLngs(t)}).reduce(function(t,e){return t.concat(e)})},DG.Wkt.toLatLngs=function(t){return DG.Util.isArray(t)||(t=[t]),t.map(function(t){var e=DG.Wkt.toGeoJSON(t).coordinates;return DG.Wkt._coordsToLatLngs(e)}).reduce(function(t,e){return t.concat(e)})},DG.Wkt.toPoints=function(t){return DG.Wkt.toGeoJSON(t).coordinates},DG.Wkt.pointsToLatLngOnMap=function(t,e){return function o(t){return Array.isArray(t)&&Array.isArray(t[0])?t.map(o):e.containerPointToLatLng(t)}(DG.Wkt.toPoints(t))},DG.ProjectDetector=DG.Handler.extend({initialize:function(t){this._map=t,this._project=void 0,this._loadProjectList()},addHooks:function(){this._projectWatch(),this._map.on("move",this._projectWatch,this)},removeHooks:function(){this._map.off("move",this._projectWatch,this)},getProject:function(){return!!this._project&&DG.Util.extend({},this._project)},getProjectsList:function(){return this._projectList.slice(0)},isProjectHere:function(t,e,o){if(!t)return null;t instanceof DG.LatLng||t instanceof DG.LatLngBounds||(t=DG.latLng(t)),t=t instanceof DG.LatLngBounds?DG.latLngBounds(t.getSouthWest().wrap(),t.getNorthEast().wrap()):t.wrap(),o=o||(t instanceof DG.LatLngBounds?"intersects":"contains");var i="intersects"==o?this._testProjectIntersects:this._testProjectContains;return i=i.bind(this,t),e?i(e):this._projectList.filter(i)[0]},_projectWatch:function(){this._map._loaded&&(this._project&&this._zoomInProject(this._project)&&this._centerInProject(this._project)||(this._searchProject(),this._project&&this._map.attributionControl._update(null,this._project.country_code)))},_checkProjectData:function(t){function e(t){return void 0!==t&&null!==t}return t&&t.bounds&&e(t.code)&&e(t.domain)&&e(t.country_code)&&e(t.flags)&&t.zoom_level&&e(t.zoom_level.min)&&e(t.zoom_level.max)&&t.time_zone&&e(t.time_zone.offset)},_loadProjectList:function(){DG.fallbackProjectsList=DG.fallbackProjectsList||[],DG.projectsList||(DG.projectsList=DG.fallbackProjectsList),delete DG.fallbackProjectsList,this._projectList=DG.projectsList.filter(this._checkProjectData).map(function(t){var e=DG.Wkt.toGeoJSON(t.bounds),o=DG.geoJSON(e).getBounds(),i=t.default_pos?DG.latLng(t.default_pos.lat,t.default_pos.lon):null;return{id:t.id,code:t.code,minZoom:t.zoom_level.min,maxZoom:t.zoom_level.max,timeOffset:t.time_zone.offset,bound:e,latLngBounds:o,traffic:!!t.flags.traffic,transport:!!t.flags.public_transport,roads:!!t.flags.road_network,country_code:t.country_code,domain:t.domain,defaultPos:i}})},_searchProject:function(){var t=this._projectList.filter(this._zoomInProject,this),e=t.filter(this._centerInProject,this);if(0===e.length){var o=this._map.getBounds();if(e=t.filter(DG.bind(this._testProjectIntersects,this,o)),e.length>1){for(var i=this._map.getCenter(),n=e[0],r=1;r<e.length;r++){var s=e[r];s.defaultPos&&i.distanceTo(n.defaultPos)>i.distanceTo(s.defaultPos)&&(n=s)}e=[n]}}var a=e[0]||null;if(this._project!==a){var u=this;null!==this._project&&(this._project=null,setTimeout(function(){u._map.fire("projectleave")},1)),a&&(this._project=a,setTimeout(function(){u._map.fire("projectchange",{getProject:u.getProject.bind(u)})},1))}},_testProjectIntersects:function(t,e){return e.latLngBounds.intersects(t)},_testProjectContains:function(t,e){return DG.PolyUtil.inside([t.lng,t.lat],e.bound)},_centerInProject:function(t,e){return this.isProjectHere(this._map.getCenter(),t,e)},_zoomInProject:function(t){return this._map.getZoom()>=t.minZoom}}),DG.Map.mergeOptions({projectDetector:!0}),DG.Map.addInitHook("addHandler","projectDetector",DG.ProjectDetector),DG.Dictionary={},DG.Dictionary.ru={pluralRules:function(t){return t%10===1&&t%100!==11?0:t%10>=2&&t%10<=4&&t%10%1===0&&(t%100<12||t%100>14)?1:t%10===0||t%10>=5&&t%10<=9&&t%10%1===0||t%100>=11&&t%100<=14&&t%100%1===0?2:void 0}},DG.Dictionary.en={pluralRules:function(t){return 1===t?0:1}},DG.Dictionary.it={pluralRules:function(t){return 1===t?0:1}},DG.Dictionary.cs={pluralRules:function(t){return 1===t?0:t>=2&&t<=4?1:2}},DG.Dictionary.es={pluralRules:function(t){return t>=2?1:0}},DG.Dictionary.ar={pluralRules:function(){return 0}},DG.Locale={t:function(t,e){var o,i,n,r=this._map.getLang(),s=!1;return"undefined"==typeof this.constructor.Dictionary[r]&&(r="ar"===r?"en":DG.config.defaultLang),i=this.constructor.Dictionary[r][t],(s="undefined"!=typeof i)?(o=s?i:t,void 0!==e&&(e=parseInt(e,10),e=isNaN(e)?0:e,n=this.constructor.Dictionary[r].pluralRules(e),o=i[n]),o=DG.Util.template(o,{n:e})):t}},DG.Map.include({setLang:function(t){t&&"[object String]"===Object.prototype.toString.call(t)&&(this.options.currentLang=t,this.fire("langchange",{lang:t}))},getLang:function(){if(!this.options.currentLang){var t=document.documentElement,e=t.lang||t.getAttributeNS&&t.getAttributeNS("http://www.w3.org/XML/1998/namespace","lang")||DG.config.defaultLang;this.options.currentLang=e}return this.options.currentLang}}),DG.RoundControl=DG.Control.extend({includes:DG.Mixin.Events,options:{position:"topright",iconClass:"default"},onAdd:function(t){var e=this._controlCLass="dg-control-round",o=this._controlIconCLass=this._controlCLass+"__icon",i=DG.DomUtil.create("div","");if(this._disable)return i;DG.DomUtil.addClass(i,e);var n=this._link=DG.DomUtil.create("a",o+" "+o+"_name_"+this.options.iconClass,i);return n.href="#",this._renderTranslation(),this._map=t,DG.DomEvent.on(i,"click",this._toggleControl,this).on(i,"dblclick",DG.DomEvent.stopPropagation).on(n,"mousedown",DG.DomEvent.stopPropagation),this.fireEvent("add"),i},onRemove:function(){this.fireEvent("remove"),DG.DomEvent.off(this._link,"click",this._toggleControl)},setState:function(t){return this._link&&this._container?(this._state&&(DG.DomUtil.removeClass(this._container,this._controlCLass+"_state_"+this._state),DG.DomUtil.removeClass(this._link,this._controlIconCLass+"_state_"+this._state),this._state=null),t&&(this._state=t,DG.DomUtil.addClass(this._container,this._controlCLass+"_state_"+this._state),DG.DomUtil.addClass(this._link,this._controlIconCLass+"_state_"+this._state)),this):this},_toggleControl:function(t){DG.DomEvent.stop(t),this.fireEvent("click")}}),DG.RoundControl.include(DG.Locale),DG.roundControl=function(t){return new DG.RoundControl(t)};var ie9=function(){var t=document.createElement("div"),e=t.getElementsByTagName("i");return t.innerHTML="<!--[if IE 9]><i></i><![endif]-->",Boolean(e[0])}(),safari51=DG.Browser.safari&&navigator.userAgent.indexOf("Version/5.1")!==-1,wasPreviouslyDisabled=!1;try{wasPreviouslyDisabled="false"===localStorage.getItem("DGMuseum")}catch(err){}DG.Map.mergeOptions({museum:!wasPreviouslyDisabled&&(DG.Browser.ielt9||ie9||DG.Browser.opera12||safari51)}),DG.Map.Museum=DG.Handler.extend({statics:{Dictionary:{ar:{wearesorry:"لا نضمن لك تشغيل ثابت للتطبيق على متصفحك. حاول التحديث:"},cs:{wearesorry:"Nezaručujeme stabilní fungování aplikace ve Vašem prohlížeči. Zkuste provést aktualizaci:"},en:{wearesorry:"We do not guarantee stable operation of the application in your browser. Try updating:"},es:{wearesorry:"No garantizamos un funcionamiento estable de la aplicación en su buscador. Intente actualizarlo:"},it:{wearesorry:"Non garantiamo il funzionamento stabile dell'applicazione nel tuo browser. Prova ad aggiornare:"},ru:{wearesorry:"Мы не гарантируем стабильную работу приложения в вашем браузере. Попробуйте обновиться:"}}},includes:[DG.Locale],initialize:function(t){this._map=t,this._element=document.createElement("div"),this._element.className="dg-museum",this._element.innerHTML='<span></span><a class="dg-museum-browser dg-museum__chrome" target="_blank" href="https://www.google.com/chrome/"></a><a class="dg-museum-browser dg-museum__firefox" target="_blank" href="https://www.mozilla.org/firefox/new/"></a><a class="dg-museum-browser dg-museum__safari" target="_blank" href="https://support.apple.com/downloads/safari"></a><a class="dg-museum-browser dg-museum__opera" target="_blank" href="https://www.opera.com/"></a><a class="dg-museum-browser dg-museum__ie" target="_blank" href="https://windows.microsoft.com/internet-explorer/download-ie"></a>',this._text=this._element.children[0],this._closeButton=document.createElement("span"),this._closeButton.className="dg-museum__close",this._element.appendChild(this._closeButton),this._renderTranslation()},addHooks:function(){this._map.getContainer().appendChild(this._element),this._map.on("langchange",this._renderTranslation,this),DG.DomEvent.on(this._closeButton,"click",this._onCloseButtonClick,this)},removeHooks:function(){this._map.getContainer().removeChild(this._element),this._map.off("langchange",this._renderTranslation,this),DG.DomEvent.off(this._closeButton,"click",this._onCloseButtonClick,this)},_onCloseButtonClick:function(t){DG.DomEvent.stop(t);try{localStorage.setItem("DGMuseum","false")}catch(e){}this.disable()},_renderTranslation:function(){var t=this._map.getLang();this._text.innerHTML=this.t("wearesorry"),this._element.setAttribute("dir","ar"===t?"rtl":"ltr")}}),DG.Map.addInitHook("addHandler","museum",DG.Map.Museum),DG.configTheme=DG.configTheme||{},DG.configTheme.markersData={iconSize:[22,34],className:"dg-customization__marker dg-customization__marker_type_mushroom",iconAnchor:[10,32]},DG.Map.mergeOptions({bounceAtZoomLimits:!1});var controlAddTo=DG.Control.prototype.addTo;DG.Control.include({addTo:function(t){return t.on("langchange",this._renderTranslation,this),controlAddTo.call(this,t)},_renderTranslation:function(){}}),DG.DivIcon.include({createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),o=this.options;if(o.html instanceof Element?(DG.DomUtil.empty(e),e.appendChild(o.html)):e.innerHTML=o.html!==!1?o.html:"",o.bgPos){var i=toPoint(o.bgPos);e.style.backgroundPosition=-i.x+"px "+-i.y+"px"}return this._setIconStyles(e,"icon"),e}}),DG.Browser.safari51=DG.Browser.safari&&navigator.userAgent.indexOf("Version/5.1")!==-1;var msPointer=navigator.msPointerEnabled&&navigator.msMaxTouchPoints&&!window.PointerEvent,pointer=window.PointerEvent&&navigator.pointerEnabled&&navigator.maxTouchPoints||msPointer,documentTouch=window.DocumentTouch&&document instanceof window.DocumentTouch;DG.Browser.touchEnabled=pointer||"ontouchstart"in window||documentTouch,DG.Marker.prototype.options.icon=DG.divIcon(DG.configTheme.markersData);var utilSetOptions=DG.Util.setOptions;if(DG.setOptions=L.setOptions=DG.Util.setOptions=function(t,e){return e&&"undefined"!=typeof e.clickable&&(e.interactive=e.clickable),utilSetOptions.call(this,t,e)},DG.Layer.mergeOptions({nonBubblingEvents:["click","dblclick","mouseover","mouseout","contextmenu"]}),L.Canvas.include({_initContainer:function(){var t=this._container=document.createElement("canvas");L.DomEvent.on(t,"mousemove",this._onMouseMove,this).on(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this).on(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")}}),DG.Path){var pathInitialize=DG.Path.prototype.onAdd;DG.Path.include({onAdd:function(t){return pathInitialize.call(this,t)}})}var initMap=DG.Map.prototype.initialize,panBy=DG.Map.prototype.panBy,getBoundsZoom=DG.Map.prototype.getBoundsZoom,setMaxZoom=DG.Map.prototype.setMaxZoom;DG.Map.include({_tileLayersNumber:0,_mapMaxZoomCache:null,initialize:function(t,e){e=DG.extend({wheelPxPerZoomLevel:1e4},e),this.metaLayers=[],initMap.call(this,t,e),this.options.center&&void 0!==this.options.zoom&&this.setView(DG.latLng(this.options.center),this.options.zoom,{reset:!0}),this._lastMetalayer={layer:void 0,entity:void 0}},setView:function(t,e,o){if(this._restrictZoom(t,e),e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(DG.latLng(t),e,this.options.maxBounds),o=o||{},o.animate&&(o.animate=this._testAnimation(t)),this._stop(),this._loaded&&!o.reset&&o!==!0){void 0!==o.animate&&(o.zoom=DG.extend({animate:o.animate,duration:o.duration},o.zoom),o.pan=DG.extend({animate:o.animate,duration:o.duration},o.pan));var i=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,o.zoom):this._tryAnimatedPan(t,o.pan);if(i)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){var o=panBy.call(this,t,e),i=this._restrictZoom(this.getCenter());return this.getZoom()>i&&this.setZoom(i),o},getBoundsZoom:function(t,e,o){return t=DG.latLngBounds(t),this._restrictZoom(t),getBoundsZoom.call(this,t,e,o)},getTileLayersNumber:function(){return this._tileLayersNumber},setMaxZoom:function(t){return this._mapMaxZoomCache=null,setMaxZoom.call(this,t)},_testAnimation:function(t){if(this.projectDetector.enabled()){var e=this.projectDetector.getProject(),o=this.projectDetector.isProjectHere(t);if(e&&o)return e.code===o.code}return!0},_updateTileLayers:function(t){t.layer instanceof DG.TileLayer&&!t.layer._isDg&&("layeradd"===t.type?this._tileLayersNumber++:this._tileLayersNumber--)},_getNewBounds:function(t,e){if(t instanceof DG.LatLngBounds)return t;var o=this.project(t,e),i=this.getSize().divideBy(2),n=this.unproject(o.subtract(i),e),r=this.unproject(o.add(i),e);return DG.latLngBounds(n,r)},_restrictZoom:function(t,e){if(this._layers&&this.projectDetector.enabled()&&0===this._tileLayersNumber){var o=this.options,i=!!o.maxZoom,n=this.baseLayer,r=this._getNewBounds(t,e),s=this.projectDetector.isProjectHere(r);return i?(this._mapMaxZoomCache||(this.baseLayer.options.detectRetina&&DG.Browser.retina&&o.maxZoom>0&&o.maxZoom--,this._mapMaxZoomCache=o.maxZoom),o.maxZoom=this._mapMaxZoomCache&&s?this._mapMaxZoomCache:DG.config.projectLeaveMaxZoom,s&&(this._mapMaxZoomCache=o.maxZoom),o.maxZoom):(s?n.options.detectRetina&&DG.Browser.retina&&s.maxZoom>0?n.options.maxZoom=s.maxZoom-1:n.options.maxZoom=s.maxZoom:n.options.maxZoom=DG.config.projectLeaveMaxZoom,n.options.maxNativeZoom=n.options.maxZoom,this._updateZoomLevels(),n.options.maxZoom)}},_fireDOMEvent:function(t,e,o){if(13!==t.keyCode){if("click"===t.type){var i=L.Util.extend({},t);i.type="preclick",this._fireDOMEvent(i,i.type,o)}if(!t._stopped&&(o=(o||[]).concat(this._findEventTargets(t,e)),o.length)){var n=o[0];"contextmenu"===e&&n.listens(e,!0)&&L.DomEvent.preventDefault(t);var r={originalEvent:t,eventTargets:o,eventTargetsMapIndex:o.indexOf(this)};if("keypress"!==t.type){var s=n instanceof L.Marker;r.containerPoint=s?this.latLngToContainerPoint(n.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=s?n.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var a=0;a<o.length;a++){if(o[a]===this){var u=this._getCurrentMetaLayer(r);"mousemove"===e?this._lastMetalayer.entity&&u.entity&&this._lastMetalayer.entity.id===u.entity.id?this._fireMetalayerEvent("mousemove",u,r):(this._fireMetalayerEvent("mouseout",this._lastMetalayer,r),this._fireMetalayerEvent("mouseover",u,r),this._fireMetalayerEvent("mousemove",u,r),this._lastMetalayer=u):this._fireMetalayerEvent(e,u,r),r.originalEvent._stopped||o[a].fire(e,r,!0)}else o[a].fire(e,r,!0),this._lastMetalayer.entity&&r.originalEvent._stopped&&(this._fireMetalayerEvent("mouseout",this._lastMetalayer,r),this._lastMetalayer={layer:void 0,entity:void 0});if(r.originalEvent._stopped||o[a].options.nonBubblingEvents&&L.Util.indexOf(o[a].options.nonBubblingEvents,e)!==-1)return}}}},_getCurrentMetaLayer:function(t){var e=t.originalEvent.target||t.originalEvent.srcElement,o="click"===t.originalEvent.type;if(e===this._container||DG.Browser.ie&&"leaflet-tile leaflet-tile-loaded"===e.className||"CANVAS"===e.tagName)for(var i=this.metaLayers.length-1;i>=0;i--){var n=this.metaLayers[i].getHoveredObject(t);if(n)return{layer:this.metaLayers[i],entity:n};if(o)return{layer:this.metaLayers[i],entity:void 0}}return{layer:void 0,entity:void 0}},_fireMetalayerEvent:function(t,e,o){if((e.entity||"click"===t)&&e.layer){var i=e.layer.mapEvents[t];i&&(o.entity=e.entity,i.call(e.layer,o))}}}),DG.Map.addInitHook(function(){this.on("layeradd layerremove",this._updateTileLayers)}),DG.Map.addInitHook(function(){0==this.options.dragging&&0==this.options.tap&&DG.DomUtil.addClass(this._container,"dg-dragging-false")}),DG.Map.addInitHook(function(){function t(){var t=this.getLang(),i=this.projectDetector&&this.projectDetector.getProject();"ru"!==t||i?this.baseLayer.options.errorTileUrl=e:this.baseLayer.options.errorTileUrl=o,""===p&&"ar"===t&&i&&"ae"===i.country_code?(p="ar",this.baseLayer.setUrl(h),this.baseLayer.setPreviewUrl&&this.baseLayer.setPreviewUrl(m)):"ar"!==p||"ar"===t&&i&&"ae"===i.country_code||(p="",this.baseLayer.setUrl(c),this.baseLayer.setPreviewUrl&&this.baseLayer.setPreviewUrl(d))}var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAAA1BMVEX28t5R0k5UAAAAH0lEQVR4Xu3AAQkAAADCMPunNsdhWxwAAAAAAAAAwAEhAAABg2UP5AAAAABJRU5ErkJggg==",o=DG.config.protocol+DG.config.baseUrl+"/img/nomap_ru.png",i=DG.Browser.mobile?DG.MobileTileLayer:DG.TileLayer,n=i.extend({initialize:function(t,e){this._isDg=!0,i.prototype.initialize.call(this,t,e)},getTiles:function(){return this._tiles}}),r=this.options.key||DG.config.key,s=this.getContainer(),a=new DG.ApiKeyValidator(r,s),u=this.options.showCommPoi?"":"&layerType=nc";a.validateKeyResponse();var l=this.options.protocol||DG.config.secureProtocol;":"!==l[l.length-1]&&(l+=":");var c=l+(DG.Browser.retina?DG.config.retinaTileServer:DG.config.tileServer)+u,h=l+(DG.Browser.retina?DG.config.arabicRetinaTileServer:DG.config.arabicTileServer)+u,d=l+(DG.Browser.retina?DG.config.previewRetinaTileServer:DG.config.previewTileServer)+u,m=l+(DG.Browser.retina?DG.config.arabicPreviewRetinaTileServer:DG.config.arabicPreviewTileServer)+u;this.baseLayer=new n(c,{subdomains:"0123",errorTileUrl:"ru"===this.getLang()?o:e,detectRetina:DG.config.detectRetina,maxZoom:20,maxNativeZoom:20,zIndex:0,updateWhenIdle:!1,previewUrl:d,key:r,crossOrigin:!0});var p="";t.call(this),this.baseLayer.addTo(this),this.on({langchange:t,projectchange:t,projectleave:t},this)}),DG.ApiKeyValidator=DG.Class.extend({initialize:function(t,e){this.apiKey=t,this.endpoint=DG.config.keyServer+t+DG.config.keyServices,this.isLoading=!1,this.attempts=0,this.lastTimeout=void 0,this.request=null,this.MAX_ATTEMPTS=4,this.keyRequestInterval=[0,2,2,2],this.isErrorWasShown=!1,this.mapContainer=e},validate:function(t){this.isLoading||(this.isLoading=!0,this.attempts=0,this._makeAttempt(t))},validateKeyResponse:function(){this.validate(function(t){t&&!this._isResponseInvalid(t)||this._showError()}.bind(this))},_makeAttempt:function(t){this.attempts>0?this.lastTimeout=window.setTimeout(function(){this._clearLastTimeout(),this._executeRequest(t)}.bind(this),1e3*this.keyRequestInterval[this.attempts]):this._executeRequest(t)},_isResponseInvalid:function(t){return 400===t.meta.code||404===t.meta.code||t.result&&(!t.result.service.is_active||!t.result.is_active||!["ok","exceeded"].includes(t.result.service.status.code))},_showError:function(){if(!this.isErrorWasShown&&this.mapContainer){var t=DG.DomUtil.create("div","dg-error-message");t.innerHTML="Your RasterJS API key is invalid. Please contact api@2gis.com to get RasterJS API key.",this.mapContainer.appendChild(t),this.isErrorWasShown=!0}},_executeRequest:function(t){this.request=DG.ajax(this.endpoint,{type:"GET",success:function(e){this.isLoading=!1,t(e)}.bind(this),error:function(e){this._handleError(t,e.status)}.bind(this)})},_handleError:function(t,e){this.attempts++,this.attempts<this.MAX_ATTEMPTS?this._makeAttempt(t):(this.isLoading=!1,t({meta:{
code:e,message:"Failed to validate API key"}}))},_clearLastTimeout:function(){void 0!==this.lastTimeout&&(clearTimeout(this.lastTimeout),this.lastTimeout=void 0)},destroy:function(){this._clearLastTimeout(),this.isLoading=!1}}),DG.Map.mergeOptions({tilesCheck:!0}),DG.Map.TilesCheck=DG.Handler.extend({initialize:function(t){this._map=t,this._layer=t.baseLayer,this._moveStartEventCounter=0,this._moveEndEventCounter=0,this._loadingEventCounter=0,this._loadEventCounter=0},addHooks:function(){this._map.on(this._mapEvents,this),this._layer.on(this._layerEvents,this)},removeHooks:function(){this._map.off(this._mapEvents,this),this._layer.off(this._layerEvents,this)},_mapEvents:{layeradd:function(t){t.layer==this._layer&&this.enable()},layerremove:function(t){t.layer==this._layer&&this.disable()},movestart:function(){this._stopWaiting(),this._moveStartEventCounter++,this._isWaiting=!0},moveend:function(){this._moveEndEventCounter++,(this._isWaiting||this._moveStartEventCounter===this._moveEndEventCounter)&&(this._isMoveEnd=!0,this._checkWaiting())}},_layerEvents:{loading:function(){this._loadingEventCounter++},load:function(){this._loadEventCounter++,(this._isWaiting||this._loadingEventCounter===this._loadEventCounter)&&(this._isLoad=!0,this._checkWaiting())}},_stopWaiting:function(){this._isWaiting=!1,this._isMoveEnd=!1,this._isLoad=!1},_checkWaiting:function(){this._isWaiting&&this._isLoad&&this._isMoveEnd&&(this._stopWaiting(),this._resetCounters(),this._checkTiles())},_checkTiles:function(){if(0===this._map.getTileLayersNumber()&&this._map._loaded){var t=this._layer._tileZoom,e=this._layer.options.errorTileUrl,o=this._layer.getTiles();for(var i in o)if(o[i].coords.z===t&&o[i].el.src!==e)return;this._map.zoomOut()}},_resetCounters:function(){this._moveStartEventCounter=0,this._moveEndEventCounter=0,this._loadingEventCounter=0,this._loadEventCounter=0}}),DG.Map.addInitHook("addHandler","tilesCheck",DG.Map.TilesCheck);var onDragEnd=DG.Map.Drag.prototype._onDragEnd;DG.Map.Drag.include({_rememberTimeAndPosition:function(){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos;for(this._positions.push(e),this._times.push(t);t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onDrag:function(t){this._map.options.inertia&&this._rememberTimeAndPosition(),this._map.fire("move",t).fire("drag",t)},_onDragEnd:function(){this._map.options.inertia&&!DG.Browser.touch&&this._rememberTimeAndPosition(),onDragEnd.call(this)}}),DG.PolyUtil.inside=function(t,e,o){o=o||DG.PolyUtil._defaultPointReduce;var i=e.coordinates,n=o(t);"Polygon"===e.type&&(i=[i]);for(var r=!1,s=0;s<i.length&&!r;){if(this._inRing(n,i[s][0],o)){for(var a=!1,u=1;u<i[s].length&&!a;)this._inRing(n,i[s][u],o)&&(a=!0),u++;a||(r=!0)}s++}return r},DG.PolyUtil._inRing=function(t,e,o){for(var i=!1,n=0,r=e.length-1;n<e.length;r=n++){var s=o(e[n]),a=o(e[r]),u=s[0],l=s[1],c=a[0],h=a[1],d=l>t[1]!=h>t[1]&&t[0]<(c-u)*(t[1]-l)/(h-l)+u;d&&(i=!i)}return i},DG.PolyUtil._defaultPointReduce=function(t){return t},DG.Browser.mobile&&!function(){var t=L.DomUtil.addClass;L.DomUtil.addClass=function(e,o){"leaflet-dragging"!==o&&"leaflet-drag-target"!==o&&t(e,o)};var e=L.DomUtil.removeClass;L.DomUtil.removeClass=function(t,o){"leaflet-dragging"!==o&&"leaflet-drag-target"!==o&&e(t,o)},L.Draggable.include({_onMove:function(t){if(!t._simulated&&this._enabled){if(t.touches&&t.touches.length>1)return void(this._moved=!0);var e=t.touches&&1===t.touches.length?t.touches[0]:t,o=new L.Point(e.clientX,e.clientY),i=o.subtract(this._startPoint);if((i.x||i.y)&&!(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance)){L.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=L.DomUtil.getPosition(this._element).subtract(i),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement));var n=this._startPos.add(i)._round();this._moving=!0,L.Util.cancelAnimFrame(this._animRequest),this._lastEvent=t,this._newPos&&this._newPos.x==n.x&&this._newPos.y==n.y||(this._newPos=n,this._animRequest=L.Util.requestAnimFrame(this._updatePosition,this,!0))}}}}),L.Map.Drag.include({_onDragEnd:function(t){var e=this._map,o=e.options,i=!o.inertia||this._times.length<2;if(e.fire("dragend",t),i)e.fire("moveend");else{var n=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,s=o.easeLinearity,a=n.multiplyBy(s/r),u=a.distanceTo([0,0]),l=Math.min(o.inertiaMaxSpeed,u),c=a.multiplyBy(l/u),h=1,d=c.multiplyBy(-h/2).round();d.x||d.y?(d=e._limitOffset(d,e.options.maxBounds),L.Util.requestAnimFrame(function(){e.panBy(d,{duration:h,easeLinearity:s,noMoveStart:!0,animate:!0})})):e.fire("moveend")}}})}(),L.MobileTileLayer=L.TileLayer.extend({initialize:function(t,e){L.TileLayer.prototype.initialize.call(this,t,e),this._appleDevice=this._isAppleDevice(),this._previewUrl=e.previewUrl},setPreviewUrl:function(t){this._previewUrl=t,this.redraw()},createTile:function(t,e,o){var i=document.createElement("img");return i.onload=L.bind(this._tileOnLoad,this,e,i),i.onerror=L.bind(this._tileOnError,this,e,i),this.options.crossOrigin&&(i.crossOrigin=""),i.alt="",i.src=this.getTileUrl(t,o),i},_initTile:function(t){t.style.position="absolute";var e=this.getTileSize();return t.style.width=e.x+"px",t.style.height=e.y+"px",t.style.visibility="hidden",t.style.pointerEvents="none",t.onselectstart=L.Util.falseFn,t.onmousemove=L.Util.falseFn,L.Browser.android&&!L.Browser.android23&&(t.style.WebkitBackfaceVisibility="hidden"),t},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var o in this._levels)this._levels[o].el.children.length||o===t?this._levels[o].el.style.zIndex=e-Math.abs(t-o):(L.DomUtil.remove(this._levels[o].el),this._removeTilesAtZoom(o),delete this._levels[o]);var i=this._levels[t],n=this._map;return i||(i=this._levels[t]={},i.el=L.DomUtil.create("div","leaflet-zoom-animated",this._container),i.el.style.zIndex=e,i.origin=n.project(n.unproject(n.getPixelOrigin()),t).round(),i.zoom=t,this._setZoomTransform(i,n.getCenter(),n.getZoom()),L.Util.falseFn(i.el.offsetWidth)),this._level=i,i}},_update:function(t){var e=this._map;if(e){var o=e.getZoom();if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var i=this._getTiledPixelBounds(t),n=this._pxBoundsToTileRange(i),r=n.getCenter(),s=[],a=this.options.keepBuffer,u=new L.Bounds(n.getBottomLeft().subtract([a,-a]),n.getTopRight().add([a,-a]));for(var l in this._tiles){var c=this._tiles[l].coords;c.z===this._tileZoom&&u.contains(L.point(c.x,c.y))||(this._tiles[l].current=!1)}if(Math.abs(o-this._tileZoom)>1)return void this._setView(t,o);for(var h=n.min.y;h<=n.max.y;h++)for(var d=n.min.x;d<=n.max.x;d++){var m=new L.Point(d,h);if(m.z=this._tileZoom,this._isValidTile(m)){var p=this._tiles[this._tileCoordsToKey(m)];p?p.current=!0:s.push(m)}}if(s.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)}),0!==s.length)for(this._loading||(this._loading=!0,this.fire("loading")),d=0;d<s.length;d++)this._addTile(s[d],this._level.el)}}},_needPreviewTile:function(t){return this._tileZoom-this._map.getZoom()>0?!this._existTileFromLowerZoom(t):!this._existTilesFromHigherZoom(t)},_existTileFromLowerZoom:function(t){var e=L.point(t.x/2,t.y/2)._floor();e.z=t.z-1;var o=this._tileCoordsToKey(e),i=this._tiles[o];return i&&!i.preview},_existTilesFromHigherZoom:function(t){for(var e=t.x,o=t.y,i=2*e;i<2*e+2;i++)for(var n=2*o;n<2*o+2;n++){var r=new L.Point(i,n);r.z=t.z+1;var s=this._tileCoordsToKey(r);if(!this._tiles[s])return!1}return!0},_isAppleDevice:function(){var t=/ip(hone|od)/i,e=/ipad/i,o=/Macintosh/i,i="undefined"!=typeof navigator?navigator.userAgent:"";if(!i)return!1;var n=t.test(i),r=e.test(i),s=navigator.maxTouchPoints>1&&o.test(i)&&i.indexOf("Safari")!==-1;return n||r||s},_addTile:function(t,e){var o=this._getTilePos(t),i=this._tileCoordsToKey(t),n=this._wrapCoords(t),r=this._needPreviewTile(n),s=r?this._previewUrl:this._url,a=this._appleDevice&&r,u=this.createTile(n,L.bind(a?this._previewReady:this._tileReady,this,t),s);this._initTile(u),L.DomUtil.setPosition(u,o),this._tiles[i]={el:u,preview:r,coords:t,current:!0},e.appendChild(u),this.fire("tileloadstart",{tile:u,coords:t})},_previewReady:function(t,e,o){if(this._map){var i=this._tileCoordsToKey(t);o=this._tiles[i],o&&(o.el.onload=L.bind(this._tileReady,this,t,e,o),o.el.onerror=L.bind(this._tileReady,this,t,e,o),o.el.src=this.getTileUrl(t,this._url))}},_tileReady:function(t,e,o){if(this._map){e&&this.fire("tileerror",{error:e,tile:o,coords:t});var i=this._tileCoordsToKey(t);o=this._tiles[i],o&&(this._appleDevice||(o.originalEl&&o.el.parentNode?(o.el.parentNode.replaceChild(o.originalEl,o.el),o.el=o.originalEl,o.originalEl=null,o.preview=!1):o.preview&&(o.originalEl=this.createTile(this._wrapCoords(t),L.bind(this._tileReady,this,t),this._url),this._initTile(o.originalEl),L.DomUtil.setPosition(o.originalEl,this._getTilePos(t)))),o.loaded=+new Date,o.active=!0,this._pruneTiles(),e||(o.el.style.visibility="",this.fire("tileload",{tile:o.el,preview:o.preview,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),L.Browser.ielt9||!this._map._fadeAnimated?L.Util.requestAnimFrame(this._pruneTiles,this):setTimeout(L.bind(this._pruneTiles,this),250)))}},getTileUrl:function(t,e){var o={r:L.Browser.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(o.y=i),o["-y"]=i}return L.Util.template(e,L.extend(o,this.options))}}),DG.Screenfull=DG.Class.extend({_apiMap:[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],initialize:function(){this.api=this._api()},request:function(t){var e=this.api.requestFullscreen;t=t||document.documentElement,t[e](Element.ALLOW_KEYBOARD_INPUT)},exit:function(){document[this.api.exitFullscreen]()},isFullscreen:function(){return!!document[this.api.fullscreenElement]},isAvailable:function(){return Boolean(this.api)},_api:function(){var t={},e=this._apiMap;return e.forEach(function(o){o&&o[1]in document&&o.forEach(function(o,i){t[e[0][i]]=o})}),!!t.requestFullscreen&&t}}),DG.screenfull=new DG.Screenfull,DG.Control.Fullscreen=DG.RoundControl.extend({statics:{Dictionary:{}},options:{position:"topright",iconClass:"fullscreen"},initialize:function(t){DG.Util.setOptions(this,t),this._isFullscreen=!1,this.on("click",this._toggleFullscreen)},_toggleFullscreen:function(){this._isFullscreen?this._toggle(!1,"exit","on","cancelfullscreen"):this._toggle(!0,"request","on","requestfullscreen"),this._renderTranslation(),this._map.invalidateSize()},_renderTranslation:function(){this._link.title=this.t(this._isFullscreen?"title_min":"title_max")},_toggle:function(t,e,o,i){var n=this._map._container;this._isFullscreen=t,this.setState(t?"active":""),DG.screenfull[e](n),DG.DomEvent[o](document,DG.screenfull.api.fullscreenchange,this._onFullScreenStateChange,this),this._map.fire(i)},_onFullScreenStateChange:function(){DG.screenfull.isFullscreen()||this._toggle(!1,"exit","on","cancelfullscreen")}}),DG.control.fullscreen=function(t){return new DG.Control.Fullscreen(t)},DG.Map.mergeOptions({fullscreenControl:!0}),DG.Map.addInitHook(function(){this.options.fullscreenControl&&(this.fullscreenControl=DG.control.fullscreen(this.options.fullscreenControl),DG.screenfull.isAvailable()&&this.addControl(this.fullscreenControl))}),DG.Control.Fullscreen.Dictionary.ru={title_max:"Развернуть",title_min:"Восстановить"},DG.Control.Fullscreen.Dictionary.it={title_max:"Espandi",title_min:"Ripristina"},DG.Control.Fullscreen.Dictionary.cs={title_max:"Rozbalit",title_min:"Obnovit"},DG.Control.Fullscreen.Dictionary.en={title_max:"Expand",title_min:"Restore"},DG.Control.Fullscreen.Dictionary.es={title_max:"Maximizar",title_min:"Restaurar"},DG.Control.Fullscreen.Dictionary.ar={title_max:"",title_min:""};var dust=_dereq_("dustjs-linkedin");_dereq_("dustjs-helpers"),DG.dust=function(t,e){var o;return dust.render(t,e,function(t,e){o=e}),o},DG.Control.Attribution.include(DG.Locale),DG.Control.Attribution.Dictionary={},DG.Control.Attribution.include({options:{position:"bottomright"},_getLink:function(t){var e={ru:{copyright_logo:"https://2gis.ru/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_apilink:"https://dev.2gis.ru/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_license:"https://law.2gis.ru/api-rules/",open_link:"https://2gis.ru"},kz:{copyright_logo:"https://2gis.kz/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_apilink:"https://dev.2gis.kz/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_license:"https://law.2gis.kz/api-rules/",open_link:"https://2gis.kz"},it:{copyright_logo:"https://2gis.it/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_apilink:"https://dev.2gis.com/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_license:"https://law.2gis.it/licensing-agreement/",open_link:"https://2gis.ru"},cz:{copyright_logo:"https://praha.2gis.cz/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_apilink:"https://dev.2gis.com/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_license:"https://law.2gis.cz/api-rules/",open_link:"https://2gis.ru"},cl:{copyright_logo:"https://santiago.2gis.cl/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_apilink:"https://dev.2gis.com/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_license:"https://law.2gis.cl/api-rules/",open_link:"https://2gis.ru"},cy:{copyright_logo:"https://info.2gis.com.cy/lemesos?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_apilink:"https://dev.2gis.com/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_license:"https://law.2gis.com.cy/api-rules/",open_link:"https://2gis.ru"},ae:{copyright_logo:"https://2gis.ae/dubai?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_apilink:"http://dev.2gis.com/?utm_source=copyright&utm_medium=map&utm_campaign=partners",copyright_license:"https://law.2gis.ae/api-rules/",open_link:"https://2gis.ae"}},o=this._countryCode in e?this._countryCode:"ru";return e[o][t]},_markerToRoute:void 0,_markers:[],_checkMarkerLayers:function(){this._markerToRoute=1!=this._markers.length?void 0:this._markers[0],this._update()},_mapEvents:{layeradd:function(t){t.layer instanceof DG.Marker&&(this._markers.push(t.layer),this._markers.length<=2&&this._checkMarkerLayers())},layerremove:function(t){if(t.layer instanceof DG.Marker){for(var e=[],o=0;o<this._markers.length;o++)this._markers[o]!==t.layer&&e.push(this._markers[o]);this._markers=e,this._markers.length<=1&&this._checkMarkerLayers()}}},onAdd:function(t){t._copyright||(t._copyright=!0,this._first=!0),this._isDefaultKey=!t.options.key,this._logotype=t.options.logotype,this._open2gis=this._getLink("open_link"),this._map.on(this._mapEvents,this),t.attributionControl=this,this._container=DG.DomUtil.create("div","dg-attribution"),DG.DomEvent.disableClickPropagation(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),DG.DomEvent.on(this._container,"touchstart",this._updateLink,this),this._container},_updateLink:function(t){"linkButton"===t.target.name&&(this._open2gis=this._getOpenUrl(),t.target.href=this._open2gis)},_update:function(t,e){if(this._map){"undefined"!=typeof e&&(this._countryCode=e);var o=[];for(var i in this._attributions)this._attributions[i]&&o.push(i);var n=[],r="";this._first&&(r=this._getAttributionHTML(t)),this.options.prefix&&n.push(this.options.prefix),o.length&&n.push(o.join(", ")),this._container.innerHTML=r+n.join(" | ")}},_getOpenUrl:function(){return this._markerToRoute?DG.Util.template(DG.config.ppLink2gis,{gislink:this._getLink("open_link"),center:this._map.getCenter().lng+","+this._map.getCenter().lat,zoom:this._map.getZoom(),rsType:this._map.getZoom()>11?"bus":"car",point:this._markerToRoute._latlng.lng+","+this._markerToRoute._latlng.lat}):DG.Util.template(DG.config.openLink2gis,{gislink:this._getLink("open_link"),center:this._map.getCenter().lng+","+this._map.getCenter().lat,zoom:this._map.getZoom()})},_getData:function(t){t=t||this._map.getLang();var e={name:"open",label:this._markerToRoute?this.t("route_on"):this.t("open_on")},o="open_on"==e.label||"route_on"==e.label||this._logotype;return{logotype:o,work_on:this.t("work_on"),has_no_key:this._isDefaultKey?this.t("has_no_key"):null,lang:t,copyright_apilink:this._getLink("copyright_apilink"),copyright_license:this._getLink("copyright_license"),copyright_logo:this._getLink("copyright_logo"),open2gis_link:this._open2gis,open2gis_name:"linkButton",license_agreement:this.t("license_agreement"),dir:"ar"!==t?"ltr":"rtl",btn:e}},_getAttributionHTML:function(t){return DG.dust("DGAttribution/copyright",this._getData(t))},_renderTranslation:function(t){this._update(t.lang)}}),DG.Map.addInitHook(function(){this._copyright||DG.control.attribution().addTo(this)}),DG.Control.Attribution.Dictionary.ru={license_agreement:"Лицензионное соглашение",work_on:"Работает на API 2ГИС",has_no_key:"Для корректной работы Raster JS API нужен ключ. Помощь: api@2gis.ru",open_on:"Открыть в 2ГИС",route_on:"Доехать с 2ГИС"},DG.Control.Attribution.Dictionary.it