@@ -2788,7 +2788,7 @@ function drawHoneycomb(obj) {
27882788 draw ( x , y , gridsW - 1 , 'rgba(0,0,0,0.4)' , ctx ) ;
27892789 }
27902790
2791- if ( obj . sup . getDrawOptions ( ) . label && obj . sup . getDrawOptions ( ) . label && ! isTooSmall && ! isTooBig ) {
2791+ if ( obj . sup . getDrawOptions ( ) . label && obj . sup . getDrawOptions ( ) . label . show && ! isTooSmall && ! isTooBig ) {
27922792 ctx . save ( ) ;
27932793 ctx . textBaseline = 'middle' ;
27942794 ctx . textAlign = 'center' ;
@@ -3104,11 +3104,22 @@ IntensityDrawer.prototype.defaultGradient = {
31043104} ;
31053105
31063106IntensityDrawer . prototype . drawMap = function ( ) {
3107+ this . Scale && this . Scale . set ( {
3108+ min : 0 ,
3109+ max : this . getMax ( ) ,
3110+ colors : this . getGradient ( )
3111+ } ) ;
3112+
3113+ this . dataRange . setMax ( this . getMax ( ) ) ;
3114+
31073115 this . beginDrawMap ( ) ;
31083116
31093117 var self = this ;
31103118 var ctx = this . getCtx ( ) ;
31113119
3120+ ctx . clearRect ( 0 , 0 , ctx . canvas . width , ctx . canvas . height ) ;
3121+
3122+
31123123 var data = this . getLayer ( ) . getData ( ) ;
31133124 var drawOptions = this . getDrawOptions ( ) ;
31143125 ctx . strokeStyle = drawOptions . strokeStyle ;
@@ -3133,7 +3144,15 @@ IntensityDrawer.prototype.drawMap = function () {
31333144 if ( dataType === 'polygon' ) {
31343145
31353146 for ( var i = 0 , len = data . length ; i < len ; i ++ ) {
3136- var geo = data [ i ] . pgeo ;
3147+ var item = data [ i ] ;
3148+ var geo = item . pgeo ;
3149+
3150+ var isTooSmall = self . masker . min && ( item . count < self . masker . min ) ;
3151+ var isTooBig = self . masker . max && ( item . count > self . masker . max ) ;
3152+ if ( isTooSmall || isTooBig ) {
3153+ continue ;
3154+ }
3155+
31373156 ctx . beginPath ( ) ;
31383157 ctx . moveTo ( geo [ 0 ] [ 0 ] , geo [ 0 ] [ 1 ] ) ;
31393158 ctx . fillStyle = this . dataRange . getColorByGradient ( data [ i ] . count ) ;
@@ -3181,14 +3200,6 @@ IntensityDrawer.prototype.drawMap = function () {
31813200 ctx . stroke ( ) ;
31823201 }
31833202
3184- this . Scale && this . Scale . set ( {
3185- min : 0 ,
3186- max : self . getMax ( ) ,
3187- colors : this . getGradient ( )
3188- } ) ;
3189-
3190- this . dataRange . setMax ( self . getMax ( ) ) ;
3191-
31923203 this . endDrawMap ( ) ;
31933204} ;
31943205
0 commit comments