Skip to content

Commit c8e1911

Browse files
committed
增加矢量瓦片面绘制示例
1 parent 8106ff3 commit c8e1911

13 files changed

+138
-11
lines changed

dist/openlayers/iclient9-openlayers-es6.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ module.exports = function(){try{return elasticsearch}catch(e){return {}}}();
12751275
}
12761276

12771277
function Promise(fn) {
1278-
if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');
1278+
if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
12791279
if (typeof fn !== 'function') throw new TypeError('not a function');
12801280
this._state = 0;
12811281
this._handled = false;
@@ -1399,9 +1399,9 @@ module.exports = function(){try{return elasticsearch}catch(e){return {}}}();
13991399
};
14001400

14011401
Promise.all = function (arr) {
1402-
var args = Array.prototype.slice.call(arr);
1403-
14041402
return new Promise(function (resolve, reject) {
1403+
if (!arr || typeof arr.length === 'undefined') throw new TypeError('Promise.all accepts an array');
1404+
var args = Array.prototype.slice.call(arr);
14051405
if (args.length === 0) return resolve([]);
14061406
var remaining = args.length;
14071407

@@ -77810,6 +77810,8 @@ class MapboxStyles_MapboxStyles extends external_ol_default.a.Observable {
7781077810
if (mbStyle.sprite) {
7781177811
const spriteScale = window.devicePixelRatio >= 1.5 ? 0.5 : 1;
7781277812
const sizeFactor = spriteScale == 0.5 ? '@2x' : '';
77813+
//兼容一下iServer 等iServer修改
77814+
mbStyle.sprite = mbStyle.sprite.replace('@2x', "");
7781377815
const spriteUrl = this._toSpriteUrl(mbStyle.sprite, this.path, sizeFactor + '.json');
7781477816
FetchRequest.get(spriteUrl)
7781577817
.then(response =>

dist/openlayers/iclient9-openlayers-es6.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/openlayers/iclient9-openlayers.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61990,6 +61990,8 @@ var MapboxStyles = exports.MapboxStyles = function (_ol$Observable) {
6199061990
if (mbStyle.sprite) {
6199161991
var spriteScale = window.devicePixelRatio >= 1.5 ? 0.5 : 1;
6199261992
var sizeFactor = spriteScale == 0.5 ? '@2x' : '';
61993+
//兼容一下iServer 等iServer修改
61994+
mbStyle.sprite = mbStyle.sprite.replace('@2x', "");
6199361995
var spriteUrl = this._toSpriteUrl(mbStyle.sprite, this.path, sizeFactor + '.json');
6199461996
_iclientCommon.FetchRequest.get(spriteUrl).then(function (response) {
6199561997
return response.json();
@@ -69322,7 +69324,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
6932269324
/* 359 */
6932369325
/***/ (function(module) {
6932469326

69325-
module.exports = {"_from":"proj4@2.4.4","_id":"proj4@2.4.4","_inBundle":false,"_integrity":"sha512-yo6qTpBQXnxhcPopKJeVwwOBRzUpEa3vzSFlr38f5mF4Jnfb6NOL/ePIomefWiZmPgkUblHpcwnWVMB8FS3GKw==","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.4.4","name":"proj4","escapedName":"proj4","rawSpec":"2.4.4","saveSpec":null,"fetchSpec":"2.4.4"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/proj4/-/proj4-2.4.4.tgz","_shasum":"c03d825e380f6850a4a7af5d20d365f6b72c4042","_spec":"proj4@2.4.4","_where":"F:\\dev\\iClient-JavaScript","author":"","bugs":{"url":"https://github.com/proj4js/proj4js/issues"},"bundleDependencies":false,"contributors":[{"name":"Mike Adair","email":"madair@dmsolutions.ca"},{"name":"Richard Greenwood","email":"rich@greenwoodmap.com"},{"name":"Calvin Metcalf","email":"calvin.metcalf@gmail.com"},{"name":"Richard Marsden","url":"http://www.winwaed.com"},{"name":"T. Mittan"},{"name":"D. Steinwand"},{"name":"S. Nelson"}],"dependencies":{"mgrs":"1.0.0","wkt-parser":"^1.2.0"},"deprecated":false,"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"^1.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~1.1.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","grunt-rollup":"^1.0.1","istanbul":"~0.2.4","mocha":"~1.17.1","rollup":"^0.41.4","rollup-plugin-json":"^2.0.1","rollup-plugin-node-resolve":"^2.0.0","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","license":"MIT","main":"dist/proj4-src.js","module":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"build":"grunt","build:tmerc":"grunt build:tmerc","test":"npm run build && istanbul test _mocha test/test.js"},"version":"2.4.4"};
69327+
module.exports = {"_from":"proj4@2.4.4","_id":"proj4@2.4.4","_inBundle":false,"_integrity":"sha1-wD2CXjgPaFCkp69dINNl9rcsQEI=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.4.4","name":"proj4","escapedName":"proj4","rawSpec":"2.4.4","saveSpec":null,"fetchSpec":"2.4.4"},"_requiredBy":["/"],"_resolved":"http://registry.npm.taobao.org/proj4/download/proj4-2.4.4.tgz","_shasum":"c03d825e380f6850a4a7af5d20d365f6b72c4042","_spec":"proj4@2.4.4","_where":"E:\\2018\\git\\iClient-JavaScript","author":"","bugs":{"url":"https://github.com/proj4js/proj4js/issues"},"bundleDependencies":false,"contributors":[{"name":"Mike Adair","email":"madair@dmsolutions.ca"},{"name":"Richard Greenwood","email":"rich@greenwoodmap.com"},{"name":"Calvin Metcalf","email":"calvin.metcalf@gmail.com"},{"name":"Richard Marsden","url":"http://www.winwaed.com"},{"name":"T. Mittan"},{"name":"D. Steinwand"},{"name":"S. Nelson"}],"dependencies":{"mgrs":"1.0.0","wkt-parser":"^1.2.0"},"deprecated":false,"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"^1.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~1.1.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","grunt-rollup":"^1.0.1","istanbul":"~0.2.4","mocha":"~1.17.1","rollup":"^0.41.4","rollup-plugin-json":"^2.0.1","rollup-plugin-node-resolve":"^2.0.0","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"homepage":"https://github.com/proj4js/proj4js#readme","license":"MIT","main":"dist/proj4-src.js","module":"lib/index.js","name":"proj4","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"build":"grunt","build:tmerc":"grunt build:tmerc","test":"npm run build && istanbul test _mocha test/test.js"},"version":"2.4.4"};
6932669328

6932769329
/***/ }),
6932869330
/* 360 */
@@ -96954,7 +96956,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
9695496956
}
9695596957

9695696958
function Promise(fn) {
96957-
if (_typeof(this) !== 'object') throw new TypeError('Promises must be constructed via new');
96959+
if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
9695896960
if (typeof fn !== 'function') throw new TypeError('not a function');
9695996961
this._state = 0;
9696096962
this._handled = false;
@@ -97078,9 +97080,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
9707897080
};
9707997081

9708097082
Promise.all = function (arr) {
97081-
var args = Array.prototype.slice.call(arr);
97082-
9708397083
return new Promise(function (resolve, reject) {
97084+
if (!arr || typeof arr.length === 'undefined') throw new TypeError('Promise.all accepts an array');
97085+
var args = Array.prototype.slice.call(arr);
9708497086
if (args.length === 0) return resolve([]);
9708597087
var remaining = args.length;
9708697088

dist/openlayers/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.

dist/openlayers/include-openlayers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@
8787
if (inArray(includes, 'animatedclusterlayer')) {
8888
inputScript("http://iclient.supermap.io/libs/openlayers/plugins/animatedclusterlayer/animatedclusterlayer.js");
8989
}
90-
90+
if (inArray(includes, 'proj4')) {
91+
inputScript("https://cdn.bootcss.com/proj4js/2.4.4/proj4.js");
92+
}
9193
if (inArray(includes, 'layerswitcher')) {
9294
inputCSS("http://iclient.supermap.io/libs/openlayers/plugins/ol-layerswitcher/2.0.0/ol-layerswitcher.css");
9395
inputScript("http://iclient.supermap.io/libs/openlayers/plugins/ol-layerswitcher/2.0.0/ol-layerswitcher.js");

examples/locales/en-US/resources.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ window.examplesResources = {
419419
"title_mvtVectorLayer4326": "iServer MVT VectorTile (WGS84)",
420420
"title_mvtVectorLayer_mapboxStyle": "Style Switch",
421421
"title_mvtVectorLayer_mapboxStyle_4326": "OSM Style(MVT WGS84)",
422-
"title_mvtVectorLayer_mapboxStyle_lineStyle": "lineStyle edit",
422+
"title_mvtVectorLayer_mapboxStyle_lineStyle": "LineStyle Edit",
423+
"title_mvtVectorLayer_mapboxStyle_landuse": "Land Use",
423424
"title_onlineSecurity": "Examples of Online SecurityManager",
424425
"title_onlineWebMap": "Be a backpacker in 2014",
425426
"title_osmBuildings": "Buildings Stereoscopic Effect of OpenLayers",

examples/locales/zh-CN/resources.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ window.examplesResources = {
364364
"title_mvtVectorLayer_mapboxStyle": "OSM风格(MVT WGS84)",
365365
"title_mvtVectorLayer_mapboxStyle_4326": "风格动态切换",
366366
"title_mvtVectorLayer_mapboxStyle_lineStyle": "线样式编辑",
367+
"title_mvtVectorLayer_mapboxStyle_landuse": "土地利用",
367368
"title_onlineSecurity": "Online SecurityManager使用示例",
368369
"title_onlineWebMap": "2014当了一回背包客",
369370
"title_osmBuildings": "openlayers 建筑立体效果",

examples/openlayers/config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,16 @@ var exampleConfig = {
817817
localIgnore:true,
818818
thumbnail: "mvtvectorlayer_mbstyle_linestyle.png",
819819
fileName: "mvtvectorlayer_mbstyle_linestyle"
820+
},
821+
{
822+
name: "土地利用",
823+
name_en: "Land Use",
824+
localIgnore:true,
825+
thumbnail: "mvtvectorlayer_mbstyle_landuse.png",
826+
fileName: "mvtvectorlayer_mbstyle_landuse"
820827
}
821828

829+
822830
]
823831
},
824832
"themeLayer": {
153 KB
Loading

examples/openlayers/mvtvectorlayer_mbstyle_4326.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
return 1 / (scale * 96 * inchPerMeter * meterPerMapUnitValue);
5252
};
5353
var vectorLayer;
54+
//通过缓存sci文件已知第10级的比例尺是0.00000346145499464224,计算0到16级的分辨率
5455
var resolutions = getResolutions(10, 0.00000346145499464224, 0, 16);
5556
var map = new ol.Map({
5657
target: 'map',

0 commit comments

Comments
 (0)