@2gis/mapgl-clusterer
Advanced tools
Comparing version
@@ -16,2 +16,2 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var o in r)("object"==typeof exports?exports:t)[o]=r[o]}}(window,(function(){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=1)}([function(t,e,r){t.exports=function(){"use strict";function t(r,o,n,i,s,a){if(!(s-i<=n)){var u=i+s>>1;!function t(r,o,n,i,s,a){for(;s>i;){if(s-i>600){var u=s-i+1,p=n-i+1,c=Math.log(u),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(u-l)/u)*(p-u/2<0?-1:1),f=Math.max(i,Math.floor(n-p*l/u+h)),d=Math.min(s,Math.floor(n+(u-p)*l/u+h));t(r,o,n,f,d,a)}var v=o[2*n+a],m=i,g=s;for(e(r,o,i,n),o[2*s+a]>v&&e(r,o,i,s);m<g;){for(e(r,o,m,g),m++,g--;o[2*m+a]<v;)m++;for(;o[2*g+a]>v;)g--}o[2*i+a]===v?e(r,o,i,g):(g++,e(r,o,g,s)),g<=n&&(i=g+1),n<=g&&(s=g-1)}}(r,o,u,i,s,a%2),t(r,o,n,i,u-1,a+1),t(r,o,n,u+1,s,a+1)}}function e(t,e,o,n){r(t,o,n),r(e,2*o,2*n),r(e,2*o+1,2*n+1)}function r(t,e,r){var o=t[e];t[e]=t[r],t[r]=o}function o(t,e,r,o){var n=t-r,i=e-o;return n*n+i*i}var n=function(t){return t[0]},i=function(t){return t[1]},s=function(e,r,o,s,a){void 0===r&&(r=n),void 0===o&&(o=i),void 0===s&&(s=64),void 0===a&&(a=Float64Array),this.nodeSize=s,this.points=e;for(var u=e.length<65536?Uint16Array:Uint32Array,p=this.ids=new u(e.length),c=this.coords=new a(2*e.length),l=0;l<e.length;l++)p[l]=l,c[2*l]=r(e[l]),c[2*l+1]=o(e[l]);t(p,c,s,0,p.length-1,0)};s.prototype.range=function(t,e,r,o){return function(t,e,r,o,n,i,s){for(var a,u,p=[0,t.length-1,0],c=[];p.length;){var l=p.pop(),h=p.pop(),f=p.pop();if(h-f<=s)for(var d=f;d<=h;d++)a=e[2*d],u=e[2*d+1],a>=r&&a<=n&&u>=o&&u<=i&&c.push(t[d]);else{var v=Math.floor((f+h)/2);a=e[2*v],u=e[2*v+1],a>=r&&a<=n&&u>=o&&u<=i&&c.push(t[v]);var m=(l+1)%2;(0===l?r<=a:o<=u)&&(p.push(f),p.push(v-1),p.push(m)),(0===l?n>=a:i>=u)&&(p.push(v+1),p.push(h),p.push(m))}}return c}(this.ids,this.coords,t,e,r,o,this.nodeSize)},s.prototype.within=function(t,e,r){return function(t,e,r,n,i,s){for(var a=[0,t.length-1,0],u=[],p=i*i;a.length;){var c=a.pop(),l=a.pop(),h=a.pop();if(l-h<=s)for(var f=h;f<=l;f++)o(e[2*f],e[2*f+1],r,n)<=p&&u.push(t[f]);else{var d=Math.floor((h+l)/2),v=e[2*d],m=e[2*d+1];o(v,m,r,n)<=p&&u.push(t[d]);var g=(c+1)%2;(0===c?r-i<=v:n-i<=m)&&(a.push(h),a.push(d-1),a.push(g)),(0===c?r+i>=v:n+i>=m)&&(a.push(d+1),a.push(l),a.push(g))}}return u}(this.ids,this.coords,t,e,r,this.nodeSize)};var a={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},u=function(t){this.options=v(Object.create(a),t),this.trees=new Array(this.options.maxZoom+1)};function p(t,e,r,o,n){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:o,properties:n}}function c(t,e){var r=t.geometry.coordinates,o=r[0],n=r[1];return{x:f(o),y:d(n),zoom:1/0,index:e,parentId:-1}}function l(t){return{type:"Feature",id:t.id,properties:h(t),geometry:{type:"Point",coordinates:[(o=t.x,360*(o-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,o}function h(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return v(v({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function f(t){return t/360+.5}function d(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function v(t,e){for(var r in e)t[r]=e[r];return t}function m(t){return t.x}function g(t){return t.y}return u.prototype.load=function(t){var e=this.options,r=e.log,o=e.minZoom,n=e.maxZoom,i=e.nodeSize;r&&console.time("total time");var a="prepare "+t.length+" points";r&&console.time(a),this.points=t;for(var u=[],p=0;p<t.length;p++)t[p].geometry&&u.push(c(t[p],p));this.trees[n+1]=new s(u,m,g,i,Float32Array),r&&console.timeEnd(a);for(var l=n;l>=o;l--){var h=+Date.now();u=this._cluster(u,l),this.trees[l]=new s(u,m,g,i,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,u.length,+Date.now()-h)}return r&&console.timeEnd("total time"),this},u.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[1])),n=180===t[2]?180:((t[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){var s=this.getClusters([r,o,180,i],e),a=this.getClusters([-180,o,n,i],e);return s.concat(a)}for(var u=this.trees[this._limitZoom(e)],p=[],c=0,h=u.range(f(r),d(i),f(n),d(o));c<h.length;c+=1){var v=h[c],m=u.points[v];p.push(m.numPoints?l(m):this.points[m.index])}return p},u.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),o="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(o);var i=n.points[e];if(!i)throw new Error(o);for(var s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=[],u=0,p=n.within(i.x,i.y,s);u<p.length;u+=1){var c=p[u],h=n.points[c];h.parentId===t&&a.push(h.numPoints?l(h):this.points[h.index])}if(0===a.length)throw new Error(o);return a},u.prototype.getLeaves=function(t,e,r){e=e||10,r=r||0;var o=[];return this._appendLeaves(o,t,e,r,0),o},u.prototype.getTile=function(t,e,r){var o=this.trees[this._limitZoom(t)],n=Math.pow(2,t),i=this.options,s=i.extent,a=i.radius/s,u=(r-a)/n,p=(r+1+a)/n,c={features:[]};return this._addTileFeatures(o.range((e-a)/n,u,(e+1+a)/n,p),o.points,e,r,n,c),0===e&&this._addTileFeatures(o.range(1-a/n,u,1,p),o.points,n,r,n,c),e===n-1&&this._addTileFeatures(o.range(0,u,a/n,p),o.points,-1,r,n,c),c.features.length?c:null},u.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},u.prototype._appendLeaves=function(t,e,r,o,n){for(var i=0,s=this.getChildren(e);i<s.length;i+=1){var a=s[i],u=a.properties;if(u&&u.cluster?n+u.point_count<=o?n+=u.point_count:n=this._appendLeaves(t,u.cluster_id,r,o,n):n<o?n++:t.push(a),t.length===r)break}return n},u.prototype._addTileFeatures=function(t,e,r,o,n,i){for(var s=0,a=t;s<a.length;s+=1){var u=e[a[s]],p=u.numPoints,c={type:1,geometry:[[Math.round(this.options.extent*(u.x*n-r)),Math.round(this.options.extent*(u.y*n-o))]],tags:p?h(u):this.points[u.index].properties},l=void 0;p?l=u.id:this.options.generateId?l=u.index:this.points[u.index].id&&(l=this.points[u.index].id),void 0!==l&&(c.id=l),i.features.push(c)}},u.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},u.prototype._cluster=function(t,e){for(var r=[],o=this.options,n=o.radius,i=o.extent,s=o.reduce,a=n/(i*Math.pow(2,e)),u=0;u<t.length;u++){var c=t[u];if(!(c.zoom<=e)){c.zoom=e;for(var l=this.trees[e+1],h=l.within(c.x,c.y,a),f=c.numPoints||1,d=c.x*f,v=c.y*f,m=s&&f>1?this._map(c,!0):null,g=(u<<5)+(e+1)+this.points.length,y=0,b=h;y<b.length;y+=1){var _=b[y],x=l.points[_];if(!(x.zoom<=e)){x.zoom=e;var M=x.numPoints||1;d+=x.x*M,v+=x.y*M,f+=M,x.parentId=g,s&&(m||(m=this._map(c,!0)),s(m,this._map(x)))}}1===f?r.push(c):(c.parentId=g,r.push(p(d/f,v/f,g,f,m)))}}return r},u.prototype._getOriginId=function(t){return t-this.points.length>>5},u.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},u.prototype._map=function(t,e){if(t.numPoints)return e?v({},t.properties):t.properties;var r=this.points[t.index].properties,o=this.options.map(r);return e&&o===r?v({},o):o},u}()},function(t,e,r){"use strict";r.r(e),r.d(e,"Clusterer",(function(){return u})); | ||
***************************************************************************** */ | ||
var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var n=function(){return(n=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};var i=function(){function t(){this.events={}}return t.prototype.on=function(t,e){var r=this.events[t];return r||(r=this.events[t]=[]),r.push(e),this},t.prototype.once=function(t,e){var r=this,o=function(n){r.off(t,o),e.call(r,n)};return this.on(t,o),this},t.prototype.off=function(t,e){var r=this.events[t];if(!r)return this;var o=r.indexOf(e);return-1!==o&&r.splice(o,1),this},t.prototype.emit=function(t,e){var r=this.events[t];if(!r)return this;for(var o=r.slice(),n=0;n<o.length;n++)o[n].call(this,e);return this},t}(),s=["click","dblclick","mousemove","mouseover","mouseout","mousedown","mouseup","touchstart","touchend"];var a=r(0),u=function(t){function e(r,o){var i;void 0===o&&(o={});var s=t.call(this)||this;s._updateVisibleObjects=function(){var t=s._getVisibleObjects();s.markers.forEach((function(t){t.hide()})),s.clusters.forEach((function(t){t.hide()})),t.forEach((function(t){if(function(t){return t.properties.cluster}(t)){var e=t.properties.cluster_id,r=s.clusters.get(e);r?r.show():s._createCluster(e,t.geometry.coordinates,t.properties.point_count)}else{var o=t.properties.index,n=s.markers.get(o);n?n.show():s._createMarker(o,t.geometry.coordinates)}}))},s._updateVisibleObjects=function(t,e){var r,o;function n(){r=!1,o&&(i.apply(void 0,o),o=!1)}function i(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];r?o=i:(t.apply(void 0,i),setTimeout(n,e),r=!0)}return i}(s._updateVisibleObjects,100);var u=null!==(i=o.radius)&&void 0!==i?i:e.options.radius,p=e.options.clusterStyle;return o.clusterStyle&&(p="function"==typeof o.clusterStyle?o.clusterStyle:n(n({},p),o.clusterStyle)),s.options={radius:u,clusterStyle:p},s.map=r,s.inputMarkers=[],s.supercluster=new a({minZoom:0,maxZoom:20,radius:s.options.radius}),s.markers=new Map,s.clusters=new Map,s.map.on("move",s._updateVisibleObjects),s.map.on("resize",s._updateVisibleObjects),s}return function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.load=function(t){this._clear(),this.inputMarkers=t,this.supercluster.load(function(t){return t.map((function(t,e){return{type:"Feature",geometry:{type:"Point",coordinates:t.coordinates},properties:{index:e,cluster:!1}}}))}(t)),this._updateVisibleObjects()},e.prototype.destroy=function(){this._clear(),this.map.off("move",this._updateVisibleObjects),this.map.off("resize",this._updateVisibleObjects)},e.prototype._dangerouslyUpdateVisibleObjects=function(){this._updateVisibleObjects()},e.prototype._clear=function(){this.markers.forEach((function(t){t.destroy()})),this.clusters.forEach((function(t){t.destroy()})),this.markers.clear(),this.clusters.clear(),this.supercluster.load([]),this.inputMarkers=[]},e.prototype._getVisibleObjects=function(){var t=Math.floor(this.map.getZoom()),e=this._getBounds();return this.supercluster.getClusters(e,t)},e.prototype._getBounds=function(){var t=this.map.getSize(),e=.06*t[0],r=.06*t[1],o=this.map.unproject([-e,t[1]+r]),n=this.map.unproject([t[0]+e,t[1]+r]),i=this.map.unproject([t[0]+e,-r]),s=this.map.unproject([-e,-r]);return[Math.min(o[0],n[0],i[0],s[0]),Math.min(o[1],n[1],i[1],s[1]),Math.max(o[0],n[0],i[0],s[0]),Math.max(o[1],n[1],i[1],s[1])]},e.prototype._createMarker=function(t,e){var r=this,o=this.inputMarkers[t],n=o.icon,i=o.size,a=o.anchor,u=o.hoverIcon,p=o.hoverSize,c=o.hoverAnchor,l=o.label,h=new mapgl.Marker(this.map,{coordinates:e,icon:n,size:i,anchor:a,hoverIcon:u,hoverSize:p,hoverAnchor:c,label:l});s.forEach((function(t){return h.on(t,(function(e){var n={originalEvent:e.originalEvent,lngLat:e.lngLat,point:e.point,target:{type:"marker",data:o}};r.emit(t,n)}))})),this.markers.set(t,h)},e.prototype._createCluster=function(t,r,o){var i,a=this,u="function"==typeof this.options.clusterStyle?n(n({},e.options.clusterStyle),this.options.clusterStyle(o)):this.options.clusterStyle,p=new mapgl.Marker(this.map,{coordinates:r,zIndex:0,icon:u.icon,size:u.size,anchor:u.anchor,hoverIcon:u.hoverIcon,hoverSize:u.hoverSize,hoverAnchor:u.hoverAnchor,label:{text:null!==(i=u.labelText)&&void 0!==i?i:String(o),color:u.labelColor,fontSize:u.labelFontSize,haloRadius:u.labelHaloRadius,haloColor:u.labelHaloColor,letterSpacing:u.labelLetterSpacing,anchor:u.labelAnchor}}),c=this.supercluster.getLeaves(t,1/0).map((function(t){return a.inputMarkers[t.properties.index]}));s.forEach((function(t){return p.on(t,(function(e){var r={originalEvent:e.originalEvent,lngLat:e.lngLat,point:e.point,target:{type:"cluster",data:c}};a.emit(t,r)}))})),this.clusters.set(t,p)},e.options={radius:80,clusterStyle:{icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48Y2lyY2xlIGZpbGw9IiM0OGQ5NWQiIGN4PSIxNSIgY3k9IjE1IiByPSIxNSIvPjwvc3ZnPg==",labelColor:"#000000",labelFontSize:14,labelText:void 0}},e}(i);"mapgl"in window?mapgl.Clusterer=u:console.error("Looks like you did not load MapGL API correctly")}])})); | ||
var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var n=function(){return(n=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};var i=function(){function t(){this.events={}}return t.prototype.on=function(t,e){var r=this.events[t];return r||(r=this.events[t]=[]),r.push(e),this},t.prototype.once=function(t,e){var r=this,o=function(n){r.off(t,o),e.call(r,n)};return this.on(t,o),this},t.prototype.off=function(t,e){var r=this.events[t];if(!r)return this;var o=r.indexOf(e);return-1!==o&&r.splice(o,1),this},t.prototype.emit=function(t,e){var r=this.events[t];if(!r)return this;for(var o=r.slice(),n=0;n<o.length;n++)o[n].call(this,e);return this},t}(),s=["click","dblclick","mousemove","mouseover","mouseout","mousedown","mouseup","touchstart","touchend"];var a=r(0),u=function(t){function e(r,o){var i;void 0===o&&(o={});var s=t.call(this)||this;s._updateVisibleObjects=function(){var t=s._getVisibleObjects();s.markers.forEach((function(t){t.hide()})),s.clusters.forEach((function(t){t.hide()})),t.forEach((function(t){if(function(t){return t.properties.cluster}(t)){var e=t.properties.cluster_id,r=s.clusters.get(e);r?r.show():s._createCluster(e,t.geometry.coordinates,t.properties.point_count)}else{var o=t.properties.index,n=s.markers.get(o);n?n.show():s._createMarker(o,t.geometry.coordinates)}}))},s._updateVisibleObjects=function(t,e){var r,o;function n(){r=!1,o&&(i.apply(void 0,o),o=!1)}function i(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];r?o=i:(t.apply(void 0,i),setTimeout(n,e),r=!0)}return i}(s._updateVisibleObjects,100);var u=null!==(i=o.radius)&&void 0!==i?i:e.options.radius,p=e.options.clusterStyle;return o.clusterStyle&&(p="function"==typeof o.clusterStyle?o.clusterStyle:n(n({},p),o.clusterStyle)),s.options={radius:u,clusterStyle:p},s.map=r,s.inputMarkers=[],s.supercluster=new a({minZoom:0,maxZoom:20,radius:s.options.radius}),s.markers=new Map,s.clusters=new Map,s.map.on("move",s._updateVisibleObjects),s.map.on("resize",s._updateVisibleObjects),s}return function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.load=function(t){this._clear(),this.inputMarkers=t,this.supercluster.load(function(t){return t.map((function(t,e){return{type:"Feature",geometry:{type:"Point",coordinates:t.coordinates},properties:{index:e,cluster:!1}}}))}(t)),this._updateVisibleObjects()},e.prototype.destroy=function(){this._clear(),this.map.off("move",this._updateVisibleObjects),this.map.off("resize",this._updateVisibleObjects)},e.prototype._dangerouslyUpdateVisibleObjects=function(){this._updateVisibleObjects()},e.prototype._clear=function(){this.markers.forEach((function(t){t.destroy()})),this.clusters.forEach((function(t){t.destroy()})),this.markers.clear(),this.clusters.clear(),this.supercluster.load([]),this.inputMarkers=[]},e.prototype._getVisibleObjects=function(){var t=Math.floor(this.map.getZoom()),e=this._getBounds();return this.supercluster.getClusters(e,t)},e.prototype._getBounds=function(){var t=this.map.getSize(),e=.06*t[0],r=.06*t[1],o=this.map.unproject([-e,t[1]+r]),n=this.map.unproject([t[0]+e,t[1]+r]),i=this.map.unproject([t[0]+e,-r]),s=this.map.unproject([-e,-r]);return[Math.min(o[0],n[0],i[0],s[0]),Math.min(o[1],n[1],i[1],s[1]),Math.max(o[0],n[0],i[0],s[0]),Math.max(o[1],n[1],i[1],s[1])]},e.prototype._createMarker=function(t,e){var r=this,o=this.inputMarkers[t],n=o.icon,i=o.size,a=o.anchor,u=o.hoverIcon,p=o.hoverSize,c=o.hoverAnchor,l=o.label,h=new mapgl.Marker(this.map,{coordinates:e,icon:n,size:i,anchor:a,hoverIcon:u,hoverSize:p,hoverAnchor:c,label:l});s.forEach((function(t){return h.on(t,(function(e){var n={originalEvent:e.originalEvent,lngLat:e.lngLat,point:e.point,target:{type:"marker",data:o}};r.emit(t,n)}))})),this.markers.set(t,h)},e.prototype._createCluster=function(t,r,o){var i,a=this,u="function"==typeof this.options.clusterStyle?n(n({},e.options.clusterStyle),this.options.clusterStyle(o)):this.options.clusterStyle,p=new mapgl.Marker(this.map,{coordinates:r,zIndex:0,icon:u.icon,size:u.size,anchor:u.anchor,hoverIcon:u.hoverIcon,hoverSize:u.hoverSize,hoverAnchor:u.hoverAnchor,label:{text:null!==(i=u.labelText)&&void 0!==i?i:String(o),color:u.labelColor,fontSize:u.labelFontSize,haloRadius:u.labelHaloRadius,haloColor:u.labelHaloColor,letterSpacing:u.labelLetterSpacing,anchor:u.labelAnchor}}),c=this.supercluster.getLeaves(t,1/0).map((function(t){return a.inputMarkers[t.properties.index]}));s.forEach((function(t){return p.on(t,(function(e){var r={originalEvent:e.originalEvent,lngLat:e.lngLat,point:e.point,target:{type:"cluster",data:c}};a.emit(t,r)}))})),this.clusters.set(t,p)},e.options={radius:80,clusterStyle:{icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48Y2lyY2xlIGZpbGw9IiM0OGQ5NWQiIGN4PSIxNSIgY3k9IjE1IiByPSIxNSIvPjwvc3ZnPg==",labelColor:"#000000",labelFontSize:14,labelAnchor:[0,0],labelText:void 0}},e}(i);"mapgl"in window?mapgl.Clusterer=u:console.error("Looks like you did not load MapGL API correctly")}])})); |
{ | ||
"name": "@2gis/mapgl-clusterer", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Marker clustering plugin for Mapgl", | ||
@@ -5,0 +5,0 @@ "main": "dist/clustering.js", |
64606
0.03%