Skip to content

Commit 39b7f30

Browse files
committed
【示例】 增加 mbgl webmap 示例 review by zhurc
1 parent d8e934d commit 39b7f30

19 files changed

+184
-59
lines changed

build/deps.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ deps = {
547547
},
548548
},
549549

550-
"Widget":{
550+
"Widget": {
551551
"title": "微件",
552552
"description": "微件模块",
553553
"description_en": "Widget module",
@@ -904,7 +904,7 @@ deps = {
904904
"name": "ol.source.Graphic",
905905
"des": "高效率点图层源",
906906
"des_en": "High efficiency point source"
907-
},{
907+
}, {
908908
"name": "ol.style.CloverShape ",
909909
"des": "高效率点图层源三叶草风格",
910910
"des_en": "Clover style of graphic source"
@@ -921,11 +921,11 @@ deps = {
921921
"name": "ol.source.VectorTileSuperMapRest",
922922
"des": "矢量瓦片图层源",
923923
"des_en": "Vector tile source"
924-
},{
924+
}, {
925925
"name": "ol.supermap.MapboxStyles",
926926
"des": "Mapbox 矢量瓦片风格",
927927
"des_en": "Mapbox vector tile style"
928-
},{
928+
}, {
929929
"name": "ol.supermap.VectorTileStyles",
930930
"des": "矢量瓦片风格",
931931
"des_en": "Vector tile style"
@@ -1017,6 +1017,9 @@ deps = {
10171017

10181018
"mapboxgl": {
10191019
"Mapping": {
1020+
"title": "地图",
1021+
"description": "基础地图模块",
1022+
"description_en": "Basic map module",
10201023
"iPortal": {
10211024
"name": "iPortal webmap",
10221025
"src": ["./src/mapboxgl/mapping/WebMap.js"],

dist/mapboxgl/iclient9-mapboxgl-es6.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74645,7 +74645,7 @@ class WebMap_WebMap extends external_mapboxgl_default.a.Evented {
7464574645
style: {
7464674646
'version': 8,
7464774647
'sources': {},
74648-
"glyphs": 'http://iclsvr.supermap.io/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf',
74648+
// "glyphs": 'http://iclsvr.supermap.io/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf',
7464974649
'layers': []
7465074650
},
7465174651
crs: this.baseProjection,
@@ -75236,6 +75236,7 @@ class WebMap_WebMap extends external_mapboxgl_default.a.Evented {
7523675236
*/
7523775237
_addLabelLayer(layerInfo, features) {
7523875238
let labelStyle = layerInfo.labelStyle;
75239+
7523975240
this.map.addLayer({
7524075241
"id": layerInfo.layerID + 'label',
7524175242
"type": "symbol",
@@ -75251,8 +75252,8 @@ class WebMap_WebMap extends external_mapboxgl_default.a.Evented {
7525175252
},
7525275253
"layout": {
7525375254
"text-field": `{${labelStyle.labelField}}`,
75254-
'text-size': parseFloat(labelStyle.fontSize),
75255-
'text-offset': [labelStyle.offsetX / 10 || 0, labelStyle.offsetY / 10 || 0],
75255+
'text-size': parseFloat(labelStyle.fontSize) || 12,
75256+
'text-offset': labelStyle.offsetX ? [labelStyle.offsetX / 10 || 0, labelStyle.offsetY / 10 || 0] : [0,-1.5],
7525675257
'text-font': ["DIN Offc Pro Italic", "Arial Unicode MS Regular"],
7525775258
'visibility': layerInfo.visible
7525875259
}
@@ -75635,7 +75636,7 @@ class WebMap_WebMap extends external_mapboxgl_default.a.Evented {
7563575636
let paint = {
7563675637
"heatmap-color": color,
7563775638
"heatmap-radius": style.radius + 15,
75638-
'heatmap-intensity': { "base": 1, "stops": [[0, 0], [22, 1]] }
75639+
'heatmap-intensity': { "base": 1, "stops": [[0, 0.8], [22, 1]] }
7563975640
}
7564075641
if (features[0].weight && features.length >= 4) {
7564175642
let weight = [];
@@ -76079,7 +76080,7 @@ class WebMap_WebMap extends external_mapboxgl_default.a.Evented {
7607976080

7608076081
let newObj = {}
7608176082
for (let item in style) {
76082-
if (transTable && transTable[item]) {
76083+
if (transTable[item]) {
7608376084
newObj[transTable[item]] = style[item];
7608476085
}
7608576086
}

dist/mapboxgl/iclient9-mapboxgl-es6.min.js

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

dist/mapboxgl/iclient9-mapboxgl.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53906,7 +53906,7 @@ var WebMap = exports.WebMap = function (_mapboxgl$Evented) {
5390653906
style: {
5390753907
'version': 8,
5390853908
'sources': {},
53909-
"glyphs": 'http://iclsvr.supermap.io/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf',
53909+
// "glyphs": 'http://iclsvr.supermap.io/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf',
5391053910
'layers': []
5391153911
},
5391253912
crs: this.baseProjection,
@@ -54556,6 +54556,7 @@ var WebMap = exports.WebMap = function (_mapboxgl$Evented) {
5455654556
key: '_addLabelLayer',
5455754557
value: function _addLabelLayer(layerInfo, features) {
5455854558
var labelStyle = layerInfo.labelStyle;
54559+
5455954560
this.map.addLayer({
5456054561
"id": layerInfo.layerID + 'label',
5456154562
"type": "symbol",
@@ -54571,8 +54572,8 @@ var WebMap = exports.WebMap = function (_mapboxgl$Evented) {
5457154572
},
5457254573
"layout": {
5457354574
"text-field": '{' + labelStyle.labelField + '}',
54574-
'text-size': parseFloat(labelStyle.fontSize),
54575-
'text-offset': [labelStyle.offsetX / 10 || 0, labelStyle.offsetY / 10 || 0],
54575+
'text-size': parseFloat(labelStyle.fontSize) || 12,
54576+
'text-offset': labelStyle.offsetX ? [labelStyle.offsetX / 10 || 0, labelStyle.offsetY / 10 || 0] : [0, -1.5],
5457654577
'text-font': ["DIN Offc Pro Italic", "Arial Unicode MS Regular"],
5457754578
'visibility': layerInfo.visible
5457854579
}
@@ -54992,7 +54993,7 @@ var WebMap = exports.WebMap = function (_mapboxgl$Evented) {
5499254993
var paint = {
5499354994
"heatmap-color": color,
5499454995
"heatmap-radius": style.radius + 15,
54995-
'heatmap-intensity': { "base": 1, "stops": [[0, 0], [22, 1]] }
54996+
'heatmap-intensity': { "base": 1, "stops": [[0, 0.8], [22, 1]] }
5499654997
};
5499754998
if (features[0].weight && features.length >= 4) {
5499854999
var weight = [];
@@ -55478,7 +55479,7 @@ var WebMap = exports.WebMap = function (_mapboxgl$Evented) {
5547855479

5547955480
var newObj = {};
5548055481
for (var item in style) {
55481-
if (transTable && transTable[item]) {
55482+
if (transTable[item]) {
5548255483
newObj[transTable[item]] = style[item];
5548355484
}
5548455485
}

dist/mapboxgl/iclient9-mapboxgl.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/locales/en-US/resources.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,11 @@ window.examplesResources = {
482482
"title_vectorTileLayerNatural": "Natural Style of SuperMap REST Vector Layer",
483483
"title_vectorTileLayerNight": "Night Style of SuperMap REST Vector Layer",
484484
"title_vectorTileLayerNormal": "Vector Layer of SuperMap REST",
485-
"title_iportalWebMap": "SuperMap iPortal Map",
485+
"title_iportalWebMap_range": "SuperMap iPortal Range Map",
486+
"title_iportalWebMap_heat": "SuperMap iPortal Heat Map",
487+
"title_iportalWebMap_unicode": "SuperMap iPortal Point Style",
488+
"title_iportalWebMap_unique": "SuperMap iPortal Unique Map",
489+
"title_iportalWebMap_label": "SuperMap iPortal Label Map",
486490
"title_earthquakeHeatMapLayer": "Earthquake occurrences(2005-2016)(Classic)",
487491
"title_echartsEarthquake": "Earthquake occurrences(2005-2016)",
488492
"title_l_echartsEarthquake": "Earthquake heat map (2001-2014)",

examples/locales/zh-CN/resources.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,11 @@ window.examplesResources = {
425425
"title_vectorTileLayerNatural": "SuperMap REST 淡雅绿风格矢量底图",
426426
"title_vectorTileLayerNight": "SuperMap REST 月夜风格矢量底图",
427427
"title_vectorTileLayerNormal": "SuperMap REST 矢量瓦片",
428-
"title_iportalWebMap": "SuperMap iPortal地图",
428+
"title_iportalWebMap_range": "SuperMap iPortal 分段专题图",
429+
"title_iportalWebMap_heat": "SuperMap iPortal 热力图",
430+
"title_iportalWebMap_unicode": "SuperMap iPortal 点样式",
431+
"title_iportalWebMap_unique": "SuperMap iPortal 单值专题图",
432+
"title_iportalWebMap_label": "SuperMap iPortal 标签专题图",
429433
"title_earthquakeHeatMapLayer": "2005-2016地震次数(Classic)",
430434
"title_echartsEarthquake": "2005到2016年地震发生情况",
431435
"title_l_echartsEarthquake": "2001年到2014年地震热力图",

examples/mapboxgl/config.js

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,46 @@ var exampleConfig = {
292292
"iPortal": {
293293
name: "iPortal",
294294
name_en: "iPortal",
295+
version: "9.1.1",
295296
content: {
296297
"ip_map": {
297298
name: "地图",
298-
name_en: "Web map",
299+
name_en: "iPortal Web map",
300+
version: "9.1.1",
299301
content: [{
300-
name: "Web Map",
301-
name_en: "Web Map",
302-
thumbnail: "l_iPortalWebmap.png",
303-
fileName: "iPortalWebmap"
302+
name: "分段专题图",
303+
name_en: "Range",
304+
version: "9.1.1",
305+
thumbnail: "iPortalWebmap_range.png",
306+
fileName: "iPortalWebmap_range"
307+
},
308+
{
309+
name: "单值专题图",
310+
name_en: "Unique",
311+
version: "9.1.1",
312+
thumbnail: "iPortalWebmap_unique.png",
313+
fileName: "iPortalWebmap_unique"
314+
},
315+
{
316+
name: "标签专题图",
317+
name_en: "Label",
318+
version: "9.1.1",
319+
thumbnail: "iPortalWebmap_label.png",
320+
fileName: "iPortalWebmap_label"
321+
},
322+
{
323+
name: "热力图",
324+
name_en: "Heat map",
325+
version: "9.1.1",
326+
thumbnail: "iPortalWebmap_heat.png",
327+
fileName: "iPortalWebmap_heat"
328+
},
329+
{
330+
name: "点样式",
331+
name_en: "Point style",
332+
version: "9.1.1",
333+
thumbnail: "iPortalWebmap_unicode.png",
334+
fileName: "iPortalWebmap_unicode"
304335
}]
305336
}
306337
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--********************************************************************
2+
* Copyright© 2000 - 2018 SuperMap Software Co.Ltd. All rights reserved.
3+
*********************************************************************-->
4+
<!DOCTYPE html>
5+
<html style=" width: 100%;height: 100%;">
6+
<head>
7+
<meta charset="UTF-8">
8+
<title data-i18n="resources.title_iportalWebMap_heat"></title>
9+
<script type="text/javascript" src="../js/include-web.js"></script>
10+
<script type="text/javascript" include='convert,jsonsql,canvg,geostats,mapbox-gl-enhance' src="../../dist/mapboxgl/include-mapboxgl.js"></script>
11+
</head>
12+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height: 100%">
13+
<div id="map" style="width: 100%;height:100%"></div>
14+
<script type="text/javascript">
15+
new mapboxgl.supermap.WebMap(1272150945 ,{
16+
target:'map',
17+
server:'http://support.supermap.com.cn:8092/'
18+
});
19+
</script>
20+
</body>

examples/mapboxgl/iPortalWebmap.html renamed to examples/mapboxgl/iPortalWebmap_label.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<html style=" width: 100%;height: 100%;">
66
<head>
77
<meta charset="UTF-8">
8-
<title data-i18n="resources.title_iportalWebMap"></title>
8+
<title data-i18n="resources.title_iportalWebMap_label"></title>
99
<script type="text/javascript" src="../js/include-web.js"></script>
1010
<script type="text/javascript" include='convert,jsonsql,canvg,geostats,mapbox-gl-enhance' src="../../dist/mapboxgl/include-mapboxgl.js"></script>
1111
</head>
1212
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height: 100%">
1313
<div id="map" style="width: 100%;height:100%"></div>
1414
<script type="text/javascript">
15-
new mapboxgl.supermap.WebMap(750216161,{
15+
new mapboxgl.supermap.WebMap(429988488,{
1616
target:'map',
1717
server:'http://support.supermap.com.cn:8092/'
1818
});

0 commit comments

Comments
 (0)