Skip to content

Commit 8a6e6e6

Browse files
author
caoxinke@supermap.com
committed
fix openlayers下mapv示例动画有重影的问题。
1 parent 5581deb commit 8a6e6e6

File tree

5 files changed

+52
-4
lines changed

5 files changed

+52
-4
lines changed

dist/iclient9-openlayers.css

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: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85113,6 +85113,8 @@ var MapvLayer = function (_BaiduMapLayer) {
8511385113
});
8511485114
_this.clickEvent = _this.clickEvent.bind(_this);
8511585115
_this.mousemoveEvent = _this.mousemoveEvent.bind(_this);
85116+
map.on('movestart', _this.moveStartEvent.bind(_this));
85117+
map.on('moveend', _this.moveEndEvent.bind(_this));
8511685118
_this.bindEvent();
8511785119
return _this;
8511885120
}
@@ -85163,6 +85165,31 @@ var MapvLayer = function (_BaiduMapLayer) {
8516385165
_get(MapvLayer.prototype.__proto__ || Object.getPrototypeOf(MapvLayer.prototype), 'mousemoveEvent', this).call(this, { x: pixel[0], y: pixel[1] }, e);
8516485166
}
8516585167

85168+
/**
85169+
* @function MapvLayer.prototype.moveStartEvent
85170+
* @description 开始移动事件
85171+
*/
85172+
85173+
}, {
85174+
key: 'moveStartEvent',
85175+
value: function moveStartEvent() {
85176+
var animationOptions = this.options.animation;
85177+
if (this.isEnabledTime() && this.animator) {
85178+
this.steps.step = animationOptions.stepsRange.start;
85179+
}
85180+
}
85181+
85182+
/**
85183+
* @function MapvLayer.prototype.moveEndEvent
85184+
* @description 结束移动事件
85185+
*/
85186+
85187+
}, {
85188+
key: 'moveEndEvent',
85189+
value: function moveEndEvent() {
85190+
this.canvasLayer.draw();
85191+
}
85192+
8516685193
/**
8516785194
* @function MapvLayer.prototype.bindEvent
8516885195
* @description 绑定事件
@@ -92030,7 +92057,7 @@ module.exports = whatwgFetch;
9203092057
/* 439 */
9203192058
/***/ (function(module, exports) {
9203292059

92033-
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"}
92060+
module.exports = {"_from":"proj4@2.3.15","_id":"proj4@2.3.15","_inBundle":false,"_integrity":"sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=","_location":"/proj4","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"proj4@2.3.15","name":"proj4","escapedName":"proj4","rawSpec":"2.3.15","saveSpec":null,"fetchSpec":"2.3.15"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/proj4/-/proj4-2.3.15.tgz","_shasum":"5ad06e8bca30be0ffa389a49e4565f51f06d089e","_spec":"proj4@2.3.15","_where":"F:\\codes\\iClient9Copy\\iClient9","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":"~0.0.2"},"deprecated":false,"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"},"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","name":"proj4","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"}
9203492061

9203592062
/***/ }),
9203692063
/* 440 */

dist/iclient9-openlayers.min.css

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.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/openlayers/overlay/mapv/MapvLayer.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export default class MapvLayer extends BaiduMapLayer {
5151
});
5252
this.clickEvent = this.clickEvent.bind(this);
5353
this.mousemoveEvent = this.mousemoveEvent.bind(this);
54+
map.on('movestart', this.moveStartEvent.bind(this));
55+
map.on('moveend', this.moveEndEvent.bind(this));
5456
this.bindEvent();
5557
}
5658

@@ -90,6 +92,25 @@ export default class MapvLayer extends BaiduMapLayer {
9092
super.mousemoveEvent({x: pixel[0], y: pixel[1]}, e);
9193
}
9294

95+
/**
96+
* @function MapvLayer.prototype.moveStartEvent
97+
* @description 开始移动事件
98+
*/
99+
moveStartEvent() {
100+
var animationOptions = this.options.animation;
101+
if (this.isEnabledTime() && this.animator) {
102+
this.steps.step = animationOptions.stepsRange.start;
103+
}
104+
}
105+
106+
/**
107+
* @function MapvLayer.prototype.moveEndEvent
108+
* @description 结束移动事件
109+
*/
110+
moveEndEvent() {
111+
this.canvasLayer.draw();
112+
}
113+
93114
/**
94115
* @function MapvLayer.prototype.bindEvent
95116
* @description 绑定事件

0 commit comments

Comments
 (0)