Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
C
country-energy-ecological-construction
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
范加坤
country-energy-ecological-construction
Commits
169114c1
Commit
169114c1
authored
Aug 02, 2021
by
吕超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改省名字图层
parent
0d342b95
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
638 additions
and
16 deletions
+638
-16
.env.development
.env.development
+0
-2
.env.production
.env.production
+1
-3
Map.vue
src/components/Map/Map.vue
+14
-11
province_point.json
src/components/Map/config/province_point.json
+623
-0
No files found.
.env.development
View file @
169114c1
NODE_ENV=development
NODE_ENV=development
VUE_APP_MAP_INIT_STYLE=http://39.104.87.15/api/tileset
VUE_APP_MAP_INIT_STYLE=http://39.104.87.15/api/tileset
VUE_APP_YGYX_URL=http://39.104.87.15/api/rasterviz
VUE_APP_BASE_MAP_URL=http://39.104.87.15/api/basemap/style/
VUE_APP_BASE_URL=http://39.104.87.15
VUE_APP_BASE_URL=http://39.104.87.15
DECIMAL_NUMBER=4
DECIMAL_NUMBER=4
\ No newline at end of file
.env.production
View file @
169114c1
NODE_ENV=development
NODE_ENV=development
VUE_APP_MAP_INIT_STYLE=http://localhost/api/tileset
VUE_APP_MAP_INIT_STYLE=http://39.104.87.15/api/tileset
VUE_APP_YGYX_URL=http://localhost/api/rasterviz
VUE_APP_BASE_MAP_URL=http://localhost/api/basemap/style/
VUE_APP_BASE_URL=http://39.104.87.15
VUE_APP_BASE_URL=http://39.104.87.15
DECIMAL_NUMBER=4
DECIMAL_NUMBER=4
\ No newline at end of file
src/components/Map/Map.vue
View file @
169114c1
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
import
mapboxgl
from
"mapbox-gl"
;
import
mapboxgl
from
"mapbox-gl"
;
import
{
register
}
from
"./config/map.js"
;
import
{
register
}
from
"./config/map.js"
;
import
style
from
"./config/index.js"
;
import
style
from
"./config/index.js"
;
import
provincePoint
from
"./config/province_point.json"
;
export
default
{
export
default
{
props
:
{
props
:
{
center
:
{
center
:
{
...
@@ -76,6 +77,7 @@ export default {
...
@@ -76,6 +77,7 @@ export default {
map
.
addLayer
(
item
);
map
.
addLayer
(
item
);
});
});
await
this
.
addProvinceLayer
();
await
this
.
addProvinceLayer
();
await
this
.
addProvincePoint
();
this
.
$emit
(
"onload"
,
map
);
this
.
$emit
(
"onload"
,
map
);
});
});
},
},
...
@@ -98,24 +100,25 @@ export default {
...
@@ -98,24 +100,25 @@ export default {
"fill-color"
:
"rgba(0, 0, 0, 0)"
,
"fill-color"
:
"rgba(0, 0, 0, 0)"
,
},
},
});
});
},
addProvincePoint
()
{
this
.
map
.
addSource
(
"__province_point"
,
{
type
:
"geojson"
,
data
:
provincePoint
,
});
this
.
map
.
addLayer
({
this
.
map
.
addLayer
({
id
:
"__province_title"
,
id
:
"__province_point"
,
source
:
"__province_point"
,
type
:
"symbol"
,
type
:
"symbol"
,
source
:
"area_title"
,
"source-layer"
:
"province"
,
layout
:
{
"text-font"
:
[
"open-sans"
],
"text-field"
:
"{PXZQMC}"
,
"text-size"
:
16
,
"text-max-width"
:
5
,
},
// maxzoom: 7,
// minzoom: 1,
paint
:
{
paint
:
{
"text-color"
:
"#fff"
,
"text-color"
:
"#fff"
,
"text-halo-color"
:
"#000"
,
"text-halo-color"
:
"#000"
,
"text-halo-width"
:
1
,
"text-halo-width"
:
1
,
},
},
layout
:
{
"text-field"
:
[
"get"
,
"P_XZQMC"
],
"text-size"
:
15
,
},
});
});
},
},
},
},
...
...
src/components/Map/config/province_point.json
0 → 100755
View file @
169114c1
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment