Skip to content

Commit bcb1427

Browse files
committed
fix leaflet echartsLayer resize bug
1 parent 41c378a commit bcb1427

File tree

3 files changed

+16
-103
lines changed

3 files changed

+16
-103
lines changed

dist/iclient9-leaflet.js

Lines changed: 8 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -30659,6 +30659,13 @@ var EchartsLayer = exports.EchartsLayer = _leaflet2["default"].Layer.extend({
3065930659
_div.style.zIndex = 10;
3066030660
this._echartsContainer = _div;
3066130661
this._map.getPanes().overlayPane.appendChild(this._echartsContainer);
30662+
var me = this;
30663+
this._map.on('resize', function (e) {
30664+
var size = e.newSize;
30665+
me._echartsContainer.style.width = size.x + 'px';
30666+
me._echartsContainer.style.height = size.y + 'px';
30667+
me._ec.resize();
30668+
});
3066230669
}
3066330670

3066430671
});
@@ -91848,108 +91855,7 @@ exports.names = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
9184891855
/* 465 */
9184991856
/***/ (function(module, exports) {
9185091857

91851-
module.exports = {
91852-
"_from": "proj4@2.3.15",
91853-
"_id": "proj4@2.3.15",
91854-
"_inBundle": false,
91855-
"_integrity": "sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=",
91856-
"_location": "/proj4",
91857-
"_phantomChildren": {},
91858-
"_requested": {
91859-
"type": "version",
91860-
"registry": true,
91861-
"raw": "proj4@2.3.15",
91862-
"name": "proj4",
91863-
"escapedName": "proj4",
91864-
"rawSpec": "2.3.15",
91865-
"saveSpec": null,
91866-
"fetchSpec": "2.3.15"
91867-
},
91868-
"_requiredBy": [
91869-
"/"
91870-
],
91871-
"_resolved": "http://registry.npm.taobao.org/proj4/download/proj4-2.3.15.tgz",
91872-
"_shasum": "5ad06e8bca30be0ffa389a49e4565f51f06d089e",
91873-
"_spec": "proj4@2.3.15",
91874-
"_where": "F:\\dev\\iClient",
91875-
"author": "",
91876-
"bugs": {
91877-
"url": "https://github.com/proj4js/proj4js/issues"
91878-
},
91879-
"bundleDependencies": false,
91880-
"contributors": [
91881-
{
91882-
"name": "Mike Adair",
91883-
"email": "madair@dmsolutions.ca"
91884-
},
91885-
{
91886-
"name": "Richard Greenwood",
91887-
"email": "rich@greenwoodmap.com"
91888-
},
91889-
{
91890-
"name": "Calvin Metcalf",
91891-
"email": "calvin.metcalf@gmail.com"
91892-
},
91893-
{
91894-
"name": "Richard Marsden",
91895-
"url": "http://www.winwaed.com"
91896-
},
91897-
{
91898-
"name": "T. Mittan"
91899-
},
91900-
{
91901-
"name": "D. Steinwand"
91902-
},
91903-
{
91904-
"name": "S. Nelson"
91905-
}
91906-
],
91907-
"dependencies": {
91908-
"mgrs": "~0.0.2"
91909-
},
91910-
"deprecated": false,
91911-
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",
91912-
"devDependencies": {
91913-
"browserify": "~12.0.1",
91914-
"chai": "~1.8.1",
91915-
"curl": "git://github.com/cujojs/curl.git",
91916-
"grunt": "~0.4.2",
91917-
"grunt-browserify": "~4.0.1",
91918-
"grunt-cli": "~0.1.13",
91919-
"grunt-contrib-connect": "~0.6.0",
91920-
"grunt-contrib-jshint": "~0.8.0",
91921-
"grunt-contrib-uglify": "~0.11.1",
91922-
"grunt-mocha-phantomjs": "~0.4.0",
91923-
"istanbul": "~0.2.4",
91924-
"mocha": "~1.17.1",
91925-
"tin": "~0.4.0"
91926-
},
91927-
"directories": {
91928-
"test": "test",
91929-
"doc": "docs"
91930-
},
91931-
"homepage": "https://github.com/proj4js/proj4js#readme",
91932-
"jam": {
91933-
"main": "dist/proj4.js",
91934-
"include": [
91935-
"dist/proj4.js",
91936-
"README.md",
91937-
"AUTHORS",
91938-
"LICENSE.md"
91939-
]
91940-
},
91941-
"license": "MIT",
91942-
"main": "lib/index.js",
91943-
"name": "proj4",
91944-
"repository": {
91945-
"type": "git",
91946-
"url": "git://github.com/proj4js/proj4js.git"
91947-
},
91948-
"scripts": {
91949-
"test": "./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"
91950-
},
91951-
"version": "2.3.15"
91952-
};
91858+
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"}
9195391859

9195491860
/***/ }),
9195591861
/* 466 */

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.

src/leaflet/overlay/EChartsLayer.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ export var EchartsLayer = L.Layer.extend({
154154
_div.style.zIndex = 10;
155155
this._echartsContainer = _div;
156156
this._map.getPanes().overlayPane.appendChild(this._echartsContainer);
157+
var me = this;
158+
this._map.on('resize', function (e) {
159+
let size = e.newSize;
160+
me._echartsContainer.style.width = size.x + 'px';
161+
me._echartsContainer.style.height = size.y + 'px';
162+
me._ec.resize()
163+
})
157164
}
158165

159166
});

0 commit comments

Comments
 (0)