Skip to content

Commit c5102dd

Browse files
committed
[feature] maplibregl支持Web符号
review by zhaoq,qiwei
1 parent 7e7c6d0 commit c5102dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4433
-9
lines changed

build/publish.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ fse.copySync(sourceDir, destDir, {
1111
return !(src.indexOf("include-") >= 0 || src.indexOf("resources") >= 0)
1212
}
1313
});
14-
if (key === 'mapboxgl') {
14+
if (key === 'mapboxgl' || key === 'maplibregl') {
1515
// 拷贝resources文件夹到src/mapboxgl
1616
const source = path.join(__dirname, "../dist/resources");
17-
const target = path.join(__dirname, "../src/mapboxgl/resources");
17+
const target = path.join(__dirname, `../src/${key}/resources`);
1818
fse.removeSync(target);
1919
fse.copySync(source, target);
2020
}

build/webpack.config.maplibregl.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const configBase = require('./webpack.config.base');
33
const libName = 'maplibregl';
44
//产品包名
55
const productName = 'iclient-maplibregl';
6+
//复制文件
7+
const CopyPlugin = require("copy-webpack-plugin");
68

79
module.exports = {
810
target: configBase.target,
@@ -61,5 +63,12 @@ module.exports = {
6163
return moduleRules;
6264
})()
6365
},
64-
plugins: configBase.plugins(libName, productName)
66+
plugins: [
67+
...configBase.plugins(libName, productName),
68+
new CopyPlugin({
69+
patterns: [
70+
{ from: `${__dirname}/../dist/resources/symbols`, to: `${__dirname}/../dist/maplibregl/resources/symbols` }
71+
]
72+
})
73+
]
6574
};

dist/mapboxgl/include-mapboxgl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,5 @@
208208
window.server = document.location.toString().match(/file:\/\//)
209209
? 'http://localhost:8090'
210210
: document.location.protocol + '//' + document.location.host;
211+
window.exampleWebSymbolBasePath = "../../dist/mapboxgl/resources/symbols";
211212
})();

dist/maplibregl/include-maplibregl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,5 @@
190190
window.server = document.location.toString().match(/file:\/\//)
191191
? 'http://localhost:8090'
192192
: document.location.protocol + '//' + document.location.host;
193+
window.exampleWebSymbolBasePath = "../../dist/maplibregl/resources/symbols";
193194
})();

examples/js/include-web.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
const resourceLanguage = getLanguage();
7272
inputScript("../locales/" + resourceLanguage + "/resources.js");
7373
inputScript("../js/tokengenerator.js");
74-
inputScript("../js/websymbol.js");
7574
var jQueryInclude = false;
7675
if (!inArray(excludes, 'example-i18n')) {
7776
inputScript(libsurl + '/jquery/jquery.min.js');

examples/js/websymbol.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/maplibregl/config.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,65 @@ var exampleConfig = {
881881
fileName: 'fgb_bbox_load'
882882
}
883883
]
884+
},
885+
WebSymbol: {
886+
name: 'Web符号',
887+
name_en: 'WebSymbol',
888+
version: '11.1.0',
889+
content: [{
890+
name: 'Web符号库',
891+
name_en: 'WebSymbol Gallery',
892+
version: '11.1.0',
893+
showCode: false,
894+
thumbnail: 'websymbol_gallery.png',
895+
fileName: 'websymbol_gallery'
896+
}, {
897+
name: 'Web符号编辑器',
898+
name_en: 'WebSymbol Editor',
899+
version: '11.1.0',
900+
showCode: false,
901+
thumbnail: 'websymbol_editor.png',
902+
fileName: 'websymbol_editor'
903+
}, {
904+
name: '长江三角洲',
905+
name_en: 'Yangtze River Delta',
906+
version: '11.1.0',
907+
thumbnail: 'websymbol_YangtzeRiverdelta.png',
908+
fileName: 'websymbol_YangtzeRiverdelta'
909+
},{
910+
name: '土地利用',
911+
name_en: 'Land Use',
912+
version: '11.1.0',
913+
thumbnail: 'websymbol_landuse.png',
914+
fileName: 'websymbol_landuse'
915+
}
916+
,{
917+
name: '数字线划地图',
918+
name_en: 'DLG_I49',
919+
version: '11.1.0',
920+
thumbnail: 'websymbol_DLG_I49.png',
921+
fileName: 'websymbol_DLG_I49'
922+
}
923+
,{
924+
name: '新疆土地利用',
925+
name_en: 'Land Use of Xinjiang',
926+
version: '11.1.0',
927+
thumbnail: 'websymbol_landuseOfXinjiang.png',
928+
fileName: 'websymbol_landuseOfXinjiang'
929+
},{
930+
name: '自定义Web符号',
931+
name_en: 'Custom WebSymbol',
932+
version: '11.1.0',
933+
thumbnail: 'websymbol_customWebSymbol.png',
934+
fileName: 'websymbol_customWebSymbol'
935+
},{
936+
name: '2019年中国各省GDP',
937+
name_en: "2019 China's GDP by Province",
938+
version: '11.1.0',
939+
thumbnail: 'websymbol_2019ChinaGDP.png',
940+
fileName: 'websymbol_2019ChinaGDP'
941+
}
942+
]
884943
}
885944
}
886945
},
44.4 KB
Loading
102 KB
Loading
54.3 KB
Loading

0 commit comments

Comments
 (0)