fix(Amap): fix mapstyle

This commit is contained in:
thinkinggis 2019-05-14 17:42:46 +08:00
parent 2da2c1f2af
commit 9be646b8ab
1 changed files with 11 additions and 9 deletions

View File

@ -38,6 +38,7 @@ export default class GaodeMap extends Base {
initMap() { initMap() {
const mapStyle = this.get('mapStyle'); const mapStyle = this.get('mapStyle');
if (mapStyle) {
switch (mapStyle) { switch (mapStyle) {
case 'dark': case 'dark':
this.set('mapStyle', Theme.DarkTheme.mapStyle); this.set('mapStyle', Theme.DarkTheme.mapStyle);
@ -48,6 +49,7 @@ export default class GaodeMap extends Base {
default: default:
this.set('mapStyle', mapStyle); this.set('mapStyle', mapStyle);
} }
}
this.set('zooms', [ this.get('minZoom'), this.get('maxZoom') ]); this.set('zooms', [ this.get('minZoom'), this.get('maxZoom') ]);
const map = this.get('map'); const map = this.get('map');
if (map instanceof AMap.Map) { if (map instanceof AMap.Map) {