mirror of https://gitee.com/antv-l7/antv-l7
style: code style change
This commit is contained in:
parent
e17977b8e0
commit
75a0a90ced
|
@ -596,6 +596,7 @@ layer.on('inited', (option) => {});
|
||||||
### boxSelect
|
### boxSelect
|
||||||
|
|
||||||
参数 option
|
参数 option
|
||||||
|
|
||||||
- box [x1: number, y1: number, x2: number, y2: number] 相较于
|
- box [x1: number, y1: number, x2: number, y2: number] 相较于
|
||||||
- cb (...args: any[]) => void 传入的回调方法,返回框选内部的 feature
|
- cb (...args: any[]) => void 传入的回调方法,返回框选内部的 feature
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,8 @@ export default class Amap2demo extends React.Component {
|
||||||
center: [121.107846, 30.267069],
|
center: [121.107846, 30.267069],
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
style: 'normal',
|
style: 'normal',
|
||||||
zoom: 13,
|
zoom: 20
|
||||||
|
,
|
||||||
animateEnable: false,
|
animateEnable: false,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
@ -27,7 +28,7 @@ export default class Amap2demo extends React.Component {
|
||||||
lat: 30.267069,
|
lat: 30.267069,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
lng: 121.1,
|
lng: 121.107,
|
||||||
lat: 30.267069,
|
lat: 30.267069,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,10 +86,8 @@ export default class Amap2demo_text extends React.Component {
|
||||||
// textAllowOverlap: true,
|
// textAllowOverlap: true,
|
||||||
});
|
});
|
||||||
scene.addLayer(pointLayer);
|
scene.addLayer(pointLayer);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json',
|
'https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json',
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,7 +15,6 @@ export default class Amap2demo_textSelect extends React.Component {
|
||||||
let fontPath =
|
let fontPath =
|
||||||
'//at.alicdn.com/t/font_2534097_99x8u6zpili.woff2?t=1621842922496';
|
'//at.alicdn.com/t/font_2534097_99x8u6zpili.woff2?t=1621842922496';
|
||||||
|
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
map: new GaodeMap({
|
map: new GaodeMap({
|
||||||
|
@ -43,7 +42,7 @@ export default class Amap2demo_textSelect extends React.Component {
|
||||||
)
|
)
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
console.log(data.list[0])
|
console.log(data.list[0]);
|
||||||
const pointLayer = new PointLayer({})
|
const pointLayer = new PointLayer({})
|
||||||
.source(data.list, {
|
.source(data.list, {
|
||||||
parser: {
|
parser: {
|
||||||
|
@ -70,11 +69,10 @@ export default class Amap2demo_textSelect extends React.Component {
|
||||||
});
|
});
|
||||||
scene.addLayer(pointLayer);
|
scene.addLayer(pointLayer);
|
||||||
pointLayer.boxSelect([0, 0, 155, 278], (f) => {
|
pointLayer.boxSelect([0, 0, 155, 278], (f) => {
|
||||||
console.log('======')
|
console.log('======');
|
||||||
console.log(f)
|
console.log(f);
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json',
|
'https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json',
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default class GaodeMapComponent extends React.Component {
|
||||||
center: [121.107846, 30.267069],
|
center: [121.107846, 30.267069],
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
style: 'normal',
|
style: 'normal',
|
||||||
zoom: 13,
|
zoom: 20,
|
||||||
animateEnable: false,
|
animateEnable: false,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
@ -31,7 +31,7 @@ export default class GaodeMapComponent extends React.Component {
|
||||||
lat: 30.267069,
|
lat: 30.267069,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
lng: 121.1,
|
lng: 121.107,
|
||||||
lat: 30.267069,
|
lat: 30.267069,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue