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.57 to 0.0.59

2

layer/tilelayer.js

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

function a(g,d,i){var a=e.deepMerge(g.options,i),c=g.variants,b;if(!c)return a;if(d&&d.length===2){var f=d[1];return b=c[f],a[f]=b.value,a}if(a.variant&&c){var h=a.variant;if(b=c[h],!b)return a;a.variant=typeof b==='string'?b:b.value,b.options&&(a=e.deepMerge(a,b.options))}return a}function b(a){var c=a.attribution;return c?c.indexOf('{attribution.')===-1?a:(a.attribution=c.replace(/\{attribution.(\w*)\}/,function(c,a){return b(d[a].options)}),a):a}var c=require('leaflet'),d=require('./tilelayer_data');delete d.__filename;var e=require('./../core/utils'),f=e.switchValue,g=c.TileLayer.extend({initialize:function(e,f){if(typeof e==='object'&&(f=e,e=f.url),e.indexOf('{')===-1&&(this.tileName=e),this._options=f,this.tData=d,typeof e!=='string')return console.log('输入必须为字符形式');if(e.indexOf('{')!==-1)return c.TileLayer.prototype.initialize.call(this,e,f);var g=e.split('.'),i=g[0],h=d[i]||d.AtlasLight,j=h.url;f=a(h,g,f),f=b(f),c.TileLayer.prototype.initialize.call(this,j,f)},update:function(d){var f=d.url,c=a(d,null,this._options);c=b(c),this.options=e.deepMerge(this.options,c),this.setUrl(f)},help:function(){console.log('L.dmap.tileLayer(name, options)\n---name可以是:\n\n\n');for(var a in d){var b=d[a].options,c=b.name;console.log(a+' | '+c)}},setVariables:function(){}}),h=c.dmap=c.dmap||{};h.TileLayer=g,h.tileLayer=function(a,b){return new h.TileLayer(a,b)},module.exports=g
function a(g,d,i){var a=e.deepMerge(g.options,i),c=g.variants,b;if(!c)return a;if(d&&d.length===2){var f=d[1];return b=c[f],a[f]=b.value,a}if(a.variant&&c){var h=a.variant;if(b=c[h],!b)return a;a.variant=typeof b==='string'?b:b.value,b.options&&(a=e.deepMerge(a,b.options))}return a}function b(a){var c=a.attribution;return c?c.indexOf('{attribution.')===-1?a:(a.attribution=c.replace(/\{attribution.(\w*)\}/,function(c,a){return b(d[a].options)}),a):a}var c=require('leaflet'),d=require('./tilelayer_data');delete d.__filename;var e=require('./../core/utils'),f=e.switchValue,g=c.TileLayer.extend({initialize:function(a,b){this.update(a,b,!0)},update:function(f,e,j){if(typeof f==='object'&&(e=f,f=e.url),f.indexOf('{')===-1&&(this.tileName=f),this._options=e,this.tData=d,typeof f!=='string')return console.log('输入必须为字符形式');if(f.indexOf('{')!==-1)return c.TileLayer.prototype.initialize.call(this,f,e),j?void 0:c.TileLayer.prototype.setUrl.call(this,f,e);var g=f.split('.'),k=g[0],h=d[k]||d.AtlasLight,i=h.url;if(e=a(h,g,e),e=b(e),c.TileLayer.prototype.initialize.call(this,i,e),j)return;this.setUrl(i,e),this.redraw()},help:function(){console.log('L.dmap.tileLayer(name, options)\n---name可以是:\n\n\n');for(var a in d){var b=d[a].options,c=b.name;console.log(a+' | '+c)}},setVariables:function(){}}),h=c.dmap=c.dmap||{};h.TileLayer=g,h.tileLayer=function(a,b){return new h.TileLayer(a,b)},module.exports=g
{
"author": "zhouningyi <ningyi.zny@alibaba-inc.com>",
"author": "zhouningyi <zny@918@126.com>",
"name": "ldmap",
"description": "2d map visualization lib",
"version": "0.0.57",
"version": "0.0.59",
"scripts": {

@@ -43,6 +43,4 @@ "test": "mocha -r jscoverage test"

"cube": {
"moduleMap": {
}
"moduleMap": {}
}
}
}

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

function b(c,a){a=this.options=d.deepMerge(b.options,a),this.initialize(c,a)}var a=require('jquery'),c=require('leaflet'),d=require('./../core/utils'),e=require('bcore/event'),a=require('keyanim');require('./ui_animate.css'),require('./tile_selector.css');var f=require('dat-gui'),g=d.switchValue;b.options={style:{left:'5%',top:'5%'}},b=e.extend(b,{initialize:function(a,b){this.container=a,this.initDom()},initDom:function(){var c=this.options,d=this.container,b=this.button=a('<div class="tile-selector">瓦片层 <div class="tile-selector-sub-wrapper"> <div class="tile-selector-sub-panel tile-selector-hide"> <div class=main></div> <div class=detail></div> </div> <div> <div> ').css(c.style).appendTo(d);this.subPanelNode=b.find('.tile-selector-sub-panel'),this.detailNode=b.find('.detail'),this.initEvents()},initEvents:function(){this.button.on('touchstart mousedown',this.switch.bind(this)),this.subPanelNode.on('touchstart mousedown',function(a){a.stopPropagation()})},bindTo:function(a){this.tilelayer=a,this._data=a.tData,this._map=a._map,this.initEventMap()},render:function(d){d&&this.bindTo(d);var e=this.tilelayer.tileName,h=this.subPanelNode,b=this._data,c,f,g;for(var a in b){if(c=b[a],c.disable)continue;f=a===e,g=this.renderGrid(c,a,f),this.initEventsGrid(g)}this.initInitFilter()},renderGrid:function(d,e,f){var c=this.subPanelNode.find('.main'),b=a('<div class="grid" id="'+e+'">'+d.options.name+'</div>').appendTo(c);return f&&this.selectGrid(b),this.initEventGrid(b),b},initEventMap:function(){this._map.on('click',this.hide.bind(this))},initEventGrid:function(d){var b=this.tilelayer,c=this._data;d.on('touchstart mousedown',function(h){var e=a(this).attr('id'),d=c[e];if(!d)return;var f=g(d.url,d.options);return b.update?b.update(d):b.setUrl(f)})},initEventsGrid:function(a){a.on('click',function(){this.selectGrid(a)}.bind(this))},selectGrid:function(a){this.curGird&&this.curGird.removeClass('grid-selected'),this.curGird=a.addClass('grid-selected')},switch:function(){if(this.isShow)return this.hide();this.show()},hide:function(){if(!this.isShow)return;this.subPanelNode.keyAnim('toolsOutLeft',{time:.3}),this.isShow=!1},show:function(){if(this.isShow)return;this.subPanelNode.css('display','block').keyAnim('toolsInLeft',{time:.3}),this.isShow=!0},initInitFilter:function(){var j=this.tilelayer,b=j._filter;if(!b)return;var h=this.detailNode,l=b.options,e=new f.gui.GUI({width:h.width(),autoPlace:!1});h.append(a(e.domElement));var c=e.addFolder('滤镜');c.open();var g=e.addFolder('其他');g.open();var d=b.updateStyle.bind(b),i={saturate:c.add(b.options,'saturate',0,200).name('饱和度(%)').onChange(d),grayscale:c.add(b.options,'grayscale',0,100).name('灰度(%)').onChange(d),brightness:c.add(b.options,'brightness',0,200).name('亮度(%)').onChange(d),contrast:c.add(b.options,'contrast',0,200).name('对比(%)').onChange(d),opacity:c.add(b.options,'opacity',0,1).name('透明(0-1)').onChange(d),hueRotate:c.add(b.options,'hueRotate',0,360).name('色相(deg)').onChange(d),blur:c.add(b.options,'blur',0,20).name('模糊(px)').onChange(d),invert:c.add(b.options,'invert',0,100).name('反向(%)').onChange(d),anim:g.add(b.options,'anim',0,3).name('缓动(秒)').onChange(d)},k={clear:!1};g.add(k,'clear').name('清除样式').onChange(function(c){c&&b.cleanStyle();for(var a in i)i[a].updateDisplay()})}}),module.exports=b
function b(c,a){a=this.options=d.deepMerge(b.options,a),this.initialize(c,a)}var a=require('jquery'),c=require('leaflet'),d=require('./../core/utils'),e=require('bcore/event'),a=require('keyanim');require('./ui_animate.css'),require('./tile_selector.css');var f=require('dat-gui'),g=d.switchValue;b.options={style:{left:'5%',top:'5%'}},b=e.extend(b,{initialize:function(a,b){this.container=a,this.initDom()},initDom:function(){var c=this.options,d=this.container,b=this.button=a('<div class="tile-selector">瓦片层 <div class="tile-selector-sub-wrapper"> <div class="tile-selector-sub-panel tile-selector-hide"> <div class=main></div> <div class=detail></div> </div> <div> <div> ').css(c.style).appendTo(d);this.subPanelNode=b.find('.tile-selector-sub-panel'),this.detailNode=b.find('.detail'),this.initEvents()},initEvents:function(){this.button.on('touchstart mousedown',this.switch.bind(this)),this.subPanelNode.on('touchstart mousedown',function(a){a.stopPropagation()})},bindTo:function(a){this.tilelayer=a,this._data=a.tData,this._map=a._map,this.initEventMap()},render:function(d){d&&this.bindTo(d);var e=this.tilelayer.tileName,h=this.subPanelNode,b=this._data,c,f,g;for(var a in b){if(c=b[a],c.disable)continue;f=a===e,g=this.renderGrid(c,a,f),this.initEventsGrid(g)}this.initInitFilter()},renderGrid:function(d,e,f){var c=this.subPanelNode.find('.main'),b=a('<div class="grid" id="'+e+'">'+d.options.name+'</div>').appendTo(c);return f&&this.selectGrid(b),this.initEventGrid(b),b},initEventMap:function(){this._map.on('click',this.hide.bind(this))},initEventGrid:function(d){var b=this.tilelayer,c=this._data;d.on('touchstart mousedown',function(h){var e=a(this).attr('id'),d=c[e];if(!d)return;var f=g(d.url,d.options);return b.update(e)})},initEventsGrid:function(a){a.on('click',function(){this.selectGrid(a)}.bind(this))},selectGrid:function(a){this.curGird&&this.curGird.removeClass('grid-selected'),this.curGird=a.addClass('grid-selected')},switch:function(){if(this.isShow)return this.hide();this.show()},hide:function(){if(!this.isShow)return;this.subPanelNode.keyAnim('toolsOutLeft',{time:.3}),this.isShow=!1},show:function(){if(this.isShow)return;this.subPanelNode.css('display','block').keyAnim('toolsInLeft',{time:.3}),this.isShow=!0},initInitFilter:function(){var j=this.tilelayer,b=j._filter;if(!b)return;var h=this.detailNode,l=b.options,e=new f.gui.GUI({width:h.width(),autoPlace:!1});h.append(a(e.domElement));var c=e.addFolder('滤镜');c.open();var g=e.addFolder('其他');g.open();var d=b.updateStyle.bind(b),i={saturate:c.add(b.options,'saturate',0,200).name('饱和度(%)').onChange(d),grayscale:c.add(b.options,'grayscale',0,100).name('灰度(%)').onChange(d),brightness:c.add(b.options,'brightness',0,200).name('亮度(%)').onChange(d),contrast:c.add(b.options,'contrast',0,200).name('对比(%)').onChange(d),opacity:c.add(b.options,'opacity',0,1).name('透明(0-1)').onChange(d),hueRotate:c.add(b.options,'hueRotate',0,360).name('色相(deg)').onChange(d),blur:c.add(b.options,'blur',0,20).name('模糊(px)').onChange(d),invert:c.add(b.options,'invert',0,100).name('反向(%)').onChange(d),anim:g.add(b.options,'anim',0,3).name('缓动(秒)').onChange(d)},k={clear:!1};g.add(k,'clear').name('清除样式').onChange(function(c){c&&b.cleanStyle();for(var a in i)i[a].updateDisplay()})}}),module.exports=b

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