Skip to content

Commit 38ea938

Browse files
committed
增加图表专题图示例,fix 相关代码; fix mapboxgl featureservice代码。 review by caoxinke.
1 parent d1878c8 commit 38ea938

32 files changed

+1659
-172
lines changed

dist/iclient9-leaflet.js

Lines changed: 126 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19615,7 +19615,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
1961519615
* 统计专题图多用于具有相关数量特征的地图上,比如表示不同地区多年的粮食产量、GDP、人口等,不同时段客运量、地铁流量等。
1961619616
* 目前提供的统计图类型有:柱状图(Bar),折线图(Line),饼图(Pie),三维柱状图(Bar3D),点状图(Point),环状图(Ring)。
1961719617
* @param name - {string} 专题图表名称
19618-
* @param chartsType - {string} 图表类型。目前可用:"Bar", "Line", "Pie"。
19618+
* @param chartsType - {string} 图表类型。目前可用:"Bar", "Bar3D", "Line","Point","Pie","Ring"。
1961919619
* @param options - {Object} 待设置得参数。如:<br>
1962019620
* isOverLay - {boolean} 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表,默认值:true。<br>
1962119621
* chartsType :图表类型。目前可用:"Bar", "Line", "Pie"。<br>
@@ -19638,17 +19638,17 @@ var GraphThemeLayer = exports.GraphThemeLayer = _ThemeLayer.ThemeLayer.extend({
1963819638
isOverLay: true
1963919639
},
1964019640

19641-
/*
19642-
*/
1964319641
initialize: function initialize(name, chartsType, options) {
1964419642
var newArgs = [];
1964519643
newArgs.push(name);
1964619644
newArgs.push(options);
1964719645
_ThemeLayer.ThemeLayer.prototype.initialize.apply(this, newArgs);
19646+
this.map = options.map || null;
1964819647
this.chartsType = chartsType;
19649-
this.charts = [];
19650-
this.cache = {};
19651-
this.chartsSetting = {};
19648+
this.chartsSetting = options.chartsSetting || {};
19649+
this.themeFields = options.themeFields || null;
19650+
this.charts = options.charts || [];
19651+
this.cache = options.cache || {};
1965219652
},
1965319653

1965419654
/**
@@ -19672,20 +19672,14 @@ var GraphThemeLayer = exports.GraphThemeLayer = _ThemeLayer.ThemeLayer.extend({
1967219672
features = [features];
1967319673
}
1967419674

19675-
var me = this,
19676-
event = { features: features };
19677-
me.fire("beforefeaturesadded", event);
19678-
features = event.features;
19675+
var me = this;
19676+
me.fire("beforefeaturesadded", { features: features });
1967919677

1968019678
for (var i = 0, len = features.length; i < len; i++) {
1968119679
var feature = features[i];
1968219680
feature = me._createFeature(feature);
1968319681
me.features.push(feature);
1968419682
}
19685-
19686-
var succeed = me.features.length === 0;
19687-
me.fire("featuresadded", { features: me.features, succeed: succeed });
19688-
1968919683
//绘制专题要素
1969019684
if (!me.renderer) {
1969119685
return;
@@ -26472,6 +26466,7 @@ var ThemeLayer = exports.ThemeLayer = _leaflet2["default"].Layer.extend({
2647226466
this.TFEvents = [];
2647326467
this.levelRenderer = new _LevelRenderer2["default"]();
2647426468
this.movingOffset = [0, 0];
26469+
this.map = options.map || null;
2647526470
},
2647626471

2647726472
/**
@@ -26498,9 +26493,9 @@ var ThemeLayer = exports.ThemeLayer = _leaflet2["default"].Layer.extend({
2649826493
* @param map - {L.map} 要删除的地图
2649926494
*/
2650026495
onRemove: function onRemove(map) {
26501-
if (map) {
26502-
map.removeLayer(this);
26503-
}
26496+
var me = this;
26497+
_leaflet2["default"].DomUtil.remove(me.container);
26498+
map.off("mousemove", me.mouseMoveHandler);
2650426499
},
2650526500

2650626501
/**
@@ -26525,12 +26520,18 @@ var ThemeLayer = exports.ThemeLayer = _leaflet2["default"].Layer.extend({
2652526520

2652626521
me.renderer = me.levelRenderer.init(me.container);
2652726522
me.renderer.clear();
26523+
if (me.features.length > 0) {
26524+
me._reset();
26525+
me.redrawThematicFeatures(me.map.getBounds());
26526+
}
26527+
2652826528
//处理用户预先(在图层添加到 map 前)监听的事件
2652926529
me.addTFEvents();
26530-
map.on("mousemove", function (e) {
26530+
me.mouseMoveHandler = function (e) {
2653126531
var xy = e.layerPoint;
2653226532
me.currentMousePosition = _leaflet2["default"].point(xy.x + me.movingOffset[0], xy.y + me.movingOffset[1]);
26533-
});
26533+
};
26534+
map.on("mousemove", me.mouseMoveHandler);
2653426535
},
2653526536

2653626537
/**
@@ -26787,7 +26788,7 @@ var ThemeLayer = exports.ThemeLayer = _leaflet2["default"].Layer.extend({
2678726788
// eslint-disable-line no-unused-vars
2678826789
var me = this;
2678926790
if (me.renderer) {
26790-
me.renderer.off(event, callback);
26791+
me.renderer.un(event, callback);
2679126792
} else {
2679226793
_leaflet2["default"].Layer.prototype.off.call(this, event, callback);
2679326794
}
@@ -26834,7 +26835,6 @@ var ThemeLayer = exports.ThemeLayer = _leaflet2["default"].Layer.extend({
2683426835
_initContainer: function _initContainer() {
2683526836
var parentContainer = this.getPane();
2683626837
this.container = _leaflet2["default"].DomUtil.create("div", "themeLayer", parentContainer);
26837-
this.container.style.position = "relative";
2683826838
this.container.style.zIndex = 100;
2683926839
},
2684026840

@@ -73700,7 +73700,7 @@ var Math = function () {
7370073700
this._radians = null;
7370173701
this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Math";
7370273702

73703-
this._radians = Math.PI / 180;
73703+
this._radians = window.Math.PI / 180;
7370473704
}
7370573705

7370673706
/**
@@ -73725,7 +73725,7 @@ var Math = function () {
7372573725
_createClass(Math, [{
7372673726
key: "sin",
7372773727
value: function sin(angle, isDegrees) {
73728-
return Math.sin(isDegrees ? angle * this._radians : angle);
73728+
return window.Math.sin(isDegrees ? angle * this._radians : angle);
7372973729
}
7373073730

7373173731
/**
@@ -73743,7 +73743,7 @@ var Math = function () {
7374373743
}, {
7374473744
key: "cos",
7374573745
value: function cos(angle, isDegrees) {
73746-
return Math.cos(isDegrees ? angle * this._radians : angle);
73746+
return window.Math.cos(isDegrees ? angle * this._radians : angle);
7374773747
}
7374873748

7374973749
/**
@@ -93820,7 +93820,108 @@ exports.names = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
9382093820
/* 466 */
9382193821
/***/ (function(module, exports) {
9382293822

93823-
module.exports = {"_args":[[{"raw":"proj4@2.3.15","scope":null,"escapedName":"proj4","name":"proj4","rawSpec":"2.3.15","spec":"2.3.15","type":"version"},"E:\\git\\iClient9"]],"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inCache":true,"_location":"/proj4","_nodeVersion":"6.1.0","_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/proj4-2.3.15.tgz_1471808262546_0.6752060337457806"},"_npmUser":{"name":"ahocevar","email":"andreas.hocevar@gmail.com"},"_npmVersion":"3.8.6","_phantomChildren":{},"_requested":{"raw":"proj4@2.3.15","scope":null,"escapedName":"proj4","name":"proj4","rawSpec":"2.3.15","spec":"2.3.15","type":"version"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/proj4/-/proj4-2.3.15.tgz","_shasum":"5ad06e8bca30be0ffa389a49e4565f51f06d089e","_shrinkwrap":null,"_spec":"proj4@2.3.15","_where":"E:\\git\\iClient9","author":"","bugs":{"url":"https://github.com/proj4js/proj4js/issues"},"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":"~0.0.2"},"description":"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.","devDependencies":{"browserify":"~12.0.1","chai":"~1.8.1","curl":"git://github.com/cujojs/curl.git","grunt":"~0.4.2","grunt-browserify":"~4.0.1","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~0.8.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","istanbul":"~0.2.4","mocha":"~1.17.1","tin":"~0.4.0"},"directories":{"test":"test","doc":"docs"},"dist":{"shasum":"5ad06e8bca30be0ffa389a49e4565f51f06d089e","tarball":"https://registry.npmjs.org/proj4/-/proj4-2.3.15.tgz"},"gitHead":"9fa5249c1f4183d5ddee3c4793dfd7b9f29f1886","homepage":"https://github.com/proj4js/proj4js#readme","jam":{"main":"dist/proj4.js","include":["dist/proj4.js","README.md","AUTHORS","LICENSE.md"]},"license":"MIT","main":"lib/index.js","maintainers":[{"name":"cwmma","email":"calvin.metcalf@gmail.com"},{"name":"ahocevar","email":"andreas.hocevar@gmail.com"}],"name":"proj4","optionalDependencies":{},"readme":"ERROR: No README data found!","repository":{"type":"git","url":"git://github.com/proj4js/proj4js.git"},"scripts":{"test":"./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"},"version":"2.3.15"}
93823+
module.exports = {
93824+
"_from": "proj4@2.3.15",
93825+
"_id": "proj4@2.3.15",
93826+
"_inBundle": false,
93827+
"_integrity": "sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=",
93828+
"_location": "/proj4",
93829+
"_phantomChildren": {},
93830+
"_requested": {
93831+
"type": "version",
93832+
"registry": true,
93833+
"raw": "proj4@2.3.15",
93834+
"name": "proj4",
93835+
"escapedName": "proj4",
93836+
"rawSpec": "2.3.15",
93837+
"saveSpec": null,
93838+
"fetchSpec": "2.3.15"
93839+
},
93840+
"_requiredBy": [
93841+
"/"
93842+
],
93843+
"_resolved": "https://registry.npmjs.org/proj4/-/proj4-2.3.15.tgz",
93844+
"_shasum": "5ad06e8bca30be0ffa389a49e4565f51f06d089e",
93845+
"_spec": "proj4@2.3.15",
93846+
"_where": "G:\\github-iClient\\iClient9",
93847+
"author": "",
93848+
"bugs": {
93849+
"url": "https://github.com/proj4js/proj4js/issues"
93850+
},
93851+
"bundleDependencies": false,
93852+
"contributors": [
93853+
{
93854+
"name": "Mike Adair",
93855+
"email": "madair@dmsolutions.ca"
93856+
},
93857+
{
93858+
"name": "Richard Greenwood",
93859+
"email": "rich@greenwoodmap.com"
93860+
},
93861+
{
93862+
"name": "Calvin Metcalf",
93863+
"email": "calvin.metcalf@gmail.com"
93864+
},
93865+
{
93866+
"name": "Richard Marsden",
93867+
"url": "http://www.winwaed.com"
93868+
},
93869+
{
93870+
"name": "T. Mittan"
93871+
},
93872+
{
93873+
"name": "D. Steinwand"
93874+
},
93875+
{
93876+
"name": "S. Nelson"
93877+
}
93878+
],
93879+
"dependencies": {
93880+
"mgrs": "~0.0.2"
93881+
},
93882+
"deprecated": false,
93883+
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",
93884+
"devDependencies": {
93885+
"browserify": "~12.0.1",
93886+
"chai": "~1.8.1",
93887+
"curl": "git://github.com/cujojs/curl.git",
93888+
"grunt": "~0.4.2",
93889+
"grunt-browserify": "~4.0.1",
93890+
"grunt-cli": "~0.1.13",
93891+
"grunt-contrib-connect": "~0.6.0",
93892+
"grunt-contrib-jshint": "~0.8.0",
93893+
"grunt-contrib-uglify": "~0.11.1",
93894+
"grunt-mocha-phantomjs": "~0.4.0",
93895+
"istanbul": "~0.2.4",
93896+
"mocha": "~1.17.1",
93897+
"tin": "~0.4.0"
93898+
},
93899+
"directories": {
93900+
"test": "test",
93901+
"doc": "docs"
93902+
},
93903+
"homepage": "https://github.com/proj4js/proj4js#readme",
93904+
"jam": {
93905+
"main": "dist/proj4.js",
93906+
"include": [
93907+
"dist/proj4.js",
93908+
"README.md",
93909+
"AUTHORS",
93910+
"LICENSE.md"
93911+
]
93912+
},
93913+
"license": "MIT",
93914+
"main": "lib/index.js",
93915+
"name": "proj4",
93916+
"repository": {
93917+
"type": "git",
93918+
"url": "git://github.com/proj4js/proj4js.git"
93919+
},
93920+
"scripts": {
93921+
"test": "./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"
93922+
},
93923+
"version": "2.3.15"
93924+
};
9382493925

9382593926
/***/ }),
9382693927
/* 467 */

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.

0 commit comments

Comments
 (0)