Shihuidev (#937)

* feat: demo fix

* style: lint style
This commit is contained in:
YiQianYao 2022-01-17 14:26:41 +08:00 committed by GitHub
parent 3d09989d44
commit d39f4fc6a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 50 additions and 25 deletions

View File

@ -31,31 +31,54 @@ export default class GaodeMapComponent extends React.Component {
// additive = 'additive', // additive = 'additive',
// cylinder circle // cylinder circle
// blend: 'additive' // blend: 'additive'
// var circleRadius = 100; let line = new LineLayer({ zIndex: 3 })
// var radius = circleRadius; .source(
// var data = { [
// type: 'FeatureCollection', {
// features: [ lng: aspaceLnglat[0],
// { lat: aspaceLnglat[1],
// type: 'Feature', lng2: aspaceLnglat[0] + 0.00104,
// properties: {}, lat2: aspaceLnglat[1],
// geometry: { },
// type: 'Polygon', ],
// coordinates: turf.circle(aspaceLnglat, radius, { {
// steps: 10, parser: {
// units: 'meters', type: 'json',
// }).geometry.coordinates, x: 'lng',
// }, y: 'lat',
// }, x1: 'lng2',
// ], y1: 'lat2',
// }; },
// let trufCircle = new PolygonLayer() },
// .size('name', [0, 10000, 50000, 30000, 100000]) )
// .source(data) .shape('line')
// .color('#f00') .size(2)
// .shape('fill'); .color('#000');
let layer = new PointLayer({ zIndex: 2, blend: 'additive' }) let text = new PointLayer({ zIndex: 2 })
.source(
[
{
lng: aspaceLnglat[0] + 0.0002,
lat: aspaceLnglat[1],
},
],
{
parser: {
type: 'json',
x: 'lng',
y: 'lat',
},
},
)
.shape('100m', 'text')
.size(25)
.color('#000')
.style({
textOffset: [50, 20],
});
let layer = new PointLayer({})
.source( .source(
[ [
{ {
@ -79,7 +102,7 @@ export default class GaodeMapComponent extends React.Component {
// .color('#0f9') // .color('#0f9')
.color('#f00') .color('#f00')
// .size([10, 10, 100]) // .size([10, 10, 100])
.size(10) .size(100)
.style({ .style({
stroke: '#f00', stroke: '#f00',
// strokeWidth: 10, // strokeWidth: 10,
@ -99,6 +122,8 @@ export default class GaodeMapComponent extends React.Component {
scene.on('loaded', () => { scene.on('loaded', () => {
scene.addLayer(layer); scene.addLayer(layer);
scene.addLayer(text);
scene.addLayer(line);
// scene.addLayer(trufCircle); // scene.addLayer(trufCircle);
// scene.on('movestart', e => console.log('e', e)) // scene.on('movestart', e => console.log('e', e))
// scene.on('mapmove', e => console.log('e', e)) // scene.on('mapmove', e => console.log('e', e))