Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@2gis/markerdrawer

Package Overview
Dependencies
Maintainers
5
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@2gis/markerdrawer - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

dist/markerdrawer.js

@@ -1,2 +0,2 @@

!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.MarkerDrawer=i():t.MarkerDrawer=i()}(this,function(){return function(t){function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}var e={};return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},i.p="/dist/",i(i.s=7)}([function(t,i,e){"use strict";var r=e(2);e.n(r);e.d(i,"a",function(){return n});var n=function(){function t(t){var i=this;this.sprites=[],this._promise=Promise.all(t.map(function(t){return i._imageLoad(t.image)})).then(function(){return i._createSprite(t)})}return t.prototype.whenReady=function(){return this._promise},t.prototype._imageLoad=function(t){return t.complete?Promise.resolve():new Promise(function(i){t.addEventListener("load",i)})},t.prototype._createSprite=function(t){var i=t.map(function(t){var i=[t.image.width,t.image.height],e=t.size||i;return{width:e[0]+4,height:e[1]+4,image:t.image,anchor:t.anchor||[.5,.5],size:e,imageSize:i,pixelDensity:t.pixelDensity||1}}),e=r(i,{inPlace:!0});this.size=[e.width,e.height],this.sprites=i.map(function(t){return{position:[t.x+2,t.y+2],size:t.size,anchor:t.anchor,pixelDensity:t.pixelDensity}});var n=this.image=document.createElement("canvas"),a=n.getContext("2d");a&&(n.width=e.width,n.height=e.height,a.shadowColor="transparent",a.shadowBlur=0,i.forEach(function(t){a.drawImage(t.image,0,0,t.imageSize[0],t.imageSize[1],t.x+2,t.y+2,t.size[0],t.size[1])}))},t}()},function(t,i,e){"use strict";var r=e(6);e.d(i,"a",function(){return a});var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])};return function(i,e){function r(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),a=function(t){function i(i,e){void 0===e&&(e={});var n=t.call(this)||this;return n._onClick=function(t){var i=n._getMousePosition(t),e=n._renderer.search(i);e.length&&(t.stopPropagation(),n.fire("click",{markers:e}))},n._atlas=i,n._markers=[],n._renderer=new r.a(n._atlas,e.debugDrawing||!1,void 0!==e.bufferFactor?e.bufferFactor:.5),n}return n(i,t),i.prototype.setMarkers=function(t){this._markers=t,this._renderer.setMarkers(t)},i.prototype.update=function(){this._renderer.update()},i.prototype.addTo=function(t){return t.addLayer(this),this},i.prototype.onAdd=function(){var t=this;return this._map?(this._pane=this._map.getPane("overlayPane"),this._renderer.onAddToMap(this._map),this._renderer.container.addEventListener("click",this._onClick),this._pane.appendChild(this._renderer.container),this._atlas.whenReady().then(function(){t._renderer.update()}),this):this},i.prototype.remove=function(){return this._map&&this._map.removeLayer(this),this},i.prototype.onRemove=function(){return this._pane.removeChild(this._renderer.container),this._renderer.onRemoveFromMap(),this._renderer.container.removeEventListener("click",this._onClick),this},i.prototype.setDebugDrawing=function(t){this._renderer.setDebugDrawing(t)},i.prototype._getMousePosition=function(t){var i=this._map,e=i.getContainer(),r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]},i}(L.Layer)},function(t,i,e){"use strict";var r=e(3);t.exports=function(t,i){i=i||{};var e=new r,n=i.inPlace||!1,a=t.map(function(t){return n?t:{width:t.width,height:t.height,item:t}});a=a.sort(function(t,i){return i.width*i.height-t.width*t.height}),e.fit(a);var o=a.reduce(function(t,i){return Math.max(t,i.x+i.width)},0),h=a.reduce(function(t,i){return Math.max(t,i.y+i.height)},0),s={width:o,height:h};return n||(s.items=a),s}},function(t,i){var e=function(){};e.prototype={fit:function(t){var i,e,r,n,a=t.length,o=a>0?t[0].width:0,h=a>0?t[0].height:0;for(this.root={x:0,y:0,width:o,height:h},i=0;i<a;i++)r=t[i],(e=this.findNode(this.root,r.width,r.height))?(n=this.splitNode(e,r.width,r.height),r.x=n.x,r.y=n.y):(n=this.growNode(r.width,r.height),r.x=n.x,r.y=n.y)},findNode:function(t,i,e){return t.used?this.findNode(t.right,i,e)||this.findNode(t.down,i,e):i<=t.width&&e<=t.height?t:null},splitNode:function(t,i,e){return t.used=!0,t.down={x:t.x,y:t.y+e,width:t.width,height:t.height-e},t.right={x:t.x+i,y:t.y,width:t.width-i,height:e},t},growNode:function(t,i){var e=t<=this.root.width,r=i<=this.root.height,n=r&&this.root.height>=this.root.width+t,a=e&&this.root.width>=this.root.height+i;return n?this.growRight(t,i):a?this.growDown(t,i):r?this.growRight(t,i):e?this.growDown(t,i):null},growRight:function(t,i){this.root={used:!0,x:0,y:0,width:this.root.width+t,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:t,height:this.root.height}};var e;return(e=this.findNode(this.root,t,i))?this.splitNode(e,t,i):null},growDown:function(t,i){this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+i,down:{x:0,y:this.root.height,width:this.root.width,height:i},right:this.root};var e;return(e=this.findNode(this.root,t,i))?this.splitNode(e,t,i):null}},t.exports=e},function(t,i,e){"use strict";function r(t,i,e,o,h){for(e=e||0,o=o||t.length-1,h=h||a;o>e;){if(o-e>600){var s=o-e+1,u=i-e+1,c=Math.log(s),d=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*d*(s-d)/s)*(u-s/2<0?-1:1);r(t,i,Math.max(e,Math.floor(i-u*d/s+f)),Math.min(o,Math.floor(i+(s-u)*d/s+f)),h)}var m=t[i],l=e,p=o;for(n(t,e,i),h(t[o],m)>0&&n(t,e,o);l<p;){for(n(t,l,p),l++,p--;h(t[l],m)<0;)l++;for(;h(t[p],m)>0;)p--}0===h(t[e],m)?n(t,e,p):(p++,n(t,p,o)),p<=i&&(e=p+1),i<=p&&(o=p-1)}}function n(t,i,e){var r=t[i];t[i]=t[e],t[e]=r}function a(t,i){return t<i?-1:t>i?1:0}t.exports=r},function(t,i,e){"use strict";function r(t,i){if(!(this instanceof r))return new r(t,i);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),i&&this._initFormat(i),this.clear()}function n(t,i,e){if(!e)return i.indexOf(t);for(var r=0;r<i.length;r++)if(e(t,i[r]))return r;return-1}function a(t,i){o(t,0,t.children.length,i,t)}function o(t,i,e,r,n){n||(n=_(null)),n.minX=1/0,n.minY=1/0,n.maxX=-(1/0),n.maxY=-(1/0);for(var a,o=i;o<e;o++)a=t.children[o],h(n,t.leaf?r(a):a);return n}function h(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function s(t,i){return t.minX-i.minX}function u(t,i){return t.minY-i.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,i){return(Math.max(i.maxX,t.maxX)-Math.min(i.minX,t.minX))*(Math.max(i.maxY,t.maxY)-Math.min(i.minY,t.minY))}function m(t,i){var e=Math.max(t.minX,i.minX),r=Math.max(t.minY,i.minY),n=Math.min(t.maxX,i.maxX),a=Math.min(t.maxY,i.maxY);return Math.max(0,n-e)*Math.max(0,a-r)}function l(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function p(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function _(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}}function g(t,i,e,r,n){for(var a,o=[i,e];o.length;)e=o.pop(),i=o.pop(),e-i<=r||(a=i+Math.ceil((e-i)/r/2)*r,x(t,a,i,e,n),o.push(i,a,a,e))}t.exports=r;var x=e(4);r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,e=[],r=this.toBBox;if(!p(t,i))return e;for(var n,a,o,h,s=[];i;){for(n=0,a=i.children.length;n<a;n++)o=i.children[n],h=i.leaf?r(o):o,p(t,h)&&(i.leaf?e.push(o):l(t,h)?this._all(o,e):s.push(o));i=s.pop()}return e},collides:function(t){var i=this.data,e=this.toBBox;if(!p(t,i))return!1;for(var r,n,a,o,h=[];i;){for(r=0,n=i.children.length;r<n;r++)if(a=i.children[r],o=i.leaf?e(a):a,p(t,o)){if(i.leaf||l(t,o))return!0;h.push(a)}i=h.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0,e=t.length;i<e;i++)this.insert(t[i]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=_([]),this},remove:function(t,i){if(!t)return this;for(var e,r,a,o,h=this.data,s=this.toBBox(t),u=[],c=[];h||u.length;){if(h||(h=u.pop(),r=u[u.length-1],e=c.pop(),o=!0),h.leaf&&(a=n(t,h.children,i))!==-1)return h.children.splice(a,1),u.push(h),this._condense(u),this;o||h.leaf||!l(h,s)?r?(e++,h=r.children[e],o=!1):h=null:(u.push(h),c.push(e),e=0,r=h,h=h.children[0])}return this},toBBox:function(t){return t},compareMinX:s,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,i){for(var e=[];t;)t.leaf?i.push.apply(i,t.children):e.push.apply(e,t.children),t=e.pop();return i},_build:function(t,i,e,r){var n,o=e-i+1,h=this._maxEntries;if(o<=h)return n=_(t.slice(i,e+1)),a(n,this.toBBox),n;r||(r=Math.ceil(Math.log(o)/Math.log(h)),h=Math.ceil(o/Math.pow(h,r-1))),n=_([]),n.leaf=!1,n.height=r;var s,u,c,d,f=Math.ceil(o/h),m=f*Math.ceil(Math.sqrt(h));for(g(t,i,e,m,this.compareMinX),s=i;s<=e;s+=m)for(c=Math.min(s+m-1,e),g(t,s,c,f,this.compareMinY),u=s;u<=c;u+=f)d=Math.min(u+f-1,c),n.children.push(this._build(t,u,d,r-1));return a(n,this.toBBox),n},_chooseSubtree:function(t,i,e,r){for(var n,a,o,h,s,u,d,m;;){if(r.push(i),i.leaf||r.length-1===e)break;for(d=m=1/0,n=0,a=i.children.length;n<a;n++)o=i.children[n],s=c(o),u=f(t,o)-s,u<m?(m=u,d=s<d?s:d,h=o):u===m&&s<d&&(d=s,h=o);i=h||i.children[0]}return i},_insert:function(t,i,e){var r=this.toBBox,n=e?t:r(t),a=[],o=this._chooseSubtree(n,this.data,i,a);for(o.children.push(t),h(o,n);i>=0&&a[i].children.length>this._maxEntries;)this._split(a,i),i--;this._adjustParentBBoxes(n,a,i)},_split:function(t,i){var e=t[i],r=e.children.length,n=this._minEntries;this._chooseSplitAxis(e,n,r);var o=this._chooseSplitIndex(e,n,r),h=_(e.children.splice(o,e.children.length-o));h.height=e.height,h.leaf=e.leaf,a(e,this.toBBox),a(h,this.toBBox),i?t[i-1].children.push(h):this._splitRoot(e,h)},_splitRoot:function(t,i){this.data=_([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,e){var r,n,a,h,s,u,d,f;for(u=d=1/0,r=i;r<=e-i;r++)n=o(t,0,r,this.toBBox),a=o(t,r,e,this.toBBox),h=m(n,a),s=c(n)+c(a),h<u?(u=h,f=r,d=s<d?s:d):h===u&&s<d&&(d=s,f=r);return f},_chooseSplitAxis:function(t,i,e){var r=t.leaf?this.compareMinX:s,n=t.leaf?this.compareMinY:u;this._allDistMargin(t,i,e,r)<this._allDistMargin(t,i,e,n)&&t.children.sort(r)},_allDistMargin:function(t,i,e,r){t.children.sort(r);var n,a,s=this.toBBox,u=o(t,0,i,s),c=o(t,e-i,e,s),f=d(u)+d(c);for(n=i;n<e-i;n++)a=t.children[n],h(u,t.leaf?s(a):a),f+=d(u);for(n=e-i-1;n>=i;n--)a=t.children[n],h(c,t.leaf?s(a):a),f+=d(c);return f},_adjustParentBBoxes:function(t,i,e){for(var r=e;r>=0;r--)h(i[r],t)},_condense:function(t){for(var i,e=t.length-1;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():a(t[e],this.toBBox)},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0])),this.compareMinY=new Function("a","b",i.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},function(t,i,e){"use strict";var r=e(5),n=(e.n(r),e(8));e.d(i,"a",function(){return a});var a=function(){function t(t,i,r){var a=this;this.update=function(){if(a._map){if(a._isRendering||a._isZooming)return void(a._needUpdate=!0);a._zoom=a._map.getZoom();var t=a._map.getCenter();e.i(n.a)(a._origin,[t.lng,t.lat],a._zoom),a._origin[0]-=a._mapSize[0]/2,a._origin[1]-=a._mapSize[1]/2;var i=a._map.containerPointToLayerPoint([-a._bufferOffset[0],-a._bufferOffset[1]]).round();L.DomUtil.setPosition(a._hiddenFrame.canvas,i),a._render()}},this._onResize=function(){if(a._map){var t=a._map.getSize();a._pixelRatio=window.devicePixelRatio,a._bufferOffset=[Math.round(t.x*a._bufferFactor),Math.round(t.y*a._bufferFactor)];var i=a._size=[t.x+2*a._bufferOffset[0],t.y+2*a._bufferOffset[1]];a._mapSize=[t.x,t.y],a._currentFrame.canvas.width=i[0]*a._pixelRatio,a._currentFrame.canvas.height=i[1]*a._pixelRatio,a._currentFrame.canvas.style.width=i[0]+"px",a._currentFrame.canvas.style.height=i[1]+"px",a._hiddenFrame.canvas.width=i[0]*a._pixelRatio,a._hiddenFrame.canvas.height=i[1]*a._pixelRatio,a._hiddenFrame.canvas.style.width=i[0]+"px",a._hiddenFrame.canvas.style.height=i[1]+"px"}},this._onZoomStart=function(){a.clear(),a._isZooming=!0},this._onMoveEnd=function(){a._isZooming=!1,a.update()},this._renderLoop=function(){var t=a._lastRenderedMarker,i=Math.min(t+a._markersPerFrame,a._markers.length);if(t===i)return void a._renderFinish();var r=e.i(n.b)();a._renderPart(t,i),a._lastRenderedMarker=i;var o=e.i(n.b)()-r,h=o/(i-t);0!==h&&(a._markersPerFrame=Math.max(Math.floor((a._markersPerFrame+a._timePerFrame/h)/2),100)),i!==a._markers.length?a._requestAnimationFrameId=requestAnimationFrame(a._renderLoop):a._renderFinish()},this._atlas=t,this._markers=[],this._markersData=[],this._isZooming=!1,this._debugDrawing=i,this._bufferFactor=r,this._markersPerFrame=5e3,this._timePerFrame=10,this._origin=e.i(n.c)(),this._vec=e.i(n.c)(),this._lastRenderedMarker=0,this._needUpdate=!1,this.container=document.createElement("div"),this._currentFrame=this._createFrame(),this._hiddenFrame=this._createFrame()}return t.prototype.setMarkers=function(t){if(this._needUpdate=!1,this._isRendering&&(cancelAnimationFrame(this._requestAnimationFrameId),this._isRendering=!1),t.length>this._markersData.length){for(var i=[],e=0;e<t.length;e++)i[e]={index:e};this._markersData=i}this._markers=t,this.update()},t.prototype.onAddToMap=function(t){this._map=t,t.on({viewreset:this.update,moveend:this._onMoveEnd,zoomstart:this._onZoomStart,resize:this._onResize}),this._onResize()},t.prototype.onRemoveFromMap=function(){this._map&&(this._map.off({viewreset:this.update,moveend:this._onMoveEnd,zoomstart:this._onZoomStart,resize:this._onResize}),this._map=void 0,this._markersData=[],this._markers=[])},t.prototype.clear=function(){this._map&&(this._currentFrame.ctx.clearRect(0,0,this._size[0]*this._pixelRatio,this._size[1]*this._pixelRatio),this._currentFrame.tree.clear(),this._needUpdate=!1,this._isRendering&&(cancelAnimationFrame(this._requestAnimationFrameId),this._isRendering=!1))},t.prototype.search=function(t){var i=(t[0]+this._bufferOffset[0])*this._pixelRatio,e=(t[1]+this._bufferOffset[1])*this._pixelRatio;return this._currentFrame.tree.search({minX:i,minY:e,maxX:i,maxY:e}).map(function(t){return t.index})},t.prototype.setDebugDrawing=function(t){this._debugDrawing=t},t.prototype._render=function(){this._map&&(this._hiddenFrame.tree.clear(),this._hiddenFrame.ctx.clearRect(0,0,this._size[0]*this._pixelRatio,this._size[1]*this._pixelRatio),this._isRendering=!0,this._lastRenderedMarker=0,this._renderLoop())},t.prototype._renderFinish=function(){this._isRendering=!1,this._switchFrames(),this._needUpdate&&(this._needUpdate=!1,this.update())},t.prototype._renderPart=function(t,i){var r=this._markers,a=this._markersData,o=this._atlas,h=this._debugDrawing,s=this._pixelRatio,u=this._size,c=this._hiddenFrame.ctx,d=this._vec,f=this._zoom,m=this._origin,l=this._bufferOffset;if(o.image){this._lastRenderedMarker=i;for(var p=[],_=t;_<i;_++){var g=r[_],x=a[_],v=o.sprites[g.iconIndex||0];if(v){var w=s/v.pixelDensity;e.i(n.a)(d,g.position,f),d[0]=Math.round(d[0]),d[1]=Math.round(d[1]),d[0]=Math.round(d[0]-m[0])+l[0],d[1]=Math.round(d[1]-m[1])+l[1],d[0]=Math.round(d[0]*s-v.size[0]*w*v.anchor[0]),d[1]=Math.round(d[1]*s-v.size[1]*w*v.anchor[1]),d[0]<0||d[0]+v.size[0]*w>u[0]*s||d[1]<0||d[1]+v.size[1]*w>u[1]*s||(x.minX=d[0],x.minY=d[1],x.maxX=d[0]+v.size[0]*w,x.maxY=d[1]+v.size[1]*w,p.push(x),c.drawImage(o.image,v.position[0],v.position[1],v.size[0],v.size[1],d[0],d[1],v.size[0]*w,v.size[1]*w),h&&this._debugDraw(g,d,v.size))}}this._hiddenFrame.tree.load(p)}},t.prototype._debugDraw=function(t,i,e){var r=this._hiddenFrame.ctx,n=["#000000","#ff0000","#00ff00","#0000ff"],a=t.drawingOffsets;if(a)for(var o=0;o<a.length;o++){var h=a[o];r.beginPath(),r.strokeStyle=n[o],r.rect(i[0]-h,i[1]-h,e[0]+2*h,e[1]+2*h),r.stroke()}},t.prototype._createFrame=function(){var t=document.createElement("canvas");t.style.display="none",t.style.position="initial";var i=t.getContext("2d"),e=r();return this.container.appendChild(t),{canvas:t,ctx:i,tree:e}},t.prototype._switchFrames=function(){if(this._map){this._currentFrame.canvas.style.display="none",this._hiddenFrame.canvas.style.display="block";var t=this._currentFrame;this._currentFrame=this._hiddenFrame,this._hiddenFrame=t}},t}()},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e(1);e.d(i,"MarkerDrawer",function(){return r.a});var n=e(0);e.d(i,"Atlas",function(){return n.a})},function(t,i,e){"use strict";function r(){return new Float64Array(2)}function n(t,i,e){o(t,i),a(t,t,e)}function a(t,i,e){var r=256*Math.pow(2,e),n=.5/(Math.PI*h);t[0]=r*(n*i[0]+.5),t[1]=r*(-n*i[1]+.5)}function o(t,i){var e=Math.PI/180,r=Math.max(Math.min(s,i[1]),-s),n=Math.sin(r*e);t[0]=h*i[0]*e,t[1]=h*Math.log((1+n)/(1-n))/2}i.c=r,i.a=n,e.d(i,"b",function(){return u});var h=6378137,s=85.0511287798,u=window.performance?performance.now.bind(performance):Date.now.bind(Date)}])});
!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.MarkerDrawer=i():t.MarkerDrawer=i()}(this,function(){return function(t){function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}var e={};return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},i.p="/dist/",i(i.s=7)}([function(t,i,e){"use strict";var r=e(2);e.n(r);e.d(i,"a",function(){return n});var n=function(){function t(t){var i=this;this.sprites=[],this._promise=Promise.all(t.map(function(t){return i._imageLoad(t.image)})).then(function(){return i._createSprite(t)})}return t.prototype.whenReady=function(){return this._promise},t.prototype._imageLoad=function(t){return t.complete?Promise.resolve():new Promise(function(i){t.addEventListener("load",i)})},t.prototype._createSprite=function(t){var i=t.map(function(t){var i=[t.image.width,t.image.height],e=t.size||i;return{width:e[0]+4,height:e[1]+4,image:t.image,anchor:t.anchor||[.5,.5],size:e,imageSize:i,pixelDensity:t.pixelDensity||1}}),e=r(i,{inPlace:!0});this.size=[e.width,e.height],this.sprites=i.map(function(t){return{position:[t.x+2,t.y+2],size:t.size,anchor:t.anchor,pixelDensity:t.pixelDensity}});var n=this.image=document.createElement("canvas"),a=n.getContext("2d");a&&(n.width=e.width,n.height=e.height,a.shadowColor="transparent",a.shadowBlur=0,i.forEach(function(t){a.drawImage(t.image,0,0,t.imageSize[0],t.imageSize[1],t.x+2,t.y+2,t.size[0],t.size[1])}))},t}()},function(t,i,e){"use strict";var r=e(6);e.d(i,"a",function(){return a});var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])};return function(i,e){function r(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),a=function(t){function i(i,e){void 0===e&&(e={});var n=t.call(this)||this;return n._onClick=function(t){var i=n._getMousePosition(t),e=n._renderer.search(i);e.length&&(t.stopPropagation(),n.fire("click",{markers:e}))},n._atlas=i,n._markers=[],n._renderer=new r.a(n._atlas,e.debugDrawing||!1,void 0!==e.bufferFactor?e.bufferFactor:.5),n}return n(i,t),i.prototype.setMarkers=function(t){this._markers=t,this._renderer.setMarkers(t)},i.prototype.update=function(){this._renderer.update()},i.prototype.addTo=function(t){return t.addLayer(this),this},i.prototype.onAdd=function(){var t=this;return this._map?(this._pane=this._map.getPane("overlayPane"),this._renderer.onAddToMap(this._map),this._renderer.container.addEventListener("click",this._onClick),this._pane.appendChild(this._renderer.container),this._atlas.whenReady().then(function(){t._renderer.update()}),this):this},i.prototype.remove=function(){return this._map&&this._map.removeLayer(this),this},i.prototype.onRemove=function(){return this._pane.removeChild(this._renderer.container),this._renderer.onRemoveFromMap(),this._renderer.container.removeEventListener("click",this._onClick),this},i.prototype.setDebugDrawing=function(t){this._renderer.setDebugDrawing(t)},i.prototype._getMousePosition=function(t){var i=this._map,e=i.getContainer(),r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]},i}(L.Layer)},function(t,i,e){"use strict";var r=e(3);t.exports=function(t,i){i=i||{};var e=new r,n=i.inPlace||!1,a=t.map(function(t){return n?t:{width:t.width,height:t.height,item:t}});a=a.sort(function(t,i){return i.width*i.height-t.width*t.height}),e.fit(a);var o=a.reduce(function(t,i){return Math.max(t,i.x+i.width)},0),h=a.reduce(function(t,i){return Math.max(t,i.y+i.height)},0),s={width:o,height:h};return n||(s.items=a),s}},function(t,i){var e=function(){};e.prototype={fit:function(t){var i,e,r,n,a=t.length,o=a>0?t[0].width:0,h=a>0?t[0].height:0;for(this.root={x:0,y:0,width:o,height:h},i=0;i<a;i++)r=t[i],(e=this.findNode(this.root,r.width,r.height))?(n=this.splitNode(e,r.width,r.height),r.x=n.x,r.y=n.y):(n=this.growNode(r.width,r.height),r.x=n.x,r.y=n.y)},findNode:function(t,i,e){return t.used?this.findNode(t.right,i,e)||this.findNode(t.down,i,e):i<=t.width&&e<=t.height?t:null},splitNode:function(t,i,e){return t.used=!0,t.down={x:t.x,y:t.y+e,width:t.width,height:t.height-e},t.right={x:t.x+i,y:t.y,width:t.width-i,height:e},t},growNode:function(t,i){var e=t<=this.root.width,r=i<=this.root.height,n=r&&this.root.height>=this.root.width+t,a=e&&this.root.width>=this.root.height+i;return n?this.growRight(t,i):a?this.growDown(t,i):r?this.growRight(t,i):e?this.growDown(t,i):null},growRight:function(t,i){this.root={used:!0,x:0,y:0,width:this.root.width+t,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:t,height:this.root.height}};var e;return(e=this.findNode(this.root,t,i))?this.splitNode(e,t,i):null},growDown:function(t,i){this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+i,down:{x:0,y:this.root.height,width:this.root.width,height:i},right:this.root};var e;return(e=this.findNode(this.root,t,i))?this.splitNode(e,t,i):null}},t.exports=e},function(t,i,e){"use strict";function r(t,i,e,o,h){for(e=e||0,o=o||t.length-1,h=h||a;o>e;){if(o-e>600){var s=o-e+1,u=i-e+1,c=Math.log(s),d=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*d*(s-d)/s)*(u-s/2<0?-1:1);r(t,i,Math.max(e,Math.floor(i-u*d/s+f)),Math.min(o,Math.floor(i+(s-u)*d/s+f)),h)}var m=t[i],l=e,p=o;for(n(t,e,i),h(t[o],m)>0&&n(t,e,o);l<p;){for(n(t,l,p),l++,p--;h(t[l],m)<0;)l++;for(;h(t[p],m)>0;)p--}0===h(t[e],m)?n(t,e,p):(p++,n(t,p,o)),p<=i&&(e=p+1),i<=p&&(o=p-1)}}function n(t,i,e){var r=t[i];t[i]=t[e],t[e]=r}function a(t,i){return t<i?-1:t>i?1:0}t.exports=r},function(t,i,e){"use strict";function r(t,i){if(!(this instanceof r))return new r(t,i);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),i&&this._initFormat(i),this.clear()}function n(t,i,e){if(!e)return i.indexOf(t);for(var r=0;r<i.length;r++)if(e(t,i[r]))return r;return-1}function a(t,i){o(t,0,t.children.length,i,t)}function o(t,i,e,r,n){n||(n=_(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var a,o=i;o<e;o++)a=t.children[o],h(n,t.leaf?r(a):a);return n}function h(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function s(t,i){return t.minX-i.minX}function u(t,i){return t.minY-i.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,i){return(Math.max(i.maxX,t.maxX)-Math.min(i.minX,t.minX))*(Math.max(i.maxY,t.maxY)-Math.min(i.minY,t.minY))}function m(t,i){var e=Math.max(t.minX,i.minX),r=Math.max(t.minY,i.minY),n=Math.min(t.maxX,i.maxX),a=Math.min(t.maxY,i.maxY);return Math.max(0,n-e)*Math.max(0,a-r)}function l(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function p(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function _(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,i,e,r,n){for(var a,o=[i,e];o.length;)e=o.pop(),i=o.pop(),e-i<=r||(a=i+Math.ceil((e-i)/r/2)*r,x(t,a,i,e,n),o.push(i,a,a,e))}t.exports=r;var x=e(4);r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,e=[],r=this.toBBox;if(!p(t,i))return e;for(var n,a,o,h,s=[];i;){for(n=0,a=i.children.length;n<a;n++)o=i.children[n],h=i.leaf?r(o):o,p(t,h)&&(i.leaf?e.push(o):l(t,h)?this._all(o,e):s.push(o));i=s.pop()}return e},collides:function(t){var i=this.data,e=this.toBBox;if(!p(t,i))return!1;for(var r,n,a,o,h=[];i;){for(r=0,n=i.children.length;r<n;r++)if(a=i.children[r],o=i.leaf?e(a):a,p(t,o)){if(i.leaf||l(t,o))return!0;h.push(a)}i=h.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0,e=t.length;i<e;i++)this.insert(t[i]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=_([]),this},remove:function(t,i){if(!t)return this;for(var e,r,a,o,h=this.data,s=this.toBBox(t),u=[],c=[];h||u.length;){if(h||(h=u.pop(),r=u[u.length-1],e=c.pop(),o=!0),h.leaf&&-1!==(a=n(t,h.children,i)))return h.children.splice(a,1),u.push(h),this._condense(u),this;o||h.leaf||!l(h,s)?r?(e++,h=r.children[e],o=!1):h=null:(u.push(h),c.push(e),e=0,r=h,h=h.children[0])}return this},toBBox:function(t){return t},compareMinX:s,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,i){for(var e=[];t;)t.leaf?i.push.apply(i,t.children):e.push.apply(e,t.children),t=e.pop();return i},_build:function(t,i,e,r){var n,o=e-i+1,h=this._maxEntries;if(o<=h)return n=_(t.slice(i,e+1)),a(n,this.toBBox),n;r||(r=Math.ceil(Math.log(o)/Math.log(h)),h=Math.ceil(o/Math.pow(h,r-1))),n=_([]),n.leaf=!1,n.height=r;var s,u,c,d,f=Math.ceil(o/h),m=f*Math.ceil(Math.sqrt(h));for(g(t,i,e,m,this.compareMinX),s=i;s<=e;s+=m)for(c=Math.min(s+m-1,e),g(t,s,c,f,this.compareMinY),u=s;u<=c;u+=f)d=Math.min(u+f-1,c),n.children.push(this._build(t,u,d,r-1));return a(n,this.toBBox),n},_chooseSubtree:function(t,i,e,r){for(var n,a,o,h,s,u,d,m;;){if(r.push(i),i.leaf||r.length-1===e)break;for(d=m=1/0,n=0,a=i.children.length;n<a;n++)o=i.children[n],s=c(o),u=f(t,o)-s,u<m?(m=u,d=s<d?s:d,h=o):u===m&&s<d&&(d=s,h=o);i=h||i.children[0]}return i},_insert:function(t,i,e){var r=this.toBBox,n=e?t:r(t),a=[],o=this._chooseSubtree(n,this.data,i,a);for(o.children.push(t),h(o,n);i>=0&&a[i].children.length>this._maxEntries;)this._split(a,i),i--;this._adjustParentBBoxes(n,a,i)},_split:function(t,i){var e=t[i],r=e.children.length,n=this._minEntries;this._chooseSplitAxis(e,n,r);var o=this._chooseSplitIndex(e,n,r),h=_(e.children.splice(o,e.children.length-o));h.height=e.height,h.leaf=e.leaf,a(e,this.toBBox),a(h,this.toBBox),i?t[i-1].children.push(h):this._splitRoot(e,h)},_splitRoot:function(t,i){this.data=_([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,e){var r,n,a,h,s,u,d,f;for(u=d=1/0,r=i;r<=e-i;r++)n=o(t,0,r,this.toBBox),a=o(t,r,e,this.toBBox),h=m(n,a),s=c(n)+c(a),h<u?(u=h,f=r,d=s<d?s:d):h===u&&s<d&&(d=s,f=r);return f},_chooseSplitAxis:function(t,i,e){var r=t.leaf?this.compareMinX:s,n=t.leaf?this.compareMinY:u;this._allDistMargin(t,i,e,r)<this._allDistMargin(t,i,e,n)&&t.children.sort(r)},_allDistMargin:function(t,i,e,r){t.children.sort(r);var n,a,s=this.toBBox,u=o(t,0,i,s),c=o(t,e-i,e,s),f=d(u)+d(c);for(n=i;n<e-i;n++)a=t.children[n],h(u,t.leaf?s(a):a),f+=d(u);for(n=e-i-1;n>=i;n--)a=t.children[n],h(c,t.leaf?s(a):a),f+=d(c);return f},_adjustParentBBoxes:function(t,i,e){for(var r=e;r>=0;r--)h(i[r],t)},_condense:function(t){for(var i,e=t.length-1;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():a(t[e],this.toBBox)},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0])),this.compareMinY=new Function("a","b",i.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},function(t,i,e){"use strict";var r=e(5),n=(e.n(r),e(8));e.d(i,"a",function(){return a});var a=function(){function t(t,i,r){var a=this;this.update=function(){if(a._map){if(a._isRendering||a._isZooming)return void(a._needUpdate=!0);a._zoom=a._map.getZoom();var t=a._map.getCenter();e.i(n.a)(a._origin,[t.lng,t.lat],a._zoom),a._origin[0]-=a._mapSize[0]/2,a._origin[1]-=a._mapSize[1]/2;var i=a._map.containerPointToLayerPoint([-a._bufferOffset[0],-a._bufferOffset[1]]).round();L.DomUtil.setPosition(a._hiddenFrame.canvas,i),a._render()}},this._onResize=function(){if(a._map){var t=a._map.getSize();a._pixelRatio=window.devicePixelRatio,a._bufferOffset=[Math.round(t.x*a._bufferFactor),Math.round(t.y*a._bufferFactor)];var i=a._size=[t.x+2*a._bufferOffset[0],t.y+2*a._bufferOffset[1]];a._mapSize=[t.x,t.y],a._currentFrame.canvas.width=i[0]*a._pixelRatio,a._currentFrame.canvas.height=i[1]*a._pixelRatio,a._currentFrame.canvas.style.width=i[0]+"px",a._currentFrame.canvas.style.height=i[1]+"px",a._hiddenFrame.canvas.width=i[0]*a._pixelRatio,a._hiddenFrame.canvas.height=i[1]*a._pixelRatio,a._hiddenFrame.canvas.style.width=i[0]+"px",a._hiddenFrame.canvas.style.height=i[1]+"px"}},this._onZoomStart=function(){a.clear(),a._isZooming=!0},this._onMoveEnd=function(){a._isZooming=!1,a.update()},this._renderLoop=function(){var t=a._lastRenderedMarker,i=Math.min(t+a._markersPerFrame,a._markers.length);if(t===i)return void a._renderFinish();var r=e.i(n.b)();a._renderPart(t,i),a._lastRenderedMarker=i;var o=e.i(n.b)()-r,h=o/(i-t);0!==h&&(a._markersPerFrame=Math.max(Math.floor((a._markersPerFrame+a._timePerFrame/h)/2),100)),i!==a._markers.length?a._requestAnimationFrameId=requestAnimationFrame(a._renderLoop):a._renderFinish()},this._atlas=t,this._markers=[],this._markersData=[],this._isZooming=!1,this._debugDrawing=i,this._bufferFactor=r,this._markersPerFrame=5e3,this._timePerFrame=10,this._origin=e.i(n.c)(),this._vec=e.i(n.c)(),this._lastRenderedMarker=0,this._needUpdate=!1,this.container=document.createElement("div"),this._currentFrame=this._createFrame(),this._hiddenFrame=this._createFrame()}return t.prototype.setMarkers=function(t){if(this._needUpdate=!1,this._isRendering&&(cancelAnimationFrame(this._requestAnimationFrameId),this._isRendering=!1),t.length>this._markersData.length){for(var i=[],e=0;e<t.length;e++)i[e]={index:e};this._markersData=i}this._markers=t,this.update()},t.prototype.onAddToMap=function(t){this._map=t,t.on({viewreset:this.update,moveend:this._onMoveEnd,zoomstart:this._onZoomStart,resize:this._onResize}),this._onResize()},t.prototype.onRemoveFromMap=function(){this._map&&(this._map.off({viewreset:this.update,moveend:this._onMoveEnd,zoomstart:this._onZoomStart,resize:this._onResize}),this._map=void 0,this._markersData=[],this._markers=[])},t.prototype.clear=function(){this._map&&(this._currentFrame.ctx.clearRect(0,0,this._size[0]*this._pixelRatio,this._size[1]*this._pixelRatio),this._currentFrame.tree.clear(),this._needUpdate=!1,this._isRendering&&(cancelAnimationFrame(this._requestAnimationFrameId),this._isRendering=!1))},t.prototype.search=function(t){var i=(t[0]+this._bufferOffset[0])*this._pixelRatio,e=(t[1]+this._bufferOffset[1])*this._pixelRatio;return this._currentFrame.tree.search({minX:i,minY:e,maxX:i,maxY:e}).map(function(t){return t.index})},t.prototype.setDebugDrawing=function(t){this._debugDrawing=t},t.prototype._render=function(){this._map&&(this._hiddenFrame.tree.clear(),this._hiddenFrame.ctx.clearRect(0,0,this._size[0]*this._pixelRatio,this._size[1]*this._pixelRatio),this._isRendering=!0,this._lastRenderedMarker=0,this._renderLoop())},t.prototype._renderFinish=function(){this._isRendering=!1,this._switchFrames(),this._needUpdate&&(this._needUpdate=!1,this.update())},t.prototype._renderPart=function(t,i){var r=this._markers,a=this._markersData,o=this._atlas,h=this._debugDrawing,s=this._pixelRatio,u=this._size,c=this._hiddenFrame.ctx,d=this._vec,f=this._zoom,m=this._origin,l=this._bufferOffset;if(o.image){this._lastRenderedMarker=i;for(var p=[],_=t;_<i;_++){var g=r[_],x=a[_],v=o.sprites[g.iconIndex||0];if(v){var w=s/v.pixelDensity;e.i(n.a)(d,g.position,f),d[0]=Math.round(d[0]),d[1]=Math.round(d[1]),d[0]=Math.round(d[0]-m[0])+l[0],d[1]=Math.round(d[1]-m[1])+l[1],d[0]=Math.round(d[0]*s-v.size[0]*w*v.anchor[0]),d[1]=Math.round(d[1]*s-v.size[1]*w*v.anchor[1]),d[0]<0||d[0]+v.size[0]*w>u[0]*s||d[1]<0||d[1]+v.size[1]*w>u[1]*s||(x.minX=d[0],x.minY=d[1],x.maxX=d[0]+v.size[0]*w,x.maxY=d[1]+v.size[1]*w,p.push(x),c.drawImage(o.image,v.position[0],v.position[1],v.size[0],v.size[1],d[0],d[1],v.size[0]*w,v.size[1]*w),h&&this._debugDraw(g,d,v.size))}}this._hiddenFrame.tree.load(p)}},t.prototype._debugDraw=function(t,i,e){var r=this._hiddenFrame.ctx,n=["#000000","#ff0000","#00ff00","#0000ff"],a=t.drawingOffsets;if(a)for(var o=0;o<a.length;o++){var h=a[o];r.beginPath(),r.strokeStyle=n[o],r.rect(i[0]-h,i[1]-h,e[0]+2*h,e[1]+2*h),r.stroke()}},t.prototype._createFrame=function(){var t=document.createElement("canvas");t.style.display="none",t.style.position="initial";var i=t.getContext("2d"),e=r();return this.container.appendChild(t),{canvas:t,ctx:i,tree:e}},t.prototype._switchFrames=function(){if(this._map){this._currentFrame.canvas.style.display="none",this._hiddenFrame.canvas.style.display="block";var t=this._currentFrame;this._currentFrame=this._hiddenFrame,this._hiddenFrame=t}},t}()},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e(1);e.d(i,"MarkerDrawer",function(){return r.a});var n=e(0);e.d(i,"Atlas",function(){return n.a})},function(t,i,e){"use strict";function r(){return new Float64Array(2)}function n(t,i,e){o(t,i),a(t,t,e)}function a(t,i,e){var r=256*Math.pow(2,e),n=.5/(Math.PI*h);t[0]=r*(n*i[0]+.5),t[1]=r*(-n*i[1]+.5)}function o(t,i){var e=Math.PI/180,r=Math.max(Math.min(s,i[1]),-s),n=Math.sin(r*e);t[0]=h*i[0]*e,t[1]=h*Math.log((1+n)/(1-n))/2}i.c=r,i.a=n,e.d(i,"b",function(){return u});var h=6378137,s=85.0511287798,u=window.performance?performance.now.bind(performance):Date.now.bind(Date)}])});
//# sourceMappingURL=markerdrawer.js.map

@@ -5,3 +5,3 @@ import { Vec2 } from './types';

*/
export declare type Icon = {
export interface Icon {
image: HTMLImageElement;

@@ -11,4 +11,4 @@ anchor?: Vec2;

pixelDensity?: number;
};
export declare type Sprite = {
}
export interface Sprite {
position: Vec2;

@@ -18,3 +18,3 @@ size: Vec2;

pixelDensity: number;
};
}
/**

@@ -21,0 +21,0 @@ * The Atlas creates one image from a set of icons.

{
"name": "@2gis/markerdrawer",
"version": "0.0.1",
"version": "0.0.2",
"description": "Library for fast drawing a huge amount of markers",

@@ -33,8 +33,8 @@ "author": {

"tslib": "^1.5.0",
"tslint": "^4.4.2",
"tslint-eslint-rules": "^3.2.3",
"tslint": "^5.1.0",
"tslint-eslint-rules": "^4.0.0",
"typescript": "^2.1.5",
"webpack": "^2.2.0",
"webpack-dev-server": "^1.16.2"
"webpack-dev-server": "^2.4.5"
}
}

@@ -7,3 +7,3 @@ import * as pack from 'bin-pack';

*/
export type Icon = {
export interface Icon {
image: HTMLImageElement;

@@ -14,5 +14,5 @@ anchor?: Vec2; // [anchor=[0.5, 0.5]]

pixelDensity?: number; // Icon pixel density, 1 by default
};
}
export type Sprite = {
export interface Sprite {
position: Vec2; // Position of icon in the image of atlas

@@ -22,3 +22,3 @@ size: Vec2; // Size of icon in the atlas

pixelDensity: number; // Icon pixel density
};
}

@@ -25,0 +25,0 @@ /**

@@ -52,3 +52,3 @@ import { Atlas } from './Atlas';

this._pane = this._map.getPane('overlayPane');
this._pane = this._map.getPane('overlayPane') as HTMLElement; // overlayPane always exist

@@ -55,0 +55,0 @@ this._renderer.onAddToMap(this._map);

@@ -9,3 +9,3 @@ export type Vec2 = [number, number] | Float64Array;

drawingOffsets?: number[];
};
}

@@ -12,0 +12,0 @@ export interface IRenderer {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc