mirror of https://gitee.com/antv-l7/antv-l7
commit
74c8ef2b60
10
README.md
10
README.md
|
@ -16,7 +16,7 @@ L7 focuses on geographic data expressiveness,interaction and design of geogra
|
||||||
![l7 demo](https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*SGU-QIZsnyoAAAAAAAAAAABkARQnAQ)
|
![l7 demo](https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*SGU-QIZsnyoAAAAAAAAAAABkARQnAQ)
|
||||||
|
|
||||||
|
|
||||||
## Highlight features of L7 2.0
|
## ✨ Highlight features of L7 2.0
|
||||||
|
|
||||||
|
|
||||||
🌏 Data-driven Visualization
|
🌏 Data-driven Visualization
|
||||||
|
@ -46,7 +46,9 @@ For global users, Mapbox is easy to be embedded by a simple line of code.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Installation
|
.
|
||||||
|
|
||||||
|
### 📦 Installation
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install @antv/l7@beta
|
npm install @antv/l7@beta
|
||||||
|
@ -98,7 +100,7 @@ scene.addLayer(pointLayer);
|
||||||
[Examples](https://l7.antv.vision/en/examples/gallery/basic)
|
[Examples](https://l7.antv.vision/en/examples/gallery/basic)
|
||||||
|
|
||||||
|
|
||||||
## Development
|
## 🔨 Development
|
||||||
|
|
||||||
使用 Yarn Workspace 完成依赖安装以及各包之间的 link 工作:
|
使用 Yarn Workspace 完成依赖安装以及各包之间的 link 工作:
|
||||||
```bash
|
```bash
|
||||||
|
@ -123,6 +125,6 @@ yarn start
|
||||||
visit http://localhost:8000/
|
visit http://localhost:8000/
|
||||||
|
|
||||||
|
|
||||||
## License
|
## ✅ License
|
||||||
|
|
||||||
[MIT license](./LICENSE).
|
[MIT license](./LICENSE).
|
||||||
|
|
|
@ -12,6 +12,36 @@ Invalid configuration object. MyPlugin has been initialised using a configuratio
|
||||||
和 Webpack 一样,我们也选择 [ajv](https://github.com/epoberezkin/ajv) 作为 JSON Schema 校验器。
|
和 Webpack 一样,我们也选择 [ajv](https://github.com/epoberezkin/ajv) 作为 JSON Schema 校验器。
|
||||||
目前我们只在 Layer 初始阶段进行校验,一旦校验失败会中断后续初始化插件的处理,并在控制台给出校验失败信息。后续需要在属性更新时同样进行校验。
|
目前我们只在 Layer 初始阶段进行校验,一旦校验失败会中断后续初始化插件的处理,并在控制台给出校验失败信息。后续需要在属性更新时同样进行校验。
|
||||||
|
|
||||||
|
## 地图参数校验
|
||||||
|
|
||||||
|
当用户传入地图参数时,需要进行校验:
|
||||||
|
```javascript
|
||||||
|
// l7-core/services/config/mapConfigSchema.ts
|
||||||
|
|
||||||
|
export default {
|
||||||
|
properties: {
|
||||||
|
// 地图缩放等级
|
||||||
|
zoom: {
|
||||||
|
type: 'number',
|
||||||
|
minimum: 0,
|
||||||
|
maximum: 20,
|
||||||
|
},
|
||||||
|
// 地图中心点
|
||||||
|
center: {
|
||||||
|
item: {
|
||||||
|
type: 'number',
|
||||||
|
},
|
||||||
|
maxItems: 2,
|
||||||
|
minItems: 2,
|
||||||
|
},
|
||||||
|
// 仰角
|
||||||
|
pitch: {
|
||||||
|
type: 'number',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
## Layer 基类配置项 Schema
|
## Layer 基类配置项 Schema
|
||||||
|
|
||||||
目前在基类中我们声明了如下属性及其对应的校验规则:
|
目前在基类中我们声明了如下属性及其对应的校验规则:
|
||||||
|
|
|
@ -171,6 +171,7 @@ protected getConfigSchema() {
|
||||||
通过 `mapService` 引用。
|
通过 `mapService` 引用。
|
||||||
|
|
||||||
常用地图状态获取方法如下:
|
常用地图状态获取方法如下:
|
||||||
|
|
||||||
| 方法名 | 参数 | 返回值 | 说明 |
|
| 方法名 | 参数 | 返回值 | 说明 |
|
||||||
| -------- | ------------- | --------- | --------- |
|
| -------- | ------------- | --------- | --------- |
|
||||||
| getSize | 无 | `[number, number]` | 获取地图尺寸(像素单位) |
|
| getSize | 无 | `[number, number]` | 获取地图尺寸(像素单位) |
|
||||||
|
@ -196,7 +197,6 @@ protected getConfigSchema() {
|
||||||
通过 `rendererService` 引用。
|
通过 `rendererService` 引用。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 图层管理服务
|
### 图层管理服务
|
||||||
|
|
||||||
开发者不需要显式调用。用于管理场景中所有的图层,负责图层的创建、销毁。
|
开发者不需要显式调用。用于管理场景中所有的图层,负责图层的创建、销毁。
|
||||||
|
|
|
@ -39,12 +39,13 @@ L7 提供三种使用方式:CDN、Submodule 以及 React 组件。
|
||||||
// 创建场景
|
// 创建场景
|
||||||
const scene = new L7.Scene({
|
const scene = new L7.Scene({
|
||||||
id: 'map', // 容器 id
|
id: 'map', // 容器 id
|
||||||
type: 'mapbox', // 高德 amap 或者 mapbox
|
map: new L7.Mapbox({ // 高德地图为 L7.AMap
|
||||||
style: 'mapbox://styles/mapbox/streets-v9',
|
style: 'mapbox://styles/mapbox/streets-v9',
|
||||||
center: [110.19382669582967, 50.258134],
|
center: [110.19382669582967, 50.258134],
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
zoom: 3,
|
zoom: 3,
|
||||||
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 创建图层
|
// 创建图层
|
||||||
|
@ -89,16 +90,17 @@ L7 提供三种使用方式:CDN、Submodule 以及 React 组件。
|
||||||
|
|
||||||
## 通过 Submodule 使用
|
## 通过 Submodule 使用
|
||||||
|
|
||||||
首先通过 `npm/yarn` 安装 `@antv/l7`:
|
首先通过 `npm/yarn` 安装 `@antv/l7@beta`:
|
||||||
```bash
|
```bash
|
||||||
npm install --save @antv/l7
|
npm install --save @antv/l7@beta
|
||||||
// or
|
// or
|
||||||
yarn add @antv/l7
|
yarn add @antv/l7@beta
|
||||||
```
|
```
|
||||||
|
|
||||||
然后就可以使用其中包含的场景和各类图层:
|
然后就可以使用其中包含的场景和各类图层:
|
||||||
```typescript
|
```typescript
|
||||||
import { Scene, PolygonLayer } from '@antv/l7';
|
import { Scene, PolygonLayer } from '@antv/l7';
|
||||||
|
import { AMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
(async function() {
|
(async function() {
|
||||||
// 获取数据
|
// 获取数据
|
||||||
|
@ -109,13 +111,14 @@ import { Scene, PolygonLayer } from '@antv/l7';
|
||||||
|
|
||||||
// 创建场景
|
// 创建场景
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
center: [110.19382669582967, 50.258134],
|
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new AMap({
|
||||||
style: 'dark',
|
center: [110.19382669582967, 50.258134],
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
zoom: 3,
|
style: 'dark',
|
||||||
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
zoom: 3,
|
||||||
|
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 创建图层
|
// 创建图层
|
||||||
|
@ -151,9 +154,10 @@ L7 目前的文档都通过这种方式使用,可以参考项目中的 stories
|
||||||
React 组件待开发,目前可以暂时以 Submodule 方式使用:
|
React 组件待开发,目前可以暂时以 Submodule 方式使用:
|
||||||
```tsx
|
```tsx
|
||||||
import { Scene, PolygonLayer } from '@antv/l7';
|
import { Scene, PolygonLayer } from '@antv/l7';
|
||||||
|
import { AMap } from '@antv/l7-maps';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
export default class AMap extends React.Component {
|
export default class AMapExample extends React.Component {
|
||||||
private scene: Scene;
|
private scene: Scene;
|
||||||
|
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
|
@ -165,13 +169,14 @@ export default class AMap extends React.Component {
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/d2e0e930-fd44-4fca-8872-c1037b0fee7b.json',
|
'https://gw.alipayobjects.com/os/basement_prod/d2e0e930-fd44-4fca-8872-c1037b0fee7b.json',
|
||||||
);
|
);
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
center: [110.19382669582967, 50.258134],
|
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new AMap({
|
||||||
style: 'dark',
|
center: [110.19382669582967, 50.258134],
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
zoom: 3,
|
style: 'dark',
|
||||||
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
zoom: 3,
|
||||||
|
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
const layer = new PolygonLayer({});
|
const layer = new PolygonLayer({});
|
||||||
|
|
||||||
|
|
|
@ -344,9 +344,9 @@ yarn build
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### [WIP] 异步加载 Mapbox
|
### 按需引入地图依赖
|
||||||
|
|
||||||
以 L7 Bundler 方式使用时,由于需要在运行时根据用户配置项选择地图底图,会导致构建时需要将全部地图依赖引入,无法进行 TreeShaking。
|
以 L7 Bundler 方式使用时,由于需要在运行时根据用户配置项选择地图底图,会导致构建时需要将全部地图依赖引入,无法进行 TreeShaking。
|
||||||
目前高德地图使用运行时异步加载方式引入,不会导致该问题,但 Mapbox 同样使用 Bundler,对于高德用户就多余了。
|
目前高德地图使用运行时异步加载方式引入,不会导致该问题,但 Mapbox 同样使用 Bundler,对于高德用户就多余了。
|
||||||
|
|
||||||
一个可能的方案是对于 Mapbox 使用 CodeSplitting。在容器首次获取 Mapbox 地图服务时异步加载并缓存。
|
[ISSUE](https://github.com/antvis/L7/issues/86)
|
||||||
|
|
|
@ -136,11 +136,12 @@ void main() {
|
||||||
// 场景定义
|
// 场景定义
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
type: 'mapbox',
|
map: new Mapbox({
|
||||||
style: 'mapbox://styles/mapbox/streets-v9',
|
style: 'mapbox://styles/mapbox/streets-v9',
|
||||||
center: [110.19382669582967, 50.258134],
|
center: [110.19382669582967, 50.258134],
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
zoom: 3,
|
zoom: 3,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
// 注册自定义后处理效果
|
// 注册自定义后处理效果
|
||||||
scene.registerPostProcessingPass(
|
scene.registerPostProcessingPass(
|
||||||
|
@ -154,7 +155,6 @@ scene.registerPostProcessingPass(
|
||||||
和 L7 内置的后处理效果使用方法一致,通过效果名引用,同时传入定义参数即可:
|
和 L7 内置的后处理效果使用方法一致,通过效果名引用,同时传入定义参数即可:
|
||||||
```typescript
|
```typescript
|
||||||
const layer = new PolygonLayer({
|
const layer = new PolygonLayer({
|
||||||
enableMultiPassRenderer: true,
|
|
||||||
enablePicking: true,
|
enablePicking: true,
|
||||||
enableHighlight: true,
|
enableHighlight: true,
|
||||||
passes: [
|
passes: [
|
||||||
|
|
|
@ -7,39 +7,47 @@ order: 3
|
||||||
地图组件 用于控制地图的状态如果平移,缩放,或者展示地图一些的辅助信息如图例,比例尺
|
地图组件 用于控制地图的状态如果平移,缩放,或者展示地图一些的辅助信息如图例,比例尺
|
||||||
|
|
||||||
|
|
||||||
## 构造函数
|
L7 目前支持Control
|
||||||
|
|
||||||
```javascript
|
- Zoom 放大缩小
|
||||||
const baseControl = new L7.Control.Base(option);
|
- Scale 比例尺
|
||||||
```
|
- Layers 图层列表
|
||||||
|
|
||||||
|
|
||||||
|
## 构造函数
|
||||||
|
|
||||||
|
|
||||||
#### option
|
#### option
|
||||||
position: `string` 控件位置支持是个方位 `bottomright, topright, bottomleft, topleft`
|
|
||||||
|
position: `string` 控件位置支持是个方位
|
||||||
|
|
||||||
|
- bottomright
|
||||||
|
- topright
|
||||||
|
- bottomleft,
|
||||||
|
- topleft`
|
||||||
|
|
||||||
|
|
||||||
#### scene 内置地图组件
|
|
||||||
zoom 地图放大缩小 默认添加<br />Scale 地图比例尺 默认添加<br />attribution 地图数据属性 默认添加<br />layer 图层列表
|
|
||||||
|
|
||||||
**scene配置项设置控件添加状态**
|
组件介绍
|
||||||
|
|
||||||
|
```
|
||||||
|
import { Scale Layers, Zoom } from '@antv/l7';
|
||||||
|
|
||||||
```javascript
|
|
||||||
scene = new L7.scene({
|
|
||||||
zoomControl: true,
|
|
||||||
scaleControl: true,
|
|
||||||
attributionControl: true
|
|
||||||
})
|
|
||||||
```
|
```
|
||||||
|
|
||||||
####
|
|
||||||
|
|
||||||
|
|
||||||
#### Zoom
|
#### Zoom
|
||||||
放大缩小组件 默认 左上角
|
放大缩小组件 默认 左上角
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
new L7.Control.Zoom({
|
const zoomControl = new Zoom({
|
||||||
position: 'topleft'
|
position: 'topleft'
|
||||||
}).addTo(scene);
|
})
|
||||||
|
|
||||||
|
scene.addControl(zoomControl);
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,50 +55,34 @@ scene = new L7.scene({
|
||||||
比例尺组件默认左下角
|
比例尺组件默认左下角
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
new L7.Control.Scale({
|
const zoomControl = new Zoom({
|
||||||
position: 'bottomleft'
|
position: 'topleft'
|
||||||
}).addTo(scene);
|
})
|
||||||
```
|
|
||||||
|
|
||||||
|
scene.addControl(zoomControl);
|
||||||
|
|
||||||
#### attribution
|
|
||||||
默认右下角
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
new L7.Control.Attribution({
|
|
||||||
position: 'bottomleft'
|
|
||||||
}).addTo(scene);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
#### layer
|
#### layer
|
||||||
图层列表目前只支持可视化overlayers 图层控制
|
图层列表目前支持可视化的图层控制
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var overlayers = {
|
|
||||||
"围栏填充": layer,
|
const overlayers = {
|
||||||
"围栏边界": layer2
|
"点图层": layer,
|
||||||
|
|
||||||
};
|
};
|
||||||
new L7.Control.Layers({
|
const layersControl = new Layers({
|
||||||
overlayers: overlayers
|
overlayers
|
||||||
}).addTo(scene);
|
});
|
||||||
|
scene.addControl(layersControl);
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## 方法
|
## 方法
|
||||||
|
|
||||||
#### onAdd
|
|
||||||
组件添加到地图Scene时调用,自定义组件时需要实现此方法
|
|
||||||
|
|
||||||
|
|
||||||
#### addTo
|
|
||||||
添加到地图scene
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
control.addTo(scene);
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
#### setPosition
|
#### setPosition
|
||||||
设置组件位置
|
设置组件位置
|
||||||
|
|
||||||
|
@ -106,32 +98,3 @@ control.setPosition('bottomright');
|
||||||
control.remove();
|
control.remove();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 示例代码
|
|
||||||
|
|
||||||
|
|
||||||
#### 自定义图例控件
|
|
||||||
[源码](https://antv.alipay.com/zh-cn/l7/1.x/demo/component/extendControl.html)
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var legend = new L7.Control.Base({
|
|
||||||
position: 'bottomright'
|
|
||||||
});
|
|
||||||
legend.onAdd = function() {
|
|
||||||
var el = document.createElement('div');
|
|
||||||
el.className = 'infolegend legend';
|
|
||||||
var grades = [0, 8, 15, 30, 65, 120];
|
|
||||||
for (var i = 0; i < grades.length; i++) {
|
|
||||||
el.innerHTML += '<i style="background:' + colors[i] + '"></i> ' + grades[i] + (grades[i + 1] ? '–' + grades[i + 1] + '<br>' : '+');
|
|
||||||
}
|
|
||||||
return el;
|
|
||||||
};
|
|
||||||
legend.addTo(scene);
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
##
|
|
||||||
|
|
||||||
## FAQ
|
|
||||||
|
|
||||||
|
|
|
@ -10,19 +10,24 @@ order: 2
|
||||||
```javascript
|
```javascript
|
||||||
// Module 引用
|
// Module 引用
|
||||||
import { Scene } from '@antv/l7';
|
import { Scene } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
mapStyle: 'dark',
|
map: new GaodeMap({
|
||||||
center: [ 110.770672, 34.159869 ],
|
style: 'dark',
|
||||||
pitch: 45,
|
center: [ 110.770672, 34.159869 ],
|
||||||
|
pitch: 45,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// CDN 使用方法
|
// CDN 使用方法
|
||||||
const scene = new L7.Scene({
|
const scene = new L7.Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
mapStyle: 'dark',
|
map: new L7.GaodeMap({
|
||||||
center: [ 110.770672, 34.159869 ],
|
style: 'dark',
|
||||||
pitch: 45,
|
center: [ 110.770672, 34.159869 ],
|
||||||
|
pitch: 45,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -43,20 +48,21 @@ const scene = new L7.Scene({
|
||||||
可以通过scene map 属性获取 map实例
|
可以通过scene map 属性获取 map实例
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const map = scene.map
|
const map = scene.map
|
||||||
|
|
||||||
```
|
```
|
||||||
为了统一不通底图之前的接口差异 L7 在scene层对map的方法做了统一,因此一些地图的操作方法可以通过scene调用这样,切换不同底图时保证表现一致。
|
为了统一不同底图之前的接口差异 L7 在scene层对map的方法做了统一,因此一些地图的操作方法可以通过scene调用这样,切换不同底图时保证表现一致。
|
||||||
|
|
||||||
示例代码
|
示例代码
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { Scene } from '@antv/l7';
|
|
||||||
const scene =new L7.Scene({
|
const scene =new L7.Scene({
|
||||||
id:'map',
|
id: 'map',
|
||||||
mapStyle:'dark',
|
map: new L7.GaodeMap({
|
||||||
center:[ 110.770672, 34.159869 ],
|
style: 'dark',
|
||||||
pitch:45
|
center: [ 110.770672, 34.159869 ],
|
||||||
|
pitch: 45,
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,29 @@ order: 2
|
||||||
|
|
||||||
## Scene
|
## Scene
|
||||||
|
|
||||||
L7 地理可视化 地图,图层,组件,以及可视化所需要的资源,如图片,字体通过Scene统一管理
|
```javascript
|
||||||
|
// Module 引用
|
||||||
|
import { Scene } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
const scene = new Scene({
|
||||||
|
id: 'map',
|
||||||
|
map: new GaodeMap({
|
||||||
|
style: 'dark',
|
||||||
|
center: [ 110.770672, 34.159869 ],
|
||||||
|
pitch: 45,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
// CDN 使用方法
|
||||||
|
const scene = new L7.Scene({
|
||||||
|
id: 'map',
|
||||||
|
map: new L7.GaodeMap({
|
||||||
|
style: 'dark',
|
||||||
|
center: [ 110.770672, 34.159869 ],
|
||||||
|
pitch: 45,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Map
|
## Map
|
||||||
|
@ -26,7 +48,7 @@ L7 地理可视化 地图,图层,组件,以及可视化所需要的资源
|
||||||
可以通过scene map 属性获取 map实例
|
可以通过scene map 属性获取 map实例
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const map = scene.map
|
const map = scene.map
|
||||||
|
|
||||||
```
|
```
|
||||||
为了统一不同底图之前的接口差异 L7 在scene层对map的方法做了统一,因此一些地图的操作方法可以通过scene调用这样,切换不同底图时保证表现一致。
|
为了统一不同底图之前的接口差异 L7 在scene层对map的方法做了统一,因此一些地图的操作方法可以通过scene调用这样,切换不同底图时保证表现一致。
|
||||||
|
@ -34,24 +56,17 @@ L7 地理可视化 地图,图层,组件,以及可视化所需要的资源
|
||||||
示例代码
|
示例代码
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// Module 引用
|
const scene =new L7.Scene({
|
||||||
import { Scene } from '@antv/l7';
|
|
||||||
const scene = new Scene({
|
|
||||||
id: 'map',
|
id: 'map',
|
||||||
mapStyle: 'dark',
|
map: new L7.GaodeMap({
|
||||||
center: [ 110.770672, 34.159869 ],
|
style: 'dark',
|
||||||
pitch: 45,
|
center: [ 110.770672, 34.159869 ],
|
||||||
});
|
pitch: 45,
|
||||||
|
}),
|
||||||
// CDN 使用方法
|
})
|
||||||
const scene = new L7.Scene({
|
|
||||||
id: 'map',
|
|
||||||
mapStyle: 'dark',
|
|
||||||
center: [ 110.770672, 34.159869 ],
|
|
||||||
pitch: 45,
|
|
||||||
});
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### 构造函数
|
### 构造函数
|
||||||
|
|
||||||
**Scene**
|
**Scene**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: AMap BaseMap
|
title: GaodeMap BaseMap
|
||||||
order: 0
|
order: 0
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -35,13 +35,13 @@ order: 0
|
||||||
``` javascript
|
``` javascript
|
||||||
const scene = new L7.Scene({
|
const scene = new L7.Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark', // 样式URL
|
map: new L7.GaodeMap({
|
||||||
center: [120.19382669582967, 30.258134],
|
style: 'dark', // 样式URL
|
||||||
pitch: 0,
|
center: [120.19382669582967, 30.258134],
|
||||||
zoom: 12,
|
pitch: 0,
|
||||||
type:'amap',
|
zoom: 12,
|
||||||
token: '高德地图token'
|
token: '高德地图token',
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -111,12 +111,13 @@ fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
||||||
|
|
||||||
const scene = new L7.Scene({
|
const scene = new L7.Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark', // 样式URL
|
map: new L7.GaodeMap({
|
||||||
center: [120.19382669582967, 30.258134],
|
style: 'dark', // 样式URL
|
||||||
pitch: 0,
|
center: [120.19382669582967, 30.258134],
|
||||||
zoom: 12,
|
pitch: 0,
|
||||||
type:'amap',
|
zoom: 12,
|
||||||
|
token: '高德地图token',
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
||||||
|
|
|
@ -35,13 +35,13 @@ order: 0
|
||||||
``` javascript
|
``` javascript
|
||||||
const scene = new L7.Scene({
|
const scene = new L7.Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark', // 样式URL
|
map: new L7.GaodeMap({
|
||||||
center: [120.19382669582967, 30.258134],
|
style: 'dark', // 样式URL
|
||||||
pitch: 0,
|
center: [120.19382669582967, 30.258134],
|
||||||
zoom: 12,
|
pitch: 0,
|
||||||
type:'amap',
|
zoom: 12,
|
||||||
token: '高德地图token'
|
token: '高德地图token',
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -111,12 +111,13 @@ fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
||||||
|
|
||||||
const scene = new L7.Scene({
|
const scene = new L7.Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark', // 样式URL
|
map: new L7.GaodeMap({
|
||||||
center: [120.19382669582967, 30.258134],
|
style: 'dark', // 样式URL
|
||||||
pitch: 0,
|
center: [120.19382669582967, 30.258134],
|
||||||
zoom: 12,
|
pitch: 0,
|
||||||
type:'amap',
|
zoom: 12,
|
||||||
|
token: '高德地图token',
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
||||||
|
|
|
@ -42,13 +42,13 @@ order: 0
|
||||||
``` javascript
|
``` javascript
|
||||||
const scene = new L7.Scene({
|
const scene = new L7.Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark', // 样式URL
|
map: new L7.Mapbox({
|
||||||
center: [120.19382669582967, 30.258134],
|
style: 'dark', // 样式URL
|
||||||
pitch: 0,
|
center: [120.19382669582967, 30.258134],
|
||||||
zoom: 12,
|
pitch: 0,
|
||||||
type:'mapbox',
|
zoom: 12,
|
||||||
token: 'mapbox token'
|
token: 'mapbox token',
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -118,12 +118,13 @@ fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
||||||
<script>
|
<script>
|
||||||
const scene = new L7.Scene({
|
const scene = new L7.Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark', // 样式URL
|
map: new L7.Mapbox({
|
||||||
center: [120.19382669582967, 30.258134],
|
style: 'dark', // 样式URL
|
||||||
pitch: 0,
|
center: [120.19382669582967, 30.258134],
|
||||||
zoom: 12,
|
pitch: 0,
|
||||||
type:'amap',
|
zoom: 12,
|
||||||
|
token: 'mapbox token',
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
||||||
|
|
|
@ -47,6 +47,7 @@ yarn add --save @antv/l7@beta
|
||||||
然后就可以使用其中包含的场景和各类图层:
|
然后就可以使用其中包含的场景和各类图层:
|
||||||
```typescript
|
```typescript
|
||||||
import { Scene, PolygonLayer } from '@antv/l7';
|
import { Scene, PolygonLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
(async function() {
|
(async function() {
|
||||||
// 获取数据
|
// 获取数据
|
||||||
|
@ -57,13 +58,14 @@ import { Scene, PolygonLayer } from '@antv/l7';
|
||||||
|
|
||||||
// 创建场景
|
// 创建场景
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
center: [110.19382669582967, 50.258134],
|
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
style: 'dark',
|
center: [110.19382669582967, 50.258134],
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
zoom: 3,
|
style: 'dark',
|
||||||
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
zoom: 3,
|
||||||
|
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 创建图层
|
// 创建图层
|
||||||
|
@ -86,15 +88,12 @@ import { Scene, PolygonLayer } from '@antv/l7';
|
||||||
|
|
||||||
// 添加图层到场景中
|
// 添加图层到场景中
|
||||||
scene.addLayer(layer);
|
scene.addLayer(layer);
|
||||||
|
|
||||||
// 渲染场景
|
|
||||||
scene.render();
|
|
||||||
})();
|
})();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
L7 目前的文档都通过这种方式使用,可以参考项目中的 stories:
|
L7 目前的文档都通过这种方式使用,可以参考项目中的 stories:
|
||||||
* [高德地图](https://github.com/antvis/L7/blob/next/stories/MapAdaptor/components/AMap.tsx)
|
* [高德地图](https://github.com/antvis/L7/blob/next/stories/MapAdaptor/components/GaodeMap.tsx)
|
||||||
* [Mapbox](https://github.com/antvis/L7/blob/next/stories/MapAdaptor/components/Mapbox.tsx)
|
* [Mapbox](https://github.com/antvis/L7/blob/next/stories/MapAdaptor/components/Mapbox.tsx)
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,9 +102,10 @@ L7 目前的文档都通过这种方式使用,可以参考项目中的 stories
|
||||||
React 组件待开发,目前可以暂时以 Submodule 方式使用:
|
React 组件待开发,目前可以暂时以 Submodule 方式使用:
|
||||||
```tsx
|
```tsx
|
||||||
import { Scene, PolygonLayer} from '@antv/l7';
|
import { Scene, PolygonLayer} from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
export default class AMap extends React.Component {
|
export default class GaodeMap extends React.Component {
|
||||||
private scene: Scene;
|
private scene: Scene;
|
||||||
|
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
|
@ -117,13 +117,14 @@ export default class AMap extends React.Component {
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/d2e0e930-fd44-4fca-8872-c1037b0fee7b.json',
|
'https://gw.alipayobjects.com/os/basement_prod/d2e0e930-fd44-4fca-8872-c1037b0fee7b.json',
|
||||||
);
|
);
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
center: [110.19382669582967, 50.258134],
|
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
style: 'dark',
|
center: [110.19382669582967, 50.258134],
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
zoom: 3,
|
style: 'dark',
|
||||||
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
zoom: 3,
|
||||||
|
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
const layer = new PolygonLayer({});
|
const layer = new PolygonLayer({});
|
||||||
|
|
||||||
|
@ -143,7 +144,6 @@ export default class AMap extends React.Component {
|
||||||
opacity: 0.8,
|
opacity: 0.8,
|
||||||
});
|
});
|
||||||
scene.addLayer(layer);
|
scene.addLayer(layer);
|
||||||
scene.render();
|
|
||||||
this.scene = scene;
|
this.scene = scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ yarn add --save @antv/l7@beta
|
||||||
然后就可以使用其中包含的场景和各类图层:
|
然后就可以使用其中包含的场景和各类图层:
|
||||||
```typescript
|
```typescript
|
||||||
import { Scene, PolygonLayer } from '@antv/l7';
|
import { Scene, PolygonLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
(async function() {
|
(async function() {
|
||||||
// 获取数据
|
// 获取数据
|
||||||
|
@ -57,13 +58,14 @@ import { Scene, PolygonLayer } from '@antv/l7';
|
||||||
|
|
||||||
// 创建场景
|
// 创建场景
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
center: [110.19382669582967, 50.258134],
|
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
style: 'dark',
|
center: [110.19382669582967, 50.258134],
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
zoom: 3,
|
style: 'dark',
|
||||||
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
zoom: 3,
|
||||||
|
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 创建图层
|
// 创建图层
|
||||||
|
@ -86,15 +88,12 @@ import { Scene, PolygonLayer } from '@antv/l7';
|
||||||
|
|
||||||
// 添加图层到场景中
|
// 添加图层到场景中
|
||||||
scene.addLayer(layer);
|
scene.addLayer(layer);
|
||||||
|
|
||||||
// 渲染场景
|
|
||||||
scene.render();
|
|
||||||
})();
|
})();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
L7 目前的文档都通过这种方式使用,可以参考项目中的 stories:
|
L7 目前的文档都通过这种方式使用,可以参考项目中的 stories:
|
||||||
* [高德地图](https://github.com/antvis/L7/blob/next/stories/MapAdaptor/components/AMap.tsx)
|
* [高德地图](https://github.com/antvis/L7/blob/next/stories/MapAdaptor/components/GaodeMap.tsx)
|
||||||
* [Mapbox](https://github.com/antvis/L7/blob/next/stories/MapAdaptor/components/Mapbox.tsx)
|
* [Mapbox](https://github.com/antvis/L7/blob/next/stories/MapAdaptor/components/Mapbox.tsx)
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,9 +102,10 @@ L7 目前的文档都通过这种方式使用,可以参考项目中的 stories
|
||||||
React 组件待开发,目前可以暂时以 Submodule 方式使用:
|
React 组件待开发,目前可以暂时以 Submodule 方式使用:
|
||||||
```tsx
|
```tsx
|
||||||
import { Scene, PolygonLayer} from '@antv/l7';
|
import { Scene, PolygonLayer} from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
export default class AMap extends React.Component {
|
export default class GaodeMap extends React.Component {
|
||||||
private scene: Scene;
|
private scene: Scene;
|
||||||
|
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
|
@ -117,13 +117,14 @@ export default class AMap extends React.Component {
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/d2e0e930-fd44-4fca-8872-c1037b0fee7b.json',
|
'https://gw.alipayobjects.com/os/basement_prod/d2e0e930-fd44-4fca-8872-c1037b0fee7b.json',
|
||||||
);
|
);
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
center: [110.19382669582967, 50.258134],
|
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
style: 'dark',
|
center: [110.19382669582967, 50.258134],
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
zoom: 3,
|
style: 'dark',
|
||||||
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
zoom: 3,
|
||||||
|
token: 'pg.xxx', // 高德或者 Mapbox 的 token
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
const layer = new PolygonLayer({});
|
const layer = new PolygonLayer({});
|
||||||
|
|
||||||
|
@ -143,7 +144,6 @@ export default class AMap extends React.Component {
|
||||||
opacity: 0.8,
|
opacity: 0.8,
|
||||||
});
|
});
|
||||||
scene.addLayer(layer);
|
scene.addLayer(layer);
|
||||||
scene.render();
|
|
||||||
this.scene = scene;
|
this.scene = scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new Mapbox({
|
||||||
type: 'mapbox',
|
style: 'dark',
|
||||||
style: 'dark',
|
pitch: 0,
|
||||||
center: [ 107.77791556935472, 35.443286920228644 ],
|
center: [ 107.77791556935472, 35.443286920228644 ],
|
||||||
zoom: 2.9142882493605033
|
zoom: 2.9142882493605033
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/UEXQMifxtkQlYfChpPwT.txt')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/UEXQMifxtkQlYfChpPwT.txt')
|
||||||
.then(res => res.text())
|
.then(res => res.text())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
center: [ 103.83735604457024, 1.360253881403068 ],
|
map: new Mapbox({
|
||||||
pitch: 4.00000000000001,
|
style: 'dark',
|
||||||
zoom: 10.210275860702593,
|
center: [ 103.83735604457024, 1.360253881403068 ],
|
||||||
rotation: 19.313180925794313,
|
pitch: 4.00000000000001,
|
||||||
type: 'mapbox',
|
zoom: 10.210275860702593,
|
||||||
style: 'dark'
|
rotation: 19.313180925794313
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 35.210526315789465,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 35.210526315789465,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 104.288144, 31.239692 ],
|
center: [ 104.288144, 31.239692 ],
|
||||||
zoom: 4.4
|
zoom: 4.4
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark',
|
map: new Mapbox({
|
||||||
pitch: 43,
|
style: 'dark',
|
||||||
center: [ 120.13383079335335, 29.651873105004427 ],
|
pitch: 43,
|
||||||
zoom: 7.068989519212174,
|
center: [ 120.13383079335335, 29.651873105004427 ],
|
||||||
type: 'mapbox'
|
zoom: 7.068989519212174
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
window.mapScene = scene;
|
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/a1a8158d-6fe3-424b-8e50-694ccf61c4d7.csv'
|
'https://gw.alipayobjects.com/os/basement_prod/a1a8158d-6fe3-424b-8e50-694ccf61c4d7.csv'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
type: 'amap',
|
map: new GaodeMap({
|
||||||
style: 'dark',
|
center: [ 121.417463, 31.215175 ],
|
||||||
center: [ 121.417463, 31.215175 ],
|
pitch: 0,
|
||||||
pitch: 0,
|
zoom: 11
|
||||||
zoom: 11
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/BElVQFEFvpAKzddxFZxJ.txt')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/BElVQFEFvpAKzddxFZxJ.txt')
|
||||||
.then(res => res.text())
|
.then(res => res.text())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 64.88,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 64.88,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 114.060288, 22.53684 ],
|
center: [ 114.060288, 22.53684 ],
|
||||||
zoom: 15.63
|
zoom: 15.63
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/513add53-dcb2-4295-8860-9e7aa5236699.json'
|
'https://gw.alipayobjects.com/os/basement_prod/513add53-dcb2-4295-8860-9e7aa5236699.json'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'light',
|
map: new GaodeMap({
|
||||||
pitch: 0,
|
style: 'light',
|
||||||
center: [ 107.054293, 35.246265 ],
|
pitch: 0,
|
||||||
zoom: 4.056,
|
center: [ 107.054293, 35.246265 ],
|
||||||
type: 'amap'
|
zoom: 4.056
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv'
|
'https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark',
|
map: new GaodeMap({
|
||||||
pitch: 0,
|
style: 'dark',
|
||||||
center: [ 110.097892, 33.853662 ],
|
pitch: 0,
|
||||||
zoom: 4.056,
|
center: [ 110.097892, 33.853662 ],
|
||||||
type: 'amap'
|
zoom: 4.056
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv'
|
'https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'light',
|
map: new GaodeMap({
|
||||||
pitch: 0,
|
style: 'light',
|
||||||
center: [ 110.097892, 33.853662 ],
|
pitch: 0,
|
||||||
zoom: 4.056,
|
center: [ 110.097892, 33.853662 ],
|
||||||
type: 'amap'
|
zoom: 4.056
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark',
|
map: new GaodeMap({
|
||||||
pitch: 0,
|
style: 'dark',
|
||||||
center: [ 110.097892, 33.853662 ],
|
pitch: 0,
|
||||||
zoom: 4.056,
|
center: [ 110.097892, 33.853662 ],
|
||||||
type: 'amap'
|
zoom: 4.056
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
window.mapScene = scene;
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv'
|
'https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark',
|
map: new Mapbox({
|
||||||
pitch: 0,
|
style: 'dark',
|
||||||
center: [ 127.5671666579043, 7.445038892195569 ],
|
pitch: 0,
|
||||||
type: 'mapbox',
|
center: [ 127.5671666579043, 7.445038892195569 ],
|
||||||
zoom: 2.632456779444394
|
zoom: 2.632456779444394
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark',
|
map: new Mapbox({
|
||||||
pitch: 58.5,
|
style: 'dark',
|
||||||
center: [ 111.8759, 30.6942 ],
|
pitch: 58.5,
|
||||||
rotation: 0.519,
|
center: [ 111.8759, 30.6942 ],
|
||||||
type: 'mapbox',
|
rotation: 0.519,
|
||||||
zoom: 3.6116
|
zoom: 3.6116
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/337ddbb7-aa3f-4679-ab60-d64359241955.json'
|
'https://gw.alipayobjects.com/os/basement_prod/337ddbb7-aa3f-4679-ab60-d64359241955.json'
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark',
|
map: new Mapbox({
|
||||||
pitch: 0,
|
style: 'dark',
|
||||||
center: [ 127.5671666579043, 7.445038892195569 ],
|
pitch: 0,
|
||||||
type: 'mapbox',
|
center: [ 127.5671666579043, 7.445038892195569 ],
|
||||||
zoom: 2.632456779444394
|
zoom: 2.632456779444394
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark',
|
map: new Mapbox({
|
||||||
pitch: 47.49999999999995,
|
style: 'dark',
|
||||||
center: [ 112.50447776627743, 30.830476390931125 ],
|
pitch: 47.49999999999995,
|
||||||
zoom: 3.9879693680088626,
|
center: [ 112.50447776627743, 30.830476390931125 ],
|
||||||
type: 'mapbox'
|
zoom: 3.9879693680088626
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv'
|
'https://gw.alipayobjects.com/os/basement_prod/7359a5e9-3c5e-453f-b207-bc892fb23b84.csv'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'light',
|
map: new Mapbox({
|
||||||
pitch: 56.499,
|
style: 'light',
|
||||||
center: [ 114.07737552216226, 22.542656745583486 ],
|
pitch: 56.499,
|
||||||
rotation: 39.19,
|
center: [ 114.07737552216226, 22.542656745583486 ],
|
||||||
zoom: 12.47985,
|
rotation: 39.19,
|
||||||
type: 'mapbox'
|
zoom: 12.47985
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/513add53-dcb2-4295-8860-9e7aa5236699.json'
|
'https://gw.alipayobjects.com/os/basement_prod/513add53-dcb2-4295-8860-9e7aa5236699.json'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'dark',
|
map: new Mapbox({
|
||||||
pitch: 43,
|
style: 'dark',
|
||||||
center: [ 120.13383079335335, 29.651873105004427 ],
|
pitch: 43,
|
||||||
zoom: 7.068989519212174,
|
center: [ 120.13383079335335, 29.651873105004427 ],
|
||||||
type: 'mapbox'
|
zoom: 7.068989519212174
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
window.mapScene = scene;
|
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/a1a8158d-6fe3-424b-8e50-694ccf61c4d7.csv'
|
'https://gw.alipayobjects.com/os/basement_prod/a1a8158d-6fe3-424b-8e50-694ccf61c4d7.csv'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, HeatmapLayer } from '@antv/l7';
|
import { Scene, HeatmapLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
style: 'light',
|
map: new GaodeMap({
|
||||||
pitch: 0,
|
style: 'light',
|
||||||
center: [ 104.995156, 31.450658 ],
|
pitch: 0,
|
||||||
type: 'amap',
|
center: [ 104.995156, 31.450658 ],
|
||||||
zoom: 3.79
|
zoom: 3.79
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new Mapbox({
|
||||||
type: 'mapbox',
|
pitch: 0,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 0, 23.107329 ],
|
center: [ 0, 23.107329 ],
|
||||||
zoom: 0
|
zoom: 0
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/b83699f9-a96d-49b8-b2ea-f99299faebaf.json'
|
'https://gw.alipayobjects.com/os/basement_prod/b83699f9-a96d-49b8-b2ea-f99299faebaf.json'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new Mapbox({
|
||||||
type: 'mapbox',
|
pitch: 0,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 107.77791556935472, 35.443286920228644 ],
|
center: [ 107.77791556935472, 35.443286920228644 ],
|
||||||
zoom: 2.9142882493605033
|
zoom: 2.9142882493605033
|
||||||
|
})
|
||||||
});
|
});
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/UEXQMifxtkQlYfChpPwT.txt')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/UEXQMifxtkQlYfChpPwT.txt')
|
||||||
.then(res => res.text())
|
.then(res => res.text())
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 60,
|
map: new Mapbox({
|
||||||
type: 'mapbox',
|
pitch: 60,
|
||||||
style: 'light',
|
type: 'mapbox',
|
||||||
center: [ -74.06967, 40.720399 ],
|
style: 'light',
|
||||||
zoom: 12.45977
|
center: [ -74.06967, 40.720399 ],
|
||||||
|
zoom: 12.45977
|
||||||
|
})
|
||||||
});
|
});
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/bd33a685-a17e-4686-bc79-b0e6a89fd950.csv'
|
'https://gw.alipayobjects.com/os/basement_prod/bd33a685-a17e-4686-bc79-b0e6a89fd950.csv'
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 60,
|
map: new Mapbox({
|
||||||
type: 'mapbox',
|
pitch: 60,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 104.34278, 41.12554 ],
|
center: [ 104.34278, 41.12554 ],
|
||||||
zoom: 2.94888,
|
zoom: 2.94888,
|
||||||
rotation: 42.3999
|
rotation: 42.3999
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/UEXQMifxtkQlYfChpPwT.txt')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/UEXQMifxtkQlYfChpPwT.txt')
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 53.6305,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 53.6305,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 102.600579, 23.114887 ],
|
center: [ 102.600579, 23.114887 ],
|
||||||
zoom: 14.66
|
zoom: 14.66
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/ZVfOvhVCzwBkISNsuKCc.json')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/ZVfOvhVCzwBkISNsuKCc.json')
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 26.842105263157915,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 26.842105263157915,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 102.599436, 23.116371 ],
|
center: [ 102.599436, 23.116371 ],
|
||||||
zoom: 14.78
|
zoom: 14.78
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/ZVfOvhVCzwBkISNsuKCc.json')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/ZVfOvhVCzwBkISNsuKCc.json')
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 104.117492, 36.492696 ],
|
center: [ 104.117492, 36.492696 ],
|
||||||
zoom: 3.89
|
zoom: 3.89
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 104.117492, 36.492696 ],
|
center: [ 104.117492, 36.492696 ],
|
||||||
zoom: 3.89
|
zoom: 3.89
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
center: [ 103.83735, 1.3602538 ],
|
map: new Mapbox({
|
||||||
pitch: 4.00000000000001,
|
center: [ 103.83735, 1.3602538 ],
|
||||||
zoom: 10.210275860702593,
|
pitch: 4.00000000000001,
|
||||||
rotation: 19.313180925794313,
|
zoom: 10.210275860702593,
|
||||||
type: 'mapbox',
|
rotation: 19.313180925794313,
|
||||||
style: 'dark'
|
style: 'dark'
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
center: [ 103.83735604457024, 1.360253881403068 ],
|
map: new Mapbox({
|
||||||
pitch: 4.00000000000001,
|
center: [ 103.83735604457024, 1.360253881403068 ],
|
||||||
zoom: 10.210275860702593,
|
pitch: 4.00000000000001,
|
||||||
rotation: 19.313180925794313,
|
zoom: 10.210275860702593,
|
||||||
type: 'mapbox',
|
rotation: 19.313180925794313,
|
||||||
style: 'light'
|
style: 'light'
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
center: [ 116.3956, 39.9392 ],
|
map: new Mapbox({
|
||||||
pitch: 0,
|
center: [ 116.3956, 39.9392 ],
|
||||||
zoom: 10,
|
pitch: 0,
|
||||||
rotation: 0,
|
zoom: 10,
|
||||||
type: 'mapbox',
|
rotation: 0,
|
||||||
style: 'dark'
|
style: 'dark'
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { Scene, LineLayer } from '@antv/l7';
|
import { Scene, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
center: [ 116.3956, 39.9392 ],
|
map: new Mapbox({
|
||||||
pitch: 0,
|
center: [ 116.3956, 39.9392 ],
|
||||||
zoom: 10,
|
pitch: 0,
|
||||||
rotation: 0,
|
zoom: 10,
|
||||||
type: 'mapbox',
|
rotation: 0,
|
||||||
style: 'light'
|
style: 'light'
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 121.435159, 31.256971 ],
|
center: [ 121.435159, 31.256971 ],
|
||||||
zoom: 14.89,
|
zoom: 14.89,
|
||||||
minZoom: 10
|
minZoom: 10
|
||||||
|
})
|
||||||
});
|
});
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/893d1d5f-11d9-45f3-8322-ee9140d288ae.json'
|
'https://gw.alipayobjects.com/os/basement_prod/893d1d5f-11d9-45f3-8322-ee9140d288ae.json'
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'light',
|
type: 'amap',
|
||||||
center: [ 140.067171, 36.26186 ],
|
style: 'light',
|
||||||
zoom: 5.32,
|
center: [ 140.067171, 36.26186 ],
|
||||||
maxZoom: 10
|
zoom: 5.32,
|
||||||
|
maxZoom: 10
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
type: 'amap',
|
map: new GaodeMap({
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ -121.24357, 37.58264 ],
|
center: [ -121.24357, 37.58264 ],
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
zoom: 6.45
|
zoom: 6.45
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new Mapbox({
|
||||||
type: 'mapbox',
|
pitch: 0,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 96.99215001469588, 29.281597225674773 ],
|
center: [ 96.99215001469588, 29.281597225674773 ],
|
||||||
zoom: 2.194613775109773,
|
zoom: 2.194613775109773,
|
||||||
maxZoom: 10
|
maxZoom: 10
|
||||||
|
})
|
||||||
});
|
});
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/337ddbb7-aa3f-4679-ab60-d64359241955.json'
|
'https://gw.alipayobjects.com/os/basement_prod/337ddbb7-aa3f-4679-ab60-d64359241955.json'
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { Scene, Marker } from '@antv/l7';
|
import { Scene, Marker } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
import * as G2 from '@antv/g2';
|
import * as G2 from '@antv/g2';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
type: 'amap',
|
map: new GaodeMap({
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 2.6125016864608597, 49.359131 ],
|
center: [ 2.6125016864608597, 49.359131 ],
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
zoom: 4.19
|
zoom: 4.19
|
||||||
|
})
|
||||||
});
|
});
|
||||||
scene.render();
|
scene.render();
|
||||||
scene.on('loaded', () => {
|
scene.on('loaded', () => {
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { Scene, Marker } from '@antv/l7';
|
import { Scene, Marker } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
import * as G2 from '@antv/g2';
|
import * as G2 from '@antv/g2';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
type: 'amap',
|
map: new GaodeMap({
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 2.6125016864608597, 49.359131 ],
|
center: [ 2.6125016864608597, 49.359131 ],
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
zoom: 4.19
|
zoom: 4.19
|
||||||
|
})
|
||||||
});
|
});
|
||||||
scene.render();
|
scene.render();
|
||||||
scene.on('loaded', () => {
|
scene.on('loaded', () => {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Scene, Marker } from '@antv/l7';
|
import { Scene, Marker } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
import * as G2 from '@antv/g2';
|
import * as G2 from '@antv/g2';
|
||||||
|
|
||||||
const CSS = `.l7-marker .g2-guide-html {
|
const CSS = `.l7-marker .g2-guide-html {
|
||||||
|
@ -36,11 +37,12 @@ loadCssCode(CSS);
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new Mapbox({
|
||||||
type: 'mapbox',
|
pitch: 0,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 52.21496184144132, 24.121126851768906 ],
|
center: [ 52.21496184144132, 24.121126851768906 ],
|
||||||
zoom: 3.802
|
zoom: 3.802
|
||||||
|
})
|
||||||
});
|
});
|
||||||
scene.render();
|
scene.render();
|
||||||
scene.on('loaded', () => {
|
scene.on('loaded', () => {
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 66.02383,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 66.02383,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 121.400257, 31.25287 ],
|
center: [ 121.400257, 31.25287 ],
|
||||||
zoom: 14.55,
|
zoom: 14.55,
|
||||||
rotation: 134.9507
|
rotation: 134.9507
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/893d1d5f-11d9-45f3-8322-ee9140d288ae.json'
|
'https://gw.alipayobjects.com/os/basement_prod/893d1d5f-11d9-45f3-8322-ee9140d288ae.json'
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 60,
|
map: new Mapbox({
|
||||||
type: 'mapbox',
|
pitch: 60,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 121.412224, 31.26192438 ],
|
center: [ 121.412224, 31.26192438 ],
|
||||||
zoom: 13.13438,
|
zoom: 13.13438,
|
||||||
rotation: 35.97133
|
rotation: 35.97133
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/893d1d5f-11d9-45f3-8322-ee9140d288ae.json'
|
'https://gw.alipayobjects.com/os/basement_prod/893d1d5f-11d9-45f3-8322-ee9140d288ae.json'
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 35.210526315789465,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 35.210526315789465,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 104.288144, 31.239692 ],
|
center: [ 104.288144, 31.239692 ],
|
||||||
zoom: 4.4
|
zoom: 4.4
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 48.62562,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 48.62562,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 104.026043, 31.847 ],
|
center: [ 104.026043, 31.847 ],
|
||||||
rotation: -0.76,
|
rotation: -0.76,
|
||||||
zoom: 4.48
|
zoom: 4.48
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 121.434765, 31.256735 ],
|
center: [ 121.434765, 31.256735 ],
|
||||||
zoom: 14.83
|
zoom: 14.83
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 116.276227, 35.256776 ],
|
center: [ 116.276227, 35.256776 ],
|
||||||
zoom: 6
|
zoom: 6
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
type: 'amap',
|
map: new GaodeMap({
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 120.5969, 29.7918 ],
|
center: [ 120.5969, 29.7918 ],
|
||||||
pitch: 35,
|
pitch: 35,
|
||||||
zoom: 7,
|
zoom: 7,
|
||||||
rotation: 4.183582
|
rotation: 4.183582
|
||||||
|
})
|
||||||
});
|
});
|
||||||
scene.addImage(
|
scene.addImage(
|
||||||
'00',
|
'00',
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, Marker } from '@antv/l7';
|
import { Scene, Marker } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
type: 'amap',
|
map: new GaodeMap({
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 105.790327, 36.495636 ],
|
center: [ 105.790327, 36.495636 ],
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
zoom: 4
|
zoom: 4
|
||||||
|
})
|
||||||
});
|
});
|
||||||
scene.render();
|
scene.render();
|
||||||
scene.on('loaded', () => {
|
scene.on('loaded', () => {
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
type: 'amap',
|
map: new GaodeMap({
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 121.417463, 31.215175 ],
|
center: [ 121.417463, 31.215175 ],
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
zoom: 11
|
zoom: 11
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/BElVQFEFvpAKzddxFZxJ.txt')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/BElVQFEFvpAKzddxFZxJ.txt')
|
||||||
.then(res => res.text())
|
.then(res => res.text())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
import { Scene, PointLayer } from '@antv/l7';
|
import { Scene, PointLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 64.88,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 64.88,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 114.060288, 22.53684 ],
|
center: [ 114.060288, 22.53684 ],
|
||||||
zoom: 15.63
|
zoom: 15.63
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/513add53-dcb2-4295-8860-9e7aa5236699.json'
|
'https://gw.alipayobjects.com/os/basement_prod/513add53-dcb2-4295-8860-9e7aa5236699.json'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
import { Scene, PolygonLayer } from '@antv/l7';
|
import { Scene, PolygonLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 114.050008, 22.529272 ],
|
center: [ 114.050008, 22.529272 ],
|
||||||
zoom: 14.1
|
zoom: 14.1
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
window.mapScene = scene;
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/972566c5-a2b9-4a7e-8da1-bae9d0eb0117.json'
|
'https://gw.alipayobjects.com/os/basement_prod/972566c5-a2b9-4a7e-8da1-bae9d0eb0117.json'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
import { Scene, PolygonLayer, LineLayer } from '@antv/l7';
|
import { Scene, PolygonLayer, LineLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 116.368652, 39.93866 ],
|
center: [ 116.368652, 39.93866 ],
|
||||||
zoom: 10.07
|
zoom: 10.07
|
||||||
|
})
|
||||||
});
|
});
|
||||||
window.mapScene = scene;
|
|
||||||
fetch(
|
fetch(
|
||||||
'https://gw.alipayobjects.com/os/basement_prod/1d27c363-af3a-469e-ab5b-7a7e1ce4f311.json'
|
'https://gw.alipayobjects.com/os/basement_prod/1d27c363-af3a-469e-ab5b-7a7e1ce4f311.json'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, PolygonLayer, LineLayer } from '@antv/l7';
|
import { Scene, PolygonLayer, LineLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 107.042225, 37.66565 ],
|
center: [ 107.042225, 37.66565 ],
|
||||||
zoom: 3.87
|
zoom: 3.87
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
fetch('https://gw.alipayobjects.com/os/rmsportal/JToMOWvicvJOISZFCkEI.json')
|
fetch('https://gw.alipayobjects.com/os/rmsportal/JToMOWvicvJOISZFCkEI.json')
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, PolygonLayer, LineLayer } from '@antv/l7';
|
import { Scene, PolygonLayer, LineLayer } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new Mapbox({
|
||||||
type: 'mapbox',
|
pitch: 0,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 3.438, 40.16797 ],
|
center: [ 3.438, 40.16797 ],
|
||||||
zoom: 0.51329
|
zoom: 0.51329
|
||||||
|
})
|
||||||
});
|
});
|
||||||
Promise.all([
|
Promise.all([
|
||||||
fetch(
|
fetch(
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, ImageLayer } from '@antv/l7';
|
import { Scene, ImageLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'light',
|
style: 'light',
|
||||||
center: [ 121.268, 30.3628 ],
|
center: [ 121.268, 30.3628 ],
|
||||||
zoom: 13
|
zoom: 13
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
const layer = new ImageLayer({});
|
const layer = new ImageLayer({});
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { Scene, ImageLayer } from '@antv/l7';
|
import { Scene, ImageLayer } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
pitch: 0,
|
map: new GaodeMap({
|
||||||
type: 'amap',
|
pitch: 0,
|
||||||
style: 'dark',
|
style: 'dark',
|
||||||
center: [ 115.5268, 34.3628 ],
|
center: [ 115.5268, 34.3628 ],
|
||||||
zoom: 7
|
zoom: 7
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
const layer = new ImageLayer({});
|
const layer = new ImageLayer({});
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
import { PointLayer, Scale, Scene, Layers, Zoom } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
const scene = new Scene({
|
||||||
|
id: 'map',
|
||||||
|
map: new GaodeMap({
|
||||||
|
style: 'light',
|
||||||
|
pitch: 0,
|
||||||
|
center: [ 121.4316962, 31.26082325 ],
|
||||||
|
zoom: 15.056
|
||||||
|
})
|
||||||
|
});
|
||||||
|
fetch('https://gw.alipayobjects.com/os/basement_prod/893d1d5f-11d9-45f3-8322-ee9140d288ae.json')
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(data => {
|
||||||
|
const pointLayer =
|
||||||
|
new PointLayer({
|
||||||
|
})
|
||||||
|
.source(data, {
|
||||||
|
parser: {
|
||||||
|
type: 'json',
|
||||||
|
x: 'longitude',
|
||||||
|
y: 'latitude'
|
||||||
|
}
|
||||||
|
}).shape('circle')
|
||||||
|
.size('unit_price', [ 5, 25 ])
|
||||||
|
.color('name', [ '#49B5AD', '#5B8FF9' ])
|
||||||
|
.style({
|
||||||
|
opacity: 0.3,
|
||||||
|
strokeWidth: 1
|
||||||
|
});
|
||||||
|
|
||||||
|
scene.addLayer(pointLayer);
|
||||||
|
const overlayers = {
|
||||||
|
围栏填充: pointLayer
|
||||||
|
};
|
||||||
|
const layersControl = new Layers({
|
||||||
|
overlayers
|
||||||
|
});
|
||||||
|
|
||||||
|
scene.addControl(layersControl);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const zoomControl = new Zoom({
|
||||||
|
position: 'topright'
|
||||||
|
});
|
||||||
|
const scaleControl = new Scale({
|
||||||
|
position: 'bottomright'
|
||||||
|
});
|
||||||
|
scene.addControl(zoomControl);
|
||||||
|
scene.addControl(scaleControl);
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { Scale, Zoom, Scene } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
const scene = new Scene({
|
||||||
|
id: 'map',
|
||||||
|
map: new Mapbox({
|
||||||
|
style: 'light',
|
||||||
|
pitch: 0,
|
||||||
|
center: [ 107.054293, 35.246265 ],
|
||||||
|
zoom: 4.056
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
const zoomControl = new Zoom();
|
||||||
|
const scaleControl = new Scale();
|
||||||
|
scene.addControl(zoomControl);
|
||||||
|
scene.addControl(scaleControl);
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"title": {
|
||||||
|
"zh": "地图",
|
||||||
|
"en": "Category"
|
||||||
|
},
|
||||||
|
"demos": [
|
||||||
|
{
|
||||||
|
"filename": "amap.js",
|
||||||
|
"title": "高德底图组件",
|
||||||
|
"screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*yXzQRYcGTyoAAAAAAAAAAABkARQnAQ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "mapbox.js",
|
||||||
|
"title": "MapBox底图组件",
|
||||||
|
"screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*_SIYR50bbcoAAAAAAAAAAABkARQnAQ"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: control
|
||||||
|
order: 2
|
||||||
|
---
|
||||||
|
How to use the map control
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: 组件
|
||||||
|
order: 2
|
||||||
|
---
|
||||||
|
如何使用组件
|
|
@ -0,0 +1,11 @@
|
||||||
|
import { Scene } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
new Scene({
|
||||||
|
id: 'map',
|
||||||
|
map: new GaodeMap({
|
||||||
|
style: 'light',
|
||||||
|
pitch: 0,
|
||||||
|
center: [ 107.054293, 35.246265 ],
|
||||||
|
zoom: 4.056
|
||||||
|
})
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"title": {
|
||||||
|
"zh": "图库",
|
||||||
|
"en": "Gallery"
|
||||||
|
},
|
||||||
|
"demos": [
|
||||||
|
{
|
||||||
|
"filename": "line.js",
|
||||||
|
"title": "json数据"",
|
||||||
|
"screenshot": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
title: Data
|
||||||
|
order: 1
|
||||||
|
---
|
||||||
|
|
||||||
|
coming soon ……
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: 数据
|
||||||
|
order: 1
|
||||||
|
---
|
||||||
|
在路上 ……
|
|
@ -0,0 +1,11 @@
|
||||||
|
import { Scene } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
new Scene({
|
||||||
|
id: 'map',
|
||||||
|
map: new GaodeMap({
|
||||||
|
style: 'light',
|
||||||
|
pitch: 0,
|
||||||
|
center: [ 107.054293, 35.246265 ],
|
||||||
|
zoom: 4.056
|
||||||
|
})
|
||||||
|
});
|
|
@ -0,0 +1,11 @@
|
||||||
|
import { Scene } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
new Scene({
|
||||||
|
id: 'map',
|
||||||
|
map: new Mapbox({
|
||||||
|
style: 'light',
|
||||||
|
pitch: 0,
|
||||||
|
center: [ 107.054293, 35.246265 ],
|
||||||
|
zoom: 4.056
|
||||||
|
})
|
||||||
|
});
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"title": {
|
||||||
|
"zh": "地图",
|
||||||
|
"en": "Category"
|
||||||
|
},
|
||||||
|
"demos": [
|
||||||
|
{
|
||||||
|
"filename": "amap.js",
|
||||||
|
"title": "高德底图",
|
||||||
|
"screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*F0JPSoLcSesAAAAAAAAAAABkARQnAQ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "mapbox.js",
|
||||||
|
"title": "MapBox底图",
|
||||||
|
"screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*_SIYR50bbcoAAAAAAAAAAABkARQnAQ"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
title: map
|
||||||
|
order: 0
|
||||||
|
---
|
||||||
|
|
||||||
|
how to use L7 Initialize third-party maps
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
title: 地图
|
||||||
|
order: 0
|
||||||
|
---
|
||||||
|
介绍如何初始化一个第三方底图
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { Scene, Marker, Popup } from '@antv/l7';
|
||||||
|
import { GaodeMap } from '@antv/l7-maps';
|
||||||
|
const scene = new Scene({
|
||||||
|
id: 'map',
|
||||||
|
map: new GaodeMap({
|
||||||
|
style: 'light',
|
||||||
|
pitch: 0,
|
||||||
|
center: [ 121.4316962, 31.26082325 ],
|
||||||
|
zoom: 12.056
|
||||||
|
})
|
||||||
|
});
|
||||||
|
// 创建默认 marker
|
||||||
|
const popup = new Popup({
|
||||||
|
offsets: [ 0, 20 ]
|
||||||
|
}).setText('hello');
|
||||||
|
|
||||||
|
const marker = new Marker()
|
||||||
|
.setLnglat([ 121.4316962, 31.26082325 ])
|
||||||
|
.setPopup(popup);
|
||||||
|
|
||||||
|
scene.addMarker(marker);
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { Scale, Zoom, Scene } from '@antv/l7';
|
||||||
|
import { Mapbox } from '@antv/l7-maps';
|
||||||
|
const scene = new Scene({
|
||||||
|
id: 'map',
|
||||||
|
map: new Mapbox({
|
||||||
|
style: 'light',
|
||||||
|
pitch: 0,
|
||||||
|
center: [ 107.054293, 35.246265 ],
|
||||||
|
zoom: 4.056
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
const zoomControl = new Zoom();
|
||||||
|
const scaleControl = new Scale();
|
||||||
|
scene.addControl(zoomControl);
|
||||||
|
scene.addControl(scaleControl);
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"title": {
|
||||||
|
"zh": "地图",
|
||||||
|
"en": "Category"
|
||||||
|
},
|
||||||
|
"demos": [
|
||||||
|
{
|
||||||
|
"filename": "amap.js",
|
||||||
|
"title": "添加默认Marker",
|
||||||
|
"screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*Gzj7SYk-vdEAAAAAAAAAAABkARQnAQ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "mapbox.js",
|
||||||
|
"title": "MapBox底图组件",
|
||||||
|
"screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*_SIYR50bbcoAAAAAAAAAAABkARQnAQ"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: control
|
||||||
|
order: 2
|
||||||
|
---
|
||||||
|
add Rich text annotation to scene
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Marker
|
||||||
|
order: 2
|
||||||
|
---
|
||||||
|
通过添加dom实现富文本地图标注
|
|
@ -4,3 +4,4 @@ require('./packages/component/src/css/l7.css');
|
||||||
window.geotiff = require('geotiff/dist/geotiff.bundle.min.js');
|
window.geotiff = require('geotiff/dist/geotiff.bundle.min.js');
|
||||||
window.g2 = require('@antv/g2');
|
window.g2 = require('@antv/g2');
|
||||||
window.l7 = require('@antv/l7');
|
window.l7 = require('@antv/l7');
|
||||||
|
window.l7Maps = require('@antv/l7-maps');
|
||||||
|
|
|
@ -9,9 +9,7 @@
|
||||||
],
|
],
|
||||||
"allowBranch": [
|
"allowBranch": [
|
||||||
"master",
|
"master",
|
||||||
"develop",
|
"next"
|
||||||
"next",
|
|
||||||
"dev-container"
|
|
||||||
],
|
],
|
||||||
"message": "chore: publish"
|
"message": "chore: publish"
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
"worker-loader": "^2.0.0"
|
"worker-loader": "^2.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "npm run site:develop",
|
"start": "npm run site:clean && npm run site:develop",
|
||||||
"site:develop": "BABEL_ENV=site gatsby develop --open -H 0.0.0.0",
|
"site:develop": "BABEL_ENV=site gatsby develop --open -H 0.0.0.0",
|
||||||
"site:build": "npm run site:clean && BABEL_ENV=site gatsby build --prefix-paths",
|
"site:build": "npm run site:clean && BABEL_ENV=site gatsby build --prefix-paths",
|
||||||
"site:clean": "gatsby clean",
|
"site:clean": "gatsby clean",
|
||||||
|
|
|
@ -33,14 +33,8 @@ export default class Layers extends Control {
|
||||||
this.layers = [];
|
this.layers = [];
|
||||||
this.lastZIndex = 0;
|
this.lastZIndex = 0;
|
||||||
this.handlingClick = false;
|
this.handlingClick = false;
|
||||||
const { baseLayers = {}, overlayers = {} } = this.controlOption;
|
this.initLayers();
|
||||||
|
|
||||||
Object.keys(baseLayers).forEach((name: string, index: number) => {
|
|
||||||
this.addLayer(baseLayers[name], name, false);
|
|
||||||
});
|
|
||||||
Object.keys(overlayers).forEach((name: any, index: number) => {
|
|
||||||
this.addLayer(overlayers[name], name, true);
|
|
||||||
});
|
|
||||||
bindAll(
|
bindAll(
|
||||||
[
|
[
|
||||||
'checkDisabledLayers',
|
'checkDisabledLayers',
|
||||||
|
@ -131,6 +125,17 @@ export default class Layers extends Control {
|
||||||
this.overlaysList = DOM.create('div', className + '-overlays', form);
|
this.overlaysList = DOM.create('div', className + '-overlays', form);
|
||||||
container.appendChild(form);
|
container.appendChild(form);
|
||||||
}
|
}
|
||||||
|
private initLayers() {
|
||||||
|
const { baseLayers = {}, overlayers = {} } = this.controlOption;
|
||||||
|
Object.keys(baseLayers).forEach((name: string, index: number) => {
|
||||||
|
// baseLayers[name].once('inited', this.update);
|
||||||
|
this.addLayer(baseLayers[name], name, false);
|
||||||
|
});
|
||||||
|
Object.keys(overlayers).forEach((name: any, index: number) => {
|
||||||
|
// overlayers[name].once('inited', this.update);
|
||||||
|
this.addLayer(overlayers[name], name, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private update() {
|
private update() {
|
||||||
if (!this.container) {
|
if (!this.container) {
|
||||||
|
@ -177,7 +182,7 @@ export default class Layers extends Control {
|
||||||
input = inputs[i];
|
input = inputs[i];
|
||||||
layer = this.layerService.getLayer(input.layerId);
|
layer = this.layerService.getLayer(input.layerId);
|
||||||
if (layer) {
|
if (layer) {
|
||||||
input.disabled = !layer.isVisible();
|
input.disabled = !layer.inited || !layer.isVisible();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,10 +256,9 @@ export default class Layers extends Control {
|
||||||
|
|
||||||
private addItem(obj: any) {
|
private addItem(obj: any) {
|
||||||
const label = document.createElement('label');
|
const label = document.createElement('label');
|
||||||
const checked =
|
const layer = this.layerService.getLayer(obj.layer.id);
|
||||||
this.layerService.getLayer(obj.layer.id) && obj.layer.isVisible();
|
const checked = layer && layer.inited && obj.layer.isVisible();
|
||||||
let input: IInputItem;
|
let input: IInputItem;
|
||||||
|
|
||||||
if (obj.overlay) {
|
if (obj.overlay) {
|
||||||
input = document.createElement('input') as IInputItem;
|
input = document.createElement('input') as IInputItem;
|
||||||
input.type = 'checkbox';
|
input.type = 'checkbox';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ILngLat, IMapService, IMarkerScene, IPopup } from '@antv/l7-core';
|
import { ILngLat, IMapService, IPoint, IPopup, TYPES } from '@antv/l7-core';
|
||||||
import { bindAll, DOM } from '@antv/l7-utils';
|
import { bindAll, DOM } from '@antv/l7-utils';
|
||||||
|
import { Container } from 'inversify';
|
||||||
import { anchorTranslate, anchorType, applyAnchorClass } from './utils/anchor';
|
import { anchorTranslate, anchorType, applyAnchorClass } from './utils/anchor';
|
||||||
// marker 支持 dragger 未完成
|
// marker 支持 dragger 未完成
|
||||||
|
|
||||||
|
@ -14,9 +15,9 @@ export default class Marker {
|
||||||
private markerOption: IMarkerOption;
|
private markerOption: IMarkerOption;
|
||||||
private defaultMarker: boolean;
|
private defaultMarker: boolean;
|
||||||
private popup: IPopup; // TODO: POPup
|
private popup: IPopup; // TODO: POPup
|
||||||
private mapservice: IMapService;
|
private mapsService: IMapService<unknown>;
|
||||||
private lngLat: ILngLat;
|
private lngLat: ILngLat;
|
||||||
private scene: IMarkerScene;
|
private scene: Container;
|
||||||
constructor(option?: Partial<IMarkerOption>) {
|
constructor(option?: Partial<IMarkerOption>) {
|
||||||
this.markerOption = {
|
this.markerOption = {
|
||||||
...this.getDefault(),
|
...this.getDefault(),
|
||||||
|
@ -36,29 +37,27 @@ export default class Marker {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public addTo(scene: IMarkerScene) {
|
public addTo(scene: Container) {
|
||||||
this.scene = scene;
|
|
||||||
const mapService = scene.getMapService();
|
|
||||||
const { element, draggable } = this.markerOption;
|
|
||||||
this.remove();
|
this.remove();
|
||||||
this.mapservice = mapService;
|
this.scene = scene;
|
||||||
mapService.getMarkerContainer().appendChild(element as HTMLElement);
|
this.mapsService = scene.get<IMapService>(TYPES.IMapService);
|
||||||
mapService.on('camerachange', this.update);
|
const { element, draggable } = this.markerOption;
|
||||||
|
this.mapsService.getMarkerContainer().appendChild(element as HTMLElement);
|
||||||
|
this.mapsService.on('camerachange', this.update);
|
||||||
// this.setDraggable(draggable);
|
// this.setDraggable(draggable);
|
||||||
this.update();
|
this.update();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public remove() {
|
public remove() {
|
||||||
if (this.mapservice) {
|
if (this.mapsService) {
|
||||||
this.mapservice.off('click', this.onMapClick);
|
this.mapsService.off('click', this.onMapClick);
|
||||||
this.mapservice.off('move', this.update);
|
this.mapsService.off('move', this.update);
|
||||||
this.mapservice.off('moveend', this.update);
|
this.mapsService.off('moveend', this.update);
|
||||||
this.mapservice.off('mousedown', this.addDragHandler);
|
this.mapsService.off('mousedown', this.addDragHandler);
|
||||||
this.mapservice.off('touchstart', this.addDragHandler);
|
this.mapsService.off('touchstart', this.addDragHandler);
|
||||||
this.mapservice.off('mouseup', this.onUp);
|
this.mapsService.off('mouseup', this.onUp);
|
||||||
this.mapservice.off('touchend', this.onUp);
|
this.mapsService.off('touchend', this.onUp);
|
||||||
delete this.mapservice;
|
|
||||||
}
|
}
|
||||||
const { element } = this.markerOption;
|
const { element } = this.markerOption;
|
||||||
if (element) {
|
if (element) {
|
||||||
|
@ -70,8 +69,15 @@ export default class Marker {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setLnglat(lngLat: ILngLat) {
|
public setLnglat(lngLat: ILngLat | IPoint) {
|
||||||
this.lngLat = lngLat;
|
this.lngLat = lngLat as ILngLat;
|
||||||
|
if (Array.isArray(lngLat)) {
|
||||||
|
this.lngLat = {
|
||||||
|
lng: lngLat[0],
|
||||||
|
lat: lngLat[1],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (this.popup) {
|
if (this.popup) {
|
||||||
this.popup.setLnglat(this.lngLat);
|
this.popup.setLnglat(this.lngLat);
|
||||||
}
|
}
|
||||||
|
@ -86,6 +92,14 @@ export default class Marker {
|
||||||
return this.markerOption.element as HTMLElement;
|
return this.markerOption.element as HTMLElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setPopup(popup: IPopup) {
|
||||||
|
this.popup = popup;
|
||||||
|
if (this.lngLat) {
|
||||||
|
this.popup.setLnglat(this.lngLat);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public togglePopup() {
|
public togglePopup() {
|
||||||
const popup = this.popup;
|
const popup = this.popup;
|
||||||
if (!popup) {
|
if (!popup) {
|
||||||
|
@ -115,7 +129,7 @@ export default class Marker {
|
||||||
}
|
}
|
||||||
|
|
||||||
private update() {
|
private update() {
|
||||||
if (!this.mapservice) {
|
if (!this.mapsService) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { element, anchor } = this.markerOption;
|
const { element, anchor } = this.markerOption;
|
||||||
|
@ -131,12 +145,12 @@ export default class Marker {
|
||||||
}
|
}
|
||||||
|
|
||||||
private updatePosition() {
|
private updatePosition() {
|
||||||
if (!this.mapservice) {
|
if (!this.mapsService) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { element } = this.markerOption;
|
const { element } = this.markerOption;
|
||||||
const { lng, lat } = this.lngLat;
|
const { lng, lat } = this.lngLat;
|
||||||
const pos = this.mapservice.lngLatToContainer([lng, lat]);
|
const pos = this.mapsService.lngLatToContainer([lng, lat]);
|
||||||
if (element) {
|
if (element) {
|
||||||
element.style.left = pos.x + 'px';
|
element.style.left = pos.x + 'px';
|
||||||
element.style.top = pos.y + 'px';
|
element.style.top = pos.y + 'px';
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { ILngLat, IMapService, IMarkerScene, IPopup } from '@antv/l7-core';
|
import { ILngLat, IMapService, IPoint, IPopup, TYPES } from '@antv/l7-core';
|
||||||
import { bindAll, DOM } from '@antv/l7-utils';
|
import { bindAll, DOM } from '@antv/l7-utils';
|
||||||
import { EventEmitter } from 'eventemitter3';
|
import { EventEmitter } from 'eventemitter3';
|
||||||
|
import { Container } from 'inversify';
|
||||||
import { anchorTranslate, anchorType, applyAnchorClass } from './utils/anchor';
|
import { anchorTranslate, anchorType, applyAnchorClass } from './utils/anchor';
|
||||||
|
|
||||||
/** colse event */
|
/** colse event */
|
||||||
|
@ -15,7 +16,7 @@ export interface IPopupOption {
|
||||||
}
|
}
|
||||||
export default class Popup extends EventEmitter implements IPopup {
|
export default class Popup extends EventEmitter implements IPopup {
|
||||||
private popupOption: IPopupOption;
|
private popupOption: IPopupOption;
|
||||||
private mapservice: IMapService;
|
private mapsService: IMapService<unknown>;
|
||||||
private lngLat: ILngLat;
|
private lngLat: ILngLat;
|
||||||
private content: HTMLElement;
|
private content: HTMLElement;
|
||||||
private closeButton: HTMLElement;
|
private closeButton: HTMLElement;
|
||||||
|
@ -32,14 +33,13 @@ export default class Popup extends EventEmitter implements IPopup {
|
||||||
bindAll(['update', 'onClickClose', 'remove'], this);
|
bindAll(['update', 'onClickClose', 'remove'], this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public addTo(scene: IMarkerScene) {
|
public addTo(scene: Container) {
|
||||||
const mapService = scene.getMapService();
|
this.mapsService = scene.get<IMapService>(TYPES.IMapService);
|
||||||
this.mapservice = mapService;
|
this.mapsService.on('camerachange', this.update);
|
||||||
this.mapservice.on('camerachange', this.update);
|
|
||||||
this.update();
|
this.update();
|
||||||
if (this.popupOption.closeOnClick) {
|
if (this.popupOption.closeOnClick) {
|
||||||
this.timeoutInstance = setTimeout(() => {
|
this.timeoutInstance = setTimeout(() => {
|
||||||
this.mapservice.on('click', this.onClickClose);
|
this.mapsService.on('click', this.onClickClose);
|
||||||
}, 30);
|
}, 30);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
@ -62,9 +62,15 @@ export default class Popup extends EventEmitter implements IPopup {
|
||||||
}
|
}
|
||||||
|
|
||||||
public setLnglat(lngLat: ILngLat): this {
|
public setLnglat(lngLat: ILngLat): this {
|
||||||
this.lngLat = lngLat;
|
this.lngLat = lngLat as ILngLat;
|
||||||
if (this.mapservice) {
|
if (Array.isArray(lngLat)) {
|
||||||
this.mapservice.on('camerachange', this.update);
|
this.lngLat = {
|
||||||
|
lng: lngLat[0],
|
||||||
|
lat: lngLat[1],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (this.mapsService) {
|
||||||
|
this.mapsService.on('camerachange', this.update);
|
||||||
}
|
}
|
||||||
this.update();
|
this.update();
|
||||||
return this;
|
return this;
|
||||||
|
@ -99,18 +105,18 @@ export default class Popup extends EventEmitter implements IPopup {
|
||||||
this.removeDom(this.container);
|
this.removeDom(this.container);
|
||||||
delete this.container;
|
delete this.container;
|
||||||
}
|
}
|
||||||
if (this.mapservice) {
|
if (this.mapsService) {
|
||||||
// TODO: mapbox AMap 事件同步
|
// TODO: mapbox AMap 事件同步
|
||||||
this.mapservice.off('camerachange', this.update);
|
this.mapsService.off('camerachange', this.update);
|
||||||
this.mapservice.off('click', this.onClickClose);
|
this.mapsService.off('click', this.onClickClose);
|
||||||
delete this.mapservice;
|
delete this.mapsService;
|
||||||
}
|
}
|
||||||
clearTimeout(this.timeoutInstance);
|
clearTimeout(this.timeoutInstance);
|
||||||
this.emit('close');
|
this.emit('close');
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public isOpen() {
|
public isOpen() {
|
||||||
return !!this.mapservice;
|
return !!this.mapsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
private createContent() {
|
private createContent() {
|
||||||
|
@ -166,10 +172,10 @@ export default class Popup extends EventEmitter implements IPopup {
|
||||||
private update() {
|
private update() {
|
||||||
const hasPosition = this.lngLat;
|
const hasPosition = this.lngLat;
|
||||||
const { className, maxWidth, anchor } = this.popupOption;
|
const { className, maxWidth, anchor } = this.popupOption;
|
||||||
if (!this.mapservice || !hasPosition || !this.content) {
|
if (!this.mapsService || !hasPosition || !this.content) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const markerContainer = this.mapservice.getMarkerContainer();
|
const markerContainer = this.mapsService.getMarkerContainer();
|
||||||
if (!this.container && markerContainer) {
|
if (!this.container && markerContainer) {
|
||||||
this.container = this.creatDom(
|
this.container = this.creatDom(
|
||||||
'div',
|
'div',
|
||||||
|
@ -198,12 +204,12 @@ export default class Popup extends EventEmitter implements IPopup {
|
||||||
}
|
}
|
||||||
|
|
||||||
private updatePosition() {
|
private updatePosition() {
|
||||||
if (!this.mapservice) {
|
if (!this.mapsService) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { lng, lat } = this.lngLat;
|
const { lng, lat } = this.lngLat;
|
||||||
const { offsets } = this.popupOption;
|
const { offsets } = this.popupOption;
|
||||||
const pos = this.mapservice.lngLatToContainer([lng, lat]);
|
const pos = this.mapsService.lngLatToContainer([lng, lat]);
|
||||||
this.container.style.left = pos.x + offsets[0] + 'px';
|
this.container.style.left = pos.x + offsets[0] + 'px';
|
||||||
this.container.style.top = pos.y - offsets[1] + 'px';
|
this.container.style.top = pos.y - offsets[1] + 'px';
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"inversify-inject-decorators": "^3.1.0",
|
"inversify-inject-decorators": "^3.1.0",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
"mapbox-gl": "^1.2.1",
|
|
||||||
"merge-json-schemas": "^1.0.0",
|
"merge-json-schemas": "^1.0.0",
|
||||||
"probe.gl": "^3.1.1",
|
"probe.gl": "^3.1.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
|
@ -39,7 +38,6 @@
|
||||||
"viewport-mercator-project": "^6.2.1"
|
"viewport-mercator-project": "^6.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/amap-js-api": "^1.4.6",
|
|
||||||
"@types/gl-matrix": "^2.4.5",
|
"@types/gl-matrix": "^2.4.5",
|
||||||
"@types/hammerjs": "^2.0.36",
|
"@types/hammerjs": "^2.0.36",
|
||||||
"@types/lodash": "^4.14.138",
|
"@types/lodash": "^4.14.138",
|
||||||
|
|
|
@ -43,7 +43,7 @@ export * from './services/asset/IIconService';
|
||||||
export * from './services/asset/IFontService';
|
export * from './services/asset/IFontService';
|
||||||
export * from './services/component/IControlService';
|
export * from './services/component/IControlService';
|
||||||
export * from './services/component/IMarkerService';
|
export * from './services/component/IMarkerService';
|
||||||
export * from './services/component/IPopUpService';
|
export * from './services/component/IPopupService';
|
||||||
export * from './services/log/ILogService';
|
export * from './services/log/ILogService';
|
||||||
export * from './services/interaction/IInteractionService';
|
export * from './services/interaction/IInteractionService';
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ import FontService from './services/asset/FontService';
|
||||||
import IconService from './services/asset/IconService';
|
import IconService from './services/asset/IconService';
|
||||||
import CameraService from './services/camera/CameraService';
|
import CameraService from './services/camera/CameraService';
|
||||||
import ControlService from './services/component/ControlService';
|
import ControlService from './services/component/ControlService';
|
||||||
|
import MarkerService from './services/component/MarkerService';
|
||||||
|
import PopupService from './services/component/PopupService';
|
||||||
import GlobalConfigService from './services/config/ConfigService';
|
import GlobalConfigService from './services/config/ConfigService';
|
||||||
import CoordinateSystemService from './services/coordinate/CoordinateSystemService';
|
import CoordinateSystemService from './services/coordinate/CoordinateSystemService';
|
||||||
import InteractionService from './services/interaction/InteractionService';
|
import InteractionService from './services/interaction/InteractionService';
|
||||||
|
@ -38,6 +40,8 @@ import SceneService from './services/scene/SceneService';
|
||||||
import ShaderModuleService from './services/shader/ShaderModuleService';
|
import ShaderModuleService from './services/shader/ShaderModuleService';
|
||||||
|
|
||||||
/** PostProcessing passes */
|
/** PostProcessing passes */
|
||||||
|
import { IMarkerService } from './services/component/IMarkerService';
|
||||||
|
import { IPopupService } from './services/component/IPopupService';
|
||||||
import {
|
import {
|
||||||
IMultiPassRenderer,
|
IMultiPassRenderer,
|
||||||
IPass,
|
IPass,
|
||||||
|
@ -181,6 +185,15 @@ export function createSceneContainer() {
|
||||||
.bind<IControlService>(TYPES.IControlService)
|
.bind<IControlService>(TYPES.IControlService)
|
||||||
.to(ControlService)
|
.to(ControlService)
|
||||||
.inSingletonScope();
|
.inSingletonScope();
|
||||||
|
sceneContainer
|
||||||
|
.bind<IMarkerService>(TYPES.IMarkerService)
|
||||||
|
.to(MarkerService)
|
||||||
|
.inSingletonScope();
|
||||||
|
|
||||||
|
sceneContainer
|
||||||
|
.bind<IPopupService>(TYPES.IPopupService)
|
||||||
|
.to(PopupService)
|
||||||
|
.inSingletonScope();
|
||||||
|
|
||||||
// 绑定常规 passes
|
// 绑定常规 passes
|
||||||
sceneContainer
|
sceneContainer
|
||||||
|
|
|
@ -1,26 +1,36 @@
|
||||||
import { DOM } from '@antv/l7-utils';
|
import { DOM } from '@antv/l7-utils';
|
||||||
import { Container, injectable } from 'inversify';
|
import { Container, injectable } from 'inversify';
|
||||||
|
import { TYPES } from '../../types';
|
||||||
|
import { IMapService } from '../map/IMapService';
|
||||||
import {
|
import {
|
||||||
IControl,
|
IControl,
|
||||||
IControlCorners,
|
IControlCorners,
|
||||||
IControlService,
|
IControlService,
|
||||||
IControlServiceCfg,
|
IControlServiceCfg,
|
||||||
} from './IControlService';
|
} from './IControlService';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export default class ControlService implements IControlService {
|
export default class ControlService implements IControlService {
|
||||||
public container: HTMLElement;
|
public container: HTMLElement;
|
||||||
public controlCorners: IControlCorners;
|
public controlCorners: IControlCorners;
|
||||||
public controlContainer: HTMLElement;
|
public controlContainer: HTMLElement;
|
||||||
|
public scene: Container;
|
||||||
|
public mapsService: IMapService;
|
||||||
private controls: IControl[] = [];
|
private controls: IControl[] = [];
|
||||||
public init(cfg: IControlServiceCfg) {
|
private unAddControls: IControl[] = [];
|
||||||
|
public init(cfg: IControlServiceCfg, sceneContainer: Container) {
|
||||||
this.container = cfg.container;
|
this.container = cfg.container;
|
||||||
|
this.scene = sceneContainer;
|
||||||
|
this.mapsService = sceneContainer.get<IMapService>(TYPES.IMapService);
|
||||||
this.initControlPos();
|
this.initControlPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
public addControl(ctr: IControl, sceneContainer: Container): void {
|
public addControl(ctr: IControl, sceneContainer: Container): void {
|
||||||
ctr.addTo(sceneContainer); // scene对象
|
const mapsService = sceneContainer.get<IMapService>(TYPES.IMapService);
|
||||||
this.controls.push(ctr);
|
if (mapsService.map) {
|
||||||
|
ctr.addTo(this.scene); // scene对象
|
||||||
|
this.controls.push(ctr);
|
||||||
|
} else {
|
||||||
|
this.unAddControls.push(ctr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public removeControl(ctr: IControl): this {
|
public removeControl(ctr: IControl): this {
|
||||||
const index = this.controls.indexOf(ctr);
|
const index = this.controls.indexOf(ctr);
|
||||||
|
@ -31,6 +41,14 @@ export default class ControlService implements IControlService {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public addControls() {
|
||||||
|
this.unAddControls.forEach((ctr: IControl) => {
|
||||||
|
ctr.addTo(this.scene); // scene对象
|
||||||
|
this.controls.push(ctr);
|
||||||
|
});
|
||||||
|
this.unAddControls = [];
|
||||||
|
}
|
||||||
|
|
||||||
public destroy(): void {
|
public destroy(): void {
|
||||||
for (const ctr of this.controls) {
|
for (const ctr of this.controls) {
|
||||||
ctr.remove();
|
ctr.remove();
|
||||||
|
|
|
@ -26,7 +26,8 @@ export interface IControlService {
|
||||||
container: HTMLElement;
|
container: HTMLElement;
|
||||||
controlCorners: IControlCorners;
|
controlCorners: IControlCorners;
|
||||||
controlContainer: HTMLElement;
|
controlContainer: HTMLElement;
|
||||||
init(cfg: IControlServiceCfg): void;
|
addControls(): void;
|
||||||
|
init(cfg: IControlServiceCfg, sceneContainer: Container): void;
|
||||||
addControl(ctr: IControl, sceneContainer: Container): void;
|
addControl(ctr: IControl, sceneContainer: Container): void;
|
||||||
removeControl(ctr: IControl): void;
|
removeControl(ctr: IControl): void;
|
||||||
destroy(): void;
|
destroy(): void;
|
||||||
|
|
|
@ -1,13 +1,28 @@
|
||||||
import { ILngLat, IMapService } from '../map/IMapService';
|
import { Container, injectable } from 'inversify';
|
||||||
|
import { ILngLat, IMapService, IPoint } from '../map/IMapService';
|
||||||
|
import { IPopup } from './IPopupService';
|
||||||
export interface IMarkerScene {
|
export interface IMarkerScene {
|
||||||
getMapService(): IMapService;
|
getMapService(): IMapService<unknown>;
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IMarkerServiceCfg {
|
||||||
|
container: HTMLElement;
|
||||||
|
}
|
||||||
export interface IMarker {
|
export interface IMarker {
|
||||||
addTo(scene: IMarkerScene): void;
|
addTo(scene: Container): void;
|
||||||
remove(): void;
|
remove(): void;
|
||||||
setLnglat(lngLat: ILngLat): this;
|
setLnglat(lngLat: ILngLat | IPoint): this;
|
||||||
getLnglat(): ILngLat;
|
getLnglat(): ILngLat;
|
||||||
getElement(): HTMLElement;
|
getElement(): HTMLElement;
|
||||||
|
setPopup(popup: IPopup): void;
|
||||||
togglePopup(): this;
|
togglePopup(): this;
|
||||||
}
|
}
|
||||||
|
export interface IMarkerService {
|
||||||
|
container: HTMLElement;
|
||||||
|
addMarker(Marker: IMarker): void;
|
||||||
|
addMarkers(): void;
|
||||||
|
removeMarker(Marker: IMarker): void;
|
||||||
|
init(scene: Container): void;
|
||||||
|
destroy(): void;
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
|
import { Container } from 'inversify';
|
||||||
import { ILngLat, IMapService } from '../map/IMapService';
|
import { ILngLat, IMapService } from '../map/IMapService';
|
||||||
import { IMarkerScene } from './IMarkerService';
|
|
||||||
export interface IPopup {
|
export interface IPopup {
|
||||||
addTo(scene: IMarkerScene): this;
|
addTo(scene: Container): this;
|
||||||
remove(): void;
|
remove(): void;
|
||||||
setLnglat(lngLat: ILngLat): this;
|
setLnglat(lngLat: ILngLat): this;
|
||||||
getLnglat(): ILngLat;
|
getLnglat(): ILngLat;
|
||||||
|
@ -10,3 +11,9 @@ export interface IPopup {
|
||||||
setMaxWidth(maxWidth: string): this;
|
setMaxWidth(maxWidth: string): this;
|
||||||
isOpen(): boolean;
|
isOpen(): boolean;
|
||||||
}
|
}
|
||||||
|
export interface IPopupService {
|
||||||
|
addPopup(popup: IPopup): void;
|
||||||
|
removePopup(popup: IPopup): void;
|
||||||
|
init(scene: Container): void;
|
||||||
|
destroy(): void;
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
import { Container, injectable } from 'inversify';
|
||||||
|
import { TYPES } from '../../types';
|
||||||
|
import { IMapService } from '../map/IMapService';
|
||||||
|
import { IMarker, IMarkerService, IMarkerServiceCfg } from './IMarkerService';
|
||||||
|
|
||||||
|
@injectable()
|
||||||
|
export default class MarkerService implements IMarkerService {
|
||||||
|
public container: HTMLElement;
|
||||||
|
private scene: Container;
|
||||||
|
private mapsService: IMapService;
|
||||||
|
private markers: IMarker[] = [];
|
||||||
|
private unAddMarkers: IMarker[] = [];
|
||||||
|
public addMarker(marker: IMarker): void {
|
||||||
|
if (!this.mapsService.map) {
|
||||||
|
this.unAddMarkers.push(marker);
|
||||||
|
} else {
|
||||||
|
this.markers.push(marker);
|
||||||
|
marker.addTo(this.scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public addMarkers(): void {
|
||||||
|
this.unAddMarkers.forEach((marker: IMarker) => {
|
||||||
|
marker.addTo(this.scene);
|
||||||
|
this.markers.push(marker);
|
||||||
|
});
|
||||||
|
this.unAddMarkers = [];
|
||||||
|
}
|
||||||
|
public removeMarker(marker: IMarker): void {
|
||||||
|
marker.remove();
|
||||||
|
}
|
||||||
|
public init(scene: Container): void {
|
||||||
|
// this.container = cfg.container;
|
||||||
|
this.scene = scene;
|
||||||
|
this.mapsService = scene.get<IMapService>(TYPES.IMapService);
|
||||||
|
}
|
||||||
|
public destroy(): void {
|
||||||
|
this.markers.forEach((marker: IMarker) => {
|
||||||
|
marker.remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
import { Container, injectable } from 'inversify';
|
||||||
|
import { TYPES } from '../../types';
|
||||||
|
import { IMapService } from '../map/IMapService';
|
||||||
|
import { IPopup, IPopupService } from './IPopupService';
|
||||||
|
|
||||||
|
@injectable()
|
||||||
|
export default class PopupService implements IPopupService {
|
||||||
|
private scene: Container;
|
||||||
|
private popup: IPopup;
|
||||||
|
|
||||||
|
public removePopup(popup: IPopup): void {
|
||||||
|
popup.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
public destroy(): void {
|
||||||
|
this.popup.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
public addPopup(popup: IPopup) {
|
||||||
|
this.popup.remove();
|
||||||
|
popup.addTo(this.scene);
|
||||||
|
this.popup = popup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(scene: Container) {
|
||||||
|
this.scene = scene;
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue