Skip to content

Commit d8ed94d

Browse files
committed
打包添加版权信息
1 parent b3bf360 commit d8ed94d

File tree

10 files changed

+77
-23
lines changed

10 files changed

+77
-23
lines changed

build/webpack.config.leaflet.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
var webpack = require('webpack');
2+
var pkg = require('../package.json');
3+
var banner = `
4+
iclient9-leaflet.(${pkg.homepage})
5+
Copyright© 2000-2017 SuperMap Software Co. Ltd
6+
license: ${pkg.license}
7+
version: v${pkg.version}
8+
`;
9+
210
module.exports = {
311
//页面入口文件配置
412
entry: {},
@@ -27,6 +35,9 @@ module.exports = {
2735
presets: ['es2015']
2836
}
2937
}]
30-
}
38+
},
39+
plugins: [
40+
new webpack.BannerPlugin(banner)
41+
]
3142

3243
};

build/webpack.config.openlayers.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
var webpack = require('webpack');
2+
var pkg = require('../package.json');
3+
var banner = `
4+
iclient9-openlayers.(${pkg.homepage})
5+
Copyright© 2000-2017 SuperMap Software Co. Ltd
6+
license: ${pkg.license}
7+
version: v${pkg.version}
8+
`;
29
module.exports = {
310
//页面入口文件配置
411
entry: {},
@@ -29,5 +36,8 @@ module.exports = {
2936
presets: ['es2015']
3037
}
3138
}]
32-
}
39+
},
40+
plugins: [
41+
new webpack.BannerPlugin(banner)
42+
]
3343
};

dist/iclient9-leaflet.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*!
2+
*
3+
* iclient9-leaflet.(http://iclient.supermapol.com)
4+
* Copyright© 2000-2017 SuperMap Software Co. Ltd
5+
* license: Apache-2.0
6+
* version: v9.0.0
7+
*
8+
*/
19
/******/ (function(modules) { // webpackBootstrap
210
/******/ // The module cache
311
/******/ var installedModules = {};
@@ -3063,13 +3071,13 @@ SuperMap.Request = {
30633071
url = this._processUrl(url);
30643072
url = SuperMap.Util.urlAppend(url, this._getParameterString(params || {}));
30653073
if (url.length <= 2000) {
3066-
if (SuperMap.Support.cors) {
3067-
return this._fetch(url, params, options, type);
3068-
}
30693074
if (!SuperMap.Util.isInTheSameDomain(url)) {
30703075
url = url.replace('.json', '.jsonp');
30713076
return this._fetchJsonp(url, options);
30723077
}
3078+
if (SuperMap.Support.cors) {
3079+
return this._fetch(url, params, options, type);
3080+
}
30733081
}
30743082
return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
30753083
},
@@ -14015,7 +14023,7 @@ var TileVectorLayer = L.VectorGrid.extend({
1401514023
// SuperMap.CartoCSSToLeaflet内部做了客户端配置的cartoCSS和服务端cartoCSS的拼接处理
1401614024
// 客户端配置的cartoCSS会覆盖相应图层的服务端cartoCSS
1401714025
if (!style && feature.type !== "TEXT") {
14018-
var scale = this.getScale(coords);
14026+
var scale = this.getScaleFromCoords(coords);
1401914027
var shaders = CartoCSSToLeaflet.pickShader(layerName) || [];
1402014028
style = [];
1402114029
for (var itemKey in shaders) {

dist/iclient9-leaflet.min.js

Lines changed: 9 additions & 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: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*!
2+
*
3+
* iclient9-openlayers.(http://iclient.supermapol.com)
4+
* Copyright© 2000-2017 SuperMap Software Co. Ltd
5+
* license: Apache-2.0
6+
* version: v9.0.0
7+
*
8+
*/
19
/******/ (function(modules) { // webpackBootstrap
210
/******/ // The module cache
311
/******/ var installedModules = {};
@@ -2995,13 +3003,13 @@ SuperMap.Request = {
29953003
url = this._processUrl(url);
29963004
url = SuperMap.Util.urlAppend(url, this._getParameterString(params || {}));
29973005
if (url.length <= 2000) {
2998-
if (SuperMap.Support.cors) {
2999-
return this._fetch(url, params, options, type);
3000-
}
30013006
if (!SuperMap.Util.isInTheSameDomain(url)) {
30023007
url = url.replace('.json', '.jsonp');
30033008
return this._fetchJsonp(url, options);
30043009
}
3010+
if (SuperMap.Support.cors) {
3011+
return this._fetch(url, params, options, type);
3012+
}
30053013
}
30063014
return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
30073015
},

dist/iclient9-openlayers.min.js

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

examples/leaflet/02_editFeatures.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@
2828
initFeature();
2929
initEditView();
3030

31-
3231
function initFeature() {
3332
var polygon = L.polygon([[10, 100], [10, 124], [40, 124], [40, 100], [10, 100]]);
3433
var getFeatureParams = new SuperMap.GetFeaturesByGeometryParameters({
35-
toIndex:-1,
34+
toIndex: -1,
3635
datasetNames: ["World:Capitals"],
3736
geometry: polygon
3837
});
@@ -120,10 +119,7 @@
120119

121120
function clearLayer() {
122121
var me = this;
123-
if (!featureGroup.hasLayer(marker)) {
124-
return;
125-
}
126-
if (id) {
122+
if (id && featureService) {
127123
var deleteParams = new SuperMap.EditFeaturesParameters({
128124
dataSourceName: "World",
129125
dataSetName: "Capitals",

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"deploy": "webpack",
1313
"deploy-leaflet": "webpack --config ./build/webpack.config.leaflet.js ",
1414
"deploy-openlayers": "webpack --config ./build/webpack.config.openlayers.js",
15-
"compress-openlayers": "uglifyjs -c -m -o ./dist/iclient9-openlayers.min.js -- ./dist/iclient9-openlayers.js ",
16-
"compress-leaflet": "uglifyjs -c -m -o ./dist/iclient9-leaflet.min.js -- ./dist/iclient9-leaflet.js",
15+
"compress-openlayers": "uglifyjs --comments /Copyright©/i -c -m -o ./dist/iclient9-openlayers.min.js -- ./dist/iclient9-openlayers.js ",
16+
"compress-leaflet": "uglifyjs --comments /Copyright©/i -c -m -o ./dist/iclient9-leaflet.min.js -- ./dist/iclient9-leaflet.js",
1717
"package": "node ./build/pack.js",
1818
"package-debug": "node ./build/pack.js - debug",
1919
"test": "karma start",
@@ -24,6 +24,11 @@
2424
"Leaflet",
2525
"OpenLayers3"
2626
],
27+
"homepage": "http://iclient.supermapol.com",
28+
"repository": {
29+
"type": "git",
30+
"url": "https://git.oschina.net/isupermap/iClient9.git"
31+
},
2732
"author": "SuperMap",
2833
"license": "Apache-2.0",
2934
"devDependencies": {

src/common/util/Request.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ SuperMap.Request = {
2929
url = this._processUrl(url);
3030
url = SuperMap.Util.urlAppend(url, this._getParameterString(params || {}));
3131
if (url.length <= 2000) {
32-
if (SuperMap.Support.cors) {
33-
return this._fetch(url, params, options, type);
34-
}
3532
if (!SuperMap.Util.isInTheSameDomain(url)) {
3633
url = url.replace('.json', '.jsonp');
3734
return this._fetchJsonp(url, options);
3835
}
36+
if (SuperMap.Support.cors) {
37+
return this._fetch(url, params, options, type);
38+
}
3939
}
4040
return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
4141
},

src/leaflet/overlay/TileVectorLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ var TileVectorLayer = L.VectorGrid.extend({
202202
// SuperMap.CartoCSSToLeaflet内部做了客户端配置的cartoCSS和服务端cartoCSS的拼接处理
203203
// 客户端配置的cartoCSS会覆盖相应图层的服务端cartoCSS
204204
if (!style && feature.type !== "TEXT") {
205-
var scale = this.getScale(coords);
205+
var scale = this.getScaleFromCoords(coords);
206206
var shaders = CartoCSSToLeaflet.pickShader(layerName) || [];
207207
style = [];
208208
for (var itemKey in shaders) {

0 commit comments

Comments
 (0)