|
@@ -1,10 +1,10 @@
|
|
-import { onMount } from "solid-js";
|
|
|
|
|
|
+import { onMount, refetchResources } from "solid-js";
|
|
import { Scene, PointLayer, PolygonLayer, LineLayer, Marker } from '@antv/l7';
|
|
import { Scene, PointLayer, PolygonLayer, LineLayer, Marker } from '@antv/l7';
|
|
import { Mapbox } from '@antv/l7-maps';
|
|
import { Mapbox } from '@antv/l7-maps';
|
|
// import { GaodeMap } from '@antv/l7-maps';
|
|
// import { GaodeMap } from '@antv/l7-maps';
|
|
// import DataSet from '@antv/data-set';
|
|
// import DataSet from '@antv/data-set';
|
|
|
|
|
|
-// import json from "../../../assets/file/100000_full.json"
|
|
|
|
|
|
+import json from "../../../assets/file/100000_full.json"
|
|
|
|
|
|
import utils from "../../../utils/index"
|
|
import utils from "../../../utils/index"
|
|
import config from "../../../base/config"
|
|
import config from "../../../base/config"
|
|
@@ -61,23 +61,23 @@ function Map(prop) {
|
|
// map: new GaodeMap({
|
|
// map: new GaodeMap({
|
|
// style: 'blank',
|
|
// style: 'blank',
|
|
// pitch: 50,
|
|
// pitch: 50,
|
|
- // zoom: 3,
|
|
|
|
|
|
+ // center: [108.2, 35],
|
|
|
|
+ // zoom: 2,
|
|
// maxZoom: 7,
|
|
// maxZoom: 7,
|
|
// minZoom: 7,
|
|
// minZoom: 7,
|
|
// token: config.gaodeToken
|
|
// token: config.gaodeToken
|
|
// })
|
|
// })
|
|
map: new Mapbox({
|
|
map: new Mapbox({
|
|
- pitch: 40,
|
|
|
|
|
|
+ pitch: 80,
|
|
|
|
+ center: [108.2, 35],
|
|
style: 'blank',
|
|
style: 'blank',
|
|
zoom: 5.6,
|
|
zoom: 5.6,
|
|
- rotateEnable: true,
|
|
|
|
-
|
|
|
|
|
|
+ minZoom: 5.6,
|
|
})
|
|
})
|
|
});
|
|
});
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ scene.setMapStatus({ dragEnable: false });
|
|
scene.on('loaded', () => {
|
|
scene.on('loaded', () => {
|
|
- scene.setCenter([108.2, 35])
|
|
|
|
|
|
+
|
|
// 获取地理/天气信息
|
|
// 获取地理/天气信息
|
|
// AMap.convertFrom([prop.Geography.longitude, prop.Geography.latitude], 'gps', function (status, result) {
|
|
// AMap.convertFrom([prop.Geography.longitude, prop.Geography.latitude], 'gps', function (status, result) {
|
|
// if (result.info !== 'ok') return
|
|
// if (result.info !== 'ok') return
|
|
@@ -88,7 +88,6 @@ function Map(prop) {
|
|
// });
|
|
// });
|
|
getMapfull().then(data => {
|
|
getMapfull().then(data => {
|
|
li = data && data.features && data.features.length ? data.features : [];
|
|
li = data && data.features && data.features.length ? data.features : [];
|
|
- console.log(prop.li)
|
|
|
|
for (let i = 0; i < li.length; i++) {
|
|
for (let i = 0; i < li.length; i++) {
|
|
const v = li[i].properties || { center: [] };
|
|
const v = li[i].properties || { center: [] };
|
|
const Data = {
|
|
const Data = {
|
|
@@ -111,13 +110,14 @@ function Map(prop) {
|
|
.color('backgoundColor')
|
|
.color('backgoundColor')
|
|
.size(42);
|
|
.size(42);
|
|
// 上层线条
|
|
// 上层线条
|
|
- const lineUp = new LineLayer({ zIndex: 3, blend: "normal" })
|
|
|
|
|
|
+ const lineUp = new LineLayer({ zIndex: 2, blend: "normal" })
|
|
.source(data)
|
|
.source(data)
|
|
.shape('line')
|
|
.shape('line')
|
|
.color('rgb(0,255,255)')
|
|
.color('rgb(0,255,255)')
|
|
.size(0.5)
|
|
.size(0.5)
|
|
.style({
|
|
.style({
|
|
- raisingHeight: 150000
|
|
|
|
|
|
+ raisingHeight: 150000,
|
|
|
|
+ opacity: 0.8,
|
|
})
|
|
})
|
|
.animate({
|
|
.animate({
|
|
interval: 1, // 间隔
|
|
interval: 1, // 间隔
|
|
@@ -126,12 +126,11 @@ function Map(prop) {
|
|
});
|
|
});
|
|
// 围栏
|
|
// 围栏
|
|
const bottomLayer = new LineLayer({ zIndex: 0, blend: "normal" })
|
|
const bottomLayer = new LineLayer({ zIndex: 0, blend: "normal" })
|
|
- .source(data)
|
|
|
|
|
|
+ .source(json)
|
|
.shape('wall')
|
|
.shape('wall')
|
|
- .color('rgb(0,255,255)')
|
|
|
|
|
|
+ .color('rgb(255,255,255)')
|
|
.size(10)
|
|
.size(10)
|
|
.style({
|
|
.style({
|
|
- raisingHeight: 0,
|
|
|
|
heightfixed: true,
|
|
heightfixed: true,
|
|
opacity: 1,
|
|
opacity: 1,
|
|
sourceColor: '#0DCCFF',
|
|
sourceColor: '#0DCCFF',
|
|
@@ -141,16 +140,17 @@ function Map(prop) {
|
|
.source(data)
|
|
.source(data)
|
|
.size(150000)
|
|
.size(150000)
|
|
.shape('extrude')
|
|
.shape('extrude')
|
|
- .color("name", cli)
|
|
|
|
|
|
+ .color("#3194fb")
|
|
|
|
+ // .color("name", cli)
|
|
.style({
|
|
.style({
|
|
heightfixed: true,
|
|
heightfixed: true,
|
|
pickLight: true,
|
|
pickLight: true,
|
|
- raisingHeight: 10000,
|
|
|
|
- opacity: 0.8
|
|
|
|
|
|
+ raisingHeight: 0,
|
|
|
|
+ opacity: 0.8,
|
|
});
|
|
});
|
|
|
|
|
|
// 水波
|
|
// 水波
|
|
- const waveLayer = new PointLayer({ zIndex: 3, blend: 'normal' })
|
|
|
|
|
|
+ const waveLayer = new PointLayer({ zIndex: 2, blend: 'normal' })
|
|
.source(source,
|
|
.source(source,
|
|
{
|
|
{
|
|
parser: {
|
|
parser: {
|
|
@@ -164,11 +164,13 @@ function Map(prop) {
|
|
.color("name", cli)
|
|
.color("name", cli)
|
|
.size('size', v => {
|
|
.size('size', v => {
|
|
let p = v / source[0].size;
|
|
let p = v / source[0].size;
|
|
- // p < 0.4 ? p = (p + 0.2).toFixed(2) - 0 : '';
|
|
|
|
- return p * 100
|
|
|
|
|
|
+ p < 0.3 ? p = (p + 0.2).toFixed(2) - 0 : '';
|
|
|
|
+ return 30
|
|
})
|
|
})
|
|
.animate(true)
|
|
.animate(true)
|
|
- .style({});
|
|
|
|
|
|
+ .style({
|
|
|
|
+ raisingHeight: 150000,
|
|
|
|
+ });
|
|
|
|
|
|
// 柱子
|
|
// 柱子
|
|
const barLayer = new PointLayer({ zIndex: 2, depth: false })
|
|
const barLayer = new PointLayer({ zIndex: 2, depth: false })
|
|
@@ -186,12 +188,12 @@ function Map(prop) {
|
|
.color("name", cli)
|
|
.color("name", cli)
|
|
.size('size', v => {
|
|
.size('size', v => {
|
|
let p = v / source[0].size;
|
|
let p = v / source[0].size;
|
|
- // p < 0.4 ? p = (p + 0.2).toFixed(2) - 0 : '';
|
|
|
|
- return [5, 5, p * 300]
|
|
|
|
|
|
+ p < 0.3 ? p = (p + 0.2).toFixed(2) - 0 : '';
|
|
|
|
+ return [5, 5, p * 100]
|
|
})
|
|
})
|
|
.animate(true)
|
|
.animate(true)
|
|
.style({
|
|
.style({
|
|
- raisingHeight: 200000,
|
|
|
|
|
|
+ raisingHeight: 150000,
|
|
opacityLinear: {
|
|
opacityLinear: {
|
|
enable: true, // true - false
|
|
enable: true, // true - false
|
|
dir: 'up' // up - down
|
|
dir: 'up' // up - down
|