@@ -11,8 +11,6 @@ var max;
1111function DensityDrawer ( ) {
1212 this . Scale ;
1313 this . masker = { } ;
14- this . mapv = null ;
15- this . ctx = null ;
1614 Drawer . apply ( this , arguments ) ;
1715}
1816
@@ -32,17 +30,15 @@ DensityDrawer.prototype.scale = function (scale) {
3230 this . Scale = scale ;
3331} ;
3432
35- DensityDrawer . prototype . drawMap = function ( mapv , ctx ) {
33+ DensityDrawer . prototype . drawMap = function ( ) {
3634
3735 var self = this ;
38- mapv = this . mapv = this . mapv || mapv ;
39- ctx = this . ctx = this . ctx || ctx ;
36+ var ctx = this . getCtx ( ) ;
4037
4138 // TODO: use workder
42- // var data = mapv.geoData.getData();
43- var data = this . _layer . getData ( ) ;
39+ var data = this . getLayer ( ) . getData ( ) ;
4440
45- var map = mapv . getMap ( ) ;
41+ var map = this . getMapv ( ) . getMap ( ) ;
4642 var zoom = map . getZoom ( ) ;
4743 var zoomUnit = this . zoomUnit = Math . pow ( 2 , 18 - zoom ) ;
4844
@@ -65,7 +61,7 @@ DensityDrawer.prototype.drawMap = function (mapv, ctx) {
6561 } ;
6662
6763 var gridsObj = { } ;
68- if ( this . drawOptions . gridType === 'honeycomb' ) {
64+ if ( this . getDrawOptions ( ) . gridType === 'honeycomb' ) {
6965 gridsObj = honeycombGrid ( obj ) ;
7066 } else {
7167 gridsObj = recGrids ( obj ) ;
@@ -90,7 +86,7 @@ DensityDrawer.prototype.drawMap = function (mapv, ctx) {
9086 } ;
9187
9288 var gridsObj = { } ;
93- if ( this . drawOptions . gridType === 'honeycomb' ) {
89+ if ( this . getDrawOptions ( ) . gridType === 'honeycomb' ) {
9490 drawHoneycomb ( obj ) ;
9591 } else {
9692 drawRec ( obj ) ;
@@ -212,7 +208,7 @@ function drawRec(obj) {
212208 ctx . fillRect ( x , y , gridStep - 1 , gridStep - 1 ) ;
213209
214210
215- if ( self . drawOptions . showNum ) {
211+ if ( self . getDrawOptions ( ) . showNum ) {
216212
217213 ctx . save ( ) ;
218214 // ctx.fillStyle = 'black';
@@ -340,7 +336,7 @@ function drawHoneycomb(obj) {
340336 draw ( x , y , gridsW - 1 , 'rgba(0,0,0,0.2)' , ctx ) ;
341337 }
342338
343- if ( obj . sup . drawOptions . showNum && ! isTooSmall && ! isTooBig ) {
339+ if ( obj . sup . getDrawOptions ( ) . showNum && ! isTooSmall && ! isTooBig ) {
344340 ctx . save ( ) ;
345341 ctx . textBaseline = 'middle' ;
346342 ctx . textAlign = 'center' ;
@@ -372,7 +368,7 @@ function draw(x, y, gridStep, color, ctx) {
372368 */
373369function formatParam ( ) {
374370
375- var options = this . drawOptions ;
371+ var options = this . getDrawOptions ( ) ;
376372 // console.log(options)
377373 var fillColors = this . fillColors = [
378374 [ 73 , 174 , 34 ] ,
0 commit comments