mirror of https://gitee.com/antv-l7/antv-l7
improvement: 设置color size 默认值
This commit is contained in:
parent
7a71b92b17
commit
a7d4991c23
|
@ -73,7 +73,7 @@ export default class Zoom extends Control {
|
||||||
!this.disabled &&
|
!this.disabled &&
|
||||||
this.mapsService.getZoom() < this.mapsService.getMaxZoom()
|
this.mapsService.getZoom() < this.mapsService.getMaxZoom()
|
||||||
) {
|
) {
|
||||||
this.mapsService.zoomIn();
|
this.mapsService.zoomIn({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private zoomOut() {
|
private zoomOut() {
|
||||||
|
@ -81,7 +81,7 @@ export default class Zoom extends Control {
|
||||||
!this.disabled &&
|
!this.disabled &&
|
||||||
this.mapsService.getZoom() > this.mapsService.getMinZoom()
|
this.mapsService.getZoom() > this.mapsService.getMinZoom()
|
||||||
) {
|
) {
|
||||||
this.mapsService.zoomOut();
|
this.mapsService.zoomOut({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private createButton(
|
private createButton(
|
||||||
|
|
|
@ -85,7 +85,7 @@ export default class CityBuildModel extends BaseModel {
|
||||||
vertex: number[],
|
vertex: number[],
|
||||||
attributeIdx: number,
|
attributeIdx: number,
|
||||||
) => {
|
) => {
|
||||||
const { size } = feature;
|
const { size = 10 } = feature;
|
||||||
return Array.isArray(size) ? [size[0]] : [size as number];
|
return Array.isArray(size) ? [size[0]] : [size as number];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -73,7 +73,7 @@ export default class ArcModel extends BaseModel {
|
||||||
vertex: number[],
|
vertex: number[],
|
||||||
attributeIdx: number,
|
attributeIdx: number,
|
||||||
) => {
|
) => {
|
||||||
const { size } = feature;
|
const { size = 1 } = feature;
|
||||||
return Array.isArray(size) ? [size[0]] : [size as number];
|
return Array.isArray(size) ? [size[0]] : [size as number];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -69,7 +69,7 @@ export default class Arc3DModel extends BaseModel {
|
||||||
vertex: number[],
|
vertex: number[],
|
||||||
attributeIdx: number,
|
attributeIdx: number,
|
||||||
) => {
|
) => {
|
||||||
const { size } = feature;
|
const { size = 1 } = feature;
|
||||||
return Array.isArray(size) ? [size[0]] : [size as number];
|
return Array.isArray(size) ? [size[0]] : [size as number];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -71,7 +71,7 @@ export default class GreatCircleModel extends BaseModel {
|
||||||
vertex: number[],
|
vertex: number[],
|
||||||
attributeIdx: number,
|
attributeIdx: number,
|
||||||
) => {
|
) => {
|
||||||
const { size } = feature;
|
const { size = 1 } = feature;
|
||||||
return Array.isArray(size) ? [size[0]] : [size as number];
|
return Array.isArray(size) ? [size[0]] : [size as number];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -86,7 +86,7 @@ export default class RegisterStyleAttributePlugin implements ILayerPlugin {
|
||||||
size: 4,
|
size: 4,
|
||||||
update: (feature: IEncodeFeature, featureIdx: number) => {
|
update: (feature: IEncodeFeature, featureIdx: number) => {
|
||||||
const { color } = feature;
|
const { color } = feature;
|
||||||
return !color || !color.length ? [0, 0, 0, 0] : color;
|
return !color || !color.length ? [1, 1, 1, 1] : color;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -114,7 +114,7 @@ export default class FillModel extends BaseModel {
|
||||||
vertex: number[],
|
vertex: number[],
|
||||||
attributeIdx: number,
|
attributeIdx: number,
|
||||||
) => {
|
) => {
|
||||||
const { size } = feature;
|
const { size = 5 } = feature;
|
||||||
return Array.isArray(size) ? [size[0]] : [size as number];
|
return Array.isArray(size) ? [size[0]] : [size as number];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -67,7 +67,7 @@ export default class ImageModel extends BaseModel {
|
||||||
vertex: number[],
|
vertex: number[],
|
||||||
attributeIdx: number,
|
attributeIdx: number,
|
||||||
) => {
|
) => {
|
||||||
const { size } = feature;
|
const { size = 5 } = feature;
|
||||||
return Array.isArray(size) ? [size[0]] : [size as number];
|
return Array.isArray(size) ? [size[0]] : [size as number];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -79,7 +79,7 @@ export default class NormalModel extends BaseModel {
|
||||||
vertex: number[],
|
vertex: number[],
|
||||||
attributeIdx: number,
|
attributeIdx: number,
|
||||||
) => {
|
) => {
|
||||||
const { size } = feature;
|
const { size = 1 } = feature;
|
||||||
return Array.isArray(size) ? [size[0]] : [size as number];
|
return Array.isArray(size) ? [size[0]] : [size as number];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -231,7 +231,7 @@ export default class TextModel extends BaseModel {
|
||||||
vertex: number[],
|
vertex: number[],
|
||||||
attributeIdx: number,
|
attributeIdx: number,
|
||||||
) => {
|
) => {
|
||||||
const { size } = feature;
|
const { size = 12 } = feature;
|
||||||
return Array.isArray(size) ? [size[0]] : [size as number];
|
return Array.isArray(size) ? [size[0]] : [size as number];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -71,7 +71,7 @@ export default class ExtrudeModel extends BaseModel {
|
||||||
vertex: number[],
|
vertex: number[],
|
||||||
attributeIdx: number,
|
attributeIdx: number,
|
||||||
) => {
|
) => {
|
||||||
const { size } = feature;
|
const { size = 10 } = feature;
|
||||||
return Array.isArray(size) ? [size[0]] : [size as number];
|
return Array.isArray(size) ? [size[0]] : [size as number];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -18,6 +18,10 @@ export default function json(data: IJsonData, cfg: IParserCfg): IParserData {
|
||||||
} // 点数据
|
} // 点数据
|
||||||
if (x && y && x1 && y1) {
|
if (x && y && x1 && y1) {
|
||||||
// 弧线 或者线段
|
// 弧线 或者线段
|
||||||
|
// const prevLng = col[x];
|
||||||
|
// let lng = col[x1];
|
||||||
|
// lng += lng - prevLng > 180 ? -360 :
|
||||||
|
// prevLng - lng > 180 ? 360 : 0;
|
||||||
coords = [
|
coords = [
|
||||||
[parseFloat(col[x]), parseFloat(col[y])],
|
[parseFloat(col[x]), parseFloat(col[y])],
|
||||||
[parseFloat(col[x1]), parseFloat(col[y1])],
|
[parseFloat(col[x1]), parseFloat(col[y1])],
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default class ArcLineDemo extends React.Component {
|
||||||
|
|
||||||
public async componentDidMount() {
|
public async componentDidMount() {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
'https://gw.alipayobjects.com/os/rmsportal/UEXQMifxtkQlYfChpPwT.txt',
|
'https://gw.alipayobjects.com/os/bmw-prod/4ededeaa-f290-46b7-a042-08210433e8f9.csv',
|
||||||
);
|
);
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
|
@ -36,24 +36,17 @@ export default class ArcLineDemo extends React.Component {
|
||||||
y1: 'lat2',
|
y1: 'lat2',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.size(1)
|
// .size(1)
|
||||||
.shape('arc3d')
|
.shape('arc')
|
||||||
.select({
|
.select({
|
||||||
color: 'red',
|
color: 'red',
|
||||||
})
|
})
|
||||||
.active({
|
.active({
|
||||||
color: 'red',
|
color: 'red',
|
||||||
})
|
})
|
||||||
.color('rgb(13,64,140)')
|
// .color('rgb(13,64,140)')
|
||||||
.animate({
|
|
||||||
enable: true,
|
|
||||||
interval: 0.1,
|
|
||||||
duration: 2,
|
|
||||||
trailLength: 1.0,
|
|
||||||
})
|
|
||||||
.style({
|
.style({
|
||||||
lineType: 'dash',
|
opacity: 1,
|
||||||
opacity: 0.5,
|
|
||||||
});
|
});
|
||||||
scene.addLayer(lineLayer);
|
scene.addLayer(lineLayer);
|
||||||
scene.render();
|
scene.render();
|
||||||
|
|
Loading…
Reference in New Issue