fix layer zoom

This commit is contained in:
thinkinggis 2019-03-01 13:09:41 +08:00
parent 4483968e91
commit be7a4208af
7 changed files with 33 additions and 33 deletions

View File

@ -29,7 +29,7 @@ const scene = new L7.Scene({
}); });
scene.on('loaded', () => { scene.on('loaded', () => {
$.get('https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv', data => { $.get('https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv', data => {
var layer = scene.HeatMapLayer({ var layer = scene.HeatmapLayer({
zIndex: 2 zIndex: 2
}) })
.source(data, { .source(data, {
@ -59,7 +59,7 @@ scene.on('loaded', () => {
} }
] ]
}) })
.shape('gird') .shape('grid')
.style({ .style({
coverage: 0.8 coverage: 0.8
}) })

View File

@ -27,7 +27,7 @@ const scene = new L7.Scene({
}); });
window.scene = scene; window.scene = scene;
scene.on('loaded', () => { scene.on('loaded', () => {
$.get('./data/earthquakes.geojson', data => { $.get('https://gw.alipayobjects.com/os/basement_prod/08c6ea00-dc5f-4bb0-b0b5-52bde5edf0a3.json', data => {
scene.HeatmapLayer({ scene.HeatmapLayer({
zIndex: 2 zIndex: 2
}) })

View File

@ -29,7 +29,7 @@ const scene = new L7.Scene({
}); });
scene.on('loaded', () => { scene.on('loaded', () => {
$.get('https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv', data => { $.get('https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv', data => {
var layer = scene.HeatMapLayer({ var layer = scene.HeatmapLayer({
zIndex: 2 zIndex: 2
}) })
.source(data, { .source(data, {

View File

@ -84,8 +84,8 @@ export default class Layer extends Base {
object.onBeforeRender = () => { object.onBeforeRender = () => {
const zoom = this.scene.getZoom(); const zoom = this.scene.getZoom();
// object.material.setUniformsValue('u_time', this.scene._engine.clock.getElapsedTime()); object.material.setUniformsValue('u_time', this.scene._engine.clock.getElapsedTime());
// object.material.setUniformsValue('u_zoom', zoom); object.material.setUniformsValue('u_zoom', zoom);
this._preRender(); this._preRender();
}; };

View File

@ -12,7 +12,7 @@ export default class HeatmapBuffer extends BufferBase {
// const indices = []; // const indices = [];
// 组织顶点数据 // 组织顶点数据
data.forEach((d, index) => { data.forEach(d => {
// const totalIndex = index * 4; // const totalIndex = index * 4;
const coord = d.coordinates; const coord = d.coordinates;
const weight = d.size; const weight = d.size;

View File

@ -4,14 +4,14 @@ import PointLayer from './pointLayer';
import LineLayer from './lineLayer'; import LineLayer from './lineLayer';
import ImageLayer from './imageLayer'; import ImageLayer from './imageLayer';
import RasterLayer from './rasterLayer'; import RasterLayer from './rasterLayer';
// import HeatmapLayer from './heatmapLayer'; import HeatmapLayer from './heatmapLayer';
registerLayer('PolygonLayer', PolygonLayer); registerLayer('PolygonLayer', PolygonLayer);
registerLayer('PointLayer', PointLayer); registerLayer('PointLayer', PointLayer);
registerLayer('LineLayer', LineLayer); registerLayer('LineLayer', LineLayer);
registerLayer('ImageLayer', ImageLayer); registerLayer('ImageLayer', ImageLayer);
registerLayer('RasterLayer', RasterLayer); registerLayer('RasterLayer', RasterLayer);
// registerLayer('HeatmapLayer', HeatmapLayer); registerLayer('HeatmapLayer', HeatmapLayer);
export { LAYER_MAP } from './factory'; export { LAYER_MAP } from './factory';