Skip to content

Commit caa38d2

Browse files
committed
1.openlayers 新增版本切换控件&添加示例
2.修改openlayers打包,新增iclient9-openlayers.min.css
1 parent ecb33e6 commit caa38d2

17 files changed

+2819
-1469
lines changed

build/deps.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,17 @@ var deps = {
415415
"./src/openlayers/overlay/mapv.js",
416416
]
417417
}
418+
},
419+
"control": {
420+
"title": "控件",
421+
"description": "--对接控件",
422+
423+
"ChangeTileVersion": {
424+
"name": "多版本缓存切换",
425+
"src": [
426+
"./src/openlayers/interaction/ChangeTileVersion.js"
427+
]
428+
}
418429
}
419430
},
420431

build/webpack.config.openlayers.js

Lines changed: 19 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-openlayers";
35
var banner = `
46
iclient9-openlayers.(${pkg.homepage})
57
Copyright© 2000-2017 SuperMap Software Co. Ltd
@@ -12,7 +14,7 @@ module.exports = {
1214
//入口文件输出配置
1315
output: {
1416
path: __dirname + '/../dist',
15-
filename: 'iclient9-openlayers.js'
17+
filename: packageName + ".js"
1618
},
1719

1820
//其它解决方案配置
@@ -35,9 +37,24 @@ module.exports = {
3537
query: {
3638
presets: ['es2015']
3739
}
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'])
3854
}]
3955
},
4056
plugins: [
41-
new webpack.BannerPlugin(banner)
57+
new webpack.BannerPlugin(banner),
58+
new ExtractTextPlugin('/../dist/' + packageName + ".min.css")
4259
]
4360
};

dist/iclient9-leaflet.js

Lines changed: 679 additions & 686 deletions
Large diffs are not rendered by default.

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.

dist/iclient9-openlayers.js

Lines changed: 1195 additions & 728 deletions
Large diffs are not rendered by default.

dist/iclient9-openlayers.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-openlayers.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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>多版本缓存切换</title>
6+
<link href="http://cdn.bootcss.com/openlayers/4.2.0/ol.css" rel="stylesheet">
7+
<link rel="stylesheet" href="../../dist/iclient9-openlayers.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 src="http://cdn.bootcss.com/openlayers/4.2.0/ol-debug.js"></script>
12+
<script type="text/javascript" src="../../dist/iclient9-openlayers.js"></script>
13+
<script type="text/javascript">
14+
var baseLayer, url = "http://117.122.248.69:8090/iserver/services/map-ChinaProvinces2/rest/maps/ChinaProvinces";
15+
var map = new ol.Map({
16+
target: 'map',
17+
view: new ol.View({
18+
center: [104.79, 33.03],
19+
zoom: 4,
20+
projection: 'EPSG:4326'
21+
})
22+
});
23+
24+
baseLayer = new ol.source.TileSuperMapRest({
25+
origin: [-180, 90],
26+
url: url,
27+
wrapX: true
28+
});
29+
30+
map.addLayer(new ol.layer.Tile({
31+
source: baseLayer,
32+
projection: 'EPSG:4326'
33+
}));
34+
35+
var control = new ol.supermap.control.ChangeTileVersion({
36+
layer: baseLayer,
37+
orientation: "horizontal"
38+
});
39+
control.setMap(map);
40+
map.addControl(control);
41+
</script>
42+
</body>
43+
</html>

examples/openlayers/config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,19 @@ var exampleConfig = {
522522
}
523523
}
524524
},
525+
"control": {
526+
name: "控件",
527+
content: {
528+
"changeTileVersion": {
529+
name: "缓存切换",
530+
content: [{
531+
name: "多版本缓存切换控件",
532+
thumbnail: "ol_changeTileVersion.png",
533+
fileName: "changeTileVersion"
534+
}]
535+
}
536+
}
537+
},
525538
"OGC": {
526539
name: "OGC",
527540
content: {
@@ -589,6 +602,7 @@ var sideBarIconConfig = {
589602
"Online": "fa-cloud",
590603
"iManager": "fa-group",
591604
"plot": "fa-edit",
605+
"control": "fa-sliders",
592606
"viz": "fa-map",
593607
"OGC": "fa-globe",
594608
"mapping": "fa-send"
@@ -605,6 +619,7 @@ var exampleIconConfig = {
605619
"Online": "fa-cloud",
606620
"iManager": "fa-group",
607621
"plot": "fa-edit",
622+
"control": "fa-sliders",
608623
"viz": "fa-map",
609624
"OGC": "fa-globe",
610625
"mapping": "fa-send"
10.5 KB
Loading

0 commit comments

Comments
 (0)