Skip to content

Commit

Permalink
fix: control css
Browse files Browse the repository at this point in the history
  • Loading branch information
lzxue committed Sep 27, 2019
1 parent 3636985 commit 09ebe29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 5 additions & 1 deletion demos/heatmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
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)
Expand All @@ -44,6 +44,10 @@
}
})
.render();
setTimeout(()=>{
scene.removeLayer(layer)
},1000)

/*scene.PointLayer({
zIndex: 2
})
Expand Down
10 changes: 2 additions & 8 deletions src/map/AMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit 09ebe29

Please sign in to comment.