Skip to content

Commit

Permalink
docs: update maps from extension
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed May 27, 2024
1 parent 2050651 commit afaa51a
Show file tree
Hide file tree
Showing 261 changed files with 296 additions and 320 deletions.
1 change: 1 addition & 0 deletions site/.dumi/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if (window) {
(window as any).g2 = require('@antv/g2');
(window as any).l7 = require('@antv/l7');
(window as any).l7Maps = require('@antv/l7-maps');
(window as any).L7ExtensionMaps = require('@antv/l7-extension-maps');
(window as any).l7plot = require('@antv/l7plot');
(window as any).l7CompositeLayers = require('@antv/l7-composite-layers');
(window as any).l7Draw = require('@antv/l7-draw');
Expand Down
8 changes: 1 addition & 7 deletions site/.dumi/pages/custom/demo/bianjieview.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// https://unpkg.com/[email protected]/data/2023_xian.pbf

// @ts-ignore
import { LineLayer, Scene } from '@antv/l7';
// @ts-ignore
import { Map } from '@antv/l7-maps';
import { LineLayer, Map, Scene } from '@antv/l7';
import { useEffect } from 'react';

export default () => {
// @ts-ignore
useEffect(() => {
const scene = new Scene({
id: 'map',
Expand Down
8 changes: 1 addition & 7 deletions site/.dumi/pages/custom/demo/china.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// https://unpkg.com/[email protected]/data/2023_xian.pbf

// @ts-ignore
import { LineLayer, Scene } from '@antv/l7';
// @ts-ignore
import { Map } from '@antv/l7-maps';
import { LineLayer, Map, Scene } from '@antv/l7';
import { useEffect } from 'react';

export default () => {
// @ts-ignore
useEffect(() => {
const scene = new Scene({
id: 'map',
Expand Down
2 changes: 1 addition & 1 deletion site/.dumi/pages/custom/demo/city.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @ts-ignore
import { PolygonLayer, Scene } from '@antv/l7';
// @ts-ignore
import { GaodeMap } from '@antv/l7-maps';
import { GaodeMap } from '@antv/l7-extension-maps';
import { RDBSource } from 'district-data';
import React, { useEffect } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion site/.dumi/pages/custom/demo/zhejiang.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @ts-ignore
import { PolygonLayer, Scene } from '@antv/l7';
// @ts-ignore
import { GaodeMap } from '@antv/l7-maps';
import { GaodeMap } from '@antv/l7-extension-maps';
import { RDBSource } from 'district-data';
import React, { useEffect } from 'react';

Expand Down
29 changes: 12 additions & 17 deletions site/.dumirc.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
import { defineConfig } from 'dumi';
import path from 'path';

const env = process.env.NODE_ENV;
const GaodeTokenScript =
env === 'production'
? [
` window._AMapSecurityConfig = {
securityJsCode: '2653011adeb04230b3a26cc9a780a800',
}`,
'https://webapi.amap.com/maps?v=2.0&key=f59bcf249433f8b05caaee19f349b3d7',
]
: [
` window._AMapSecurityConfig = {
securityJsCode: "290ddc4b0d33be7bc9b354bc6a4ca614"
}`,
'https://webapi.amap.com/maps?v=2.0&key=6f025e700cbacbb0bb866712d20bb35c',
];
const isProduction = process.env.NODE_ENV === 'production';
const GaodeTokenScript = isProduction
? [
`window._AMapSecurityConfig = { securityJsCode: '2653011adeb04230b3a26cc9a780a800' }`,
'https://webapi.amap.com/maps?v=2.0&key=f59bcf249433f8b05caaee19f349b3d7',
]
: [
` window._AMapSecurityConfig = { securityJsCode: "290ddc4b0d33be7bc9b354bc6a4ca614" }`,
'https://webapi.amap.com/maps?v=2.0&key=6f025e700cbacbb0bb866712d20bb35c',
];

export default defineConfig({
locales: [
{ id: 'zh', name: '中文' },
{ id: 'en', name: 'English' },
],
mfsu: false,
copy: env === 'production' ? ['docs/CNAME'] : [],
copy: isProduction ? ['docs/CNAME'] : [],
// ...(process.env.NODE_ENV === 'development' ? {} : { ssr: {} }),
metas: [
{
Expand Down Expand Up @@ -679,7 +674,7 @@ export default defineConfig({
container: '<div style="height: 80vh;justify-content: center; position: relative" id="map"/>',
dependencies: {
'@antv/l7': 'latest',
'@antv/l7-maps': 'latest',
'@antv/l7-extension-maps': 'latest',
},
},
mdPlayground: {
Expand Down
10 changes: 4 additions & 6 deletions site/docs/api/experiment/earth.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ l7-maps provides`Earth`Maps, compared to AMap and mapbox maps, are a completely
✨ In order to distinguish from ordinary maps, l7-maps provides a brand new`Earth`Map type, L7 provides corresponding`EarthLayer`Layers

```js
import { EarthLayer } from '@antv/l7';
import { Earth } from '@antv/l7-maps';
import { EarthLayer, Earth } from '@antv/l7';
```

## Currently supported layer types in Earth mode
Expand All @@ -38,8 +37,7 @@ import { Earth } from '@antv/l7-maps';

```javascript
// 1. Introduce the corresponding module
import { Scene, Earth } from '@antv/l7-maps';
import { EarthLayer } from '@antv/l7-layers';
import { Scene, Earth, EarthLayer } from '@antv/l7-layers';

// 2. Build Earth Map
const scene = new Scene({
Expand Down Expand Up @@ -89,7 +87,7 @@ As the base map type of l7-maps,`Earth`The camera system of the earth system is
- args:**{}**

```js
import { Scene, Earth } from '@antv/l7-maps';
import { Scene, Earth } from '@antv/l7';

const scene = new Scene({
id: 'map',
Expand All @@ -106,7 +104,7 @@ Provides a simple method to control the rotation of the earth system (actually c
🌟Unit rotation angle = Math.min(this.earthCameraZoom \* this.earthCameraZoom, 1)

```js
import { Scene, Earth } from '@antv/l7-maps';
import { Scene, Earth } from '@antv/l7';

const scene = new Scene({
id: 'map',
Expand Down
10 changes: 4 additions & 6 deletions site/docs/api/experiment/earth.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ l7-maps 提供 `Earth` 地图,相较于高德地图、mapbox 地图,是完
✨ 为了区别普通的地图,l7-maps 提供了全新的 `Earth` 地图类型, L7 提供对应的 `EarthLayer` 图层

```js
import { EarthLayer } from '@antv/l7';
import { Earth } from '@antv/l7-maps';
import { EarthLayer, Earth } from '@antv/l7';
```

## 目前在地球模式下支持的图层类型
Expand All @@ -38,8 +37,7 @@ import { Earth } from '@antv/l7-maps';

```javascript
// 1、引入对应模块
import { Scene, Earth } from '@antv/l7-maps';
import { EarthLayer } from '@antv/l7-layers';
import { Scene, Earth, EarthLayer } from '@antv/l7-layers';

// 2、构建 Earth Map
const scene = new Scene({
Expand Down Expand Up @@ -89,7 +87,7 @@ scene.on('loaded', () => {
- args: **{}**

```js
import { Scene, Earth } from '@antv/l7-maps';
import { Scene, Earth } from '@antv/l7';

const scene = new Scene({
id: 'map',
Expand All @@ -106,7 +104,7 @@ const scene = new Scene({
🌟 单位旋转角度 = Math.min(this.earthCameraZoom \* this.earthCameraZoom, 1)

```js
import { Scene, Earth } from '@antv/l7-maps';
import { Scene, Earth } from '@antv/l7';

const scene = new Scene({
id: 'map',
Expand Down
3 changes: 1 addition & 2 deletions site/docs/api/experiment/simple_coordinates.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ We usually use longitude and latitude to describe geographical location, but in
In order to use a simple coordinate system, we need to use the L7 custom Map map type and specify the version attribute of the map.

```javascript
import { Scene, ImageLayer, PointLayer } from '@antv/l7';
import { Map } from '@antv/l7-maps';
import { Scene, ImageLayer, PointLayer, Map } from '@antv/l7';

const scene = new Scene({
id: 'map',
Expand Down
3 changes: 1 addition & 2 deletions site/docs/api/experiment/simple_coordinates.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ order: 1
为了使用简单坐标系,我们需要是使用 L7 自定义的 Map 地图类型,同时制定 map 的 version 属性

```javascript
import { Scene, ImageLayer, PointLayer } from '@antv/l7';
import { Map } from '@antv/l7-maps';
import { Scene, ImageLayer, PointLayer, Map } from '@antv/l7';

const scene = new Scene({
id: 'map',
Expand Down
4 changes: 2 additions & 2 deletions site/docs/api/map/bmap.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Before using Baidu Maps, you need to apply for a Baidu Map key. How to apply for
### import

```javascript
import { BaiduMap } from '@antv/l7-maps';
import { BaiduMap } from '@antv/l7-extension-maps';
```

### Instantiate
Expand All @@ -34,7 +34,7 @@ It is recommended for new projects to instantiate BaiduMap directly. Existing ma
#### BaiduMap instantiation

```js
import { BaiduMap } from '@antv/l7-maps';
import { BaiduMap } from '@antv/l7-extension-maps';

const scene = new Scene({
id: 'map',
Expand Down
4 changes: 2 additions & 2 deletions site/docs/api/map/bmap.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ L7 目前支持的百度地图是[API GL版本](https://lbsyun.baidu.com/index.p
### import

```javascript
import { BaiduMap } from '@antv/l7-maps';
import { BaiduMap } from '@antv/l7-extension-maps';
```

### 实例化
Expand All @@ -34,7 +34,7 @@ L7 提供 BaiduMap直接实例化地图,也可外部传入方式实例化地
#### BaiduMap 实例化

```js
import { BaiduMap } from '@antv/l7-maps';
import { BaiduMap } from '@antv/l7-extension-maps';

const scene = new Scene({
id: 'map',
Expand Down
5 changes: 2 additions & 3 deletions site/docs/api/map/map.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ L7 internally resolves the differences between different map basemaps, and at th
## import

```javascript
import { Map } from '@antv/l7-maps';
import { Map } from '@antv/l7';
```

## Map instantiation

```ts
import { Scene, PointLayer } from '@antv/l7';
import { Map } from '@antv/l7-maps';
import { Scene, PointLayer, Map } from '@antv/l7';

const scene = new Scene({
id: 'map',
Expand Down
5 changes: 2 additions & 3 deletions site/docs/api/map/map.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ L7 在内部解决了不同地图底图之间差异,同时 L7 层面统一管
## import

```javascript
import { Map } from '@antv/l7-maps';
import { Map } from '@antv/l7';
```

## Map 实例化

```ts
import { Scene, PointLayer } from '@antv/l7';
import { Map } from '@antv/l7-maps';
import { Scene, PointLayer, Map } from '@antv/l7';

const scene = new Scene({
id: 'map',
Expand Down
2 changes: 1 addition & 1 deletion site/docs/api/map/mapbox.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ L7 internally resolves the differences between different map basemaps, and at th

```ts
import { Scene, PointLayer } from '@antv/l7';
import { Mapbox } from '@antv/l7-maps';
import { Mapbox } from '@antv/l7-extension-maps';

const scene = new Scene({
id: 'map',
Expand Down
2 changes: 1 addition & 1 deletion site/docs/api/map/mapbox.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ L7 在内部解决了不同地图底图之间差异,同时 L7 层面统一管

```ts
import { Scene, PointLayer } from '@antv/l7';
import { Mapbox } from '@antv/l7-maps';
import { Mapbox } from '@antv/l7-extension-maps';

const scene = new Scene({
id: 'map',
Expand Down
4 changes: 2 additions & 2 deletions site/docs/api/map/maplibre.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ L7 internally resolves the differences between different map basemaps, and at th

```ts
import { Scene, PointLayer } from '@antv/l7';
import { MapLibre } from '@antv/l7-maps';
import { MapLibre } from '@antv/l7-extension-maps';
const scene = new Scene({
id: 'map',
map: new MapLibre({
Expand All @@ -34,7 +34,7 @@ const scene = new Scene({

```javascript
import { Scene, PointLayer } from '@antv/l7';
import { MapLibre } from '@antv/l7-maps';
import { MapLibre } from '@antv/l7-extension-maps';
var map = new maplibregl.Map({
container: 'map', // container id
style: 'https://demotiles.maplibre.org/style.json', // style URL
Expand Down
4 changes: 2 additions & 2 deletions site/docs/api/map/maplibre.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ L7 在内部解决了不同地图底图之间差异,同时 L7 层面统一管

```ts
import { Scene, PointLayer } from '@antv/l7';
import { MapLibre } from '@antv/l7-maps';
import { MapLibre } from '@antv/l7-extension-maps';
const scene = new Scene({
id: 'map',
map: new MapLibre({
Expand All @@ -34,7 +34,7 @@ const scene = new Scene({

```javascript
import { Scene, PointLayer } from '@antv/l7';
import { MapLibre } from '@antv/l7-maps';
import { MapLibre } from '@antv/l7-extension-maps';
var map = new maplibregl.Map({
container: 'map', // container id
style: 'https://demotiles.maplibre.org/style.json', // style URL
Expand Down
4 changes: 2 additions & 2 deletions site/docs/api/map/tencent.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Before using Tencent Map, you need to register a Tencent Map account and apply f
### import

```javascript
import { TencentMap } from '@antv/l7-maps';
import { TencentMap } from '@antv/l7-extension-maps';
```

## Initialize map

```ts
import { Scene, PointLayer } from '@antv/l7';
import { TencentMap } from '@antv/l7-maps';
import { TencentMap } from '@antv/l7-extension-maps';
const scene = new Scene({
id: 'map',
map: new TencentMap({
Expand Down
4 changes: 2 additions & 2 deletions site/docs/api/map/tencent.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ L7 目前支持的腾讯地图是[JavaScript API GL](https://lbs.qq.com/webApi/j
### import

```javascript
import { TencentMap } from '@antv/l7-maps';
import { TencentMap } from '@antv/l7-extension-maps';
```

## 初始化地图

```ts
import { Scene, PointLayer } from '@antv/l7';
import { TencentMap } from '@antv/l7-maps';
import { TencentMap } from '@antv/l7-extension-maps';
const scene = new Scene({
id: 'map',
map: new TencentMap({
Expand Down
4 changes: 2 additions & 2 deletions site/docs/api/other/city_building.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ time: time milliseconds

```js
import { CityBuildingLayer, Scene } from '@antv/l7';
import { Mapbox } from '@antv/l7-maps';
import { Mapbox } from '@antv/l7-extension-maps';

const scene = new Scene({
id: 'map',
Expand Down Expand Up @@ -92,7 +92,7 @@ scene.on('loaded', () => {

```javascript
import { Scene, CityBuildingLayer } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
import { GaodeMap } from '@antv/l7-extension-maps';

const scene = new Scene({
id: 'map',
Expand Down
4 changes: 2 additions & 2 deletions site/docs/api/other/city_building.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ time : 时间 毫秒

```js
import { CityBuildingLayer, Scene } from '@antv/l7';
import { Mapbox } from '@antv/l7-maps';
import { Mapbox } from '@antv/l7-extension-maps';

const scene = new Scene({
id: 'map',
Expand Down Expand Up @@ -92,7 +92,7 @@ scene.on('loaded', () => {

```javascript
import { Scene, CityBuildingLayer } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
import { GaodeMap } from '@antv/l7-extension-maps';

const scene = new Scene({
id: 'map',
Expand Down
Loading

0 comments on commit afaa51a

Please sign in to comment.