mirror of https://gitee.com/antv-l7/antv-l7
fix: lint error
This commit is contained in:
parent
ce46dd0870
commit
eb013e3230
|
@ -57,7 +57,7 @@ import { MapboxScene } from '@antv/l7-react';
|
|||
|
||||
| option | Type | Default | Description |
|
||||
| -------- | ---------- | ------------------ | --------------------------------------------------------------------------------------------------------------- |
|
||||
| style | `string` | `light` | 地图样式 `dark|light|normal|blank` L7 默认提供四种样式,同时也支持自定义样式 |
|
||||
| style | `string` | `light` | 地图样式 `dark | light | normal | blank` L7 默认提供四种样式,同时也支持自定义样式 |
|
||||
| token | `string` | `Required` | 地图密钥,需要平台申请 |
|
||||
| plugin | `string[]` | `null` | 高德地图[API 插件](https://lbs.amap.com/api/javascript-api/guide/abc/plugins) `['AMap.ToolBar','AMap.Driving']` |
|
||||
| center | `number` | null | 地图中心点 |
|
||||
|
@ -76,12 +76,12 @@ Mapbox Map 地图配置项 [配置项](https://docs.mapbox.com/mapbox-gl-js/api/
|
|||
|
||||
### scene option
|
||||
|
||||
| option | Type | Default | Description |
|
||||
| --------------------- | --------- | ------------ | --------------------------------------------------- |
|
||||
| logoPosition | string | `bottomleft` | logo 位置 `bottomright|topright|bottomleft|topleft` |
|
||||
| logoVisible | `boolean` | `true` | 是否显示 logo |
|
||||
| antialias | `boolean` | `true` | 是否开启抗锯齿 |
|
||||
| preserveDrawingBuffer | `boolean` | `false` | 是否保留缓冲区数据 |
|
||||
| option | Type | Default | Description |
|
||||
| --------------------- | --------- | ------------ | --------------------------------------------------------- |
|
||||
| logoPosition | string | `bottomleft` | logo 位置 `bottomright | topright | bottomleft | topleft` |
|
||||
| logoVisible | `boolean` | `true` | 是否显示 logo |
|
||||
| antialias | `boolean` | `true` | 是否开启抗锯齿 |
|
||||
| preserveDrawingBuffer | `boolean` | `false` | 是否保留缓冲区数据 |
|
||||
|
||||
### 获取 scene 对象
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ import { MapboxScene } from '@antv/l7-react';
|
|||
|
||||
| option | Type | Default | Description |
|
||||
| -------- | ---------- | ------------------ | --------------------------------------------------------------------------------------------------------------- |
|
||||
| style | `string` | `light` | 地图样式 `dark|light|normal|blank` L7 默认提供四种样式,同时也支持自定义样式 |
|
||||
| style | `string` | `light` | 地图样式 `dark | light | normal | blank` L7 默认提供四种样式,同时也支持自定义样式 |
|
||||
| token | `string` | `Required` | 地图密钥,需要平台申请 |
|
||||
| plugin | `string[]` | `null` | 高德地图[API 插件](https://lbs.amap.com/api/javascript-api/guide/abc/plugins) `['AMap.ToolBar','AMap.Driving']` |
|
||||
| center | `number` | null | 地图中心点 |
|
||||
|
@ -76,12 +76,12 @@ Mapbox Map 地图配置项 [配置项](https://docs.mapbox.com/mapbox-gl-js/api/
|
|||
|
||||
### scene option
|
||||
|
||||
| option | Type | Default | Description |
|
||||
| --------------------- | --------- | ------------ | --------------------------------------------------- |
|
||||
| logoPosition | string | `bottomleft` | logo 位置 `bottomright|topright|bottomleft|topleft` |
|
||||
| logoVisible | `boolean` | `true` | 是否显示 logo |
|
||||
| antialias | `boolean` | `true` | 是否开启抗锯齿 |
|
||||
| preserveDrawingBuffer | `boolean` | `false` | 是否保留缓冲区数据 |
|
||||
| option | Type | Default | Description |
|
||||
| --------------------- | --------- | ------------ | --------------------------------------------------------- |
|
||||
| logoPosition | string | `bottomleft` | logo 位置 `bottomright | topright | bottomleft | topleft` |
|
||||
| logoVisible | `boolean` | `true` | 是否显示 logo |
|
||||
| antialias | `boolean` | `true` | 是否开启抗锯齿 |
|
||||
| preserveDrawingBuffer | `boolean` | `false` | 是否保留缓冲区数据 |
|
||||
|
||||
### 获取 scene 对象
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
"@types/node": "13.11.1",
|
||||
"@types/storybook__react": "^4.0.2",
|
||||
"@types/supercluster": "^5.0.1",
|
||||
"antd": "^4.2.4",
|
||||
"antd": "^4.12.3",
|
||||
"awesome-typescript-loader": "^5.2.1",
|
||||
"babel-eslint": "8.2.5",
|
||||
"babel-jest": "^24.9.0",
|
||||
|
|
|
@ -226,7 +226,7 @@ export default class Marker extends EventEmitter {
|
|||
const { lng, lat } = this.lngLat;
|
||||
const bounds = this.mapsService.getBounds();
|
||||
const pos = this.mapsService.lngLatToContainer([lng, lat]);
|
||||
|
||||
|
||||
if (element) {
|
||||
element.style.display = 'block';
|
||||
const container = this.mapsService.getContainer();
|
||||
|
@ -236,21 +236,26 @@ export default class Marker extends EventEmitter {
|
|||
containerWidth = container.scrollWidth;
|
||||
containerHeight = container.scrollHeight;
|
||||
}
|
||||
//当前可视区域包含跨日界线
|
||||
if(Math.abs(bounds[0][0]) > 180 || Math.abs(bounds[1][0]) >180){
|
||||
if(pos.x > containerWidth){
|
||||
// 当前可视区域包含跨日界线
|
||||
if (Math.abs(bounds[0][0]) > 180 || Math.abs(bounds[1][0]) > 180) {
|
||||
if (pos.x > containerWidth) {
|
||||
// 日界线右侧点左移
|
||||
let newPos = this.mapsService.lngLatToContainer([lng - 360, lat]);
|
||||
const newPos = this.mapsService.lngLatToContainer([lng - 360, lat]);
|
||||
pos.x = newPos.x;
|
||||
}
|
||||
if(pos.x < 0){
|
||||
if (pos.x < 0) {
|
||||
// 日界线左侧点右移
|
||||
let newPos = this.mapsService.lngLatToContainer([lng + 360, lat]);
|
||||
const newPos = this.mapsService.lngLatToContainer([lng + 360, lat]);
|
||||
pos.x = newPos.x;
|
||||
}
|
||||
}
|
||||
// 不在当前可视区域内隐藏点
|
||||
if (pos.x > containerWidth || pos.x < 0 || pos.y > containerHeight || pos.y < 0) {
|
||||
if (
|
||||
pos.x > containerWidth ||
|
||||
pos.x < 0 ||
|
||||
pos.y > containerHeight ||
|
||||
pos.y < 0
|
||||
) {
|
||||
element.style.display = 'none';
|
||||
}
|
||||
element.style.left = pos.x + offsets[0] + 'px';
|
||||
|
|
Loading…
Reference in New Issue