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

ldmap

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldmap - npm Package Compare versions

Comparing version 0.0.59 to 0.0.60

render.zip

2

layer/heatmap_grid_new.js

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

'use strict';function a(b){this.options=c.deepMerge(a.options,b),this.initialize(b)}var b=require('leaflet'),c=require('./../core/utils'),d=c.Grid,e=c.getColorFunc,f=require('bcore/event');a.options={clusterStepByZoom:1,isAutoUpdate:!0,isNeedAggregate:!0,shape:{type:'hex',rx:20,ry:18,mouseover:{fillOpacity:.8,color:'rgba(255,255,255,0.9)'},mouseout:{fillOpacity:1,color:'rgba(255,255,255,0.0)'},style:{weight:0,fillOpacity:1,color:'rgba(255,255,255,0.0)'},click:{}},color:e('rgba(62,18,0,0.8)','rgba(255,208,122,0.8)','hsl','linear.Out.1.4'),scale:function(a){return 1},value:function(a,b,c){return Math.min(1,a.length/40)},lng:c.getLng,lat:c.getLat},a=f.extend(a,{initialize:function(a){this.events={'grid-resize':{desc:'格子大小发生变化'},'grid-mouseover':{desc:'鼠标移至格子范围'},'grid-dblclick':{desc:'双击格子'},'grid-mouseout':{desc:'鼠标移出格子范围'},'grid-click':{desc:'点击某个格子'}},this.gridMap={},this.aggregatedData={},this.getMax=a.getMax,this.getColor=c.getColorFunc(a.shape.color||a.color),this.getScale=c.getColorFunc(a.shape.scale||a.scale),this.isable=!0},addTo:function(a){if(this._map||!a)return;this._map=a,this.initDataProcesser(),this._data&&this.updateZoom()},initDataProcesser:function(){var a=this._map,c=this.options.shape;this.gridEncoder=new d().transform(function(i,m){var d=a.getSize(),e=d.x/2,f=d.y/2,h=e-i,j=f+m,k=e+i,l=f-m,g=a.containerPointToLatLng(b.point(h,j)),c=a.containerPointToLatLng(b.point(k,l));return{dlat:c.lat-g.lat,dlng:c.lng-g.lng}}).shape(c.type).rx(c.rx).ry(c.ry).update(),this.initEventsMap()},data:function(b){if(!b)return this._data;this._data=b;var a=this.options;a.isAutoUpdate&&this._map&&this.updateZoom(),this.updateColor();var c=a.shape},initEventsMap:function(){var a=this;this._map.on('moveend',function(){this.render()}.bind(this)).on('zoomend',function(){a.updateZoom()})},updateZoom:function(){var a=this.options,c=a.clusterStepByZoom,d=this._map;if(a.isNeedAggregate){var e=d.getZoom(),b=Math.floor(e/c);if(b===this.zoomLevel)return;this.gridEncoder.update(),this.zoomLevel=b,this.clean(),this.aggregate(),this.fire('grid-resize'),this._updateTransformOrigin()}},aggregate:function(){if(!this.isable)return;var b=this.gridEncoder,a=this.options,f=this._data,d=a.lat,e=a.lng;this.aggregatedData=c.mapReduce(this._data,{map:function(c,a){return{key:b.encode(d(a),e(a)),value:a}}})},getBounds:function(){var c=this._map.getBounds(),a=c._southWest,b=c._northEast,d=.5*(b.lat-a.lat),e=.5*(b.lng-a.lng);return{latMin:a.lat-d,latMax:b.lat+d,lngMin:a.lng-e,lngMax:b.lng+e}},clean:function(){var a=this.gridMap,c=this._map;for(var b in a){var d=a[b];c.removeLayer(d),delete a[b]}},disable:function(){this.isable=!1,this.clean()},enable:function(){this.isable=!0,this.draw()},link:function(){},updateShape:function(){this.clean();var b=this.options.shape,c=b.type,d=b.rx,e=b.ry,a=this.gridEncoder;a.shape(c),a.rx(d),a.ry(e),a.update(),this.aggregate(),this.draw()},updateColor:function(d,h,i,j){if(!d)return;var e=this.getColor=c.getColorFunc(d,h,i,j),a=this.gridMap,b,f;for(var g in a)b=a[g],f=b._value,b.setStyle({fillColor:e(f)})},updateScale:function(a){if(!a)return;this.scaleGridFunc=function(e,f){if(!e)return;var b=e._container;this._updateTranformOriginGird(b);var c=a(f),d='scale3d('+c+','+c+',1)';b.style.transform=d,b.style['-webkit-transform']=d,this.getScale=a}},_updateTranformOriginGird:function(b){if(!b)return;var a=b.getBBox(),c=a.width/2+a.x+'px '+(a.height/2+a.y)+'px 0px';b.style['transform-origin']=c,b.style['-webkit-transform-origin']=c},_updateTransformOrigin:function(){if(!this.scaleGridFunc)return;var a=this.gridMap,b=this;setTimeout(function(){for(var c in a)b._updateTranformOriginGird(a[c]._container)})},render:function(a){a&&this.data(a),this.draw()},each:function(d){var a=this.gridMap;for(var b in a){var c=a[b];d(c,b)}},draw:function(){if(!this.isable)return;var m=this.options,w=this.gridEncoder,h=m.shape.style,t=this.getColor,v=m.value,g=this.aggregatedData,i=this.gridMap,s=this._map,c=this.getBounds(),d,q=c.latMax,n=c.latMin,o=c.lngMax,p=c.lngMin;for(var a in g){var r=g[a],j=w.decode(a),k=j.center,u=j.pts,l=k[0],f=k[1];if(l<n||f<p||l>q||f>o)continue;var e=v(r);if(!i[a]){if(h.fillColor=t(e),d=i[a]=b.polygon(u,h).addTo(s),d._value=e,d._gridid=a,this.initEventsGrid(d),!this.scaleGridFunc)continue;this.scaleGridFunc(d,e)}}},initEventsGrid:function(a){var b=this,i=this.aggregatedData,d=this.options.shape,e=d.click||{},f=d.mouseover||{},g=d.mouseout||{},h=a._gridid,c={gridid:h,data:i[h],layer:a};a.on('mouseover',function(d){f&&a.setStyle(f),b.fire('grid-mouseover',c),a.bringToFront()}).on('mouseout',function(d){g&&a.setStyle(g),b.fire('grid-mouseout',c)}).on('mousedown',function(d){e&&a.setStyle(e),b.fire('grid-click',c)}).on('dblclick',function(a){b.fire('grid-dblclick',c)})}});var g=b.dmap=b.dmap||{};g.HeatmapGrid=a,g.heatmapGrid=function(b){return a(b)},module.exports=a
'use strict';function a(b){this.options=c.deepMerge(a.options,b),this.initialize(b)}var b=require('leaflet'),c=require('./../core/utils'),d=c.Grid,e=c.getColorFunc,f=require('bcore/event');a.options={clusterStepByZoom:1,isAutoUpdate:!0,isNeedAggregate:!0,shape:{type:'hex',rx:20,ry:18,mouseover:{fillOpacity:.8,color:'rgba(255,255,255,0.9)'},mouseout:{fillOpacity:1,color:'rgba(255,255,255,0.0)'},style:{weight:0,fillOpacity:1,color:'rgba(255,255,255,0.0)'},click:{}},color:e('rgba(62,18,0,0.8)','rgba(255,208,122,0.8)','hsl','linear.Out.1.4'),scale:function(a){return 1},value:function(a,b,c){return Math.min(1,a.length/40)},lng:c.getLng,lat:c.getLat},a=f.extend(a,{initialize:function(a){this.events={'grid-resize':{desc:'格子大小发生变化'},'grid-mouseover':{desc:'鼠标移至格子范围'},'grid-dblclick':{desc:'双击格子'},'grid-mouseout':{desc:'鼠标移出格子范围'},'grid-click':{desc:'点击某个格子'}},this.gridMap={},this.aggregatedData={},this.getMax=a.getMax,this.getColor=c.getColorFunc(a.shape.color||a.color),this.getScale=c.getColorFunc(a.shape.scale||a.scale),this.isable=!0},addTo:function(a){if(this._map||!a)return;this._map=a,this.initDataProcesser(),this._data&&this.updateZoom()},initDataProcesser:function(){var a=this._map,c=this.options.shape;this.gridEncoder=new d().transform(function(i,m){var d=a.getSize(),e=d.x/2,f=d.y/2,h=e-i,j=f+m,k=e+i,l=f-m,g=a.containerPointToLatLng(b.point(h,j)),c=a.containerPointToLatLng(b.point(k,l));return{dlat:c.lat-g.lat,dlng:c.lng-g.lng}}).shape(c.type).rx(c.rx).ry(c.ry).update(),this.initEventsMap()},data:function(b){if(!b)return this._data;this._data=b;var a=this.options;a.isAutoUpdate&&this._map&&this.updateZoom(),this.updateColor();var c=a.shape},initEventsMap:function(){var a=this;this._map.on('moveend',function(){this.render()}.bind(this)).on('zoomend',function(){a.updateZoom()})},updateZoom:function(){var a=this.options,c=a.clusterStepByZoom,d=this._map;if(a.isNeedAggregate){var e=d.getZoom(),b=Math.floor(e/c);if(b===this.zoomLevel)return;this.gridEncoder.update(),this.zoomLevel=b,this.clean(),this.aggregate(),this.fire('grid-resize'),this._updateTransformOrigin()}},aggregate:function(){if(!this.isable)return;var b=this.gridEncoder,a=this.options,f=this._data,d=a.lat,e=a.lng;this.aggregatedData=c.mapReduce(this._data,{map:function(c,a){return{key:b.encode(d(a),e(a)),value:a}}})},getBounds:function(){var c=this._map.getBounds(),a=c._southWest,b=c._northEast,d=.5*(b.lat-a.lat),e=.5*(b.lng-a.lng);return{latMin:a.lat-d,latMax:b.lat+d,lngMin:a.lng-e,lngMax:b.lng+e}},clean:function(){var a=this.gridMap,c=this._map;for(var b in a){var d=a[b];c.removeLayer(d),delete a[b]}},disable:function(){this.isable=!1,this.clean()},enable:function(){this.isable=!0,this.draw()},link:function(){},updateShape:function(){this.clean();var b=this.options.shape,c=b.type,d=b.rx,e=b.ry,a=this.gridEncoder;a.shape(c),a.rx(d),a.ry(e),a.update(),this.aggregate(),this.draw()},updateColor:function(a,h,i,j){a||(a=this.options.color);var e=this.getColor=c.getColorFunc(a,h,i,j),b=this.gridMap,d,f;for(var g in b)d=b[g],f=d._value,d.setStyle({fillColor:e(f)})},updateOptions:function(a){this.options=c.deepMerge(this.options,a),this.updateColor(),this.updateShape()},updateScale:function(a){if(!a)return;this.scaleGridFunc=function(e,f){if(!e)return;var b=e._container;this._updateTranformOriginGird(b);var c=a(f),d='scale3d('+c+','+c+',1)';b.style.transform=d,b.style['-webkit-transform']=d,this.getScale=a}},_updateTranformOriginGird:function(b){if(!b)return;var a=b.getBBox(),c=a.width/2+a.x+'px '+(a.height/2+a.y)+'px 0px';b.style['transform-origin']=c,b.style['-webkit-transform-origin']=c},_updateTransformOrigin:function(){if(!this.scaleGridFunc)return;var a=this.gridMap,b=this;setTimeout(function(){for(var c in a)b._updateTranformOriginGird(a[c]._container)})},render:function(a){a&&this.data(a),this.draw()},each:function(d){var a=this.gridMap;for(var b in a){var c=a[b];d(c,b)}},draw:function(){if(!this.isable)return;var m=this.options,w=this.gridEncoder,h=m.shape.style,t=this.getColor,v=m.value,g=this.aggregatedData,i=this.gridMap,s=this._map,c=this.getBounds(),d,q=c.latMax,n=c.latMin,o=c.lngMax,p=c.lngMin;for(var a in g){var r=g[a],j=w.decode(a),k=j.center,u=j.pts,l=k[0],f=k[1];if(l<n||f<p||l>q||f>o)continue;var e=v(r);if(!i[a]){if(h.fillColor=t(e),d=i[a]=b.polygon(u,h).addTo(s),d._value=e,d._gridid=a,this.initEventsGrid(d),!this.scaleGridFunc)continue;this.scaleGridFunc(d,e)}}},initEventsGrid:function(a){var b=this,i=this.aggregatedData,d=this.options.shape,e=d.click||{},f=d.mouseover||{},g=d.mouseout||{},h=a._gridid,c={gridid:h,data:i[h],layer:a};a.on('mouseover',function(d){f&&a.setStyle(f),b.fire('grid-mouseover',c),a.bringToFront()}).on('mouseout',function(d){g&&a.setStyle(g),b.fire('grid-mouseout',c)}).on('mousedown',function(d){e&&a.setStyle(e),b.fire('grid-click',c)}).on('dblclick',function(a){b.fire('grid-dblclick',c)})}});var g=b.dmap=b.dmap||{};g.HeatmapGrid=a,g.heatmapGrid=function(b){return a(b)},module.exports=a

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

function a(a,b,c,d){return typeof a==='function'?a(b,c,d):a}var b=require('leaflet'),c=require('konva'),d=require('lodash'),e=require('./../render/leaflet_layer_konva'),f=require('./../core/utils'),g=f.getSprite,h=f.fireEvent,a=f.getValue,i=b.Class.extend({includes:[b.Mixin.Events],initialize:function(a){a=this.options=f.deepMerge(i.options,a),this.resetVariables()},resetVariables:function(){this.isable=!0},disable:function(){this.isable=!1,this.kLeafLayer.disable()},enable:function(){this.isable=!0,this.kLeafLayer.enable()},addTo:function(a){if(this._map||!a)return;this._map=a,this.initCanvas(),this.initEventsMap(),this.initEventsShapes()},initEventsShapes:function(){var d=this,b=this.options.hoverScale||1,a,c=this.kLeafLayer.onKonva('dragstart',function(a){}).onKonva('mouseover touchstart',function(c){a=c.target,a.setAttrs({scale:{x:b,y:b}}),a.parent.draw()}).onKonva('mouseout',function(b){a=b.target,a.setAttrs({scale:{x:1,y:1}}),a.parent.draw()}).onKonva('mouseout mouseup touchend',function(a){setTimeout(function(){c.enableMapEvents()})}).onKonva('mousedown touchstart',this.onMouseDown.bind(this)),e=['mouseout','mousedown','mouseover','mouseout','touchstart','touchend','touchup'];e.forEach(function(a){c.onKonva(a,function(b){h(a,b,d)})})},onMouseDown:function(g){var c=this.options,d=this._map,e=g.target,f=e.__data,a=c.popup;if(a&&(a=a.bind(c)),a||(a=c.child.popup,a&&(a=a.bind(c.child))),!a)return;popupText=a(f),setTimeout(function(){var a=g.getClientRect(),d=a.x+a.width/2,e=a.y,c=f.containerPointToLatLng(b.point(d,e));f.openPopup(popupText,b.latLng(c.lat,c.lng))}.bind(this)),this.kLeafLayer.disableMapEvents()},initCanvas:function(){var b=this._map,a=this.options,d=b.getSize(),f=new c.Stage({container:a.container,width:d.x,height:d.y}),g=this.kLeafLayer=new e(f,{transition:a.lazyFresh.transition,blending:a.blending,ptNPerLayer:a.ptNPerLayer});g.addTo(b),this.initEditor()},data:function(c){this._data=c;var a=this.options,b=a.zIndex||a.child.zIndex;b&&(this._data=d.sortBy(c,b))},updateOptions:function(a){var b=this.kLeafLayer;b.resetOffset(),a&&(this.options=f.deepMerge(this.options,a)),b.hideLayers(),b.updateOptions({transition:a.lazyFresh.transition,blending:a.blending,ptNPerLayer:a.ptNPerLayer}),this.draw()},updateFilter:function(a){if(!a||typeof a!=='function')return;this.options.filter=a,this.draw()},render:function(a){a&&this.data(a),this.draw()},createShapeAttr:function(e,n){if(!this.isable)return;var d=this.options,i=d.lat.bind(d),l=d.lng.bind(d),k=a(d.id.bind(d),e),f=a(d.size,e)||1,m=i(e),j=l(e),h=this._map.latLngToContainerPoint(b.latLng(m,j));return{data:e,Constructor:c.Image,index:n,id:k,attrs:{x:h.x,y:h.y,offset:{x:f/2,y:f/2},image:g(d.sprite||d.child.sprite,e),width:f,height:f,draggable:!1}}},draw:function(){var b=this._data;if(!b)return;if(!this.isable)return;var d,f,c=this.kLeafLayer,e=this.options.filter;for(var a=b.length-1;a>-1;a--){if(d=b[a],e&&!e(d,a))continue;f=this.createShapeAttr(d,a),c.addOrSetShape(f)}c.stopLazyFresh(),c.lazyFresh()},initEventsMap:function(){this._map.on('zoomend',this.draw.bind(this)).on('moveend',this.draw.bind(this))},destroy:function(){},initEditor:function(){this.eidtList=[],this.kLeafLayer.initEditor(),this.initEventEditor()},enableEditor:function(){this.kLeafLayer.enableEditor()},disableEditor:function(){this.kLeafLayer.disableEditor()},initEventEditor:function(){var a=this;this.kLeafLayer.on('shape-dragged',function(b){a.onShapeDragged(b.shape)})},onShapeDragged:function(e){var a=e.getClientRect(),f=a.x+a.width/2,g=a.y+a.height/2,h=this._map.containerPointToLatLng(b.point(f,g)),i=this.options,d=i.editor.setLatLng;if(!d)return console.log('请设置options.editor.setLatLng');var c=e.__data;d(h,c),this.kLeafLayer.addOrSetShape(c,null,!0),this.eidtList.push(c),this.fire('data-edited',c)},isEdited:function(){return this.eidtList.length>0},submitEdit:function(){var a=this.options,b=this.eidtList}});i.options={lng:f.getLng,lat:f.getLat,refreshInterval:1,ptNPerLayer:1e3,lazyFresh:{transition:'opacity 0.4s'},size:function(a){return 40},id:function(a,b){return a.id||b},hoverScale:1.2,blending:'lighter',container:'tilePane',sprite:{drawN:1.15,color:{from:'rgba(245,230,0,1)',to:'rgba(205,0,0, 0.6)',easing:'Linear.None.1.7',space:'rgb'}},child:{},editor:{setLatLng:function(b,a){if(!a)return;a.lat=b.lat,a.lng=b.lng}}};var j=b.dmap=b.dmap||{};j.ScatterKonva=i,j.scatterKonva=function(a){return new i(a)},module.exports=i
function a(a,b,c,d){return typeof a==='function'?a(b,c,d):a}var b=require('leaflet'),c=require('konva'),d=require('lodash'),e=require('./../render/leaflet_layer_konva'),f=require('./../core/utils'),g=f.getSprite,h=f.fireEvent,a=f.getValue,i=b.Class.extend({includes:[b.Mixin.Events],initialize:function(a){a=this.options=f.deepMerge(i.options,a),this.resetVariables()},resetVariables:function(){this.isable=!0},disable:function(){this.isable=!1,this.kLeafLayer.disable()},enable:function(){this.isable=!0,this.kLeafLayer.enable()},addTo:function(a){if(this._map||!a)return;this._map=a,this.initCanvas(),this.initEventsMap(),this.initEventsShapes()},initEventsShapes:function(){var d=this,b=this.options.hoverScale||1,a,c=this.kLeafLayer.onKonva('dragstart',function(a){}).onKonva('mouseover touchstart',function(c){a=c.target,a.setAttrs({scale:{x:b,y:b}}),a.parent.draw()}).onKonva('mouseout',function(b){a=b.target,a.setAttrs({scale:{x:1,y:1}}),a.parent.draw()}).onKonva('mouseout mouseup touchend',function(a){setTimeout(function(){c.enableMapEvents()})}).onKonva('mousedown touchstart',this.onMouseDown.bind(this)),e=['mouseout','mousedown','mouseover','mouseout','touchstart','touchend','touchup'];e.forEach(function(a){c.onKonva(a,function(b){h(a,b,d)})})},onMouseDown:function(g){var c=this.options,d=this._map,e=g.target,f=e.__data,a=c.popup;if(a&&(a=a.bind(c)),a||(a=c.child.popup,a&&(a=a.bind(c.child))),!a)return;popupText=a(f),setTimeout(function(){var a=g.getClientRect(),d=a.x+a.width/2,e=a.y,c=f.containerPointToLatLng(b.point(d,e));f.openPopup(popupText,b.latLng(c.lat,c.lng))}.bind(this)),this.kLeafLayer.disableMapEvents()},initCanvas:function(){var b=this._map,a=this.options,d=b.getSize(),f=new c.Stage({container:a.container,width:d.x,height:d.y}),g=this.kLeafLayer=new e(f,{transition:a.lazyFresh.transition,blending:a.blending,ptNPerLayer:a.ptNPerLayer});g.addTo(b),this.initEditor()},data:function(c){this._data=c;var a=this.options,b=a.zIndex||a.child.zIndex;b&&(this._data=d.sortBy(c,b))},updateOptions:function(a){var b=this.kLeafLayer;b.resetOffset(),a&&(this.options=f.deepMerge(this.options,a)),b.hideLayers(),b.updateOptions({transition:a.lazyFresh.transition,blending:a.blending,ptNPerLayer:a.ptNPerLayer}),this.draw()},updateFilter:function(a){if(!a||typeof a!=='function')return;this.options.filter=a,this.draw()},render:function(a){a&&this.data(a),a&&this.kLeafLayer.beginDraw(),this.draw(),a&&this.kLeafLayer.endDraw()},createShapeAttr:function(e,n){if(!this.isable)return;var d=this.options,i=d.lat.bind(d),l=d.lng.bind(d),k=a(d.id.bind(d),e),f=a(d.size,e)||1,m=i(e),j=l(e),h=this._map.latLngToContainerPoint(b.latLng(m,j));return{data:e,Constructor:c.Image,index:n,id:k,attrs:{x:h.x,y:h.y,offset:{x:f/2,y:f/2},image:g(d.sprite||d.child.sprite,e),width:f,height:f,draggable:!1}}},draw:function(){var b=this._data;if(!b)return;if(!this.isable)return;var d,f,c=this.kLeafLayer,e=this.options.filter;for(var a=b.length-1;a>-1;a--){if(d=b[a],e&&!e(d,a))continue;f=this.createShapeAttr(d,a),c.addOrSetShape(f)}c.stopLazyFresh(),c.lazyFresh()},initEventsMap:function(){this._map.on('zoomend',this.draw.bind(this)).on('moveend',this.draw.bind(this))},destroy:function(){this.kLeafLayer.destroy()},initEditor:function(){this.eidtList=[],this.kLeafLayer.initEditor(),this.initEventEditor()},enableEditor:function(){this.kLeafLayer.enableEditor()},disableEditor:function(){this.kLeafLayer.disableEditor()},initEventEditor:function(){var a=this;this.kLeafLayer.on('shape-dragged',function(b){a.onShapeDragged(b.shape)})},onShapeDragged:function(e){var a=e.getClientRect(),f=a.x+a.width/2,g=a.y+a.height/2,h=this._map.containerPointToLatLng(b.point(f,g)),i=this.options,d=i.editor.setLatLng;if(!d)return console.log('请设置options.editor.setLatLng');var c=e.__data;d(h,c),this.kLeafLayer.addOrSetShape(c,null,!0),this.eidtList.push(c),this.fire('data-edited',c)},isEdited:function(){return this.eidtList.length>0},submitEdit:function(){var a=this.options,b=this.eidtList}});i.options={lng:f.getLng,lat:f.getLat,refreshInterval:1,ptNPerLayer:1e3,lazyFresh:{transition:'opacity 0.4s'},size:function(a){return 40},id:function(a,b){return a.id||b},hoverScale:1.2,blending:'lighter',container:'tilePane',sprite:{drawN:1.15,color:{from:'rgba(245,230,0,1)',to:'rgba(205,0,0, 0.6)',easing:'Linear.None.1.7',space:'rgb'}},child:{},editor:{setLatLng:function(b,a){if(!a)return;a.lat=b.lat,a.lng=b.lng}}};var j=b.dmap=b.dmap||{};j.ScatterKonva=i,j.scatterKonva=function(a){return new i(a)},module.exports=i

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

function a(b){b=this.options=f.deepMerge(a.options,b),this.initialize(b),b.child.id=b.child.id||b.id,b.child.text=b.child.text||b.text,b.child.lat=b.child.lat||b.lat,b.child.lng=b.child.lng||b.lng,b.child.range=b.child.range||b.range,b.child.value=b.child.value||b.value,b.child.css=b.child.css||b.css}var b=require('leaflet');require('./../core/utils');var c=require('bcore/event'),d=require('./scatter_marker'),e=b.dmap=b.dmap||{},f=e.Utils;a.options={lat:f.getLat,lng:f.getLng,filter:function(a,b){return!0},range:[0,1],id:function(a,b){return a.id||b},text:function(a){return a.text},value:function(a){return a.value||a.num||a[0]},zoom:{max:15,min:3},child:{size:function(a,b,c){return 15},shape:{normal:{}}}},a=c.extend(a,{initialize:function(a){this.cache={},this.isable=!0},addTo:function(a){if(!a)return;this._map=a,this.initEventsMap()},data:function(a){},clean:function(){var a=this.cache,c,b;if(!a)return;for(var d in a)c=a[d],b=c.visual,b&&b.destroy&&(b.destroy(),delete c.visual)},updateData:function(a){this.processing(a),this.cleanOld()},updateFilter:function(a){if(typeof a!=='function')return;this.options.filter=a,this.updateMap()},cleanOld:function(){var c=this.versionID,b=this.cache,d,a,f;if(!(c&&b))return;for(var e in b)d=b[e],f=d.versionID,f!==c&&(a=d.visual,a&&(a.off&&a.off(),a.destroy&&a.destroy()),delete b[e])},processing:function(y){var t=this.versionID=Math.random(),j=this._map;if(!j)return;var b=this.options,w=b.child,a,i,u,v,e,c,n=this.isInZoom(),o=this._map.getZoom(),p=b.id,q=b.lat,r=b.lng,s=b.filter,g=b.groups,k,h,l=this.cache,m=this.isable;for(var f in y){if(a=y[f],b.processing&&b.processing(a),i=p(a,f),u=q(a),v=r(a),e=l[i],k=!0,k=s(a,o),h=!0,g){h=!1;for(var f in g){var x=g[f];if(x.filter(a)){h=!0;break}}}if(e?e.data=a:e=l[i]={data:a},e.versionID=t,n&&k&&h&&this.isInView(u,v)&&m){var c=e.visual;c?c.updateData(a):m&&(c=e.visual=new d(w),c.addTo(j),c.render(a),this.initEventsScatter(c))}}this.updateRange()},render:function(a){if(!a)return;this.updateData(a)},enable:function(){this.isable=!0},disable:function(){this.isable=!1},isInZoom:function(){var a=this.options.zoom;if(!a)return!0;var c=this._map,d=a.max,e=a.min,b=c.getZoom();return b>d||b<e?!1:!0},isInView:function(b,c,a){a=a||this._map.getBounds();var d=a._northEast.lng,e=a._northEast.lat,f=a._southWest.lng,g=a._southWest.lat;return b<e&&b>g&&c<d&&c>f},updateMap:function(){var f=this.options,g=this.cache,e,a,l,h,b,j=f.lng,k=f.lat,c,m,n=f.filter,o=this._map.getZoom(),p,q=this.isInZoom(),t=f.groups;if(!q)return this.clean();if(!g)return;if(!this.isable)return;var s=this.options.child,r=this._map;for(var i in g)e=g[i],b=e.data,l=k(b),h=j(b),p=this.isInView(l,h),c=!0,c=n(b,o),m=!0,c=c&&m,a=e.visual,p&&c?a?(a.updateData(b),a.updateZIndex()):(a=e.visual=new d(s),a.addTo(r),a.render(b),this.initEventsScatter(a)):a&&(a.off&&a.off(),a.destroy&&a.destroy(),delete e.visual)},updateRange:function(){var c=this.cache,d=this.ranges=this.ranges||{},e=this.options.value,a=d.value=[];for(var f in c){var g=c[f].data,b=e(g);a[0]||(a=[b,b]),b<a[0]&&(a[0]=b),b>a[1]&&(a[1]=b)}},initEventsMap:function(){this._map.on('moveend',this.updateMap.bind(this))},initEventsScatter:function(b){var a=this;b.on('click',function(b){a.emit('click-scatter',b)})},destroy:function(){}}),e.ScatterMarkers=a,e.scatterMarkers=function(b){return new a(b)},module.exports=a
function a(b){b=this.options=f.deepMerge(a.options,b),this.initialize(b),b.child.id=b.child.id||b.id,b.child.text=b.child.text||b.text,b.child.lat=b.child.lat||b.lat,b.child.lng=b.child.lng||b.lng,b.child.range=b.child.range||b.range,b.child.value=b.child.value||b.value,b.child.css=b.child.css||b.css}var b=require('leaflet');require('./../core/utils');var c=require('bcore/event'),d=require('./scatter_marker'),e=b.dmap=b.dmap||{},f=e.Utils;a.options={lat:f.getLat,lng:f.getLng,filter:function(a,b){return!0},range:[0,1],id:function(a,b){return a.id||b},text:function(a){return a.text},value:function(a){return a.value||a.num||a[0]},zoom:{max:15,min:3},child:{size:function(a,b,c){return 15},shape:{normal:{}}}},a=c.extend(a,{initialize:function(a){this.cache={},this.isable=!0},addTo:function(a){if(!a)return;this._map=a,this.initEventsMap()},data:function(a){this._data=a},clean:function(){var a=this.cache,c,b;if(!a)return;for(var d in a)c=a[d],b=c.visual,b&&b.destroy&&(b.destroy(),delete c.visual)},updateData:function(a){this.processing(a),this.cleanOld()},updateFilter:function(a){if(typeof a!=='function')return;this.options.filter=a,this.updateMap()},cleanOld:function(){var c=this.versionID,b=this.cache,d,a,f;if(!(c&&b))return;for(var e in b)d=b[e],f=d.versionID,f!==c&&(a=d.visual,a&&(a.off&&a.off(),a.destroy&&a.destroy()),delete b[e])},processing:function(y){var t=this.versionID=Math.random(),j=this._map;if(!j)return;var b=this.options,w=b.child,a,i,u,v,e,c,n=this.isInZoom(),o=this._map.getZoom(),p=b.id,q=b.lat,r=b.lng,s=b.filter,g=b.groups,k,h,l=this.cache,m=this.isable;for(var f in y){if(a=y[f],b.processing&&b.processing(a),i=p(a,f),u=q(a),v=r(a),e=l[i],k=!0,k=s(a,o),h=!0,g){h=!1;for(var f in g){var x=g[f];if(x.filter(a)){h=!0;break}}}if(e?e.data=a:e=l[i]={data:a},e.versionID=t,n&&k&&h&&this.isInView(u,v)&&m){var c=e.visual;c?c.updateData(a):m&&(c=e.visual=new d(w),c.addTo(j),c.render(a),this.initEventsScatter(c))}}this.updateRange()},render:function(a){a&&this.data(a),a=this._data,this.updateData(a)},enable:function(){this.isable=!0},disable:function(){this.isable=!1},isInZoom:function(){var a=this.options.zoom;if(!a)return!0;var c=this._map,d=a.max,e=a.min,b=c.getZoom();return b>d||b<e?!1:!0},isInView:function(b,c,a){a=a||this._map.getBounds();var d=a._northEast.lng,e=a._northEast.lat,f=a._southWest.lng,g=a._southWest.lat;return b<e&&b>g&&c<d&&c>f},updateOptions:function(a){a=this.options=f.deepMerge(this.options,a),this.draw()},draw:function(){var f=this.options,g=this.cache,e,a,l,h,b,j=f.lng,k=f.lat,c,m,n=f.filter,o=this._map.getZoom(),p,q=this.isInZoom(),t=f.groups;if(!q)return this.clean();if(!g)return;if(!this.isable)return;var s=this.options.child,r=this._map;for(var i in g)e=g[i],b=e.data,l=k(b),h=j(b),p=this.isInView(l,h),c=!0,c=n(b,o),m=!0,c=c&&m,a=e.visual,p&&c?a?(a.updateData(b),a.updateZIndex()):(a=e.visual=new d(s),a.addTo(r),a.render(b),this.initEventsScatter(a)):a&&(a.off&&a.off(),a.destroy&&a.destroy(),delete e.visual)},updateMap:function(){this.draw()},updateRange:function(){var c=this.cache,d=this.ranges=this.ranges||{},e=this.options.value,a=d.value=[];for(var f in c){var g=c[f].data,b=e(g);a[0]||(a=[b,b]),b<a[0]&&(a[0]=b),b>a[1]&&(a[1]=b)}},initEventsMap:function(){this._map.on('moveend',this.updateMap.bind(this))},initEventsScatter:function(b){var a=this;b.on('click',function(b){a.emit('click-scatter',b)})},destroy:function(){this.clean()}}),e.ScatterMarkers=a,e.scatterMarkers=function(b){return new a(b)},module.exports=a

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

function a(a){this.initialize(a)}var b=require('bcore/event'),c=require('./../core/utils'),d=require('./../render/leaflet_layer_konva'),e=require('konva'),f=require('./../leaflet'),g=require('lodash'),h=c.fireEvent,i=c.getValue;a.options={ptNPerLayer:2e3,lazyFresh:{transition:'opacity 0.4s'},blending:'lighter',lng:c.getLng,lat:c.getLat,id:function(a,b){return a.id||b},radius:10,angle:10,rotation:0,stroke:'transparent',strokeWidth:0,fill:'rgba(0,190,190,0.2)',hoverScale:1.2,zIndex:function(a){return-a.value}},a=b.extend(a,{addTo:function(a){this._map=a,this.initCanvas(),this.initEventsMap(),this.initEventsShapes()},initialize:function(b){b=this.options=c.deepMerge(a.options,b),this.resetVariables()},resetVariables:function(){this.isable=!0},disable:function(){this.isable=!1,this.kLeafLayer.disable()},enable:function(){this.isable=!0,this.kLeafLayer.enable()},initCanvas:function(){var b=this._map,a=this.options,c=b.getSize(),f=new e.Stage({container:a.container,width:c.x,height:c.y}),g=this.kLeafLayer=new d(f,{transition:a.lazyFresh.transition,blending:a.blending,ptNPerLayer:a.ptNPerLayer});g.addTo(b)},data:function(c){this._data=c;var a=this.options,b=a.zIndex||a.child.zIndex;b&&(this._data=g.sortBy(c,b))},createShapeAttr:function(b,g){if(!this.isable)return;var a=this.options,c=this._map.getZoom(),h=i(a.lat,b),j=i(a.lng,b),k=i(a.id.bind(a),b,g),l=i(a.radius,b,c)||1,m=i(a.angle,b,c)||1,n=i(a.rotation,b,c),o=i(a.fill,b,c),p=i(a.stroke,b,c),q=i(a.strokeWidth,b,c),d=this._map.latLngToContainerPoint(f.latLng(h,j));return{data:b,Constructor:e.Wedge,index:g,id:k,attrs:{x:d.x,y:d.y,radius:l,rotation:n,angle:m,stroke:p,strokeWidth:q,fill:o}}},draw:function(){var b=this._data;if(!b)return;if(!this.isable)return;var d,f,c=this.kLeafLayer,e=this.options.filter;for(var a=b.length-1;a>-1;a--){if(d=b[a],e&&!e(d,a))continue;f=this.createShapeAttr(d,a),c.addOrSetShape(f)}c.stopLazyFresh(),c.lazyFresh()},render:function(a){a&&this.data(a),this.draw()},initEventsMap:function(){this._map.on('zoomend',this.draw.bind(this)).on('moveend',this.draw.bind(this))},onMouseDown:function(g){var b=this.options,c=this._map,d=g.target,e=d.__data,a=b.popup;if(a&&(a=a.bind(b)),a||(a=b.child.popup,a&&(a=a.bind(b.child))),!a)return;popupText=a(e),setTimeout(function(){var a=e.getClientRect(),d=a.x+a.width/2,g=a.y+a.height/2,b=c.containerPointToLatLng(f.point(d,g));c.openPopup(popupText,f.latLng(b.lat,b.lng))}.bind(this)),this.kLeafLayer.disableMapEvents()},initEventsShapes:function(){var d=this,b=this.options.hoverScale||1,a,c=this.kLeafLayer.onKonva('mouseover touchstart',function(c){a=c.target,a.setAttrs({scale:{x:b,y:b}}),a.parent.draw()}).onKonva('mouseout',function(b){a=b.target,a.setAttrs({scale:{x:1,y:1}}),a.parent.draw()}).onKonva('mouseout mouseup touchend',function(a){setTimeout(function(){c.enableMapEvents()})}).onKonva('mousedown touchstart',this.onMouseDown.bind(this)),e=['mouseout','mousedown','mouseover','mouseout','touchstart','touchend','touchup'];e.forEach(function(a){c.onKonva(a,function(b){h(a,b,d)})})}}),module.exports=a
function a(a){this.initialize(a)}var b=require('bcore/event'),c=require('./../core/utils'),d=require('./../render/leaflet_layer_konva'),e=require('konva'),f=require('./../leaflet'),g=require('lodash'),h=c.fireEvent,i=c.getValue;a.options={ptNPerLayer:2e3,lazyFresh:{transition:'opacity 0.4s'},blending:'lighter',lng:c.getLng,lat:c.getLat,id:function(a,b){return a.id||b},radius:10,angle:10,rotation:0,stroke:'transparent',strokeWidth:0,fill:'rgba(0,190,190,0.2)',hoverScale:1.2,zIndex:function(a){return-a.value}},a=b.extend(a,{addTo:function(a){this._map=a,this.initCanvas(),this.initEventsMap(),this.initEventsShapes()},initialize:function(b){b=this.options=c.deepMerge(a.options,b),this.resetVariables()},resetVariables:function(){this.isable=!0},disable:function(){this.isable=!1,this.kLeafLayer.disable()},enable:function(){this.isable=!0,this.kLeafLayer.enable()},initCanvas:function(){var b=this._map,a=this.options,c=b.getSize(),f=new e.Stage({container:a.container,width:c.x,height:c.y}),g=this.kLeafLayer=new d(f,{transition:a.lazyFresh.transition,blending:a.blending,ptNPerLayer:a.ptNPerLayer});g.addTo(b)},data:function(c){this._data=c;var a=this.options,b=a.zIndex||a.child.zIndex;b&&(this._data=g.sortBy(c,b))},createShapeAttr:function(b,g){if(!this.isable)return;var a=this.options,c=this._map.getZoom(),h=i(a.lat,b),j=i(a.lng,b),k=i(a.id.bind(a),b,g),l=i(a.radius,b,c)||1,m=i(a.angle,b,c)||1,n=i(a.rotation,b,c),o=i(a.fill,b,c),p=i(a.stroke,b,c),q=i(a.strokeWidth,b,c),d=this._map.latLngToContainerPoint(f.latLng(h,j));return{data:b,Constructor:e.Wedge,index:g,id:k,attrs:{x:d.x,y:d.y,radius:l,rotation:n,angle:m,stroke:p,strokeWidth:q,fill:o}}},draw:function(){var b=this._data;if(!b)return;if(!this.isable)return;var d,f,c=this.kLeafLayer,e=this.options.filter;for(var a=b.length-1;a>-1;a--){if(d=b[a],e&&!e(d,a))continue;f=this.createShapeAttr(d,a),c.addOrSetShape(f)}c.stopLazyFresh(),c.lazyFresh()},render:function(a){a&&this.data(a),a&&this.kLeafLayer.beginDraw(),this.draw(),a&&this.kLeafLayer.endDraw()},initEventsMap:function(){this._map.on('zoomend',this.draw.bind(this)).on('moveend',this.draw.bind(this))},onMouseDown:function(g){var b=this.options,c=this._map,d=g.target,e=d.__data,a=b.popup;if(a&&(a=a.bind(b)),a||(a=b.child.popup,a&&(a=a.bind(b.child))),!a)return;popupText=a(e),setTimeout(function(){var a=e.getClientRect(),d=a.x+a.width/2,g=a.y+a.height/2,b=c.containerPointToLatLng(f.point(d,g));c.openPopup(popupText,f.latLng(b.lat,b.lng))}.bind(this)),this.kLeafLayer.disableMapEvents()},initEventsShapes:function(){var d=this,b=this.options.hoverScale||1,a,c=this.kLeafLayer.onKonva('mouseover touchstart',function(c){a=c.target,a.setAttrs({scale:{x:b,y:b}}),a.parent.draw()}).onKonva('mouseout',function(b){a=b.target,a.setAttrs({scale:{x:1,y:1}}),a.parent.draw()}).onKonva('mouseout mouseup touchend',function(a){setTimeout(function(){c.enableMapEvents()})}).onKonva('mousedown touchstart',this.onMouseDown.bind(this)),e=['mouseout','mousedown','mouseover','mouseout','touchstart','touchend','touchup'];e.forEach(function(a){c.onKonva(a,function(b){h(a,b,d)})})}}),module.exports=a

@@ -5,3 +5,3 @@ {

"description": "2d map visualization lib",
"version": "0.0.59",
"version": "0.0.60",
"scripts": {

@@ -8,0 +8,0 @@ "test": "mocha -r jscoverage test"

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

function a(b,d){this.options=c.deepMerge(a.options,d),this.stage=b}var b=require('bcore/event'),c=require('bcore/utils'),d=require('./../leaflet');a.options={transition:'opacity 0.4s',blending:'lighter',lazyFresh:!0,ptNPerLayer:1e3},a=b.extend(a,{addTo:function(a){this._map=a,this.resetVariables(),this.initEventsMap()},resetOffset:function(){this.pOffset=this.offset},disable:function(){this.isable=!1,this.stage.content.style.display='none'},enable:function(){this.isable=!0,this.stage.content.style.display='block'},resetVariables:function(){this.isable=!0,this.shapes={},this.layers=[],this.offset={x:0,y:0},this.pOffset={x:0,y:0}},add:function(a){this.stage.add(a)},addOrSetShape:function(a){var g=a.Constructor,h=a.index,e=a.attrs,i=a.data,b=a.id,c=this.shapes;if(c[b])return c[b].setAttrs(e);var d=new g(e),f=this.getOrAddLayer(h);f.getCanvas().getContext('2d').globalCompositeOperation=this.options.blending,f.add(d),c[b]=d,d.__data=i},getOrAddLayer:function(b){if(!this.isable)return;b=Math.floor(b/this.options.ptNPerLayer);var c=this.layers,a=c[b];return a?a:(a=new Konva.Layer({'z-index':1e4-b}),c[b]=a,this.stage.add(a),a)},fresh:function(){this.layers.forEach(function(a){a.draw()})},lazyFresh:function(){if(!this.isable)return;this.lazyFreshDraw(0)},lazyFreshDraw:function(b){var c=this;b=b||0;var a=this.layers[b];if(!a)return window.requestAnimationFrame(this.lazyFreshDone.bind(this));a.draw(),this.resetPos(a.canvas._canvas,{x:c.offset.x-c.pOffset.x,y:c.offset.y-c.pOffset.y}),a.canvas._canvas.style.opacity=1,a.canvas._canvas.style.transition=this.options.lazyFresh.transition,b++,this.lazyFreshId=window.requestAnimationFrame(function(){this.lazyFreshDraw(b)}.bind(this))},lazyFreshDone:function(){this.resetPos(this.stage.content),this.layers.forEach(function(a){d.DomUtil.setPosition(a.canvas._canvas,{x:0,y:0})})},resetPos:function(b,a){if(a=a||d.DomUtil.getPosition(this._map.getPanes().mapPane),!a)return;d.DomUtil.setPosition(b,{x:-a.x,y:-a.y})},stopLazyFresh:function(){if(!this.lazyFreshId)return;window.cancelAnimationFrame(this.lazyFreshId),this.lazyFreshId=null},hideLayers:function(){this.layers.forEach(function(a){a.canvas._canvas.style.opacity=0})},updateOptions:function(a){this.options=c.deepMerge(this.options,a),this.updateBlending()},updateBlending:function(b){var a=this.options;this.layers.forEach(function(b){b.getCanvas().getContext('2d').globalCompositeOperation=a.blending})},initEventsMap:function(){var a=this,b=this._map;b.on('zoomstart',function(){a.hideLayers(),a.stopLazyFresh()}).on('movestart',function(){a.stopLazyFresh()}).on('moveend',function(){a.pOffset=a.offset,a.offset=d.DomUtil.getPosition(b.getPanes().mapPane)}).on('resize',function(){console.log('resize')})},onKonva:function(a,b){return this.stage.on(a,b),this},enableMapEvents:function(){var a=this.stage.content;d.DomEvent.off(a,'click',d.DomEvent._fakeStop),d.DomEvent.off(a,'mousedown',d.DomEvent.stopPropagation),d.DomEvent.off(a,'mousemove',d.DomEvent.stopPropagation),this._map.dragging.enable()},disableMapEvents:function(){var a=this.stage.content;d.DomEvent.on(a,'click',d.DomEvent._fakeStop),d.DomEvent.on(a,'mousedown',d.DomEvent.stopPropagation),d.DomEvent.on(a,'mousemove',d.DomEvent.stopPropagation),this._map.dragging.disable()}}),a.prototype=c.merge(a.prototype,require('./leaflet_layer_konva.editor')),module.exports=a
function a(b,d){this.options=c.deepMerge(a.options,d),this.stage=b}var b=require('bcore/event'),c=require('bcore/utils'),d=require('./../leaflet');a.options={transition:'opacity 0.4s',blending:'lighter',lazyFresh:!0,ptNPerLayer:1e3},a=b.extend(a,{beginDraw:function(){this.versionID=Math.random()},endDraw:function(){var a=this.shapes;for(var b in a){var c=a[b];c.__versionID!==this.versionID&&(c.destroy(),delete a[b])}this.lazyFresh()},cleanOld:function(){var c=this.versionID,b=this.cache,d,a,f;if(!(c&&b))return;for(var e in b)d=b[e],f=d.versionID,f!==c&&(a=d.visual,a&&(a.off&&a.off(),a.destroy&&a.destroy()),delete b[e])},addTo:function(a){this._map=a,this.resetVariables(),this.initEventsMap()},resetOffset:function(){this.pOffset=this.offset},disable:function(){this.isable=!1,this.stage.content.style.display='none'},enable:function(){this.isable=!0,this.stage.content.style.display='block'},resetVariables:function(){this.isable=!0,this.shapes={},this.layers=[],this.offset={x:0,y:0},this.pOffset={x:0,y:0}},add:function(a){this.stage.add(a)},addOrSetShape:function(a){var g=a.Constructor,h=a.index,e=a.attrs,i=a.data,c=a.id,d=this.shapes;if(d[c])return d[c].setAttrs(e);var b=new g(e),f=this.getOrAddLayer(h);f.getCanvas().getContext('2d').globalCompositeOperation=this.options.blending,f.add(b),d[c]=b,b.__versionID=this.versionID,b.__data=i},getOrAddLayer:function(b){if(!this.isable)return;b=Math.floor(b/this.options.ptNPerLayer);var c=this.layers,a=c[b];return a?a:(a=new Konva.Layer({'z-index':1e4-b}),c[b]=a,this.stage.add(a),a)},fresh:function(){this.layers.forEach(function(a){a.draw()})},lazyFresh:function(){if(!this.isable)return;this.lazyFreshDraw(0)},lazyFreshDraw:function(b){var c=this;b=b||0;var a=this.layers[b];if(!a)return window.requestAnimationFrame(this.lazyFreshDone.bind(this));a.draw(),this.resetPos(a.canvas._canvas,{x:c.offset.x-c.pOffset.x,y:c.offset.y-c.pOffset.y}),a.canvas._canvas.style.opacity=1,a.canvas._canvas.style.transition=this.options.lazyFresh.transition,b++,this.lazyFreshId=window.requestAnimationFrame(function(){this.lazyFreshDraw(b)}.bind(this))},lazyFreshDone:function(){this.resetPos(this.stage.content),this.layers.forEach(function(a){d.DomUtil.setPosition(a.canvas._canvas,{x:0,y:0})})},resetPos:function(b,a){if(a=a||d.DomUtil.getPosition(this._map.getPanes().mapPane),!a)return;d.DomUtil.setPosition(b,{x:-a.x,y:-a.y})},stopLazyFresh:function(){if(!this.lazyFreshId)return;window.cancelAnimationFrame(this.lazyFreshId),this.lazyFreshId=null},hideLayers:function(){this.layers.forEach(function(a){a.canvas._canvas.style.opacity=0})},updateOptions:function(a){this.options=c.deepMerge(this.options,a),this.updateBlending()},updateBlending:function(b){var a=this.options;this.layers.forEach(function(b){b.getCanvas().getContext('2d').globalCompositeOperation=a.blending})},initEventsMap:function(){var a=this,b=this._map;b.on('zoomstart',function(){a.hideLayers(),a.stopLazyFresh()}).on('movestart',function(){a.stopLazyFresh()}).on('moveend',function(){a.pOffset=a.offset,a.offset=d.DomUtil.getPosition(b.getPanes().mapPane)}).on('resize',function(){console.log('resize')})},onKonva:function(a,b){return this.stage.on(a,b),this},enableMapEvents:function(){var a=this.stage.content;d.DomEvent.off(a,'click',d.DomEvent._fakeStop),d.DomEvent.off(a,'mousedown',d.DomEvent.stopPropagation),d.DomEvent.off(a,'mousemove',d.DomEvent.stopPropagation),this._map.dragging.enable()},disableMapEvents:function(){var a=this.stage.content;d.DomEvent.on(a,'click',d.DomEvent._fakeStop),d.DomEvent.on(a,'mousedown',d.DomEvent.stopPropagation),d.DomEvent.on(a,'mousemove',d.DomEvent.stopPropagation),this._map.dragging.disable()},destroy:function(){this.stage.clearCache(),this.stage.clear()}}),a.prototype=c.merge(a.prototype,require('./leaflet_layer_konva.editor')),module.exports=a
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