@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 o=e();for(var n in o)("object"==typeof exports?exports:t)[n]=o[n]}}(window,(function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/",o(o.s=0)}([function(t,e,o){"use strict";o.r(e),o.d(e,"Clusterer",(function(){return j})); | ||
***************************************************************************** */ | ||
var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};var r=function(){return(r=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function i(t,e,o,n,r,a){if(r-n<=o)return;const u=n+r>>1;!function t(e,o,n,r,i,a){for(;i>r;){if(i-r>600){const s=i-r+1,u=n-r+1,c=Math.log(s),p=.5*Math.exp(2*c/3),l=.5*Math.sqrt(c*p*(s-p)/s)*(u-s/2<0?-1:1),h=Math.max(r,Math.floor(n-u*p/s+l)),f=Math.min(i,Math.floor(n+(s-u)*p/s+l));t(e,o,n,h,f,a)}const u=o[2*n+a];let c=r,p=i;for(s(e,o,r,n),o[2*i+a]>u&&s(e,o,r,i);c<p;){for(s(e,o,c,p),c++,p--;o[2*c+a]<u;)c++;for(;o[2*p+a]>u;)p--}o[2*r+a]===u?s(e,o,r,p):(p++,s(e,o,p,i)),p<=n&&(r=p+1),n<=p&&(i=p-1)}}(t,e,u,n,r,a%2),i(t,e,o,n,u-1,a+1),i(t,e,o,u+1,r,a+1)}function s(t,e,o,n){a(t,o,n),a(e,2*o,2*n),a(e,2*o+1,2*n+1)}function a(t,e,o){const n=t[e];t[e]=t[o],t[o]=n}function u(t,e,o,n){const r=t-o,i=e-n;return r*r+i*i}const c=t=>t[0],p=t=>t[1];class l{constructor(t,e=c,o=p,n=64,r=Float64Array){this.nodeSize=n,this.points=t;const s=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new s(t.length),u=this.coords=new r(2*t.length);for(let n=0;n<t.length;n++)a[n]=n,u[2*n]=e(t[n]),u[2*n+1]=o(t[n]);i(a,u,n,0,a.length-1,0)}range(t,e,o,n){return function(t,e,o,n,r,i,s){const a=[0,t.length-1,0],u=[];let c,p;for(;a.length;){const l=a.pop(),h=a.pop(),f=a.pop();if(h-f<=s){for(let s=f;s<=h;s++)c=e[2*s],p=e[2*s+1],c>=o&&c<=r&&p>=n&&p<=i&&u.push(t[s]);continue}const d=Math.floor((f+h)/2);c=e[2*d],p=e[2*d+1],c>=o&&c<=r&&p>=n&&p<=i&&u.push(t[d]);const m=(l+1)%2;(0===l?o<=c:n<=p)&&(a.push(f),a.push(d-1),a.push(m)),(0===l?r>=c:i>=p)&&(a.push(d+1),a.push(h),a.push(m))}return u}(this.ids,this.coords,t,e,o,n,this.nodeSize)}within(t,e,o){return function(t,e,o,n,r,i){const s=[0,t.length-1,0],a=[],c=r*r;for(;s.length;){const p=s.pop(),l=s.pop(),h=s.pop();if(l-h<=i){for(let r=h;r<=l;r++)u(e[2*r],e[2*r+1],o,n)<=c&&a.push(t[r]);continue}const f=Math.floor((h+l)/2),d=e[2*f],m=e[2*f+1];u(d,m,o,n)<=c&&a.push(t[f]);const g=(p+1)%2;(0===p?o-r<=d:n-r<=m)&&(s.push(h),s.push(f-1),s.push(g)),(0===p?o+r>=d:n+r>=m)&&(s.push(f+1),s.push(l),s.push(g))}return a}(this.ids,this.coords,t,e,o,this.nodeSize)}}const h={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t};class f{constructor(t){this.options=x(Object.create(h),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:e,minZoom:o,maxZoom:n,nodeSize:r}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;let s=[];for(let e=0;e<t.length;e++)t[e].geometry&&s.push(m(t[e],e));this.trees[n+1]=new l(s,M,w,r,Float32Array),e&&console.timeEnd(i);for(let t=n;t>=o;t--){const o=+Date.now();s=this._cluster(s,t),this.trees[t]=new l(s,M,w,r,Float32Array),e&&console.log("z%d: %d clusters in %dms",t,s.length,+Date.now()-o)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let o=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let r=180===t[2]?180:((t[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)o=-180,r=180;else if(o>r){const t=this.getClusters([o,n,180,i],e),s=this.getClusters([-180,n,r,i],e);return t.concat(s)}const s=this.trees[this._limitZoom(e)],a=s.range(v(o),b(i),v(r),b(n)),u=[];for(const t of a){const e=s.points[t];u.push(e.numPoints?g(e):this.points[e.index])}return u}getChildren(t){const e=this._getOriginId(t),o=this._getOriginZoom(t),n="No cluster with the specified id.",r=this.trees[o];if(!r)throw new Error(n);const i=r.points[e];if(!i)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,o-1)),a=r.within(i.x,i.y,s),u=[];for(const e of a){const o=r.points[e];o.parentId===t&&u.push(o.numPoints?g(o):this.points[o.index])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,o){e=e||10,o=o||0;const n=[];return this._appendLeaves(n,t,e,o,0),n}getTile(t,e,o){const n=this.trees[this._limitZoom(t)],r=Math.pow(2,t),{extent:i,radius:s}=this.options,a=s/i,u=(o-a)/r,c=(o+1+a)/r,p={features:[]};return this._addTileFeatures(n.range((e-a)/r,u,(e+1+a)/r,c),n.points,e,o,r,p),0===e&&this._addTileFeatures(n.range(1-a/r,u,1,c),n.points,r,o,r,p),e===r-1&&this._addTileFeatures(n.range(0,u,a/r,c),n.points,-1,o,r,p),p.features.length?p:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const o=this.getChildren(t);if(e++,1!==o.length)break;t=o[0].properties.cluster_id}return e}_appendLeaves(t,e,o,n,r){const i=this.getChildren(e);for(const e of i){const i=e.properties;if(i&&i.cluster?r+i.point_count<=n?r+=i.point_count:r=this._appendLeaves(t,i.cluster_id,o,n,r):r<n?r++:t.push(e),t.length===o)break}return r}_addTileFeatures(t,e,o,n,r,i){for(const s of t){const t=e[s],a=t.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(t.x*r-o)),Math.round(this.options.extent*(t.y*r-n))]],tags:a?y(t):this.points[t.index].properties};let c;a?c=t.id:this.options.generateId?c=t.index:this.points[t.index].id&&(c=this.points[t.index].id),void 0!==c&&(u.id=c),i.features.push(u)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))}_cluster(t,e){const o=[],{radius:n,extent:r,reduce:i}=this.options,s=n/(r*Math.pow(2,e));for(let n=0;n<t.length;n++){const r=t[n];if(r.zoom<=e)continue;r.zoom=e;const a=this.trees[e+1],u=a.within(r.x,r.y,s);let c=r.numPoints||1,p=r.x*c,l=r.y*c,h=i&&c>1?this._map(r,!0):null;const f=(n<<5)+(e+1)+this.points.length;for(const t of u){const o=a.points[t];if(o.zoom<=e)continue;o.zoom=e;const n=o.numPoints||1;p+=o.x*n,l+=o.y*n,c+=n,o.parentId=f,i&&(h||(h=this._map(r,!0)),i(h,this._map(o)))}1===c?o.push(r):(r.parentId=f,o.push(d(p/c,l/c,f,c,h)))}return o}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e){if(t.numPoints)return e?x({},t.properties):t.properties;const o=this.points[t.index].properties,n=this.options.map(o);return e&&n===o?x({},n):n}}function d(t,e,o,n,r){return{x:t,y:e,zoom:1/0,id:o,parentId:-1,numPoints:n,properties:r}}function m(t,e){const[o,n]=t.geometry.coordinates;return{x:v(o),y:b(n),zoom:1/0,index:e,parentId:-1}}function g(t){return{type:"Feature",id:t.id,properties:y(t),geometry:{type:"Point",coordinates:[(e=t.x,360*(e-.5)),_(t.y)]}};var e}function y(t){const e=t.numPoints,o=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${Math.round(e/100)/10}k`:e;return x(x({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:o})}function v(t){return t/360+.5}function b(t){const e=Math.sin(t*Math.PI/180),o=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return o<0?0:o>1?1:o}function _(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function x(t,e){for(const o in e)t[o]=e[o];return t}function M(t){return t.x}function w(t){return t.y}var S=function(){function t(){this.events={}}return t.prototype.on=function(t,e){var o=this.events[t];return o||(o=this.events[t]=[]),o.push(e),this},t.prototype.once=function(t,e){var o=this,n=function(r){o.off(t,n),e.call(o,r)};return this.on(t,n),this},t.prototype.off=function(t,e){var o=this.events[t];if(!o)return this;var n=o.indexOf(e);return-1!==n&&o.splice(n,1),this},t.prototype.emit=function(t,e){var o=this.events[t];if(!o)return this;for(var n=o.slice(),r=0;r<n.length;r++)n[r].call(this,e);return this},t}(),I=["click","dblclick","mousemove","mouseover","mouseout","mousedown","mouseup","touchstart","touchend"];var j=function(t){function e(o,n){var i;void 0===n&&(n={});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){var e=t.marker,o=t.label;e.hide(),o.hide()})),t.forEach((function(t){if(function(t){return t.properties.cluster}(t)){var e=t.properties.cluster_id,o=s.clusters.get(e);o?(o.marker.show(),o.label.show()):s._createCluster(e,t.geometry.coordinates,t.properties.point_count)}else{var n=t.properties.index,r=s.markers.get(n);r?r.show():s._createMarker(n,t.geometry.coordinates)}}))},s._updateVisibleObjects=function(t,e){var o,n;function r(){o=!1,n&&(i.apply(void 0,n),n=!1)}function i(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];o?n=i:(t.apply(void 0,i),setTimeout(r,e),o=!0)}return i}(s._updateVisibleObjects,100);var a=null!==(i=n.radius)&&void 0!==i?i:e.options.radius,u=e.options.clusterStyle;return n.clusterStyle&&(u="function"==typeof n.clusterStyle?n.clusterStyle:r(r({},u),n.clusterStyle)),s.options={radius:a,clusterStyle:u},s.map=o,s.inputMarkers=[],s.supercluster=new f({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 o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}(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._clear=function(){this.markers.forEach((function(t){t.destroy()})),this.clusters.forEach((function(t){var e=t.marker,o=t.label;e.destroy(),o.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],o=.06*t[1],n=this.map.unproject([-e,t[1]+o]),r=this.map.unproject([t[0]+e,t[1]+o]),i=this.map.unproject([t[0]+e,-o]),s=this.map.unproject([-e,-o]);return[Math.min(n[0],r[0],i[0],s[0]),Math.min(n[1],r[1],i[1],s[1]),Math.max(n[0],r[0],i[0],s[0]),Math.max(n[1],r[1],i[1],s[1])]},e.prototype._createMarker=function(t,e){var o=this,n=this.inputMarkers[t],r=n.icon,i=n.size,s=n.anchor,a=n.hoverIcon,u=n.hoverSize,c=n.hoverAnchor,p=new mapgl.Marker(this.map,{coordinates:e,icon:r,size:i,anchor:s,hoverIcon:a,hoverSize:u,hoverAnchor:c});I.forEach((function(t){return p.on(t,(function(e){var r={originalEvent:e.originalEvent,lngLat:e.lngLat,point:e.point,target:{type:"marker",data:n}};o.emit(t,r)}))})),this.markers.set(t,p)},e.prototype._createCluster=function(t,o,n){var i=this,s="function"==typeof this.options.clusterStyle?r(r({},e.options.clusterStyle),this.options.clusterStyle(n)):this.options.clusterStyle;void 0===s.labelText&&(s.labelText=String(n));var a=new mapgl.Marker(this.map,{coordinates:o,zIndex:0,icon:s.icon,size:s.size,anchor:s.anchor,hoverIcon:s.hoverIcon,hoverSize:s.hoverSize,hoverAnchor:s.hoverAnchor}),u=this.supercluster.getLeaves(t,1/0).map((function(t){return i.inputMarkers[t.properties.index]}));I.forEach((function(t){return a.on(t,(function(e){var o={originalEvent:e.originalEvent,lngLat:e.lngLat,point:e.point,target:{type:"cluster",data:u}};i.emit(t,o)}))}));var c=new mapgl.Label(this.map,{coordinates:o,text:s.labelText,color:s.labelColor,fontSize:s.labelFontSize,haloRadius:s.labelHaloRadius,haloColor:s.labelHaloColor,letterSpacing:s.labelLetterSpacing,anchor:s.labelAnchor});this.clusters.set(t,{marker:a,label:c})},e.options={radius:80,clusterStyle:{icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48Y2lyY2xlIGZpbGw9IiM0OGQ5NWQiIGN4PSIxNSIgY3k9IjE1IiByPSIxNSIvPjwvc3ZnPg==",labelColor:"#000000",labelFontSize:14,labelText:void 0}},e}(S);"mapgl"in window?mapgl.Clusterer=j:console.error("Looks like you did not load MapGL API correctly")}])})); | ||
var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};var r=function(){return(r=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function i(t,e,o,n,r,u){if(r-n<=o)return;const a=n+r>>1;!function t(e,o,n,r,i,u){for(;i>r;){if(i-r>600){const s=i-r+1,a=n-r+1,c=Math.log(s),p=.5*Math.exp(2*c/3),l=.5*Math.sqrt(c*p*(s-p)/s)*(a-s/2<0?-1:1),h=Math.max(r,Math.floor(n-a*p/s+l)),f=Math.min(i,Math.floor(n+(s-a)*p/s+l));t(e,o,n,h,f,u)}const a=o[2*n+u];let c=r,p=i;for(s(e,o,r,n),o[2*i+u]>a&&s(e,o,r,i);c<p;){for(s(e,o,c,p),c++,p--;o[2*c+u]<a;)c++;for(;o[2*p+u]>a;)p--}o[2*r+u]===a?s(e,o,r,p):(p++,s(e,o,p,i)),p<=n&&(r=p+1),n<=p&&(i=p-1)}}(t,e,a,n,r,u%2),i(t,e,o,n,a-1,u+1),i(t,e,o,a+1,r,u+1)}function s(t,e,o,n){u(t,o,n),u(e,2*o,2*n),u(e,2*o+1,2*n+1)}function u(t,e,o){const n=t[e];t[e]=t[o],t[o]=n}function a(t,e,o,n){const r=t-o,i=e-n;return r*r+i*i}const c=t=>t[0],p=t=>t[1];class l{constructor(t,e=c,o=p,n=64,r=Float64Array){this.nodeSize=n,this.points=t;const s=t.length<65536?Uint16Array:Uint32Array,u=this.ids=new s(t.length),a=this.coords=new r(2*t.length);for(let n=0;n<t.length;n++)u[n]=n,a[2*n]=e(t[n]),a[2*n+1]=o(t[n]);i(u,a,n,0,u.length-1,0)}range(t,e,o,n){return function(t,e,o,n,r,i,s){const u=[0,t.length-1,0],a=[];let c,p;for(;u.length;){const l=u.pop(),h=u.pop(),f=u.pop();if(h-f<=s){for(let s=f;s<=h;s++)c=e[2*s],p=e[2*s+1],c>=o&&c<=r&&p>=n&&p<=i&&a.push(t[s]);continue}const d=Math.floor((f+h)/2);c=e[2*d],p=e[2*d+1],c>=o&&c<=r&&p>=n&&p<=i&&a.push(t[d]);const m=(l+1)%2;(0===l?o<=c:n<=p)&&(u.push(f),u.push(d-1),u.push(m)),(0===l?r>=c:i>=p)&&(u.push(d+1),u.push(h),u.push(m))}return a}(this.ids,this.coords,t,e,o,n,this.nodeSize)}within(t,e,o){return function(t,e,o,n,r,i){const s=[0,t.length-1,0],u=[],c=r*r;for(;s.length;){const p=s.pop(),l=s.pop(),h=s.pop();if(l-h<=i){for(let r=h;r<=l;r++)a(e[2*r],e[2*r+1],o,n)<=c&&u.push(t[r]);continue}const f=Math.floor((h+l)/2),d=e[2*f],m=e[2*f+1];a(d,m,o,n)<=c&&u.push(t[f]);const g=(p+1)%2;(0===p?o-r<=d:n-r<=m)&&(s.push(h),s.push(f-1),s.push(g)),(0===p?o+r>=d:n+r>=m)&&(s.push(f+1),s.push(l),s.push(g))}return u}(this.ids,this.coords,t,e,o,this.nodeSize)}}const h={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t};class f{constructor(t){this.options=x(Object.create(h),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:e,minZoom:o,maxZoom:n,nodeSize:r}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;let s=[];for(let e=0;e<t.length;e++)t[e].geometry&&s.push(m(t[e],e));this.trees[n+1]=new l(s,M,w,r,Float32Array),e&&console.timeEnd(i);for(let t=n;t>=o;t--){const o=+Date.now();s=this._cluster(s,t),this.trees[t]=new l(s,M,w,r,Float32Array),e&&console.log("z%d: %d clusters in %dms",t,s.length,+Date.now()-o)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let o=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let r=180===t[2]?180:((t[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)o=-180,r=180;else if(o>r){const t=this.getClusters([o,n,180,i],e),s=this.getClusters([-180,n,r,i],e);return t.concat(s)}const s=this.trees[this._limitZoom(e)],u=s.range(v(o),b(i),v(r),b(n)),a=[];for(const t of u){const e=s.points[t];a.push(e.numPoints?g(e):this.points[e.index])}return a}getChildren(t){const e=this._getOriginId(t),o=this._getOriginZoom(t),n="No cluster with the specified id.",r=this.trees[o];if(!r)throw new Error(n);const i=r.points[e];if(!i)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,o-1)),u=r.within(i.x,i.y,s),a=[];for(const e of u){const o=r.points[e];o.parentId===t&&a.push(o.numPoints?g(o):this.points[o.index])}if(0===a.length)throw new Error(n);return a}getLeaves(t,e,o){e=e||10,o=o||0;const n=[];return this._appendLeaves(n,t,e,o,0),n}getTile(t,e,o){const n=this.trees[this._limitZoom(t)],r=Math.pow(2,t),{extent:i,radius:s}=this.options,u=s/i,a=(o-u)/r,c=(o+1+u)/r,p={features:[]};return this._addTileFeatures(n.range((e-u)/r,a,(e+1+u)/r,c),n.points,e,o,r,p),0===e&&this._addTileFeatures(n.range(1-u/r,a,1,c),n.points,r,o,r,p),e===r-1&&this._addTileFeatures(n.range(0,a,u/r,c),n.points,-1,o,r,p),p.features.length?p:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const o=this.getChildren(t);if(e++,1!==o.length)break;t=o[0].properties.cluster_id}return e}_appendLeaves(t,e,o,n,r){const i=this.getChildren(e);for(const e of i){const i=e.properties;if(i&&i.cluster?r+i.point_count<=n?r+=i.point_count:r=this._appendLeaves(t,i.cluster_id,o,n,r):r<n?r++:t.push(e),t.length===o)break}return r}_addTileFeatures(t,e,o,n,r,i){for(const s of t){const t=e[s],u=t.numPoints,a={type:1,geometry:[[Math.round(this.options.extent*(t.x*r-o)),Math.round(this.options.extent*(t.y*r-n))]],tags:u?y(t):this.points[t.index].properties};let c;u?c=t.id:this.options.generateId?c=t.index:this.points[t.index].id&&(c=this.points[t.index].id),void 0!==c&&(a.id=c),i.features.push(a)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))}_cluster(t,e){const o=[],{radius:n,extent:r,reduce:i}=this.options,s=n/(r*Math.pow(2,e));for(let n=0;n<t.length;n++){const r=t[n];if(r.zoom<=e)continue;r.zoom=e;const u=this.trees[e+1],a=u.within(r.x,r.y,s);let c=r.numPoints||1,p=r.x*c,l=r.y*c,h=i&&c>1?this._map(r,!0):null;const f=(n<<5)+(e+1)+this.points.length;for(const t of a){const o=u.points[t];if(o.zoom<=e)continue;o.zoom=e;const n=o.numPoints||1;p+=o.x*n,l+=o.y*n,c+=n,o.parentId=f,i&&(h||(h=this._map(r,!0)),i(h,this._map(o)))}1===c?o.push(r):(r.parentId=f,o.push(d(p/c,l/c,f,c,h)))}return o}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e){if(t.numPoints)return e?x({},t.properties):t.properties;const o=this.points[t.index].properties,n=this.options.map(o);return e&&n===o?x({},n):n}}function d(t,e,o,n,r){return{x:t,y:e,zoom:1/0,id:o,parentId:-1,numPoints:n,properties:r}}function m(t,e){const[o,n]=t.geometry.coordinates;return{x:v(o),y:b(n),zoom:1/0,index:e,parentId:-1}}function g(t){return{type:"Feature",id:t.id,properties:y(t),geometry:{type:"Point",coordinates:[(e=t.x,360*(e-.5)),_(t.y)]}};var e}function y(t){const e=t.numPoints,o=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${Math.round(e/100)/10}k`:e;return x(x({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:o})}function v(t){return t/360+.5}function b(t){const e=Math.sin(t*Math.PI/180),o=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return o<0?0:o>1?1:o}function _(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function x(t,e){for(const o in e)t[o]=e[o];return t}function M(t){return t.x}function w(t){return t.y}var S=function(){function t(){this.events={}}return t.prototype.on=function(t,e){var o=this.events[t];return o||(o=this.events[t]=[]),o.push(e),this},t.prototype.once=function(t,e){var o=this,n=function(r){o.off(t,n),e.call(o,r)};return this.on(t,n),this},t.prototype.off=function(t,e){var o=this.events[t];if(!o)return this;var n=o.indexOf(e);return-1!==n&&o.splice(n,1),this},t.prototype.emit=function(t,e){var o=this.events[t];if(!o)return this;for(var n=o.slice(),r=0;r<n.length;r++)n[r].call(this,e);return this},t}(),I=["click","dblclick","mousemove","mouseover","mouseout","mousedown","mouseup","touchstart","touchend"];var j=function(t){function e(o,n){var i;void 0===n&&(n={});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,o=s.clusters.get(e);o?o.show():s._createCluster(e,t.geometry.coordinates,t.properties.point_count)}else{var n=t.properties.index,r=s.markers.get(n);r?r.show():s._createMarker(n,t.geometry.coordinates)}}))},s._updateVisibleObjects=function(t,e){var o,n;function r(){o=!1,n&&(i.apply(void 0,n),n=!1)}function i(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];o?n=i:(t.apply(void 0,i),setTimeout(r,e),o=!0)}return i}(s._updateVisibleObjects,100);var u=null!==(i=n.radius)&&void 0!==i?i:e.options.radius,a=e.options.clusterStyle;return n.clusterStyle&&(a="function"==typeof n.clusterStyle?n.clusterStyle:r(r({},a),n.clusterStyle)),s.options={radius:u,clusterStyle:a},s.map=o,s.inputMarkers=[],s.supercluster=new f({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 o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}(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._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],o=.06*t[1],n=this.map.unproject([-e,t[1]+o]),r=this.map.unproject([t[0]+e,t[1]+o]),i=this.map.unproject([t[0]+e,-o]),s=this.map.unproject([-e,-o]);return[Math.min(n[0],r[0],i[0],s[0]),Math.min(n[1],r[1],i[1],s[1]),Math.max(n[0],r[0],i[0],s[0]),Math.max(n[1],r[1],i[1],s[1])]},e.prototype._createMarker=function(t,e){var o=this,n=this.inputMarkers[t],r=n.icon,i=n.size,s=n.anchor,u=n.hoverIcon,a=n.hoverSize,c=n.hoverAnchor,p=n.label,l=new mapgl.Marker(this.map,{coordinates:e,icon:r,size:i,anchor:s,hoverIcon:u,hoverSize:a,hoverAnchor:c,label:p});I.forEach((function(t){return l.on(t,(function(e){var r={originalEvent:e.originalEvent,lngLat:e.lngLat,point:e.point,target:{type:"marker",data:n}};o.emit(t,r)}))})),this.markers.set(t,l)},e.prototype._createCluster=function(t,o,n){var i=this,s="function"==typeof this.options.clusterStyle?r(r({},e.options.clusterStyle),this.options.clusterStyle(n)):this.options.clusterStyle;void 0===s.labelText&&(s.labelText=String(n));var u=new mapgl.Marker(this.map,{coordinates:o,zIndex:0,icon:s.icon,size:s.size,anchor:s.anchor,hoverIcon:s.hoverIcon,hoverSize:s.hoverSize,hoverAnchor:s.hoverAnchor,label:{text:s.labelText,color:s.labelColor,fontSize:s.labelFontSize,haloRadius:s.labelHaloRadius,haloColor:s.labelHaloColor,letterSpacing:s.labelLetterSpacing,anchor:s.labelAnchor}}),a=this.supercluster.getLeaves(t,1/0).map((function(t){return i.inputMarkers[t.properties.index]}));I.forEach((function(t){return u.on(t,(function(e){var o={originalEvent:e.originalEvent,lngLat:e.lngLat,point:e.point,target:{type:"cluster",data:a}};i.emit(t,o)}))})),this.clusters.set(t,u)},e.options={radius:80,clusterStyle:{icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48Y2lyY2xlIGZpbGw9IiM0OGQ5NWQiIGN4PSIxNSIgY3k9IjE1IiByPSIxNSIvPjwvc3ZnPg==",labelColor:"#000000",labelFontSize:14,labelText:void 0}},e}(S);"mapgl"in window?mapgl.Clusterer=j:console.error("Looks like you did not load MapGL API correctly")}])})); |
@@ -1,1 +0,1 @@ | ||
!function(e){var o={};function r(n){if(o[n])return o[n].exports;var t=o[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=e,r.c=o,r.d=function(e,o,n){r.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,o){if(1&o&&(e=r(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var t in e)r.d(n,t,function(o){return e[o]}.bind(null,t));return n},r.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(o,"a",o),o},r.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r.p="/",r(r.s=0)}([function(e,o,r){"use strict";r.r(o);var n=new mapgl.Map("container",{center:[55.31878,25.23584],zoom:13,key:"Your API access key"});function t(e,o){return"data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" width="'+2*o+'" height="'+2*o+'" viewBox="0 0 '+2*o+" "+2*o+'"><circle fill="'+e+'" cx="'+o+'" cy="'+o+'" r="'+o+'"/></svg>')}window.addEventListener("resize",(function(){return n.invalidateSize()}));var l=new mapgl.Clusterer(n,{clusterStyle:function(e){return e<5e3?{icon:t("#48d95d",12.5),size:[25,25],hoverIcon:t("#24b137",12.5),hoverSize:[30,30],labelHaloRadius:2,labelHaloColor:"#ffffff88",labelFontSize:12}:e<3e4?{icon:t("#ffad33",15),size:[30,30],hoverIcon:t("#c07915",15),hoverSize:[35,35],labelText:"Medium size "+e,labelHaloRadius:2,labelHaloColor:"#ffffff88"}:{icon:t("#e82734",17.5),size:[35,35],hoverIcon:t("#c3121e",17.5),hoverSize:[40,40],labelHaloRadius:2,labelHaloColor:"#ffffff88",labelFontSize:16}}}),i=function(e){console.log(e)};l.on("click",i),l.on("mouseover",i),l.on("mouseout",i);var a=function(e){for(var o=n.getBounds(),r=function(){for(var e=0,o=0,r=arguments.length;o<r;o++)e+=arguments[o].length;var n=Array(e),t=0;for(o=0;o<r;o++)for(var l=arguments[o],i=0,a=l.length;i<a;i++,t++)n[t]=l[i];return n}(o.northEast,o.southWest),l=[],i=t("#1d8ce8",10),a=t("#12c3b2",10),u=0;u<e;u++)l.push({coordinates:[r[0]+Math.random()*(r[2]-r[0]),r[1]+Math.random()*(r[3]-r[1])],properties:{id:u},icon:u%2==0?a:i});return l}(5e4);l.load(a)}]); | ||
!function(e){var o={};function r(n){if(o[n])return o[n].exports;var t=o[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=e,r.c=o,r.d=function(e,o,n){r.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,o){if(1&o&&(e=r(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var t in e)r.d(n,t,function(o){return e[o]}.bind(null,t));return n},r.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(o,"a",o),o},r.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r.p="/",r(r.s=0)}([function(e,o,r){"use strict";r.r(o);var n=new mapgl.Map("container",{center:[55.31878,25.23584],zoom:13,key:"Your API access key"});function t(e,o){return"data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" width="'+2*o+'" height="'+2*o+'" viewBox="0 0 '+2*o+" "+2*o+'"><circle fill="'+e+'" cx="'+o+'" cy="'+o+'" r="'+o+'"/></svg>')}window.addEventListener("resize",(function(){return n.invalidateSize()}));var l=new mapgl.Clusterer(n,{clusterStyle:function(e){return e<5e3?{icon:t("#48d95d",12.5),size:[25,25],hoverIcon:t("#24b137",12.5),hoverSize:[30,30],labelHaloRadius:2,labelHaloColor:"#ffffff88",labelFontSize:12}:e<3e4?{icon:t("#ffad33",15),size:[30,30],hoverIcon:t("#c07915",15),hoverSize:[35,35],labelText:"Medium size "+e,labelHaloRadius:2,labelHaloColor:"#ffffff88"}:{icon:t("#e82734",17.5),size:[35,35],hoverIcon:t("#c3121e",17.5),hoverSize:[40,40],labelHaloRadius:2,labelHaloColor:"#ffffff88",labelFontSize:16}}}),a=function(e){console.log(e)};l.on("click",a),l.on("mouseover",a),l.on("mouseout",a);var i=function(e){for(var o=n.getBounds(),r=function(){for(var e=0,o=0,r=arguments.length;o<r;o++)e+=arguments[o].length;var n=Array(e),t=0;for(o=0;o<r;o++)for(var l=arguments[o],a=0,i=l.length;a<i;a++,t++)n[t]=l[a];return n}(o.northEast,o.southWest),l=[],a=t("#1d8ce8",10),i=t("#12c3b2",10),u=0;u<e;u++)l.push({coordinates:[r[0]+Math.random()*(r[2]-r[0]),r[1]+Math.random()*(r[3]-r[1])],icon:u%2==0?i:a,label:{text:"marker №"+u}});return l}(5e4);l.load(i)}]); |
@@ -1,1 +0,1 @@ | ||
{"typescript":{"Evented":{"documentation":{"contents":["<p>Event emitter</p>\n"],"contentsRaw":"Event emitter","metadata":{}},"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"class","name":"Evented","methods":[{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"emit","signatures":[{"documentation":{"contents":["<p>Calls all event listeners with event type <code>type</code></p>\n"],"contentsRaw":"Calls all event listeners with event type `type`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"emit","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Data transferred to events</p>\n"],"contentsRaw":"Data transferred to events","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"data","type":"M[K]"}],"returnType":"this","type":"(type: K, data?: M[K]) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"off","signatures":[{"documentation":{"contents":["<p>Removes event listener registered with <code>on</code></p>\n"],"contentsRaw":"Removes event listener registered with `on`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"off","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"on","signatures":[{"documentation":{"contents":["<p>Registers event listener</p>\n"],"contentsRaw":"Registers event listener","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"on","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"once","signatures":[{"documentation":{"contents":["<p>Registers event listener which will be called once</p>\n"],"contentsRaw":"Registers event listener which will be called once","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"once","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]}],"properties":[],"accessors":[],"constructorType":{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"constructor","name":"constructor","signatures":[{"fileName":"src/evented.ts","kind":"signature","name":"new Evented","parameters":[],"returnType":"Evented","type":"() => Evented"}]}},"Clusterer":{"documentation":{"contents":["<p>A class that provides markers clustering functionality.</p>\n"],"contentsRaw":"A class that provides markers clustering functionality.","metadata":{}},"fileName":"src/clusterer.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"class","name":"Clusterer","extends":["Evented<ClustererEventTable>"],"methods":[{"fileName":"src/clusterer.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"destroy","signatures":[{"documentation":{"contents":["<p>Destroys the clusterer.</p>\n"],"contentsRaw":"Destroys the clusterer.","metadata":{}},"fileName":"src/clusterer.ts","kind":"signature","name":"destroy","parameters":[],"returnType":"void","type":"() => void"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"emit","inheritedFrom":"Evented.emit","signatures":[{"documentation":{"contents":["<p>Calls all event listeners with event type <code>type</code></p>\n"],"contentsRaw":"Calls all event listeners with event type `type`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"emit","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Data transferred to events</p>\n"],"contentsRaw":"Data transferred to events","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"data","type":"ClustererEventTable[K]"}],"returnType":"this","type":"(type: K, data?: ClustererEventTable[K]) => this"}]},{"fileName":"src/clusterer.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"load","signatures":[{"documentation":{"contents":["<p>Loads markers to clusterer.</p>\n"],"contentsRaw":"Loads markers to clusterer.","metadata":{}},"fileName":"src/clusterer.ts","kind":"signature","name":"load","parameters":[{"documentation":{"contents":["<p>An array of markers.</p>\n"],"contentsRaw":"An array of markers.","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"input","type":"InputMarker[]"}],"returnType":"void","type":"(input: InputMarker[]) => void"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"off","inheritedFrom":"Evented.off","signatures":[{"documentation":{"contents":["<p>Removes event listener registered with <code>on</code></p>\n"],"contentsRaw":"Removes event listener registered with `on`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"off","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: ClustererEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: ClustererEventTable[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"on","inheritedFrom":"Evented.on","signatures":[{"documentation":{"contents":["<p>Registers event listener</p>\n"],"contentsRaw":"Registers event listener","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"on","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: ClustererEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: ClustererEventTable[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"once","inheritedFrom":"Evented.once","signatures":[{"documentation":{"contents":["<p>Registers event listener which will be called once</p>\n"],"contentsRaw":"Registers event listener which will be called once","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"once","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: ClustererEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: ClustererEventTable[K]) => void) => this"}]}],"properties":[],"accessors":[],"constructorType":{"documentation":{"contents":["<p>Example:</p>\n<pre><code class=\"language-js\">const clusterer = new mapgl.Clusterer(map, {\n radius: 60\n});</code></pre>\n"],"contentsRaw":"Example:\n```js\nconst clusterer = new mapgl.Clusterer(map, {\n radius: 60\n});\n```","metadata":{}},"fileName":"src/clusterer.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"constructor","name":"constructor","signatures":[{"documentation":{"contents":["<p>Example:</p>\n<pre><code class=\"language-js\">const clusterer = new mapgl.Clusterer(map, {\n radius: 60\n});</code></pre>\n"],"contentsRaw":"Example:\n```js\nconst clusterer = new mapgl.Clusterer(map, {\n radius: 60\n});\n```","metadata":{}},"fileName":"src/clusterer.ts","kind":"signature","name":"new Clusterer","parameters":[{"documentation":{"contents":["<p>The map instance.</p>\n"],"contentsRaw":"The map instance.","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"map","type":"mapgl.Map"},{"documentation":{"contents":["<p>Clusterer initialization options.</p>\n"],"contentsRaw":"Clusterer initialization options.","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"userOptions","defaultValue":"{}","type":"ClustererOptions"}],"returnType":"Clusterer","type":"(map: mapgl.Map, userOptions?: ClustererOptions) => Clusterer"}]}},"InputMarker":{"documentation":{"contents":["<p>A marker for clustering.</p>\n"],"contentsRaw":"A marker for clustering.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"InputMarker","indexSignature":{"documentation":{"contents":["<p>Any specific data.</p>\n"],"contentsRaw":"Any specific data.","metadata":{}},"fileName":"src/types.ts","kind":"signature","name":"__index","parameters":[{"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"key","type":"string"}],"returnType":"any","type":"{ [key: string]: any }"},"methods":[],"properties":[{"documentation":{"contents":["<p>The position of the "tip" of the icon (relative to its top left corner).\nThe icon will be aligned so that this point is at the marker's geographical location.\nCentered by default if anchor is not specified and custom icon is provided.</p>\n"],"contentsRaw":"The position of the \"tip\" of the icon (relative to its top left corner).\nThe icon will be aligned so that this point is at the marker's geographical location.\nCentered by default if anchor is not specified and custom icon is provided.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"anchor","type":"number[]"},{"documentation":{"contents":["<p>Geographical coordinates of marker center <code>[longitude, latitude]</code>.</p>\n"],"contentsRaw":"Geographical coordinates of marker center `[longitude, latitude]`.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"coordinates","type":"number[]"},{"documentation":{"contents":["<p>Marker icon anchor in hovered state.</p>\n"],"contentsRaw":"Marker icon anchor in hovered state.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverAnchor","type":"number[]"},{"documentation":{"contents":["<p>Marker icon URL in hovered state.</p>\n"],"contentsRaw":"Marker icon URL in hovered state.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverIcon","type":"undefined | string"},{"documentation":{"contents":["<p>Marker icon size <code>[width, height]</code> in pixels in hovered state.</p>\n"],"contentsRaw":"Marker icon size `[width, height]` in pixels in hovered state.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverSize","type":"number[]"},{"documentation":{"contents":["<p>Marker icon URL.</p>\n"],"contentsRaw":"Marker icon URL.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"icon","type":"undefined | string"},{"documentation":{"contents":["<p>Marker icon size <code>[width, height]</code> in pixels.</p>\n"],"contentsRaw":"Marker icon size `[width, height]` in pixels.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"size","type":"number[]"}]},"MarkerTarget":{"documentation":{"contents":["<p>Marker event target.</p>\n"],"contentsRaw":"Marker event target.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"MarkerTarget","methods":[],"properties":[{"documentation":{"contents":["<p>The targeted marker.</p>\n"],"contentsRaw":"The targeted marker.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"data","type":"InputMarker"},{"documentation":{"contents":["<p>Type of the target.</p>\n"],"contentsRaw":"Type of the target.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"type","type":"\"marker\""}]},"ClusterTarget":{"documentation":{"contents":["<p>Cluster event target.</p>\n"],"contentsRaw":"Cluster event target.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"ClusterTarget","methods":[],"properties":[{"documentation":{"contents":["<p>Markers contained in the targeted cluster.</p>\n"],"contentsRaw":"Markers contained in the targeted cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"data","type":"InputMarker[]"},{"documentation":{"contents":["<p>Type of the target.</p>\n"],"contentsRaw":"Type of the target.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"type","type":"\"cluster\""}]},"ClustererPointerEvent":{"documentation":{"contents":["<p>The event type for pointer-related clusterer events.</p>\n"],"contentsRaw":"The event type for pointer-related clusterer events.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"ClustererPointerEvent","methods":[],"properties":[{"documentation":{"contents":["<p>Geographical coordinates of the event.</p>\n"],"contentsRaw":"Geographical coordinates of the event.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"lngLat","type":"number[]"},{"documentation":{"contents":["<p>The original DOM event.</p>\n"],"contentsRaw":"The original DOM event.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"originalEvent","type":"MouseEvent | TouchEvent"},{"documentation":{"contents":["<p>Screen coordinates of the event.</p>\n"],"contentsRaw":"Screen coordinates of the event.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"point","type":"number[]"},{"documentation":{"contents":["<p>Target (a marker or a cluster) of the event.</p>\n"],"contentsRaw":"Target (a marker or a cluster) of the event.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"target","type":"MarkerTarget | ClusterTarget"}]},"ClustererOptions":{"documentation":{"contents":["<p>Clusterer initialization options.</p>\n"],"contentsRaw":"Clusterer initialization options.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"ClustererOptions","methods":[],"properties":[{"documentation":{"contents":["<p>Style of clusters.\nThis parameter accepts an object or a function.\nWhen given an object, the same style will be applied to all clusters.\nIf you want to customize the style based on the number of markers within the cluster, you can provide a function instead.</p>\n"],"contentsRaw":"Style of clusters.\nThis parameter accepts an object or a function.\nWhen given an object, the same style will be applied to all clusters.\nIf you want to customize the style based on the number of markers within the cluster, you can provide a function instead.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"clusterStyle","type":"(pointsCount: number) => ClusterStyle | ClusterStyle"},{"documentation":{"contents":["<p>Clustering radius in pixels.</p>\n"],"contentsRaw":"Clustering radius in pixels.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"radius","type":"undefined | number"}]},"ClustererEventTable":{"documentation":{"contents":["<p>The list of events that can be emitted by clusterer.</p>\n"],"contentsRaw":"The list of events that can be emitted by clusterer.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"ClustererEventTable","methods":[],"properties":[{"documentation":{"contents":["<p>Emitted when the marker/cluster is clicked.</p>\n"],"contentsRaw":"Emitted when the marker/cluster is clicked.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"click","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the marker/cluster is doubleclicked.</p>\n"],"contentsRaw":"Emitted when the marker/cluster is doubleclicked.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"dblclick","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user presses a mouse button over the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user presses a mouse button over the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"mousedown","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user moves the pointer over the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user moves the pointer over the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"mousemove","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user moves the pointer away from the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user moves the pointer away from the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"mouseout","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user hovers over the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user hovers over the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"mouseover","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user releases the mouse button over the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user releases the mouse button over the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"mouseup","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user lifts the finger off the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user lifts the finger off the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"touchend","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user taps on the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user taps on the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"touchstart","type":"ClustererPointerEvent"}]},"ClusterStyle":{"documentation":{"contents":["<p>An object describing a cluster style.</p>\n"],"contentsRaw":"An object describing a cluster style.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"ClusterStyle","methods":[],"properties":[{"documentation":{"contents":["<p>The position of the "tip" of the icon (relative to its top left corner).\nThe icon will be aligned so that this point is at the cluster's geographical location.\nCentered by default if anchor is not specified and custom icon is provided.</p>\n"],"contentsRaw":"The position of the \"tip\" of the icon (relative to its top left corner).\nThe icon will be aligned so that this point is at the cluster's geographical location.\nCentered by default if anchor is not specified and custom icon is provided.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"anchor","type":"number[]"},{"documentation":{"contents":["<p>Cluster icon anchor in hovered state.</p>\n"],"contentsRaw":"Cluster icon anchor in hovered state.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverAnchor","type":"number[]"},{"documentation":{"contents":["<p>Cluster icon URL in hovered state.</p>\n"],"contentsRaw":"Cluster icon URL in hovered state.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverIcon","type":"undefined | string"},{"documentation":{"contents":["<p>Cluster icon size <code>[width, height]</code> in hovered state in pixels.</p>\n"],"contentsRaw":"Cluster icon size `[width, height]` in hovered state in pixels.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverSize","type":"number[]"},{"documentation":{"contents":["<p>Cluster icon URL.</p>\n"],"contentsRaw":"Cluster icon URL.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"icon","type":"undefined | string"},{"documentation":{"contents":["<p>The position in pixels of the "tip" of the cluster label relative to its center.</p>\n"],"contentsRaw":"The position in pixels of the \"tip\" of the cluster label relative to its center.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelAnchor","type":"number[]"},{"documentation":{"contents":["<p>Label's text color of a cluster in CSS hexadecimal RGB format (e.g. <code>#ff0000</code>).</p>\n"],"contentsRaw":"Label's text color of a cluster in CSS hexadecimal RGB format (e.g. `#ff0000`).","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelColor","type":"undefined | string"},{"documentation":{"contents":["<p>Label's text font size of a cluster.</p>\n"],"contentsRaw":"Label's text font size of a cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelFontSize","type":"undefined | number"},{"documentation":{"contents":["<p>Label's text background color of a cluster in CSS hexadecimal RGB format (e.g. <code>#ff0000</code>).</p>\n"],"contentsRaw":"Label's text background color of a cluster in CSS hexadecimal RGB format (e.g. `#ff0000`).","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelHaloColor","type":"undefined | string"},{"documentation":{"contents":["<p>Label's text background radius of a cluster.\nThe background is set for each letter of the text.</p>\n"],"contentsRaw":"Label's text background radius of a cluster.\nThe background is set for each letter of the text.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelHaloRadius","type":"undefined | number"},{"documentation":{"contents":["<p>Label's text letter spacing of a cluster.</p>\n"],"contentsRaw":"Label's text letter spacing of a cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelLetterSpacing","type":"undefined | number"},{"documentation":{"contents":["<p>Label's text of a cluster. By default, it's the size of the cluster.</p>\n"],"contentsRaw":"Label's text of a cluster. By default, it's the size of the cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelText","type":"undefined | string"},{"documentation":{"contents":["<p>Cluster icon size <code>[width, height]</code> in pixels.</p>\n"],"contentsRaw":"Cluster icon size `[width, height]` in pixels.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"size","type":"number[]"}]}}} | ||
{"typescript":{"Evented":{"documentation":{"contents":["<p>Event emitter</p>\n"],"contentsRaw":"Event emitter","metadata":{}},"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"class","name":"Evented","methods":[{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"emit","signatures":[{"documentation":{"contents":["<p>Calls all event listeners with event type <code>type</code></p>\n"],"contentsRaw":"Calls all event listeners with event type `type`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"emit","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Data transferred to events</p>\n"],"contentsRaw":"Data transferred to events","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"data","type":"M[K]"}],"returnType":"this","type":"(type: K, data?: M[K]) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"off","signatures":[{"documentation":{"contents":["<p>Removes event listener registered with <code>on</code></p>\n"],"contentsRaw":"Removes event listener registered with `on`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"off","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"on","signatures":[{"documentation":{"contents":["<p>Registers event listener</p>\n"],"contentsRaw":"Registers event listener","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"on","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"once","signatures":[{"documentation":{"contents":["<p>Registers event listener which will be called once</p>\n"],"contentsRaw":"Registers event listener which will be called once","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"once","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: M[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: M[K]) => void) => this"}]}],"properties":[],"accessors":[],"constructorType":{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"constructor","name":"constructor","signatures":[{"fileName":"src/evented.ts","kind":"signature","name":"new Evented","parameters":[],"returnType":"Evented","type":"() => Evented"}]}},"Clusterer":{"documentation":{"contents":["<p>A class that provides markers clustering functionality.</p>\n"],"contentsRaw":"A class that provides markers clustering functionality.","metadata":{}},"fileName":"src/clusterer.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"class","name":"Clusterer","extends":["Evented<ClustererEventTable>"],"methods":[{"fileName":"src/clusterer.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"destroy","signatures":[{"documentation":{"contents":["<p>Destroys the clusterer.</p>\n"],"contentsRaw":"Destroys the clusterer.","metadata":{}},"fileName":"src/clusterer.ts","kind":"signature","name":"destroy","parameters":[],"returnType":"void","type":"() => void"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"emit","inheritedFrom":"Evented.emit","signatures":[{"documentation":{"contents":["<p>Calls all event listeners with event type <code>type</code></p>\n"],"contentsRaw":"Calls all event listeners with event type `type`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"emit","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Data transferred to events</p>\n"],"contentsRaw":"Data transferred to events","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"data","type":"ClustererEventTable[K]"}],"returnType":"this","type":"(type: K, data?: ClustererEventTable[K]) => this"}]},{"fileName":"src/clusterer.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"load","signatures":[{"documentation":{"contents":["<p>Loads markers to clusterer.</p>\n"],"contentsRaw":"Loads markers to clusterer.","metadata":{}},"fileName":"src/clusterer.ts","kind":"signature","name":"load","parameters":[{"documentation":{"contents":["<p>An array of markers.</p>\n"],"contentsRaw":"An array of markers.","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"input","type":"InputMarker[]"}],"returnType":"void","type":"(input: InputMarker[]) => void"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"off","inheritedFrom":"Evented.off","signatures":[{"documentation":{"contents":["<p>Removes event listener registered with <code>on</code></p>\n"],"contentsRaw":"Removes event listener registered with `on`","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"off","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: ClustererEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: ClustererEventTable[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"on","inheritedFrom":"Evented.on","signatures":[{"documentation":{"contents":["<p>Registers event listener</p>\n"],"contentsRaw":"Registers event listener","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"on","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: ClustererEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: ClustererEventTable[K]) => void) => this"}]},{"fileName":"src/evented.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":true,"isRest":false,"isStatic":false},"kind":"method","name":"once","inheritedFrom":"Evented.once","signatures":[{"documentation":{"contents":["<p>Registers event listener which will be called once</p>\n"],"contentsRaw":"Registers event listener which will be called once","metadata":{}},"fileName":"src/evented.ts","kind":"signature","name":"once","parameters":[{"documentation":{"contents":["<p>Event type</p>\n"],"contentsRaw":"Event type","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"type","type":"K"},{"documentation":{"contents":["<p>Event handler</p>\n"],"contentsRaw":"Event handler","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"listener","type":"(ev: ClustererEventTable[K]) => void"}],"returnType":"this","type":"(type: K, listener: (ev: ClustererEventTable[K]) => void) => this"}]}],"properties":[],"accessors":[],"constructorType":{"documentation":{"contents":["<p>Example:</p>\n<pre><code class=\"language-js\">const clusterer = new mapgl.Clusterer(map, {\n radius: 60\n});</code></pre>\n"],"contentsRaw":"Example:\n```js\nconst clusterer = new mapgl.Clusterer(map, {\n radius: 60\n});\n```","metadata":{}},"fileName":"src/clusterer.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"constructor","name":"constructor","signatures":[{"documentation":{"contents":["<p>Example:</p>\n<pre><code class=\"language-js\">const clusterer = new mapgl.Clusterer(map, {\n radius: 60\n});</code></pre>\n"],"contentsRaw":"Example:\n```js\nconst clusterer = new mapgl.Clusterer(map, {\n radius: 60\n});\n```","metadata":{}},"fileName":"src/clusterer.ts","kind":"signature","name":"new Clusterer","parameters":[{"documentation":{"contents":["<p>The map instance.</p>\n"],"contentsRaw":"The map instance.","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"map","type":"mapgl.Map"},{"documentation":{"contents":["<p>Clusterer initialization options.</p>\n"],"contentsRaw":"Clusterer initialization options.","metadata":{}},"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"userOptions","defaultValue":"{}","type":"ClustererOptions"}],"returnType":"Clusterer","type":"(map: mapgl.Map, userOptions?: ClustererOptions) => Clusterer"}]}},"InputMarker":{"documentation":{"contents":["<p>A marker for clustering.</p>\n"],"contentsRaw":"A marker for clustering.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"InputMarker","indexSignature":{"documentation":{"contents":["<p>Any specific data.</p>\n"],"contentsRaw":"Any specific data.","metadata":{}},"fileName":"src/types.ts","kind":"signature","name":"__index","parameters":[{"flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"parameter","name":"key","type":"string"}],"returnType":"any","type":"{ [key: string]: any }"},"methods":[],"properties":[{"documentation":{"contents":["<p>The position of the "tip" of the icon (relative to its top left corner).\nThe icon will be aligned so that this point is at the marker's geographical location.\nCentered by default if anchor is not specified and custom icon is provided.</p>\n"],"contentsRaw":"The position of the \"tip\" of the icon (relative to its top left corner).\nThe icon will be aligned so that this point is at the marker's geographical location.\nCentered by default if anchor is not specified and custom icon is provided.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"anchor","type":"number[]"},{"documentation":{"contents":["<p>Geographical coordinates of marker center <code>[longitude, latitude]</code>.</p>\n"],"contentsRaw":"Geographical coordinates of marker center `[longitude, latitude]`.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"coordinates","type":"number[]"},{"documentation":{"contents":["<p>Marker icon anchor in hovered state.</p>\n"],"contentsRaw":"Marker icon anchor in hovered state.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverAnchor","type":"number[]"},{"documentation":{"contents":["<p>Marker icon URL in hovered state.</p>\n"],"contentsRaw":"Marker icon URL in hovered state.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverIcon","type":"undefined | string"},{"documentation":{"contents":["<p>Marker icon size <code>[width, height]</code> in pixels in hovered state.</p>\n"],"contentsRaw":"Marker icon size `[width, height]` in pixels in hovered state.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverSize","type":"number[]"},{"documentation":{"contents":["<p>Marker icon URL.</p>\n"],"contentsRaw":"Marker icon URL.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"icon","type":"undefined | string"},{"documentation":{"contents":["<p>Initialization options of the marker's label.</p>\n"],"contentsRaw":"Initialization options of the marker's label.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"label","type":"undefined | "},{"documentation":{"contents":["<p>Marker icon size <code>[width, height]</code> in pixels.</p>\n"],"contentsRaw":"Marker icon size `[width, height]` in pixels.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"size","type":"number[]"}]},"MarkerTarget":{"documentation":{"contents":["<p>Marker event target.</p>\n"],"contentsRaw":"Marker event target.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"MarkerTarget","methods":[],"properties":[{"documentation":{"contents":["<p>The targeted marker.</p>\n"],"contentsRaw":"The targeted marker.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"data","type":"InputMarker"},{"documentation":{"contents":["<p>Type of the target.</p>\n"],"contentsRaw":"Type of the target.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"type","type":"\"marker\""}]},"ClusterTarget":{"documentation":{"contents":["<p>Cluster event target.</p>\n"],"contentsRaw":"Cluster event target.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"ClusterTarget","methods":[],"properties":[{"documentation":{"contents":["<p>Markers contained in the targeted cluster.</p>\n"],"contentsRaw":"Markers contained in the targeted cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"data","type":"InputMarker[]"},{"documentation":{"contents":["<p>Type of the target.</p>\n"],"contentsRaw":"Type of the target.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"type","type":"\"cluster\""}]},"ClustererPointerEvent":{"documentation":{"contents":["<p>The event type for pointer-related clusterer events.</p>\n"],"contentsRaw":"The event type for pointer-related clusterer events.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"ClustererPointerEvent","methods":[],"properties":[{"documentation":{"contents":["<p>Geographical coordinates of the event.</p>\n"],"contentsRaw":"Geographical coordinates of the event.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"lngLat","type":"number[]"},{"documentation":{"contents":["<p>The original DOM event.</p>\n"],"contentsRaw":"The original DOM event.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"originalEvent","type":"MouseEvent | TouchEvent"},{"documentation":{"contents":["<p>Screen coordinates of the event.</p>\n"],"contentsRaw":"Screen coordinates of the event.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"point","type":"number[]"},{"documentation":{"contents":["<p>Target (a marker or a cluster) of the event.</p>\n"],"contentsRaw":"Target (a marker or a cluster) of the event.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"target","type":"MarkerTarget | ClusterTarget"}]},"ClustererOptions":{"documentation":{"contents":["<p>Clusterer initialization options.</p>\n"],"contentsRaw":"Clusterer initialization options.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"ClustererOptions","methods":[],"properties":[{"documentation":{"contents":["<p>Style of clusters.\nThis parameter accepts an object or a function.\nWhen given an object, the same style will be applied to all clusters.\nIf you want to customize the style based on the number of markers within the cluster, you can provide a function instead.</p>\n"],"contentsRaw":"Style of clusters.\nThis parameter accepts an object or a function.\nWhen given an object, the same style will be applied to all clusters.\nIf you want to customize the style based on the number of markers within the cluster, you can provide a function instead.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"clusterStyle","type":"(pointsCount: number) => ClusterStyle | ClusterStyle"},{"documentation":{"contents":["<p>Clustering radius in pixels.</p>\n"],"contentsRaw":"Clustering radius in pixels.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"radius","type":"undefined | number"}]},"ClustererEventTable":{"documentation":{"contents":["<p>The list of events that can be emitted by clusterer.</p>\n"],"contentsRaw":"The list of events that can be emitted by clusterer.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"ClustererEventTable","methods":[],"properties":[{"documentation":{"contents":["<p>Emitted when the marker/cluster is clicked.</p>\n"],"contentsRaw":"Emitted when the marker/cluster is clicked.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"click","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the marker/cluster is doubleclicked.</p>\n"],"contentsRaw":"Emitted when the marker/cluster is doubleclicked.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"dblclick","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user presses a mouse button over the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user presses a mouse button over the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"mousedown","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user moves the pointer over the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user moves the pointer over the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"mousemove","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user moves the pointer away from the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user moves the pointer away from the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"mouseout","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user hovers over the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user hovers over the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"mouseover","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user releases the mouse button over the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user releases the mouse button over the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"mouseup","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user lifts the finger off the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user lifts the finger off the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"touchend","type":"ClustererPointerEvent"},{"documentation":{"contents":["<p>Emitted when the user taps on the marker/cluster.</p>\n"],"contentsRaw":"Emitted when the user taps on the marker/cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"touchstart","type":"ClustererPointerEvent"}]},"ClusterStyle":{"documentation":{"contents":["<p>An object describing a cluster style.</p>\n"],"contentsRaw":"An object describing a cluster style.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":false,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"interface","name":"ClusterStyle","methods":[],"properties":[{"documentation":{"contents":["<p>The position of the "tip" of the icon (relative to its top left corner).\nThe icon will be aligned so that this point is at the cluster's geographical location.\nCentered by default if anchor is not specified and custom icon is provided.</p>\n"],"contentsRaw":"The position of the \"tip\" of the icon (relative to its top left corner).\nThe icon will be aligned so that this point is at the cluster's geographical location.\nCentered by default if anchor is not specified and custom icon is provided.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"anchor","type":"number[]"},{"documentation":{"contents":["<p>Cluster icon anchor in hovered state.</p>\n"],"contentsRaw":"Cluster icon anchor in hovered state.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverAnchor","type":"number[]"},{"documentation":{"contents":["<p>Cluster icon URL in hovered state.</p>\n"],"contentsRaw":"Cluster icon URL in hovered state.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverIcon","type":"undefined | string"},{"documentation":{"contents":["<p>Cluster icon size <code>[width, height]</code> in hovered state in pixels.</p>\n"],"contentsRaw":"Cluster icon size `[width, height]` in hovered state in pixels.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"hoverSize","type":"number[]"},{"documentation":{"contents":["<p>Cluster icon URL.</p>\n"],"contentsRaw":"Cluster icon URL.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"icon","type":"undefined | string"},{"documentation":{"contents":["<p>The position in pixels of the "tip" of the cluster label relative to its center.</p>\n"],"contentsRaw":"The position in pixels of the \"tip\" of the cluster label relative to its center.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelAnchor","type":"number[]"},{"documentation":{"contents":["<p>Label's text color of a cluster in CSS hexadecimal RGB format (e.g. <code>#ff0000</code>).</p>\n"],"contentsRaw":"Label's text color of a cluster in CSS hexadecimal RGB format (e.g. `#ff0000`).","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelColor","type":"undefined | string"},{"documentation":{"contents":["<p>Label's text font size of a cluster.</p>\n"],"contentsRaw":"Label's text font size of a cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelFontSize","type":"undefined | number"},{"documentation":{"contents":["<p>Label's text background color of a cluster in CSS hexadecimal RGB format (e.g. <code>#ff0000</code>).</p>\n"],"contentsRaw":"Label's text background color of a cluster in CSS hexadecimal RGB format (e.g. `#ff0000`).","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelHaloColor","type":"undefined | string"},{"documentation":{"contents":["<p>Label's text background radius of a cluster.\nThe background is set for each letter of the text.</p>\n"],"contentsRaw":"Label's text background radius of a cluster.\nThe background is set for each letter of the text.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelHaloRadius","type":"undefined | number"},{"documentation":{"contents":["<p>Label's text letter spacing of a cluster.</p>\n"],"contentsRaw":"Label's text letter spacing of a cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelLetterSpacing","type":"undefined | number"},{"documentation":{"contents":["<p>Label's text of a cluster. By default, it's the size of the cluster.</p>\n"],"contentsRaw":"Label's text of a cluster. By default, it's the size of the cluster.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"labelText","type":"undefined | string"},{"documentation":{"contents":["<p>Cluster icon size <code>[width, height]</code> in pixels.</p>\n"],"contentsRaw":"Cluster icon size `[width, height]` in pixels.","metadata":{}},"fileName":"src/types.ts","flags":{"isExported":true,"isExternal":false,"isOptional":true,"isPrivate":false,"isProtected":false,"isPublic":false,"isRest":false,"isStatic":false},"kind":"property","name":"size","type":"number[]"}]}}} |
@@ -37,2 +37,51 @@ import Supercluster from 'supercluster'; | ||
/** | ||
* Initialization options of the marker's label. | ||
*/ | ||
label?: { | ||
/** | ||
* Label's text. | ||
*/ | ||
text: string; | ||
/** | ||
* Minimum display zoom level of the label. | ||
*/ | ||
minZoom?: number; | ||
/** | ||
* Maximum display zoom level of the label. | ||
*/ | ||
maxZoom?: number; | ||
/** | ||
* Text color in hexadecimal RGB (`#ff0000`) or RGBA (`#ff0000ff`) format. | ||
*/ | ||
color?: string; | ||
/** | ||
* Text size. | ||
*/ | ||
fontSize?: number; | ||
/** | ||
* Use `haloRadius` to add background behind each letter. | ||
*/ | ||
haloRadius?: number; | ||
/** | ||
* Color of letters background (when `haloRadius` is specified). Same format as for `color`. | ||
*/ | ||
haloColor?: string; | ||
/** | ||
* Space between each letter. | ||
*/ | ||
letterSpacing?: number; | ||
/** | ||
* For multiline label `lineHeight` specify how far lines between each other. | ||
*/ | ||
lineHeight?: number; | ||
/** | ||
* The position in pixels of the "tip" of the label relative to its center. | ||
*/ | ||
anchor?: number[]; | ||
/** | ||
* Draw order. | ||
*/ | ||
zIndex?: number; | ||
}; | ||
/** | ||
* Any specific data. | ||
@@ -109,10 +158,2 @@ */ | ||
*/ | ||
export interface Cluster { | ||
marker: mapgl.Marker; | ||
label: mapgl.Label; | ||
} | ||
/** | ||
* @hidden | ||
* @internal | ||
*/ | ||
export interface MarkerGeoJsonProperties { | ||
@@ -119,0 +160,0 @@ index: number; |
{ | ||
"name": "@2gis/mapgl-clusterer", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Marker clustering plugin for Mapgl", | ||
@@ -23,3 +23,3 @@ "main": "dist/clustering.js", | ||
"devDependencies": { | ||
"@2gis/jakarta": "https://gitlab.2gis.ru/WebMaps/jakarta/builds/artifacts/v12.5.0/raw/build.tar.gz?job=release", | ||
"@webmaps/jakarta": "15.0.0", | ||
"@documentalist/compiler": "^2.7.0", | ||
@@ -26,0 +26,0 @@ "@types/supercluster": "^5.0.2", |
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
65994
2.11%423
10.73%1
Infinity%