Skip to content

Commit ecb33e6

Browse files
committed
1.leaflet 新增缓存版本切换控件ChangeTileVersion
2.修改leaflet 打包。新增iclient9-leaflet.min.css 2.leaflet MapV图层增加数据操作接口
1 parent 77b5d7f commit ecb33e6

File tree

14 files changed

+4339
-3042
lines changed

14 files changed

+4339
-3042
lines changed

build/deps.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,18 @@ var deps = {
261261
"./src/common/thirdparty/elasticsearch/ElasticSearchService.js"
262262
]
263263
}
264+
},
265+
266+
"control": {
267+
"title": "控件",
268+
"description": "--对接控件",
269+
270+
"ChangeTileVersion": {
271+
"name": "多版本缓存切换",
272+
"src": [
273+
"./src/leaflet/control/ChangeTileVersion.js"
274+
]
275+
},
264276
}
265277

266278
},

build/webpack.config.leaflet.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
var webpack = require('webpack');
2+
var ExtractTextPlugin = require("extract-text-webpack-plugin");
23
var pkg = require('../package.json');
4+
var packageName = "iclient9-leaflet";
35
var banner = `
46
iclient9-leaflet.(${pkg.homepage})
57
Copyright© 2000-2017 SuperMap Software Co. Ltd
@@ -13,7 +15,7 @@ module.exports = {
1315
//入口文件输出配置
1416
output: {
1517
path: __dirname + '/../dist',
16-
filename: 'iclient9-leaflet.js'
18+
filename: packageName + ".js"
1719
},
1820

1921
//其它解决方案配置
@@ -26,6 +28,7 @@ module.exports = {
2628
'mapv': 'mapv',
2729
'elasticsearch': 'elasticsearch'
2830
},
31+
2932
module: {
3033
rules: [{
3134
test: /MapVRenderer\.js/,
@@ -34,10 +37,25 @@ module.exports = {
3437
query: {
3538
presets: ['es2015']
3639
}
40+
}, {
41+
test: /\.css$/,
42+
use: ExtractTextPlugin.extract({
43+
use: {
44+
loader: 'css-loader',
45+
options: {
46+
minimize: true
47+
}
48+
}
49+
}),
50+
}],
51+
loaders: [{
52+
test: /\.css$/,
53+
loader: ExtractTextPlugin.extract(['style-loader', 'css-loader'])
3754
}]
3855
},
3956
plugins: [
40-
new webpack.BannerPlugin(banner)
57+
new webpack.BannerPlugin(banner),
58+
new ExtractTextPlugin('/../dist/' + packageName + ".min.css")
4159
]
4260

4361
};

dist/iclient9-leaflet.js

Lines changed: 3446 additions & 3007 deletions
Large diffs are not rendered by default.

dist/iclient9-leaflet.min.css

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

dist/iclient9-leaflet.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.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>多版本缓存切换</title>
6+
<link rel="stylesheet" href="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.css">
7+
<link rel="stylesheet" href="../../dist/iclient9-leaflet.min.css">
8+
</head>
9+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
10+
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
11+
<script type="text/javascript" src="http://cdn.bootcss.com/leaflet/1.0.3/leaflet.js"></script>
12+
<script type="text/javascript" src="../../dist/iclient9-leaflet.min.js"></script>
13+
<script type="text/javascript">
14+
var url = "http://117.122.248.69:8090/iserver/services/map-ChinaProvinces2/rest/maps/ChinaProvinces";
15+
var map = L.map('map', {
16+
crs: L.CRS.EPSG4326,
17+
center: [33.03, 104.79],
18+
zoom: 3,
19+
});
20+
var baseLayer = L.supermap.tiledMapLayer(url).addTo(map);
21+
22+
L.supermap.control.changeTileVersion({
23+
layer: baseLayer,
24+
position: "topleft",
25+
orientation: "horizontal"
26+
}).addTo(map);
27+
</script>
28+
</body>
29+
</html>

examples/leaflet/config.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,19 @@ var exampleConfig = {
538538
}
539539
}
540540
},
541+
"control": {
542+
name: "控件",
543+
content: {
544+
"changeTileVersion": {
545+
name: "缓存切换",
546+
content: [{
547+
name: "多版本缓存切换控件",
548+
thumbnail: "l_changeTileVersion.png",
549+
fileName: "changeTileVersion"
550+
}]
551+
}
552+
}
553+
},
541554
"OGC": {
542555
name: "OGC",
543556
content: {
@@ -591,7 +604,7 @@ var exampleConfig = {
591604
}]
592605
}
593606
}
594-
}
607+
},
595608

596609
};
597610
/**
@@ -607,6 +620,7 @@ var sideBarIconConfig = {
607620
"iManager": "fa-group",
608621
"ElasticSearch": "fa-tasks",
609622
"plot": "fa-edit",
623+
"control": "fa-sliders",
610624
"viz": "fa-map",
611625
"OGC": "fa-globe",
612626
"mapping": "fa-send"
@@ -624,6 +638,7 @@ var exampleIconConfig = {
624638
"iManager": "fa-group",
625639
"ElasticSearch": "fa-tasks",
626640
"plot": "fa-edit",
641+
"control": "fa-sliders",
627642
"viz": "fa-map",
628643
"OGC": "fa-globe",
629644
"mapping": "fa-send"
5.86 KB
Loading

0 commit comments

Comments
 (0)