fix: control css

This commit is contained in:
thinkinggis 2019-09-27 17:52:42 +08:00
parent 3636985eff
commit 09ebe2981e
2 changed files with 7 additions and 9 deletions

View File

@ -29,7 +29,7 @@ const scene = new L7.Scene({
window.scene = scene;
scene.on('loaded', () => {
$.get('https://gw.alipayobjects.com/os/basement_prod/08c6ea00-dc5f-4bb0-b0b5-52bde5edf0a3.json', data => {
scene.HeatmapLayer({
const layer = scene.HeatmapLayer({
zIndex: 2
})
.source(data)
@ -44,6 +44,10 @@ scene.on('loaded', () => {
}
})
.render();
setTimeout(()=>{
scene.removeLayer(layer)
},1000)
/*scene.PointLayer({
zIndex: 2
})

View File

@ -3,7 +3,6 @@ import Global from '../global';
import * as Theme from '../theme/index';
import Util from '../util';
const DEG2RAD = Math.PI / 180;
const defaultMapFeatures = [ 'bg', 'point', 'road', 'building' ];
export default class GaodeMap extends Base {
getDefaultCfg() {
return Util.assign(Global.scene, {
@ -105,12 +104,10 @@ export default class GaodeMap extends Base {
return this.projectFlat(this.getCenter());
}
addOverLayer() {
// const canvasContainer = this.container instanceof HTMLElement ? this.container : document.getElementById(this.container);
// this.canvasContainer = canvasContainer;
this.amapContainer = this.map.getContainer().getElementsByClassName('amap-maps')[0];
this.renderDom = document.createElement('div');
this.renderDom.style.cssText +=
'position: absolute;top: 0;height: 100%;width: 100%;pointer-events: none;';
'position: absolute;top: 0;height: 100%;width: 100%;pointer-events: none;background: white;';
this.renderDom.id = 'l7_canvaslayer';
this.amapContainer.appendChild(this.renderDom);
@ -136,10 +133,7 @@ export default class GaodeMap extends Base {
map.setMapStyle(this.get('mapStyle'));
if (style === 'blank') {
map.setFeatures([]);
} else
if (map.getFeatures().length === 0) {
map.setFeatures(defaultMapFeatures);
map.setLayers([]);
}
return;
}