mirror of https://gitee.com/antv-l7/antv-l7
merge github master
This commit is contained in:
parent
ad1ca09cbf
commit
367d24519d
|
@ -14,8 +14,8 @@ const production = BUILD === 'production';
|
|||
const outputFile = !production
|
||||
? 'build/L7.js'
|
||||
: minified
|
||||
? 'build/L7-min.js'
|
||||
: 'build/L7-unminified.js';
|
||||
? 'build/L7-min.js'
|
||||
: 'build/L7-unminified.js';
|
||||
|
||||
const config = [
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@ export default class Popup extends Base {
|
|||
this._container.appendChild(this._content);
|
||||
if (this.get('className')) {
|
||||
this.get('className').split(' ').forEach(name =>
|
||||
this._container.classList.add(name));
|
||||
this._container.classList.add(name));
|
||||
}
|
||||
}
|
||||
if (this.get('maxWidth') && this._container.style.maxWidth !== this.get('maxWidth')) {
|
||||
|
|
|
@ -3,7 +3,7 @@ import Global from '../../global';
|
|||
import ScaleController from './scale';
|
||||
import Attr from '../../attr/index';
|
||||
export default class Mapping {
|
||||
/** 初始化mapping
|
||||
/** 初始化mapping
|
||||
* 初始化mapping
|
||||
* @param {*} cfg 配置
|
||||
* @param {*} cfg.layer layer对象
|
||||
|
|
|
@ -190,7 +190,7 @@ export default class Scene extends Base {
|
|||
this.map.off('mapmove', this._updateRender);
|
||||
this.map.off('camerachange', this._updateRender);
|
||||
}
|
||||
// control
|
||||
// control
|
||||
|
||||
addControl(ctr) {
|
||||
this.get('controlController').addControl(ctr);
|
||||
|
|
|
@ -112,7 +112,7 @@ export default class BufferBase extends Base {
|
|||
prePoint[0], prePoint[1], 0,
|
||||
nextPoint[0], nextPoint[1], 0
|
||||
],
|
||||
positionOffset * 3);
|
||||
positionOffset * 3);
|
||||
const indexArray = [ 1, 2, 0, 3, 2, 1 ].map(v => { return v + positionOffset; });
|
||||
if (this.get('uv')) {
|
||||
this.attributes.uv.set([ 0.1, 0, 0, 0, 0.1, size / 2000, 0, size / 2000 ], positionOffset * 2);
|
||||
|
|
|
@ -41,7 +41,7 @@ export default class Grid3D extends BufferBase {
|
|||
this._encodeArray(feature, 4);
|
||||
this.attributes.positions.set([ x, y, size, x, y, size, x, y, size, x, y, size ], this._offset * 3);
|
||||
this.attributes.miters.set([ -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1 ], this._offset * 3);
|
||||
this.attributes.normals.set([ 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1 ], this._offset * 3); // top normal
|
||||
this.attributes.normals.set([ 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1 ], this._offset * 3); // top normal
|
||||
const indexArray = [ 0, 2, 1, 2, 3, 1 ].map(v => { return v + this._offset; });
|
||||
this.indexArray.set(indexArray, this._offset * 1.5);
|
||||
this._offset += 4;
|
||||
|
@ -60,7 +60,7 @@ export default class Grid3D extends BufferBase {
|
|||
-1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, // left
|
||||
0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, // top
|
||||
1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 // right
|
||||
], this._offset * 3); // top normal
|
||||
], this._offset * 3); // top normal
|
||||
|
||||
for (let i = 0; i < 4; i++) {
|
||||
this.attributes.positions.set([ x, y, 1, x, y, 1, x, y, 1, x, y, 1 ], this._offset * 3);
|
||||
|
@ -77,7 +77,7 @@ export default class Grid3D extends BufferBase {
|
|||
prePoint[0], prePoint[1], 0,
|
||||
nextPoint[0], nextPoint[1], 0
|
||||
],
|
||||
positionOffset * 3);
|
||||
positionOffset * 3);
|
||||
const indexArray = [ 0, 1, 2, 1, 3, 2 ].map(v => { return v + positionOffset; });
|
||||
if (this.get('uv')) {
|
||||
// temp 点亮城市demo
|
||||
|
|
|
@ -16,7 +16,7 @@ export function LineMaterial(options) {
|
|||
vertexShader: vs,
|
||||
fragmentShader: fs,
|
||||
transparent: true
|
||||
// blending: THREE.AdditiveBlending
|
||||
// blending: THREE.AdditiveBlending
|
||||
});
|
||||
return material;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ export default class ImageTile extends Tile {
|
|||
// Making this asynchronous really speeds up the LOD framerate
|
||||
setTimeout(() => {
|
||||
if (!this._mesh) {
|
||||
// this._mesh = this._createMesh();
|
||||
// this._mesh = this._createMesh();
|
||||
this._requestTile();
|
||||
}
|
||||
}, 0);
|
||||
|
|
|
@ -80,7 +80,7 @@ export default class Tile extends Base {
|
|||
return urlParams[key];
|
||||
});
|
||||
}
|
||||
// 经纬度范围转瓦片范围
|
||||
// 经纬度范围转瓦片范围
|
||||
_tileBounds(lnglatBound) {
|
||||
const ne = this.layer.scene.project([ lnglatBound.getNorthEast().lng, lnglatBound.getNorthEast().lat ]);
|
||||
const sw = this.layer.scene.project([ lnglatBound.getSouthWest().lng, lnglatBound.getSouthWest().lat ]);
|
||||
|
|
|
@ -116,7 +116,7 @@ export default class TileLayer extends Layer {
|
|||
const tileRange = this._pxBoundsToTileRange(pixelBounds);
|
||||
const margin = this.get('keepBuffer');
|
||||
this.noPruneRange = new Bounds(tileRange.getBottomLeft().subtract([ margin, -margin ]),
|
||||
tileRange.getTopRight().add([ margin, -margin ]));
|
||||
tileRange.getTopRight().add([ margin, -margin ]));
|
||||
if (!(isFinite(tileRange.min.x) &&
|
||||
isFinite(tileRange.min.y) &&
|
||||
isFinite(tileRange.max.x) &&
|
||||
|
@ -424,7 +424,7 @@ export default class TileLayer extends Layer {
|
|||
if (!this._tiles.children.length > 0 || !this._object3D.visible) {
|
||||
return;
|
||||
}
|
||||
// 更新数据颜色 过滤 filter
|
||||
// 更新数据颜色 过滤 filter
|
||||
if (!Util.isEqual(preAttrs.color, nextAttrs.color) || !Util.isEqual(preAttrs.filter, nextAttrs.filter)) {
|
||||
this._tileCache.setNeedUpdate();
|
||||
this._tiles.children.forEach(tile => {
|
||||
|
|
|
@ -58,9 +58,9 @@ export default class VectorTile extends Tile {
|
|||
context.depthMask(false);
|
||||
renderer.clearDepth();
|
||||
|
||||
// only render where stencil is set to 1
|
||||
// only render where stencil is set to 1
|
||||
|
||||
context.stencilFunc(context.EQUAL, 1, 0xffffffff); // draw if == 1
|
||||
context.stencilFunc(context.EQUAL, 1, 0xffffffff); // draw if == 1
|
||||
context.stencilOp(context.KEEP, context.KEEP, context.KEEP);
|
||||
}
|
||||
_tileMaskMesh() {
|
||||
|
|
|
@ -79,9 +79,9 @@ export default class VectorTileMesh {
|
|||
context.depthMask(false);
|
||||
renderer.clearDepth();
|
||||
|
||||
// only render where stencil is set to 1
|
||||
// only render where stencil is set to 1
|
||||
|
||||
context.stencilFunc(context.EQUAL, 1, 0xffffffff); // draw if == 1
|
||||
context.stencilFunc(context.EQUAL, 1, 0xffffffff); // draw if == 1
|
||||
context.stencilOp(context.KEEP, context.KEEP, context.KEEP);
|
||||
}
|
||||
_tileMaskMesh() {
|
||||
|
|
|
@ -3,7 +3,7 @@ import { getCoords } from '@turf/invariant';
|
|||
import { djb2hash } from '../../util/bkdr-hash';
|
||||
import rewind from '@mapbox/geojson-rewind';
|
||||
export default function geoJSON(data, cfg) {
|
||||
// 矢量瓦片图层不做 rewind
|
||||
// 矢量瓦片图层不做 rewind
|
||||
|
||||
rewind(data, true);
|
||||
const resultData = [];
|
||||
|
|
|
@ -122,7 +122,7 @@ export default class SouceCache extends Base {
|
|||
_calculateTileIDs() {
|
||||
this._tileMap = {};
|
||||
this.updateTileList = [];
|
||||
const zoom = Math.floor(this.scene.getZoom()); // - window.window.devicePixelRatio + 1; // zoom - 1
|
||||
const zoom = Math.floor(this.scene.getZoom()); // - window.window.devicePixelRatio + 1; // zoom - 1
|
||||
const minSourceZoom = this.get('minZoom');
|
||||
const maxSourceZoom = this.get('maxZoom');
|
||||
this.tileZoom = zoom > maxSourceZoom ? maxSourceZoom : zoom;
|
||||
|
@ -300,7 +300,7 @@ export default class SouceCache extends Base {
|
|||
}
|
||||
}
|
||||
}
|
||||
// 地图拾取
|
||||
// 地图拾取
|
||||
_addPickMesh(layer, meshObj) {
|
||||
if (this.type === 'image') {
|
||||
return;
|
||||
|
|
|
@ -69,9 +69,9 @@ export default function(points, closed, indexOffset) {
|
|||
|
||||
attrIndex.push([ index + 0, index + 2, index + 1 ]);
|
||||
|
||||
// no miter, simple segment
|
||||
// no miter, simple segment
|
||||
if (!next) {
|
||||
// reset normal
|
||||
// reset normal
|
||||
normal(_normal, lineA);
|
||||
extrusions(attrPos, out, cur, _normal, 1);
|
||||
attrDistance.push(d, d);
|
||||
|
@ -97,7 +97,7 @@ export default function(points, closed, indexOffset) {
|
|||
attrDistance.push(d, d);
|
||||
attrIndex.push(
|
||||
_lastFlip === 1 ? [ index + 1, index + 3, index + 2 ]
|
||||
: [ index, index + 2, index + 3 ]
|
||||
: [ index, index + 2, index + 3 ]
|
||||
);
|
||||
|
||||
// 避免在 Material 中使用 THREE.DoubleSide
|
||||
|
|
|
@ -71,9 +71,9 @@ export default function(points, closed, indexOffset) {
|
|||
|
||||
attrIndex.push(index + 0, index + 2, index + 1);
|
||||
|
||||
// no miter, simple segment
|
||||
// no miter, simple segment
|
||||
if (!next) {
|
||||
// reset normal
|
||||
// reset normal
|
||||
normal(_normal, lineA);
|
||||
extrusions(attrPos, out, miters, cur, _normal, 1);
|
||||
attrDistance.push(d, d);
|
||||
|
@ -98,7 +98,7 @@ export default function(points, closed, indexOffset) {
|
|||
extrusions(attrPos, out, miters, cur, _normal, 1);
|
||||
attrDistance.push(d, d);
|
||||
const indexData = _lastFlip === 1 ? [ index + 1, index + 3, index + 2 ]
|
||||
: [ index, index + 2, index + 3 ];
|
||||
: [ index, index + 2, index + 3 ];
|
||||
attrIndex.push(...indexData);
|
||||
|
||||
// 避免在 Material 中使用 THREE.DoubleSide
|
||||
|
|
Loading…
Reference in New Issue