2gis-maps
Advanced tools
Comparing version 3.6.1 to 3.6.3
@@ -6,3 +6,3 @@ (function() { | ||
var rejects = []; | ||
var version = 'v3.6.1'; | ||
var version = 'v3.6.3'; | ||
var baseURL = '__BASE_URL__'; | ||
@@ -9,0 +9,0 @@ var query = __QUERY__; |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";function e(){var e={skin:f.skin,pkg:f.pkg,version:l};/MSIE\x20(\d+\.\d+);/.test(navigator.userAgent)&&parseInt(RegExp.$1,10)<9&&(e.ie8=!0);var t=[];for(var n in e){var o=e[n];o&&t.push(n+"="+o)}return t.length?"?"+t.join("&"):""}function t(){s=!0;var e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("src",m+"/js/"+v),e.onerror=function(e){d(e)},document.getElementsByTagName("head")[0].appendChild(e)}function n(){return new Promise(function(e,t){function n(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",n,!1),window.removeEventListener("load",n,!1)):(document.detachEvent("onreadystatechange",n),window.detachEvent("onload",n)),i||(i=!0,e())}function o(){if(!i){try{document.documentElement.doScroll("left")}catch(e){return void setTimeout(o,50)}n()}}var i=!1;if("loading"!==document.readyState)return n();if(document.addEventListener)document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",n),window.attachEvent("onload",n);var r=!1;try{r=null==window.frameElement}catch(a){}document.documentElement.doScroll&&r&&o()}})}function o(){var e=m+"/css/"+v,t=document.createElement("style");return t.type="text/css",new Promise(function(n,o){DG.ajax(e,{type:"get",dataType:"html",success:function(e){var o=document.getElementsByTagName("head")[0],i="https://maps.api.2gis.ru/2.0";m!==i&&(e=e.replace(new RegExp(i,"g"),m)),t.styleSheet?(o.appendChild(t),t.styleSheet.cssText=e):(t.appendChild(document.createTextNode(e)),o.appendChild(t)),n()},error:function(){o()}})})}function i(){var e=DG.config.protocol+DG.config.webApiServer+"/"+DG.config.webApiVersion+"/region/list";return new Promise(function(t){DG.ajax(e,{type:DG.ajax.corsSupport?"get":"jsonp",data:{format:DG.ajax.corsSupport?"json":"jsonp",key:DG.config.webApiKey,fields:DG.config.regionListFields},timeout:DG.config.loadProjectListTimeout,success:function(e){var n=e.result;n&&n.items&&n.items.length&&(DG.projectsList=n.items),t()},error:function(e){t()}})})}function r(){DG.extend(DG.config,__LOCAL_CONFIG__),DG.customConfig&&DG.extend(DG.config,DG.customConfig)}function a(){return Promise.all([o(),i(),n()])}function c(){DG.ready=!0}function d(){for(var e=0,t=u.length;e<t;e++)"function"==typeof u[e]&&u[e]()}var s=!1,u=[],l="v3.6.1",m="__BASE_URL__",f=__QUERY__,p="true"===f.lazy,v=e();window.DG=window.DG||{},window.DG.ready=!1,window.__dgApi__={callbacks:[[r,void 0],[a,void 0],[c,void 0]],version:l};var g=window.DG.then=function(e,n){return DG.then!==g?DG.then(e,n):(window.__dgApi__.callbacks.push([e,n]),p&&!s&&t(),n&&u.push(n),this)};p||t()}(); | ||
!function(){"use strict";function e(){var e={skin:f.skin,pkg:f.pkg,version:l};/MSIE\x20(\d+\.\d+);/.test(navigator.userAgent)&&parseInt(RegExp.$1,10)<9&&(e.ie8=!0);var t=[];for(var n in e){var o=e[n];o&&t.push(n+"="+o)}return t.length?"?"+t.join("&"):""}function t(){s=!0;var e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("src",m+"/js/"+v),e.onerror=function(e){d(e)},document.getElementsByTagName("head")[0].appendChild(e)}function n(){return new Promise(function(e,t){function n(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",n,!1),window.removeEventListener("load",n,!1)):(document.detachEvent("onreadystatechange",n),window.detachEvent("onload",n)),i||(i=!0,e())}function o(){if(!i){try{document.documentElement.doScroll("left")}catch(e){return void setTimeout(o,50)}n()}}var i=!1;if("loading"!==document.readyState)return n();if(document.addEventListener)document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",n),window.attachEvent("onload",n);var r=!1;try{r=null==window.frameElement}catch(a){}document.documentElement.doScroll&&r&&o()}})}function o(){var e=m+"/css/"+v,t=document.createElement("style");return t.type="text/css",new Promise(function(n,o){DG.ajax(e,{type:"get",dataType:"html",success:function(e){var o=document.getElementsByTagName("head")[0],i="https://maps.api.2gis.ru/2.0";m!==i&&(e=e.replace(new RegExp(i,"g"),m)),t.styleSheet?(o.appendChild(t),t.styleSheet.cssText=e):(t.appendChild(document.createTextNode(e)),o.appendChild(t)),n()},error:function(){o()}})})}function i(){var e=DG.config.protocol+DG.config.webApiServer+"/"+DG.config.webApiVersion+"/region/list";return new Promise(function(t){DG.ajax(e,{type:DG.ajax.corsSupport?"get":"jsonp",data:{format:DG.ajax.corsSupport?"json":"jsonp",key:DG.config.webApiKey,fields:DG.config.regionListFields},timeout:DG.config.loadProjectListTimeout,success:function(e){var n=e.result;n&&n.items&&n.items.length&&(DG.projectsList=n.items),t()},error:function(e){t()}})})}function r(){DG.extend(DG.config,__LOCAL_CONFIG__),DG.customConfig&&DG.extend(DG.config,DG.customConfig)}function a(){return Promise.all([o(),i(),n()])}function c(){DG.ready=!0}function d(){for(var e=0,t=u.length;e<t;e++)"function"==typeof u[e]&&u[e]()}var s=!1,u=[],l="v3.6.3",m="__BASE_URL__",f=__QUERY__,p="true"===f.lazy,v=e();window.DG=window.DG||{},window.DG.ready=!1,window.__dgApi__={callbacks:[[r,void 0],[a,void 0],[c,void 0]],version:l};var g=window.DG.then=function(e,n){return DG.then!==g?DG.then(e,n):(window.__dgApi__.callbacks.push([e,n]),p&&!s&&t(),n&&u.push(n),this)};p||t()}(); |
{ | ||
"name": "2gis-maps", | ||
"version": "3.6.1", | ||
"version": "3.6.3", | ||
"description": "Interactive 2GIS maps API, based on Leaflet", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN FILE", |
@@ -371,3 +371,3 @@ /** | ||
var url = needPreview ? this._previewUrl : this._url; | ||
var tile = this.createTile(wrapCoords, L.bind(this._tileReady, this, coords), url); | ||
var tile = this.createTile(wrapCoords, L.bind(needPreview ? this._previewReady : this._tileReady, this, coords), url); | ||
@@ -395,2 +395,17 @@ this._initTile(tile); | ||
_previewReady: function(coords, err, tile) { | ||
if (!this._map) { return; } | ||
var key = this._tileCoordsToKey(coords); | ||
tile = this._tiles[key]; | ||
if (!tile) { return; } | ||
tile.el.onload = L.bind(this._tileReady, this, coords, err, tile); | ||
tile.el.onerror = L.bind(this._tileReady, this, coords, err, tile); | ||
tile.el.src = this.getTileUrl(coords, this._url); | ||
}, | ||
/** | ||
@@ -417,19 +432,2 @@ * Убран fadeAnimated и класс leaflet-tile-loaded | ||
// Если у тайла уже есть оригинальная (не пожатая) картинка, | ||
// то заменим превью на нее | ||
if (tile.originalEl && tile.el.parentNode) { | ||
tile.el.parentNode.replaceChild(tile.originalEl, tile.el); | ||
tile.el = tile.originalEl; | ||
tile.originalEl = null; | ||
tile.preview = false; | ||
// Если у тайла есть только превью, то добавим его на карту | ||
// И начнем грузить оригинальный | ||
} else if (tile.preview) { | ||
tile.originalEl = this.createTile(this._wrapCoords(coords), L.bind(this._tileReady, this, coords), this._url); | ||
this._initTile(tile.originalEl); | ||
L.DomUtil.setPosition(tile.originalEl, this._getTilePos(coords)); | ||
} | ||
tile.loaded = +new Date(); | ||
@@ -436,0 +434,0 @@ tile.active = true; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
10603574
79460
11