Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MyEMS
MyEMS能源管理系统
提交
f5284db4
M
MyEMS能源管理系统
项目概览
MyEMS
/
MyEMS能源管理系统
通知
46
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
MyEMS能源管理系统
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f5284db4
编写于
3月 24, 2024
作者:
nengyuangzhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changed map marker in myems-web
上级
cbe2a3cb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
13 deletion
+21
-13
CHANGELOG.md
CHANGELOG.md
+1
-0
myems-web/src/components/MyEMS/common/CustomizeMapBox.js
myems-web/src/components/MyEMS/common/CustomizeMapBox.js
+20
-13
未找到文件。
CHANGELOG.md
浏览文件 @
f5284db4
...
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
...
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
### Added
-
added hyperlink to meter name of Meter Batch report in myems-web
-
added hyperlink to meter name of Meter Batch report in myems-web
### Changed
### Changed
-
changed map marker in myems-web
### Fixed
### Fixed
-
added decimal data value range check to myems-modbus-tcp.
-
added decimal data value range check to myems-modbus-tcp.
### Removed
### Removed
...
...
myems-web/src/components/MyEMS/common/CustomizeMapBox.js
浏览文件 @
f5284db4
...
@@ -6,6 +6,7 @@ import MapboxLanguage from '@mapbox/mapbox-gl-language';
...
@@ -6,6 +6,7 @@ import MapboxLanguage from '@mapbox/mapbox-gl-language';
import
'
mapbox-gl/dist/mapbox-gl.css
'
;
import
'
mapbox-gl/dist/mapbox-gl.css
'
;
import
{
checkEmpty
,
getCookieValue
}
from
'
../../../helpers/utils
'
;
import
{
checkEmpty
,
getCookieValue
}
from
'
../../../helpers/utils
'
;
import
{
settings
}
from
'
../../../config
'
;
import
{
settings
}
from
'
../../../config
'
;
import
map_maker
from
'
../../../assets/img/icons/map-marker.png
'
;
mapboxgl
.
accessToken
=
settings
.
mapboxToken
;
mapboxgl
.
accessToken
=
settings
.
mapboxToken
;
if
(
mapboxgl
.
getRTLTextPluginStatus
!==
'
loaded
'
)
{
if
(
mapboxgl
.
getRTLTextPluginStatus
!==
'
loaded
'
)
{
...
@@ -37,7 +38,8 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
...
@@ -37,7 +38,8 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
container
:
mapContainer
.
current
,
container
:
mapContainer
.
current
,
zoom
:
Zoom
?
Zoom
:
zoom
,
zoom
:
Zoom
?
Zoom
:
zoom
,
center
:
[
Longitude
?
Longitude
:
lng
,
Latitude
?
Latitude
:
lat
],
center
:
[
Longitude
?
Longitude
:
lng
,
Latitude
?
Latitude
:
lat
],
style
:
isDark
?
'
mapbox://styles/mapbox/dark-v10
'
:
'
mapbox://styles/mapbox/streets-v11
'
// https://docs.mapbox.com/api/maps/styles/#mapbox-styles
style
:
isDark
?
'
mapbox://styles/mapbox/dark-v11
'
:
'
mapbox://styles/mapbox/streets-v12
'
});
});
map
.
current
.
on
(
'
move
'
,
()
=>
{
map
.
current
.
on
(
'
move
'
,
()
=>
{
...
@@ -64,7 +66,7 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
...
@@ -64,7 +66,7 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
container
:
mapContainer
.
current
,
container
:
mapContainer
.
current
,
zoom
:
Zoom
?
Zoom
:
zoom
,
zoom
:
Zoom
?
Zoom
:
zoom
,
center
:
[
Longitude
?
Longitude
:
lng
,
Latitude
?
Latitude
:
lat
],
center
:
[
Longitude
?
Longitude
:
lng
,
Latitude
?
Latitude
:
lat
],
style
:
isDark
?
'
mapbox://styles/mapbox/dark-v1
0
'
:
'
mapbox://styles/mapbox/streets-v11
'
style
:
isDark
?
'
mapbox://styles/mapbox/dark-v1
1
'
:
'
mapbox://styles/mapbox/streets-v12
'
});
});
map
.
current
.
on
(
'
move
'
,
()
=>
{
map
.
current
.
on
(
'
move
'
,
()
=>
{
...
@@ -80,7 +82,14 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
...
@@ -80,7 +82,14 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
map
.
current
.
addControl
(
mapboxLanguage
);
map
.
current
.
addControl
(
mapboxLanguage
);
map
.
current
.
on
(
'
load
'
,
()
=>
{
map
.
current
.
on
(
'
load
'
,
()
=>
{
map
.
current
.
addSource
(
'
earthquakes
'
,
{
map
.
current
.
loadImage
(
map_maker
,
(
error
,
image
)
=>
{
if
(
error
)
throw
error
;
map
.
current
.
addImage
(
'
map-marker
'
,
image
);
}
);
map
.
current
.
addSource
(
'
myems
'
,
{
type
:
'
geojson
'
,
type
:
'
geojson
'
,
data
:
{
data
:
{
type
:
'
FeatureCollection
'
,
type
:
'
FeatureCollection
'
,
...
@@ -94,7 +103,7 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
...
@@ -94,7 +103,7 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
map
.
current
.
addLayer
({
map
.
current
.
addLayer
({
id
:
'
clusters
'
,
id
:
'
clusters
'
,
type
:
'
circle
'
,
type
:
'
circle
'
,
source
:
'
earthquake
s
'
,
source
:
'
myem
s
'
,
filter
:
[
'
has
'
,
'
point_count
'
],
filter
:
[
'
has
'
,
'
point_count
'
],
paint
:
{
paint
:
{
// Use step expressions (https://docs.mapbox.com/style-spec/reference/expressions/#step)
// Use step expressions (https://docs.mapbox.com/style-spec/reference/expressions/#step)
...
@@ -110,7 +119,7 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
...
@@ -110,7 +119,7 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
map
.
current
.
addLayer
({
map
.
current
.
addLayer
({
id
:
'
cluster-count
'
,
id
:
'
cluster-count
'
,
type
:
'
symbol
'
,
type
:
'
symbol
'
,
source
:
'
earthquake
s
'
,
source
:
'
myem
s
'
,
filter
:
[
'
has
'
,
'
point_count
'
],
filter
:
[
'
has
'
,
'
point_count
'
],
layout
:
{
layout
:
{
'
text-field
'
:
[
'
get
'
,
'
point_count_abbreviated
'
],
'
text-field
'
:
[
'
get
'
,
'
point_count_abbreviated
'
],
...
@@ -121,14 +130,12 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
...
@@ -121,14 +130,12 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
map
.
current
.
addLayer
({
map
.
current
.
addLayer
({
id
:
'
unclustered-point
'
,
id
:
'
unclustered-point
'
,
type
:
'
circle
'
,
type
:
'
symbol
'
,
source
:
'
earthquake
s
'
,
source
:
'
myem
s
'
,
filter
:
[
'
!
'
,
[
'
has
'
,
'
point_count
'
]],
filter
:
[
'
!
'
,
[
'
has
'
,
'
point_count
'
]],
paint
:
{
'
layout
'
:
{
'
circle-color
'
:
'
#11b4da
'
,
'
icon-image
'
:
'
map-marker
'
,
'
circle-radius
'
:
10
,
"
icon-size
"
:
0.5
'
circle-stroke-width
'
:
1
,
'
circle-stroke-color
'
:
'
#fff
'
}
}
});
});
...
@@ -138,7 +145,7 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
...
@@ -138,7 +145,7 @@ const CustomizeMapBox = ({ Latitude, Longitude, Zoom, Geojson, t }) => {
layers
:
[
'
clusters
'
]
layers
:
[
'
clusters
'
]
});
});
const
clusterId
=
features
[
0
].
properties
.
cluster_id
;
const
clusterId
=
features
[
0
].
properties
.
cluster_id
;
map
.
current
.
getSource
(
'
earthquake
s
'
).
getClusterExpansionZoom
(
clusterId
,
(
err
,
zoom
)
=>
{
map
.
current
.
getSource
(
'
myem
s
'
).
getClusterExpansionZoom
(
clusterId
,
(
err
,
zoom
)
=>
{
if
(
err
)
return
;
if
(
err
)
return
;
map
.
current
.
easeTo
({
map
.
current
.
easeTo
({
zoom
:
zoom
,
zoom
:
zoom
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录