Comparing version 0.1.10 to 0.1.12
@@ -1,1 +0,1 @@ | ||
"use strict";function t(t){var n=Math.floor(1e7*Math.random()),e=(new Date).getTime();return t+"_"+e+"_"+n}function n(t,n){n||(n=N(t.target)),n=N(n);var e,r,o=n.width(),i=n.height(),a=n.offset(),u=a.left,f=a.top;if(-1!==t.type.indexOf("mouse"))return e=t.x||t.pageX,r=t.y||t.pageY,[e-u,r-f];var l=window.event.touches[0];return e=l.pageX-u,r=l.pageY-f,e=o>e?e:o,e=e>0?e:1,r=i>r?r:i,r=r>0?r:1,[e,r]}function e(t){if(t.fromLat&&t.fromLng)return{lat:t.fromLat,lng:t.fromLng};if(t.from){var n=t.from;return"string"==typeof n&&-1!==n.indexOf(",")?(n=n.split(",")[1],{lat:n[1],lng:n[0]}):n}}function r(t){if(t.toLat&&t.toLng)return{lat:t.toLat,lng:t.toLng};if(t.to){var n=t.to;return"string"==typeof n&&-1!==n.indexOf(",")?(n=n.split(",")[1],{lat:n[1],lng:n[0]}):n}}function o(t){var n,e,r=t.length,o=0,i=q.LatLng.DEG_TO_RAD;if(r>2){for(var a=0;r>a;a++)n=t[a],e=t[(a+1)%r],o+=(e.lng-n.lng)*i*(2+Math.sin(n.lat*i)+Math.sin(e.lat*i));o=6378137*o*6378137/2}return Math.abs(o)}function i(t){for(var n=0,e=t.length,r=0;e>r;r++){var o=(r+1)%e;n+=t[r].distanceTo(t[o])}return n}function a(t,n,e){var r=n.target,o=r.__data,i="child-"+t;e.fire(i,{layer:r,data:o})}function u(t,n,e,r,o){return"function"==typeof t?t(n,e,r,o):t}function f(t,n){if(!t)return console.log("节点不存在");for(var e in n)t.style[e]=n[e]}function l(t){return t?("number"==typeof t&&(t=t.toString()),t.length>20?t.substring(0,20):t):""}function g(t){if("string"!=typeof t)return!1;var n=["http://","https://","www."];for(var e in n)if(-1!==t.indexOf(n[e]))return!0}function c(t,n,e){var r;return g(t)?r=t:t=l(t),e?r?'<a href="'+r+'">点击查看</a><br>':"<div>"+t+"</div><br>":r?'<div style="'+J+'"> <div style="'+J+'">'+n+': </div> <a target="_Blank" style="'+k+'" href="'+r+'">『点击查看』</a> </div><br>':'<div style="'+J+'"> <div style="'+J+'">'+n+': </div> <a style="'+k+'">'+t+"</a> </div><br>"}function v(t,n){return n?0===t?"0":t&&t.toString()&&-1===t.toString().indexOf(".")?t:t.toFixed(n):t}function d(t,n){return n=n||2,1e4>t?v(t,n):1e8>t?v(t/1e4,n)+" 万":v(t/1e8,n)+" 亿"}function p(t,n){var e="array"==typeof t,r=void 0,o="";for(var i in t)r=t[i],"object"!==("undefined"==typeof r?"undefined":E(r))&&("number"==typeof r&&(r=d(r,2)),o+=c(r,i,e,n));return o}function s(t,n){return function(e){var r={};for(var o in t){var i=t[o];i in e&&(r[i]=e[i])}return p(r,n)}}function m(t){return function(n,e){var r=void 0,o=void 0,i=void 0;n&&e&&n.properties?(r=n,i=r.properties,o=e):o=n;var a={},u=void 0;return D.forEach(t,function(t,n){i&&(u=i[t]),o&&(u=u||o[t]),a[n]=u}),G.popupFromObject(P(a))}}function y(t){var n=G.getLat(t),e=G.getLng(t);if(n&&e){var r=j.BD092GCJ(n,e).lat;return r}}function h(t){var n=G.getLat(t),e=G.getLng(t);return n&&e?j.BD092GCJ(n,e).lng:void 0}function L(t){var n=G.getLat(t),e=G.getLng(t);return n&&e?j.WGS2GCJ(n,e).lat:void 0}function b(t){var n=G.getLat(t),e=G.getLng(t);return n&&e?j.WGS2GCJ(n,e).lng:void 0}function x(t){var n=G.getLat(t),e=G.getLng(t);return n&&e?j.GCJ2BD09(n,e).lat:void 0}function M(t){var n=G.getLat(t),e=G.getLng(t);return n&&e?j.GCJ2BD09(n,e).lng:void 0}function w(t,n,e,r,o){r=r||0,o=null===o||void 0===o?1:o;var i=e-n||.001,a=(Math.max(n,Math.min(e,t))-n)/i;return r+a*(o-r)}function S(t){return null===t||void 0===t||isNaN(t)?!1:"number"==typeof+t}function B(t,n){var e,r=n(t[0]),o=r,i="undefined"==typeof n?"undefined":E(n);return"function"===i?t.forEach(function(t,i){e=n(t,i),S(e)&&(r=Math.min(e,r),o=Math.max(e,o))}):"string"===i&&t.forEach(function(t){e=t[n],S(e)&&(r=Math.min(e,r),o=Math.max(e,o))}),{min:r,max:o}}function O(t,n,e){if(!t||!t.length)return{};e=e||.05;var r="function"==typeof n?n:function(t){return t[n]};t=D.filter(t,function(t){return!W(r(t))}),t=D.sortBy(t,function(t){return parseFloat(r(t),10)});var o=Math.floor(e*t.length),i=Math.floor((1-e)*t.length),a=r(t[o]),u=r(t[i]);return{min:Math.min(a,u),max:Math.max(a,u)}}var E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G=require("aliyun-map-utils"),_=require("./l_utils"),q=require("./../leaflet"),A=q.dmap=q.dmap||{},N=require("jquery"),j=require("./projection"),C=require("./curve_util"),D=require("lodash"),F=["mouseout","mousedown","mouseover","mouseout","touchstart","touchend","touchup","click"],T=["click","mouseover","mouseout","mousedown"],J="margin-right:5px; color:#999;white-space:nowrap; display:inline-block;",k="white-space:nowrap;color:#fff;display:inline-block;font-weight:bold;text-decoration:none;",P=function(t){var n=void 0;for(var e in t)n=t[e],(null===n||void 0===n||""===n)&&delete t[e],isNaN(n)&&"number"==typeof n&&delete t[e];return t},W=function(t){return"number"==typeof t?null===t||void 0===t||isNaN(t):!1};module.exports=A.Utils=G.merge(G,j,C,_,{getRangePercentTile:O,getLngBA:h,getLatBA:y,getLngAB:M,getLatAB:x,getLngWA:b,getLatWA:L,getFrom:e,getTo:r,getId:t,getPt:n,getRange:B,geodesicArea:o,getLengthPolyline:i,genPopupFromObject:s,popupFromObject:p,genPopupObject:m,fireEvent:a,getValue:u,applyCss:f,EVENTS:F,EVENTSBasic:T,numberFormater:d,map:w}); | ||
"use strict";function t(t){var n=Math.floor(1e7*Math.random()),e=(new Date).getTime();return t+"_"+e+"_"+n}function n(t,n){n||(n=N(t.target)),n=N(n);var e,r,o=n.width(),i=n.height(),a=n.offset(),u=a.left,f=a.top;if(-1!==t.type.indexOf("mouse"))return e=t.x||t.pageX,r=t.y||t.pageY,[e-u,r-f];var l=window.event.touches[0];return e=l.pageX-u,r=l.pageY-f,e=o>e?e:o,e=e>0?e:1,r=i>r?r:i,r=r>0?r:1,[e,r]}function e(t){if(t.fromLat&&t.fromLng)return{lat:t.fromLat,lng:t.fromLng};if(t.from){var n=t.from;return"string"==typeof n&&-1!==n.indexOf(",")?(n=n.split(",")[1],{lat:n[1],lng:n[0]}):n}}function r(t){if(t.toLat&&t.toLng)return{lat:t.toLat,lng:t.toLng};if(t.to){var n=t.to;return"string"==typeof n&&-1!==n.indexOf(",")?(n=n.split(",")[1],{lat:n[1],lng:n[0]}):n}}function o(t){var n,e,r=t.length,o=0,i=q.LatLng.DEG_TO_RAD;if(r>2){for(var a=0;r>a;a++)n=t[a],e=t[(a+1)%r],o+=(e.lng-n.lng)*i*(2+Math.sin(n.lat*i)+Math.sin(e.lat*i));o=6378137*o*6378137/2}return Math.abs(o)}function i(t){for(var n=0,e=t.length,r=0;e>r;r++){var o=(r+1)%e;n+=t[r].distanceTo(t[o])}return n}function a(t,n,e){var r=n.target,o=r.__data,i="child-"+t;e.fire(i,{layer:r,data:o})}function u(t,n,e,r,o){return"function"==typeof t?t(n,e,r,o):t}function f(t,n){if(!t)return console.log("节点不存在");for(var e in n)t.style[e]=n[e]}function l(t){return t?("number"==typeof t&&(t=t.toString()),t.length>20?t.substring(0,20):t):""}function g(t){if("string"!=typeof t)return!1;var n=["http://","https://","www."];for(var e in n)if(-1!==t.indexOf(n[e]))return!0}function c(t,n,e){var r;return g(t)?r=t:t=l(t),e?r?'<a href="'+r+'">点击查看</a><br>':"<div>"+t+"</div><br>":r?'<div style="'+J+'"> <div style="'+J+'">'+n+': </div> <a target="_Blank" style="'+k+'" href="'+r+'">『点击查看』</a> </div><br>':'<div style="'+J+'"> <div style="'+J+'">'+n+': </div> <a style="'+k+'">'+t+"</a> </div><br>"}function v(t,n){return n?0===t?"0":t&&t.toString()&&-1===t.toString().indexOf(".")?t:t.toFixed(n):t}function d(t,n){return n=n||2,1e4>t?v(t,n):1e8>t?v(t/1e4,n)+" 万":v(t/1e8,n)+" 亿"}function p(t,n){var e="array"==typeof t,r=void 0,o="";for(var i in t)r=t[i],"object"!==("undefined"==typeof r?"undefined":E(r))&&("number"==typeof r&&(r=d(r,2)),o+=c(r,i,e,n));return o}function s(t,n){return function(e){var r={};for(var o in t){var i=t[o];i in e&&(r[i]=e[i])}return p(r,n)}}function m(t){return function(n,e){var r=void 0,o=void 0,i=void 0;n&&e&&n.properties?(r=n,i=r.properties,o=e):o=n;var a={},u=void 0;return D.forEach(t,function(t,n){i&&(u=i[t]),o&&(u=o[t]||u),a[n]=u}),G.popupFromObject(P(a))}}function y(t){var n=G.getLat(t),e=G.getLng(t);if(n&&e){var r=j.BD092GCJ(n,e).lat;return r}}function h(t){var n=G.getLat(t),e=G.getLng(t);return n&&e?j.BD092GCJ(n,e).lng:void 0}function L(t){var n=G.getLat(t),e=G.getLng(t);return n&&e?j.WGS2GCJ(n,e).lat:void 0}function b(t){var n=G.getLat(t),e=G.getLng(t);return n&&e?j.WGS2GCJ(n,e).lng:void 0}function x(t){var n=G.getLat(t),e=G.getLng(t);return n&&e?j.GCJ2BD09(n,e).lat:void 0}function M(t){var n=G.getLat(t),e=G.getLng(t);return n&&e?j.GCJ2BD09(n,e).lng:void 0}function w(t,n,e,r,o){r=r||0,o=null===o||void 0===o?1:o;var i=e-n||.001,a=(Math.max(n,Math.min(e,t))-n)/i;return r+a*(o-r)}function S(t){return null===t||void 0===t||isNaN(t)?!1:"number"==typeof+t}function B(t,n){var e,r=n(t[0]),o=r,i="undefined"==typeof n?"undefined":E(n);return"function"===i?t.forEach(function(t,i){e=n(t,i),S(e)&&(r=Math.min(e,r),o=Math.max(e,o))}):"string"===i&&t.forEach(function(t){e=t[n],S(e)&&(r=Math.min(e,r),o=Math.max(e,o))}),{min:r,max:o}}function O(t,n,e){if(!t||!t.length)return{};e=e||.05;var r="function"==typeof n?n:function(t){return t[n]};t=D.filter(t,function(t){return!W(r(t))}),t=D.sortBy(t,function(t){return parseFloat(r(t),10)});var o=Math.floor(e*t.length),i=Math.floor((1-e)*t.length),a=r(t[o]),u=r(t[i]);return{min:Math.min(a,u),max:Math.max(a,u)}}var E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G=require("aliyun-map-utils"),_=require("./l_utils"),q=require("./../leaflet"),A=q.dmap=q.dmap||{},N=require("jquery"),j=require("./projection"),C=require("./curve_util"),D=require("lodash"),F=["mouseout","mousedown","mouseover","mouseout","touchstart","touchend","touchup","click"],T=["click","mouseover","mouseout","mousedown"],J="margin-right:5px; color:#999;white-space:nowrap; display:inline-block;",k="white-space:nowrap;color:#fff;display:inline-block;font-weight:bold;text-decoration:none;",P=function(t){var n=void 0;for(var e in t)n=t[e],(null===n||void 0===n||""===n)&&delete t[e],isNaN(n)&&"number"==typeof n&&delete t[e];return t},W=function(t){return"number"==typeof t?null===t||void 0===t||isNaN(t):!1};module.exports=A.Utils=G.merge(G,j,C,_,{getRangePercentTile:O,getLngBA:h,getLatBA:y,getLngAB:M,getLatAB:x,getLngWA:b,getLatWA:L,getFrom:e,getTo:r,getId:t,getPt:n,getRange:B,geodesicArea:o,getLengthPolyline:i,genPopupFromObject:s,popupFromObject:p,genPopupObject:m,fireEvent:a,getValue:u,applyCss:f,EVENTS:F,EVENTSBasic:T,numberFormater:d,map:w}); |
@@ -1,1 +0,1 @@ | ||
"use strict";var t=require("lodash"),i=require("./../leaflet"),e=require("./../core/utils"),n=e.isNone,o=require("./../core/utils").getColorFunc,s=o({from:"#002170",to:"#c5f2e7",easing:"Quadratic.Out.1.1",space:"rgb"}),a=e.switchValue,r=i.Class.extend({includes:[i.Mixin.Events],addTo:function(t){return this._map=t,this.geojson&&this.initGeojson(),this},geoJson:function(i){if(i){this.geojson=t.cloneDeep(i);var e=this._map;e&&(this.removeGeojson(),this.initGeojson())}},removeGeojson:function(t){t=t||this.geojsonLayer,t&&this._map.removeLayer(t)},initGeojson:function(){var t=this.options,e=this.genStyle(t.style),n=this.geojson,o=t.geoid.bind(t),s=this.layers=[],a=this,r=this.geojsonLayer=i.geoJson(n,{style:e,draggable:!1,onEachFeature:function(t,i){var e=o(t);s[e]=i,i.__feature=t,a.initEventChild(i,t)}});r.addTo(this._map),r.bringToBack(),this.initEventsPopup()},initEventChild:function(i,n){var o={feature:n,layer:i},s=this,a=(this.options.popup,this._map),r=t.filter(e.EVENTSBasic,function(t){return"mousedown"!==t});r.forEach(function(t){i.on(t,function(){return i.__data&&(o.data=i.__data),s.fire("child-"+t,o),!0})});var u=this.options,h=u.style.hover;h&&i.on("mouseover",function(){a.closePopup(),i.setStyle(h)}).on("mouseout",function(){i.setStyle(i.__style)})},initEventsPopup:function(){var t=this._map,i=this.options.popup;this.each(function(n){n&&(this.updatePopupPostion(n),e.initEventsPopup({parent:this,child:n,map:t,datas:[n.__feature,n.__data],popup:i}))}.bind(this))},updatePopupPostion:function(t){var n=(this._map,e.getTopPoint(t.__feature));t.popupPosition=i.latLng(n[1],n[0])},initialize:function(t){this.options=e.deepMerge(r.options,t)},getLayer:function(t){return t&&this.layers?this.layers[t]:void 0},genStyle:function(t,i,e,n,o){var s={};for(var r in t)s[r]=a(t[r],i,e,n,o);return s},each:function(t){if(t){var i=this.layers;for(var e in i)t(i[e],e)}},data:function(t){this._data=t,this.updateRange()},updateRange:function(){this.range=e.getRangePercentTile(this._data,this.options.value)},render:function(t){t&&this.data(t),this.draw()},updateOptions:function(t){this.options=e.deepMerge(this.options,t),this.updateRange(),this.draw()},draw:function(){var t,i,e,n=this._data,o={},s=this.options,a=s.filter,r=s.style,u=s.id.bind(s),h=s.value.bind(s);for(var p in n)t=n[p],i=u(t),o[i]=t;var d,c=(this.layers,this.range||{});this.each(function(i,n){t=o[n]||{},(!a||a(t))&&(e=h(t),d=this.genStyle(r,e,c.min,c.max),i.setStyle(d),i.__style=d,i.__data=t)}.bind(this)),this.initEventsPopup()},hide:function(){this.geojsonLayer&&this.geojsonLayer.setStyle({opacity:0})},show:function(){this.geojsonLayer&&this.geojsonLayer.setStyle({opacity:1})},getBounds:function(){return this._map?this.geojsonLayer.getBounds():void 0},destroy:function(){this.geojsonLayer&&this._map.removeLayer(this.geojsonLayer),this._data=null}});r.options={geoid:function(t){var i=t.id||t.adcode;if(i)return i;var e=t.properties;return e?e.id||e.adcode:void 0},id:function(t,i){return t?t.id||t.adcode:i},value:function(t){return t.value},style:{fillColor:function(t,i,e){if(!t)return"rgba(0,150,200,1)";var n=(t-i)/(e-i);return s(n)},color:"transparent",weight:2,opacity:1,fillOpacity:1,dashArray:null},filter:function(){return!0}};var u=i.dmap=i.dmap||{};u.Area=r,u.area=function(t){return new r(t)},module.exports=r; | ||
"use strict";var t=require("lodash"),i=require("./../leaflet"),e=require("./../core/utils"),n=e.isNone,o=require("./../core/utils").getColorFunc,s=o({from:"#002170",to:"#c5f2e7",easing:"Quadratic.Out.1.1",space:"rgb"}),a=e.switchValue,r=i.Class.extend({includes:[i.Mixin.Events],addTo:function(t){return this._map=t,this.geojson&&this.initGeojson(),this},geoJson:function(i){if(i){this.geojson=t.cloneDeep(i);var e=this._map;e&&(this.removeGeojson(),this.initGeojson())}},removeGeojson:function(t){t=t||this.geojsonLayer,t&&this._map.removeLayer(t)},initGeojson:function(){var t=this,e=this.options,n=this.genStyle(e.style),o=this.geojson,s=e.geoid.bind(e),a=this.layers=[],r=0,u=this.geojsonLayer=i.geoJson(o,{style:n,draggable:!1,onEachFeature:function(i,e){var n=s(i)||r++;a[n]=e,e.__feature=i,t.initEventChild(e,i)}});u.addTo(this._map),u.bringToBack(),this.initEventsPopup()},initEventChild:function(i,n){var o={feature:n,layer:i},s=this,a=(this.options.popup,this._map),r=t.filter(e.EVENTSBasic,function(t){return"mousedown"!==t});r.forEach(function(t){i.on(t,function(){return i.__data&&(o.data=i.__data),s.fire("child-"+t,o),!0})});var u=this.options,h=u.style.hover;h&&i.on("mouseover",function(){a.closePopup(),i.setStyle(h)}).on("mouseout",function(){i.setStyle(i.__style)})},initEventsPopup:function(){var t=this._map,i=this.options.popup;this.each(function(n){n&&(this.updatePopupPostion(n),e.initEventsPopup({parent:this,child:n,map:t,datas:[n.__feature,n.__data],popup:i}))}.bind(this))},updatePopupPostion:function(t){var n=(this._map,e.getTopPoint(t.__feature));t.popupPosition=i.latLng(n[1],n[0])},initialize:function(t){this.options=e.deepMerge(r.options,t)},getLayer:function(t){return t&&this.layers?this.layers[t]:void 0},genStyle:function(t,i,e,n,o){var s={};for(var r in t)s[r]=a(t[r],i,e,n,o);return s},each:function(t){if(t){var i=this.layers;for(var e in i)t(i[e],e)}},data:function(t){this._data=t,this.updateRange()},updateRange:function(){this.range=e.getRangePercentTile(this._data,this.options.value)},render:function(t){t&&this.data(t),this.draw()},updateOptions:function(t){this.options=e.deepMerge(this.options,t),this.updateRange(),this.draw()},draw:function(){var t=this;if(this.isable){var i,e,n,o=this._data,s={},a=this.options,r=a.filter,u=a.style,h=a.id.bind(a),p=a.value.bind(a);for(var d in o)i=o[d],e=h(i),s[e]=i;var c,l=(this.layers,this.range||{});this.each(function(e,o){i=s[o]||{},(!r||r(i))&&(n=p(i),c=t.genStyle(u,n,l.min,l.max),e.setStyle(c),e.__style=c,e.__data=i)}),this.initEventsPopup()}},hide:function(){var t=this;this.geojsonLayer&&this.geojsonLayer.setStyle({opacity:0,fillOpacity:0}),setTimeout(function(){t.isable=!1})},show:function(){var t=this;this.geojsonLayer&&this.geojsonLayer.setStyle({opacity:1,fillOpacity:1}),setTimeout(function(){t.isable=!0,t.draw()})},getBounds:function(){return this._map?this.geojsonLayer.getBounds():void 0},destroy:function(){this.geojsonLayer&&this._map.removeLayer(this.geojsonLayer),this._data=null}});r.options={geoid:function(t){var i=t.id||t.adcode;if(i)return i;var e=t.properties;return e?e.id||e.adcode:void 0},id:function(t,i){return t?t.id||t.adcode:i},value:function(t){return t.value},style:{fillColor:function(t,i,e){if(!t)return"rgba(0,150,200,1)";var n=(t-i)/(e-i);return s(n)},color:"transparent",weight:2,dashArray:null},filter:function(){return!0}};var u=i.dmap=i.dmap||{};u.Area=r,u.area=function(t){return new r(t)},module.exports=r; |
@@ -1,1 +0,1 @@ | ||
"use strict";function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t){t=this.options=s.deepMerge(e.options,t)}function n(t){return!t[0][0][0]}function i(t){return t.type&&-1!==t.type.toLowerCase().indexOf("feature")||t.features}var o,a=require("./../leaflet"),r=require("bcore/event"),s=require("./../core/utils"),u=s.isNone,h=s.fireEvent,c=require("konva"),p=a.dmap=a.dmap||{},f=require("./../render/leaflet_layer_konva"),d=s.getColorFunc({from:"rgba(245,230,0,1)",to:"rgba(205,0,0, 0.6)",none:"rgba(200,200,200, 0.6)",easing:"Linear.None.1.7",space:"rgb"});e.options=(o={container:".leaflet-overlay-pane",value:function(t){return t.value},lazyFresh:{transition:"opacity 0.1s"},popup:function(){return"test"},blending:"source-over",color:function(t,e,n){if(!t)return d(null);var i=(t.value-e)/(n-e);return d(i)},id:function(t,e){return t.id||t[0]||e},style:{stroke:"#fff",strokeWidth:2,lineCap:"round",lineJoin:"round"}},t(o,"value",function(t){return t.value}),t(o,"geoId",function(t,e){return t.properties?t.properties.id||e:t.id||e}),t(o,"lat",s.getLat),t(o,"lng",s.getLng),o),e=r.extend(e,{initCanvas:function(){var t=this._map,e=this.options,n=s.createContainer(e.container),i=t.getSize(),o=new c.Stage({container:n,width:i.x,height:i.y}),a=this.kLeafLayer=new f(o,{transition:e.lazyFresh.transition,blending:e.blending,ptNPerLayer:e.ptNPerLayer});a.addTo(t)},addTo:function(t){return t?(t._map&&(t=t._map),this._map=t,this.isable=!0,this.initCanvas(),this.initEvents(),this.initEventsMap(),this):void 0},geojson:function(t){return t?(this._geodata=t,this.processGeoData(t),void this.draw()):console.log("地理数据缺失")},processGeoData:function(t){var e,n=this.features={},o=this.options,a=o.geoId,r=o.lng,s=o.lat;if(i(t)){var u=t.features;u.forEach(function(t,i){e=a(t,i),n[e]=t})}else t.forEach(function(t){var i=t.latlngs||t.coords||t.coordinates,o=[];i.forEach(function(t){o.push([r(t),s(t)])}),e=a(t),n[e]={type:"feature",geometry:{type:"LineString",coordinates:o}}})},draw:function(){var t,e,i,o=this,a=this.dataObj||{},r=this.features,s=this.layers={};this.lineIndex=0;for(var u in r){t=r[u].geometry,e=t.coordinates,i=a[u];var h=(s[u]=[],0);n(e)?this.createLineAttr(e,u,h,i):e.forEach(function(t){return Array.isArray(t[0])?(h++,o.createLineAttr(t,u,h,i)):void t.forEach(function(t){h++,o.createLineAttr(t,u,h,i)})})}this.kLeafLayer.stopLazyFresh(),this.kLeafLayer.lazyFresh()},createLineAttr:function(t,e,n,i){if(this.isable){this.lineIndex+=1;var o=this.getChildOptions(),r=s.getValue(o.weight,i)||1;o.strokeWidth=r;var u=this._map.latLngToContainerPoint.bind(this._map),h=this.range||[],p=(o.stroke=s.getValue(this.options.color,i,h[0],h[1]),o.points=[]);t.forEach(function(t){var e=u(a.latLng(t[1],t[0]));p.push(e.x,e.y)});var f=Math.floor(p.length/4),d={x:p[2*f],y:p[2*f+1]};this.kLeafLayer.addOrSetShape({data:i,top:d,Constructor:c.Line,index:this.lineIndex,id:e+"-"+n,attrs:o})}},getChildOptions:function(){var t=this.options;return t.style},updateRange:function(){var t,e,n,i,o=this._data,a=this.options,r=a.value,s=a.filter,h=this.range=[];for(var c in o)t=o[c],e=r(t),u(e)||(!s||s(t))&&("number"!=typeof e&&(e=parseFloat(e)),u(h[0])&&(h[0]=h[1]=e),n=h[0],i=h[1],e>i&&(h[1]=e),n>e&&(h[0]=e))},initEventsMap:function(){this._map.on("zoomend",this.draw.bind(this)).on("moveend",this.draw.bind(this))},initEvents:function(){var t,e=this,n=this.kLeafLayer.onKonva("dragstart",function(){}).onKonva("mouseover touchstart",function(e){t=e.target,t.setAttrs({opacity:.8}),t.parent.draw()}).onKonva("mouseout",function(e){t=e.target,t.setAttrs({opacity:1}),t.parent.draw()}).onKonva("mouseout mouseup touchend",function(){setTimeout(function(){n.enableMapEvents()})}).onKonva("mousedown touchstart",this.onMouseDown.bind(this)),i=["mouseout","mousedown","mouseover","mouseout","touchstart","touchend","touchup"];i.forEach(function(t){n.onKonva(t,function(n){h(t,n,e)})})},onMouseDown:function(t){var e=this.options,n=this._map,i=t.target,o=i.__data,r=e.popup;r&&(r=r.bind(e)),r||(r=e.popup,r&&(r=r.bind(e))),r&&(popupText=r(o),setTimeout(function(){if(i){var t=i.__options.top,e=n.containerPointToLatLng(a.point(t.x,t.y));n.openPopup(popupText,a.latLng(e.lat,e.lng))}}.bind(this)),this.kLeafLayer.disableMapEvents())},each:function(){},data:function(t){return t?(this._data=t,this.processing(t),void this.updateRange()):console.log("没数据...")},processing:function(t){var e,n,i=this.options.id,o=this.dataObj={};for(var a in t)e=t[a],n=i(e),o[n]=e},render:function(t){t&&this.data(t),this.draw()},disable:function(){this.isable=!1,this.kLeafLayer.disable()},enable:function(){this.isable=!0,this.kLeafLayer.enable()},update:function(){this.updateLife()},updateOptions:function(t){this.options=s.deepMerge(this.options,t),this.draw()},remove:function(){}}),p.LinesKonva=e,p.linesKonva=function(t){return new e(t)},module.exports=e; | ||
"use strict";function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t){t=this.options=s.deepMerge(e.options,t)}function n(t){return!t[0][0][0]}function i(t){return t.type&&-1!==t.type.toLowerCase().indexOf("feature")||t.features}var o,a=require("./../leaflet"),r=require("bcore/event"),s=require("./../core/utils"),u=s.isNone,h=s.fireEvent,c=require("konva"),f=a.dmap=a.dmap||{},p=require("./../render/leaflet_layer_konva"),d=s.getColorFunc({from:"rgba(245,230,0,1)",to:"rgba(205,0,0, 0.6)",none:"rgba(200,200,200, 0.6)",easing:"Linear.None.1.7",space:"rgb"});e.options=(o={container:".leaflet-overlay-pane",value:function(t){return t.value},lazyFresh:{transition:"opacity 0.1s"},popup:function(){return"test"},blending:"source-over",color:function(t,e,n){if(!t)return d(null);var i=(t.value-e)/(n-e);return d(i)},id:function(t,e){return t.id||t[0]||e},style:{stroke:"#fff",strokeWidth:2,lineCap:"round",lineJoin:"round"}},t(o,"value",function(t){return t.value}),t(o,"geoId",function(t,e){return t.properties?t.properties.id||e:t.id||e}),t(o,"lat",s.getLat),t(o,"lng",s.getLng),o),e=r.extend(e,{initCanvas:function(){var t=this._map,e=this.options,n=s.createContainer(e.container),i=t.getSize(),o=new c.Stage({container:n,width:i.x,height:i.y}),a=this.kLeafLayer=new p(o,{transition:e.lazyFresh.transition,blending:e.blending,ptNPerLayer:e.ptNPerLayer});a.addTo(t)},addTo:function(t){return t?(t._map&&(t=t._map),this._map=t,this.isable=!0,this.initCanvas(),this.initEvents(),this.initEventsMap(),this):void 0},geojson:function(t){return t?(this._geodata=t,this.processGeoData(t),void this.draw()):console.log("地理数据缺失")},processGeoData:function(t){var e,n=this.features={},o=this.options,a=o.geoId,r=o.lng,s=o.lat;if(i(t)){var u=t.features;u.forEach(function(t,i){e=a(t,i),n[e]=t})}else t.forEach(function(t){var i=t.latlngs||t.coords||t.coordinates,o=[];i.forEach(function(t){o.push([r(t),s(t)])}),e=a(t),n[e]={type:"feature",geometry:{type:"LineString",coordinates:o}}})},draw:function(){var t,e,i,o=this,a=this.dataObj||{},r=this.features,s=this.layers={};this.lineIndex=0;for(var u in r){t=r[u].geometry,e=t.coordinates,i=a[u];var h=(s[u]=[],0);n(e)?this.createLineAttr(e,u,h,i):e.forEach(function(t){return Array.isArray(t[0])?(h++,o.createLineAttr(t,u,h,i)):void t.forEach(function(t){h++,o.createLineAttr(t,u,h,i)})})}this.kLeafLayer.stopLazyFresh(),this.kLeafLayer.lazyFresh()},createLineAttr:function(t,e,n,i){if(this.isable){this.lineIndex+=1;var o=this.getChildOptions(),r=s.getValue(this.options.weight,i)||1;o.strokeWidth=r;var u=this._map.latLngToContainerPoint.bind(this._map),h=this.range||[],f=(o.stroke=s.getValue(this.options.color,i,h[0],h[1]),o.points=[]);t.forEach(function(t){var e=u(a.latLng(t[1],t[0]));f.push(e.x,e.y)});var p=Math.floor(f.length/4),d={x:f[2*p],y:f[2*p+1]};this.kLeafLayer.addOrSetShape({data:i,top:d,Constructor:c.Line,index:this.lineIndex,id:e+"-"+n,attrs:o})}},getChildOptions:function(){var t=this.options;return t.style},updateRange:function(){var t,e,n,i,o=this._data,a=this.options,r=a.value,s=a.filter,h=this.range=[];for(var c in o)t=o[c],e=r(t),u(e)||(!s||s(t))&&("number"!=typeof e&&(e=parseFloat(e)),u(h[0])&&(h[0]=h[1]=e),n=h[0],i=h[1],e>i&&(h[1]=e),n>e&&(h[0]=e))},initEventsMap:function(){this._map.on("zoomend",this.draw.bind(this)).on("moveend",this.draw.bind(this))},initEvents:function(){var t,e=this,n=this.kLeafLayer.onKonva("dragstart",function(){}).onKonva("mouseover touchstart",function(e){t=e.target,t.setAttrs({opacity:.8}),t.parent.draw()}).onKonva("mouseout",function(e){t=e.target,t.setAttrs({opacity:1}),t.parent.draw()}).onKonva("mouseout mouseup touchend",function(){setTimeout(function(){n.enableMapEvents()})}).onKonva("mousedown touchstart",this.onMouseDown.bind(this)),i=["mouseout","mousedown","mouseover","mouseout","touchstart","touchend","touchup"];i.forEach(function(t){n.onKonva(t,function(n){h(t,n,e)})})},onMouseDown:function(t){var e=this.options,n=this._map,i=t.target,o=i.__data,r=e.popup;if(r&&(r=r.bind(e)),r||(r=e.popup,r&&(r=r.bind(e))),r){var s=r(o);setTimeout(function(){if(i){var t=i.__options.top,e=n.containerPointToLatLng(a.point(t.x,t.y));n.openPopup(s,a.latLng(e.lat,e.lng))}}.bind(this)),this.kLeafLayer.disableMapEvents()}},each:function(){},data:function(t){return t?(this._data=t,this.processing(t),void this.updateRange()):console.log("没数据...")},processing:function(t){var e,n,i=this.options.id,o=this.dataObj={};for(var a in t)e=t[a],n=i(e),o[n]=e},render:function(t){t&&this.data(t),this.draw()},disable:function(){this.isable=!1,this.kLeafLayer.disable()},enable:function(){this.isable=!0,this.kLeafLayer.enable()},update:function(){this.updateLife()},updateOptions:function(t){this.options=s.deepMerge(this.options,t),this.draw()},remove:function(){}}),f.LinesKonva=e,f.linesKonva=function(t){return new e(t)},module.exports=e; |
@@ -1,1 +0,1 @@ | ||
"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),a=require("./../leaflet"),o=require("konva"),r=require("lodash"),s=require("bcore/event"),u=require("./../render/leaflet_layer_konva"),h=require("./../core/utils"),l=h.getSprite,d=h.fireEvent,c=h.getValue,f=function(s){function f(i){t(this,f);var n=e(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return i=n.options=h.deepMerge(f.options,i),n.resetVariables(),n}return i(f,s),n(f,[{key:"resetVariables",value:function(){this.enable()}},{key:"disable",value:function(){this.isable=!1,this.kLeafLayer&&this.kLeafLayer.disable()}},{key:"enable",value:function(){this.isable=!0,this.kLeafLayer&&this.kLeafLayer.enable()}},{key:"addTo",value:function(t){!this._map&&t&&(this._map=t,this.initKonva(),this.initEventsMap(),this.initEventsShapes())}},{key:"initEventsShapes",value:function(){var t,e=this,i=this,n=this.options,a=n.hoverScale||1,o=this.kLeafLayer.onKonva("dragstart",function(){}).onKonva("mouseover touchstart",function(e){t=e.target,t.setAttrs({scale:{x:a,y:a},fill:n.hoverColor||"transparent"}),t.parent.draw()}).onKonva("mouseout",function(e){t=e.target,t.setAttrs({scale:{x:1,y:1},fill:"transparent"}),t.parent.draw()}).onKonva("mouseout mouseup touchend",function(){setTimeout(function(){o.enableMapEvents()})}).onKonva("mousedown touchstart",this.onMouseDown.bind(this)),r=["mouseout","mousedown","mouseover","mouseout","touchstart","touchend","touchup"];r.forEach(function(t){o.onKonva(t,function(n){d(t,n,i);var a=n.target.__id,o=n.target.__data;e.emit("child-"+t,{id:a,data:o})})})}},{key:"onMouseDown",value:function(t){var e=this.options,i=this._map,n=t.target,o=n.__data,r=e.popup;if(r&&(r=r.bind(e)),r||(r=e.child.popup,r&&(r=r.bind(e.child))),r){var s=r(o);setTimeout(function(){if(n){var t=n.getClientRect(),o=t.x+t.width/2,r=t.y+t.height/2/(e.hoverScale||1),u=i.containerPointToLatLng(a.point(o,r));i.openPopup(s,a.latLng(u.lat,u.lng))}}.bind(this),100),this.kLeafLayer.disableMapEvents()}}},{key:"initKonva",value:function(){var t=this._map,e=this.options,i=t.getSize(),n=this.konvaContainer=h.createContainer(e.container),a=new o.Stage({container:n,width:i.x,height:i.y}),r=this.kLeafLayer=new u(a,{transition:e.lazyFresh.transition,blending:e.blending,ptNPerLayer:e.ptNPerLayer});r.addTo(t),this.initEditor()}},{key:"data",value:function(t){this._data=t,this.updateDataZindex()}},{key:"updateDataZindex",value:function(){var t=this.options,e=t.zIndex||t.child.zIndex;e&&(this._data=r.sortBy(this._data,e))}},{key:"updateOptions",value:function(t){var e=this.kLeafLayer;e.resetOffset(),t=this.options=h.deepMerge(this.options,t),e.hideLayers(),e.updateOptions({transition:t.lazyFresh.transition,blending:t.blending,ptNPerLayer:t.ptNPerLayer}),this.draw()}},{key:"updateFilter",value:function(t){t&&"function"==typeof t&&(this.options.filter=t,this.draw())}},{key:"render",value:function(t){this.first=this._data?!1:!0,t&&this.data(t),t=this._data,this.kLeafLayer&&(t&&this.kLeafLayer.beginDraw(),this.draw(),t&&this.kLeafLayer.endDraw())}},{key:"createShapeAttr",value:function(t,e){if(this.isable){var i=this.options,n=i.lat.bind(i),r=i.lng.bind(i),s=c(i.id.bind(i),t,e),u=c(i.size,t)||1,d=n(t),f=r(t),p=this._map.latLngToContainerPoint(a.latLng(d,f));y=i.sprite||i.child.sprite;var y=h.switchValue(y,t);return y=h.getSprite(y),{data:t,Constructor:o.Image,index:e,id:s,attrs:{x:p.x,y:p.y,offset:{x:u/2,y:u/2},image:l(y,t),width:u,height:u,draggable:!1,scaleX:1.2,scaleY:1.2}}}}},{key:"draw",value:function(){var t=this._data;if(t&&this.isable){for(var e,i,n=this.kLeafLayer,a=this.options.filter,o=t.length-1;o>-1;o--)e=t[o],(!a||a(e,o))&&(i=this.createShapeAttr(e,o),n.addOrSetShape(i));n.stopLazyFresh(),n.lazyFresh()}}},{key:"initEventsMap",value:function(){this._map.on("zoomend",this.draw.bind(this)).on("moveend",this.draw.bind(this))}},{key:"destroy",value:function(){this.kLeafLayer.destroy(),this.konvaContainer.remove()}},{key:"clean",value:function(){this.kLeafLayer.clean()}},{key:"initEditor",value:function(){this.eidtList=[],this.kLeafLayer.initEditor(),this.initEventEditor()}},{key:"enableEditor",value:function(){this.kLeafLayer.enableEditor()}},{key:"disableEditor",value:function(){this.kLeafLayer.disableEditor()}},{key:"initEventEditor",value:function(){var t=this;this.kLeafLayer.on("shape-dragged",function(e){t.onShapeDragged(e.shape)})}},{key:"onShapeDragged",value:function(t){var e=t.getClientRect(),i=e.x+e.width/2,n=e.y+e.height/2,o=this._map.containerPointToLatLng(a.point(i,n)),r=this.options,s=r.editor.setLatLng;if(!s)return console.log("请设置options.editor.setLatLng");var u=t.__data;s(o,u),this.kLeafLayer.addOrSetShape(u,null,!0),this.eidtList.push(u),this.fire("data-edited",u)}},{key:"isEdited",value:function(){return this.eidtList.length>0}},{key:"submitEdit",value:function(){this.options,this.eidtList}}]),f}(s);f.options={lng:h.getLng,lat:h.getLat,zIndex:null,refreshInterval:1,ptNPerLayer:1e3,lazyFresh:{transition:"opacity 0.4s"},size:function(){return 40},id:function(t,e){return t.id||e},hoverScale:1.2,blending:"lighter",container:".leaflet-overlay-pane",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(t,e){e&&(e.lat=t.lat,e.lng=t.lng)}}};var p=a.dmap=a.dmap||{};p.ScatterKonva=f,p.scatterKonva=function(t){return new f(t)},module.exports=f; | ||
"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),a=require("./../leaflet"),r=require("konva"),o=require("lodash"),s=require("bcore/event"),u=require("./../render/leaflet_layer_konva"),h=require("./../core/utils"),l=h.getSprite,d=h.fireEvent,c=h.getValue,f=function(s){function d(i){t(this,d);var n=e(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return i=n.options=h.deepMerge(d.options,i),n.resetVariables(),n}return i(d,s),n(d,[{key:"resetVariables",value:function(){this.enable()}},{key:"disable",value:function(){this.isable=!1,this.kLeafLayer&&this.kLeafLayer.disable()}},{key:"enable",value:function(){this.isable=!0,this.kLeafLayer&&this.kLeafLayer.enable()}},{key:"addTo",value:function(t){!this._map&&t&&(this._map=t,this.initKonva(),this.initEventsMap(),this.initEventsShapes())}},{key:"initEventsShapes",value:function(){var t,e=this,i=this.options,n=i.hoverScale||1,a=this.kLeafLayer.onKonva("dragstart",function(){}).onKonva("mouseover touchstart",function(e){t=e.target,t.setAttrs({scale:{x:n,y:n},fill:i.hoverColor||"transparent"}),t.parent.draw()}).onKonva("mouseout",function(e){t=e.target,t.setAttrs({scale:{x:1,y:1},fill:"transparent"}),t.parent.draw()}).onKonva("mouseout mouseup touchend",function(){setTimeout(function(){a.enableMapEvents()})}).onKonva("mousedown touchstart",this.onMouseDown.bind(this)),r=["mouseout","mousedown","mouseover","mouseout","touchstart","touchend","touchup","click"];r.forEach(function(t){a.onKonva(t,function(i){var n=i.target.__id,a=i.target.__data;e.emit("child-"+t,{id:n,data:a})})})}},{key:"onMouseDown",value:function(t){var e=this.options,i=this._map,n=t.target,r=n.__data,o=e.popup;if(o&&(o=o.bind(e)),o||(o=e.child.popup,o&&(o=o.bind(e.child))),o){var s=o(r);setTimeout(function(){if(n){var t=n.getClientRect(),r=t.x+t.width/2,o=t.y+t.height/2/(e.hoverScale||1),u=i.containerPointToLatLng(a.point(r,o));i.openPopup(s,a.latLng(u.lat,u.lng))}}.bind(this),100),this.kLeafLayer.disableMapEvents()}}},{key:"initKonva",value:function(){var t=this._map,e=this.options,i=t.getSize(),n=this.konvaContainer=h.createContainer(e.container),a=new r.Stage({container:n,width:i.x,height:i.y}),o=this.kLeafLayer=new u(a,{transition:e.lazyFresh.transition,blending:e.blending,ptNPerLayer:e.ptNPerLayer});o.addTo(t),this.initEditor()}},{key:"data",value:function(t){this._data=t,this.updateDataZindex()}},{key:"updateDataZindex",value:function(){var t=this.options,e=t.zIndex||t.child.zIndex;e&&(this._data=o.sortBy(this._data,e))}},{key:"updateOptions",value:function(t){var e=this.kLeafLayer;e.resetOffset(),t=this.options=h.deepMerge(this.options,t),e.hideLayers(),e.updateOptions({transition:t.lazyFresh.transition,blending:t.blending,ptNPerLayer:t.ptNPerLayer}),this.draw()}},{key:"updateFilter",value:function(t){t&&"function"==typeof t&&(this.options.filter=t,this.draw())}},{key:"render",value:function(t){this.first=this._data?!1:!0,t&&this.data(t),t=this._data,this.kLeafLayer&&(t&&this.kLeafLayer.beginDraw(),this.draw(),t&&this.kLeafLayer.endDraw())}},{key:"createShapeAttr",value:function(t,e){if(this.isable){var i=this.options,n=i.lat.bind(i),o=i.lng.bind(i),s=c(i.id.bind(i),t,e),u=c(i.size,t)||1,d=n(t),f=o(t);if(!d||!f)return null;var p=this._map.latLngToContainerPoint(a.latLng(d,f));y=i.sprite||i.child.sprite;var y=h.switchValue(y,t);return y=h.getSprite(y),{data:t,Constructor:r.Image,index:e,id:s,attrs:{x:p.x,y:p.y,offset:{x:u/2,y:u/2},image:l(y,t),width:u,height:u,draggable:!1,scaleX:1.2,scaleY:1.2}}}}},{key:"draw",value:function(){var t=this._data;if(t&&this.isable){for(var e,i,n=this.kLeafLayer,a=this.options.filter,r=t.length-1;r>-1;r--)e=t[r],(!a||a(e,r))&&(i=this.createShapeAttr(e,r),i&&n.addOrSetShape(i));n.stopLazyFresh(),n.lazyFresh()}}},{key:"initEventsMap",value:function(){this._map.on("zoomend",this.draw.bind(this)).on("moveend",this.draw.bind(this))}},{key:"destroy",value:function(){this.kLeafLayer.destroy(),this.konvaContainer.remove()}},{key:"clean",value:function(){this.kLeafLayer.clean()}},{key:"initEditor",value:function(){this.eidtList=[],this.kLeafLayer.initEditor(),this.initEventEditor()}},{key:"enableEditor",value:function(){this.kLeafLayer.enableEditor()}},{key:"disableEditor",value:function(){this.kLeafLayer.disableEditor()}},{key:"initEventEditor",value:function(){var t=this;this.kLeafLayer.on("shape-dragged",function(e){t.onShapeDragged(e.shape)})}},{key:"onShapeDragged",value:function(t){var e=t.getClientRect(),i=e.x+e.width/2,n=e.y+e.height/2,r=this._map.containerPointToLatLng(a.point(i,n)),o=this.options,s=o.editor.setLatLng;if(!s)return console.log("请设置options.editor.setLatLng");var u=t.__data;s(r,u),this.kLeafLayer.addOrSetShape(u,null,!0),this.eidtList.push(u),this.fire("data-edited",u)}},{key:"isEdited",value:function(){return this.eidtList.length>0}},{key:"submitEdit",value:function(){this.options,this.eidtList}}]),d}(s);f.options={lng:h.getLng,lat:h.getLat,zIndex:null,refreshInterval:1,ptNPerLayer:1e3,lazyFresh:{transition:"opacity 0.4s"},size:function(){return 40},id:function(t,e){return t.id||e},hoverScale:1.2,blending:"lighter",container:".leaflet-overlay-pane",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(t,e){e&&(e.lat=t.lat,e.lng=t.lng)}}};var p=a.dmap=a.dmap||{};p.ScatterKonva=f,p.scatterKonva=function(t){return new f(t)},module.exports=f; |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.1.10", | ||
"version": "0.1.12", | ||
"scripts": { | ||
@@ -11,0 +11,0 @@ "test": "mocha -r jscoverage test", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
245733
0