44 ( factory ( ( global . mapv = global . mapv || { } ) ) ) ;
55} ( this , ( function ( exports ) { 'use strict' ;
66
7- var version = "2.0.13 " ;
7+ var version = "2.0.14 " ;
88
99/**
1010 * @author kyle / http://nikai.us/
@@ -21,7 +21,7 @@ var clear = function (context) {
2121 */
2222
2323var resolutionScale$1 = function ( context ) {
24- var devicePixelRatio = window . devicePixelRatio ;
24+ var devicePixelRatio = window . devicePixelRatio || 1 ;
2525 context . canvas . width = context . canvas . width * devicePixelRatio ;
2626 context . canvas . height = context . canvas . height * devicePixelRatio ;
2727 context . canvas . style . width = context . canvas . width / devicePixelRatio + 'px' ;
@@ -651,8 +651,9 @@ function Canvas(width, height) {
651651
652652 if ( typeof document === 'undefined' ) {
653653
654- var Canvas = require ( 'canvas' ) ;
655- canvas = new Canvas ( width , height ) ;
654+ // var Canvas = require('canvas');
655+ // canvas = new Canvas(width, height);
656+
656657 } else {
657658
658659 var canvas = document . createElement ( 'canvas' ) ;
@@ -810,7 +811,7 @@ Intensity.prototype.getLegend = function (options) {
810811
811812var global$1 = typeof window === 'undefined' ? { } : window ;
812813
813- var devicePixelRatio = global$1 . devicePixelRatio ;
814+ var devicePixelRatio = global$1 . devicePixelRatio || 1 ;
814815
815816/**
816817 * @author kyle / http://nikai.us/
@@ -2112,6 +2113,12 @@ var cityCenter = {
21122113 }
21132114 }
21142115
2116+ for ( var i = 0 ; i < citycenter . other . length ; i ++ ) {
2117+ if ( citycenter . other [ i ] . n == name ) {
2118+ return getCenter ( citycenter . other [ i ] . g ) ;
2119+ }
2120+ }
2121+
21152122 var provinces = citycenter . provinces ;
21162123 for ( var i = 0 ; i < provinces . length ; i ++ ) {
21172124 if ( provinces [ i ] . n == name ) {
@@ -2887,7 +2894,7 @@ if (global$3.BMap) {
28872894 var size = this . _map . getSize ( ) ;
28882895 var canvas = this . canvas ;
28892896
2890- var devicePixelRatio = this . devicePixelRatio = global$3 . devicePixelRatio ;
2897+ var devicePixelRatio = this . devicePixelRatio = global$3 . devicePixelRatio || 1 ;
28912898
28922899 canvas . width = size . width * devicePixelRatio ;
28932900 canvas . height = size . height * devicePixelRatio ;
@@ -4224,6 +4231,7 @@ var AnimationLayer = function (_BaseLayer) {
42244231 map : map ,
42254232 update : _this . _canvasUpdate . bind ( _this )
42264233 } ) ;
4234+ _this . canvasLayer = canvasLayer ;
42274235 _this . transferToMercator ( ) ;
42284236 var self = _this ;
42294237 dataSet . on ( 'change' , function ( ) {
@@ -4419,6 +4427,20 @@ var AnimationLayer = function (_BaseLayer) {
44194427 value : function stop ( ) {
44204428 clearTimeout ( this . timeout ) ;
44214429 }
4430+ } , {
4431+ key : "unbindEvent" ,
4432+ value : function unbindEvent ( ) { }
4433+ } , {
4434+ key : "hide" ,
4435+ value : function hide ( ) {
4436+ this . canvasLayer . hide ( ) ;
4437+ this . stop ( ) ;
4438+ }
4439+ } , {
4440+ key : "show" ,
4441+ value : function show ( ) {
4442+ this . start ( ) ;
4443+ }
44224444 } ] ) ;
44234445 return AnimationLayer ;
44244446} ( BaseLayer ) ;
0 commit comments