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

ldmap

Package Overview
Dependencies
Maintainers
4
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.1.42 to 0.1.43

2

layer/stream_popups/index.js

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

function f(a){this.options=c.deepMerge(this.options,a)}var d=require('bcore/event'),c=require('bcore/utils'),a=require('jquery'),b=require('lodash'),e='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQEAAAEBCAYAAAB47BD9AAAACXBIWXMAAAsSAAALEgHS3X78AAATNElEQVR42u2d3XEbRxaFj5UAmQGxCZB0BIIjEByBoHdUGYrAUASGqviuYQQGI9AgggWQwA4yICLQPvTAoGxZmp7unumf71SxvFvFH6in+5tz7+2+/dOXL1+ECtLD7bWk++9+z+JQM1Dl6CcgkNUCv5d0LWna/ve82O8lXfX8rSdJu/Z/1y/++6zFYcegAwE07oKftgv8XtLdSJ9kK6lpwbADDEAAhV30s3bhv474k55aIJgvoAAEkFPsfl70Mwc7P7aOLRA2Whw2PFgggH68+Ofton+T4b/uJGkDEIAA+rbVXyb+xu/jEDaS1locGiYBECj5rb/UeEm9WLRtYYA7AALFxPrL9uuKAfmHO1hpcagYCiDA4gcGVesOnhkOIMDi96e9pK6L6jqCMAVnAASSB8Bq4MV/1GXjTvPXl2vi7bIT8eWOxPuB/11LcgZAIKXFP5O0lnQT8K+cN+XsdNmt9zzwv/MlEKYKv4lp28KADUhAINrFP2lj2VCLYa9LnX0X6Ri83OAUCoIf2zCBfAEQiGryLyWtAljkfQuWTXL1dAPFmaR5gPzCUdKcE49AINe3/zk7XmWzkcbkFebtl09Q4gqAwKgTe97G/r4m9ZNMWawuYNzmHsF5lDQjVwAEhpzE1+2b2tf+/sf2bdYUNo7TFgZvPf3GD1ocVkxQIDCEra08xLin1kWwIcaEVCtPMNi2roDwAAhEbf/LfPN3g0H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FgQAq+E3LjcJAAA3kBmrFuYGIG4WBABpQ88g+DzcKAwE0sBtoFFebcpKBQACNoJXiKBnSPhwIoJHcQCynDOc8DCCAxgPB2D0HuFEYCKCC38T0CgACKBI3UGuckiGnBIEAikhDZ+e5URgIoMjcwNBtyucMOhBAcbqBIUqGlASBAIrUDQx1szEbgzIStxLnqLA3G3OjME4AJaBVoN/LjcJAACUSFlQKUzLkRmEggAp2A9woDARQYm6glt+SIWEAEECJugEfJUNuFAYCKFE30MhPyZAwAAighOV6ypAbhYEAStwNuPQc4JQgEECZgKBSvzbl3CgMBFBGss3uc6MwEECZuYFa0pPFT9ArAAiggt0ANwoDAZSpG2jU7WbjFYMFBFC++tHNxpQEgQDK3A38qGSICwACqAAQ/NsGIm4UBgKoIM3/9v+5URgIoMLcQK2vew5wozAQQAW7AW4UBgKoUDfQyPQcoFdAwfo/Y31G2mVm8jQAAAAASUVORK5CYII=';module.exports=d.extend(f,{options:{isCache:!1,cacheCount:1e3,popupNum:10,isOrder:!1,iconUrl:'',iconSize:50,fontFamily:'Microsoft Yahei',contentBack:'#94E55D',contentWidth:80,contentHeight:20,fontColor:'#fff',fontSize:12,spreadTime:.5,keepTime:1,fadeTime:1,updateTime:1,getLat:function(a){return+a.lat},getLng:function(a){return+a.lng},getContent:function(a){return a.info||'请补充info字段'}},initPopup:function(c){var f=Math.random().toString(36).substr(2),g=L.marker(L.latLng(this.options.getLat(c),this.options.getLng(c)),{icon:L.divIcon({iconSize:null,className:'stream-popup-icon',html:'<div style="position:relative;transform: translate(0, -50%);left:'+this.options.iconSize/2+'px;"><div id='+f+' style="text-align:center;display: flex; align-items: center; justify-content: center;padding:2px;font-family:'+this.options.fontFamily+'; color:rgba(0,0,0,0);">'+this.options.getContent(c)+'</div></div>'})}),d=L.marker(L.latLng(this.options.getLat(c),this.options.getLng(c)),{icon:L.icon({iconUrl:this.options.iconUrl||e,iconSize:[this.options.iconSize,this.options.iconSize],iconAnchor:[this.options.iconSize/2,this.options.iconSize]})});d.addTo(this.map),g.addTo(this.map),this.popups=this.popups||{},this.popups[f]=[g,d];var h=a('#'+f);h.css({width:0,'font-size':this.options.fontSize+'px',height:this.options.contentHeight+'px',background:this.options.contentBack});var b=this;h.animate({width:this.options.contentWidth},b.options.spreadTime*1e3,'linear',function(){a(this).css('color',b.options.fontColor);var c=this;setTimeout(function(){a(c).animate({opacity:0},b.options.fadeTime*1e3,'linear',function(){b.map.removeLayer(g)}),a(d._icon).animate({opacity:0},b.options.fadeTime*1e3,'linear',function(){b.map.removeLayer(d)})},b.options.keepTime*1e3)})},addTo:function(a){this.map=a},setData:function(a){if(!a||a.length===0)return;if(this.data=this.data||[],this.options.isCache?([].push.apply(this.data,a),this.data=b.slice(this.data,0,this.options.cacheCount)):(this.data=a,this.removeAllPopups()),this.timer)return;this.random(a)},random:function(){if(this.options.isOrder){var a=this.data.splice(0,this.options.popupNum);this.addPopups(a),[].push.apply(this.data,a)}else{var a=b.shuffle(this.data);this.addPopups(b.slice(a,0,this.options.popupNum))}this.timer=setTimeout(this.random.bind(this),this.options.updateTime*2e3)},addPopups:function(b){var a=this;b.forEach(function(b){a.initPopup(b)})},updateOptions:function(a){this.options=c.deepMerge(this.options,a)},removeAllPopups:function(){if(!this.popups)return;var a=this;for(var b in this.popups)Array.isArray(this.popups)&&this.popups[b].forEach(function(b){a.map.removeLayer(b)})},destory:function(){this.timer&&cancelAnimationFrame(this.timer),this.removeAllPopups(),this.data=null}})
function f(a){this.options=c.deepMerge(this.options,a)}var d=require('bcore/event'),c=require('bcore/utils'),a=require('jquery'),b=require('lodash'),e='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQEAAAEBCAYAAAB47BD9AAAACXBIWXMAAAsSAAALEgHS3X78AAATNElEQVR42u2d3XEbRxaFj5UAmQGxCZB0BIIjEByBoHdUGYrAUASGqviuYQQGI9AgggWQwA4yICLQPvTAoGxZmp7unumf71SxvFvFH6in+5tz7+2+/dOXL1+ECtLD7bWk++9+z+JQM1Dl6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exports=d.extend(f,{options:{isCircle:!0,isCache:!1,cacheCount:1e3,popupNum:10,isOrder:!1,iconUrl:'',iconSize:50,iconWidth:50,iconHeight:50,iconOffsetX:25,iconOffsetY:50,fontFamily:'Microsoft Yahei',contentBack:'#94E55D',contentWidth:80,contentHeight:20,contentALign:'center',contentOffsetX:25,contentOffsetY:50,fontColor:'#fff',fontSize:12,spreadTime:.5,keepTime:1,fadeTime:1,updateTime:1,getLat:function(a){return+a.lat},getLng:function(a){return+a.lng},getContent:function(a){return a.info||'请补充info字段'}},initPopup:function(c){var d=Math.random().toString(36).substr(2),g;this.options.isCircle&&(g=L.circleMarker(L.latLng(this.options.getLat(c),this.options.getLng(c)),{radius:4,fillColor:'#0ff',fillOpacity:0,stroke:!0,weight:2,color:'#0ff'}).addTo(this.map));var h=L.marker(L.latLng(this.options.getLat(c),this.options.getLng(c)),{icon:L.divIcon({iconSize:null,className:'stream-popup-icon',iconAnchor:[this.options.contentOffsetX,this.options.contentOffsetY],html:'<div id='+d+' style="text-align:center;display: flex; align-items: center; justify-content: center; text-align:'+this.options.contentALign+';padding:2px;font-family:'+this.options.fontFamily+'; color:rgba(0,0,0,0);">'+this.options.getContent(c)+'</div>'})}),f=L.marker(L.latLng(this.options.getLat(c),this.options.getLng(c)),{icon:L.icon({iconUrl:this.options.iconUrl||e,iconSize:[this.options.iconWidth,this.options.iconHeight],iconAnchor:[this.options.iconOffsetX,this.options.iconOffsetY]})});f.addTo(this.map),h.addTo(this.map),this.popups=this.popups||{},this.popups[d]=[h,f],g&&this.popups[d].push(g);var i=a('#'+d);i.css({width:0,'font-size':this.options.fontSize+'px',height:this.options.contentHeight+'px',background:this.options.contentBack});var b=this;i.animate({width:this.options.contentWidth},b.options.spreadTime*1e3,'linear',function(){a(this).css('color',b.options.fontColor);var c=this;setTimeout(function(){a(c).animate({opacity:0},b.options.fadeTime*1e3,'linear',function(){b.map.removeLayer(h),b.map.removeLayer(g)}),a(f._icon).animate({opacity:0},b.options.fadeTime*1e3,'linear',function(){b.map.removeLayer(f)})},b.options.keepTime*1e3)})},addTo:function(a){this.map=a},setData:function(a){if(!a||a.length===0)return;if(this.data=this.data||[],this.options.isCache?([].push.apply(this.data,a),this.data=b.slice(this.data,0,this.options.cacheCount)):(this.data=a,this.removeAllPopups()),this.timer)return;this.random(a)},random:function(){if(this.options.isOrder){var a=this.data.splice(0,this.options.popupNum);this.addPopups(a),[].push.apply(this.data,a)}else{var a=b.shuffle(this.data);this.addPopups(b.slice(a,0,this.options.popupNum))}this.timer=setTimeout(this.random.bind(this),this.options.updateTime*2e3)},addPopups:function(b){var a=this;b.forEach(function(b){a.initPopup(b)})},updateOptions:function(a){this.options=c.deepMerge(this.options,a)},removeAllPopups:function(){if(!this.popups)return;var a=this;for(var b in this.popups)Array.isArray(this.popups)&&this.popups[b].forEach(function(b){a.map.removeLayer(b)})},destory:function(){this.timer&&cancelAnimationFrame(this.timer),this.removeAllPopups(),this.data=null}})

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

"description": "2d map visualization lib",
"version": "0.1.42",
"version": "0.1.43",
"scripts": {

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

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