Skip to content

Commit 3a549c1

Browse files
新增图层管理组件例子 review bu songym
1 parent f04d502 commit 3a549c1

File tree

9 files changed

+5812
-1580
lines changed

9 files changed

+5812
-1580
lines changed

dist/mapboxgl/iclient-mapboxgl-vue.css

Lines changed: 3005 additions & 160 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mapboxgl/iclient-mapboxgl-vue.js

Lines changed: 2649 additions & 1407 deletions
Large diffs are not rendered by default.

dist/mapboxgl/iclient-mapboxgl-vue.min.css

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mapboxgl/iclient-mapboxgl-vue.min.js

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<!--********************************************************************
2+
* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved.
3+
*********************************************************************-->
4+
<!DOCTYPE html>
5+
<html>
6+
<head>
7+
<meta charset="UTF-8" />
8+
<title data-i18n="resources.title_componentsLayerManager_vue"></title>
9+
<script type="text/javascript" include="vue" src="../js/include-web.js"></script>
10+
<script
11+
include="ant-design-vue,iclient-mapboxgl-vue,mapbox-gl-enhance"
12+
src="../../dist/mapboxgl/include-mapboxgl.js"
13+
></script>
14+
<style>
15+
#main {
16+
margin: 0 auto;
17+
width: 100%;
18+
height: 100%;
19+
}
20+
</style>
21+
</head>
22+
23+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
24+
<div id="main">
25+
<sm-web-map :map-options="mapOptions">
26+
<!-- 图层管理组件:sm-layer-manager -->
27+
<sm-layer-manager
28+
position="top-left"
29+
:collapsed="false"
30+
:layers="layers"
31+
:default-expand-all="true"
32+
></sm-layer-manager>
33+
</sm-web-map>
34+
</div>
35+
<script>
36+
new Vue({
37+
el: '#main',
38+
data() {
39+
var host = window.isLocal ? window.server : 'https://iserver.supermap.io';
40+
var attribution =
41+
"<a href='https://www.mapbox.com/about/maps/' target='_blank'>© Mapbox </a>" +
42+
" with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a> | </span>" +
43+
" Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> ";
44+
return {
45+
layers: [
46+
{
47+
title: '直辖市',
48+
children: [
49+
{
50+
title: '上海',
51+
mapInfo: {
52+
serverUrl: 'https://www.supermapol.com/',
53+
mapId: 394538195,
54+
layerFilter: function(layer) {
55+
if (layer.name === '上海_县级行政区划图@公众数据') {
56+
return true;
57+
}
58+
return false;
59+
}
60+
}
61+
},
62+
{
63+
title: '天津',
64+
mapInfo: {
65+
serverUrl: 'https://www.supermapol.com/',
66+
mapId: 849848633,
67+
layerFilter: function(layer) {
68+
if (layer.name === '天津_县级行政区划图@公众数据') {
69+
return true;
70+
}
71+
return false;
72+
}
73+
}
74+
},
75+
{
76+
title: '北京',
77+
mapInfo: {
78+
serverUrl: 'https://www.supermapol.com/',
79+
mapId: 1837435007,
80+
layerFilter: function(layer) {
81+
if (layer.name === '北京_县级行政区划图@公众数据') {
82+
return true;
83+
}
84+
return false;
85+
}
86+
}
87+
},
88+
{
89+
title: '重庆',
90+
mapInfo: {
91+
serverUrl: 'https://www.supermapol.com/',
92+
mapId: 1589273415,
93+
layerFilter: function(layer) {
94+
if (layer.name === '重庆_县级行政区划图@公众数据') {
95+
return true;
96+
}
97+
return false;
98+
}
99+
}
100+
}
101+
]
102+
}
103+
],
104+
mapOptions: {
105+
container: 'map', // container id
106+
style: {
107+
version: 8,
108+
sources: {
109+
'raster-tiles': {
110+
attribution: attribution,
111+
type: 'raster',
112+
tiles: [host + '/iserver/services/map-china400/rest/maps/ChinaDark'],
113+
rasterSource: 'iserver',
114+
tileSize: 256
115+
}
116+
},
117+
layers: [
118+
{
119+
id: 'simple-tiles',
120+
type: 'raster',
121+
source: 'raster-tiles',
122+
minzoom: 0,
123+
maxzoom: 22
124+
}
125+
]
126+
},
127+
center: [113.91814841850453, 34.946821449424775], // starting position
128+
zoom: 5.39 // starting zoom
129+
}
130+
};
131+
}
132+
});
133+
</script>
134+
</body>
135+
</html>

examples/component/config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ var exampleConfig = {
137137
version: '10.0.0',
138138
thumbnail: 'components_identify_vue.png',
139139
fileName: 'components_identify_vue'
140+
},
141+
{
142+
name: '图层管理',
143+
name_en: 'Layer Manager',
144+
version: '10.0.1',
145+
thumbnail: 'components_layerManager_vue.png',
146+
fileName: 'components_layerManager_vue'
140147
}
141148
]
142149
},
10.7 KB
Loading

examples/locales/en-US/resources.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ window.examplesResources = {
630630
"title_componentsBorder_Vue": 'Border component',
631631
"title_componentsIdentify_Vue": 'Identify component(Vue)',
632632
"title_componentsPopup_Vue": 'Popup(Vue)',
633+
"title_componentsLayerManager_vue": 'LayerManager component(Vue)',
633634
"title_componentsWebmap_React": 'iPortal Map component(React)',
634635
"title_componentsMap_React": 'iServer Map component(React)',
635636
"title_componentsRasterTile_React": 'Raster Layer component(React)',

examples/locales/zh-CN/resources.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ window.examplesResources = {
581581
"title_componentsTianditu_switch_Vue": '天地图切换',
582582
"title_componentsTianditu_home_Vue": '天地图首页',
583583
"title_componentsPopup_Vue": '弹窗(Vue)',
584+
"title_componentsLayerManager_vue": '图层管理组件',
584585
"title_componentsWebmap_React": 'iPortal地图',
585586
"title_componentsMap_React": 'iServer地图',
586587
"title_componentsRasterTile_React": '栅格图层组件',

0 commit comments

Comments
 (0)