Skip to content

Commit 425d24b

Browse files
committed
fix mapv点击事件
1 parent 09ad0f2 commit 425d24b

File tree

17 files changed

+70
-45
lines changed

17 files changed

+70
-45
lines changed

dist/iclient-classic.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3550,6 +3550,11 @@ var MapVLayer = exports.MapVLayer = function (_SuperMap$Layer) {
35503550
_this.div.appendChild(_this.canvas);
35513551
var context = _this.options && _this.options.context || "2d";
35523552
_this.canvasContext = _this.canvas.getContext(context);
3553+
var global$2 = typeof window === 'undefined' ? {} : window;
3554+
var devicePixelRatio = _this.devicePixelRatio = global$2.devicePixelRatio;
3555+
if (_this.options.context == '2d') {
3556+
_this.canvasContext.scale(devicePixelRatio, devicePixelRatio);
3557+
}
35533558
_this.attribution = "© 2017 百度 <a href='http://mapv.baidu.com' target='_blank'>MapV</a> with <span>© <a target='_blank' href='http://iclient.supermap.io' " + "style='color: #08c;text-decoration: none;'>SuperMap iClient</a></span>";
35543559
return _this;
35553560
}
@@ -5625,7 +5630,7 @@ var MapVRenderer = function (_MapVBaseLayer) {
56255630
_createClass(MapVRenderer, [{
56265631
key: 'clickEvent',
56275632
value: function clickEvent(e) {
5628-
var pixel = e.layerPoint;
5633+
var pixel = e.xy;
56295634
_get(MapVRenderer.prototype.__proto__ || Object.getPrototypeOf(MapVRenderer.prototype), 'clickEvent', this).call(this, pixel, e);
56305635
}
56315636

@@ -5638,7 +5643,7 @@ var MapVRenderer = function (_MapVBaseLayer) {
56385643
}, {
56395644
key: 'mousemoveEvent',
56405645
value: function mousemoveEvent(e) {
5641-
var pixel = e.layerPoint;
5646+
var pixel = e.xy;
56425647
_get(MapVRenderer.prototype.__proto__ || Object.getPrototypeOf(MapVRenderer.prototype), 'mousemoveEvent', this).call(this, pixel, e);
56435648
}
56445649

dist/iclient-classic.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/iclient9-leaflet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14366,7 +14366,7 @@ var GeoText = function (_Geometry) {
1436614366
left = locationPx.x - labelSize.w / 2;
1436714367
bottom = locationPx.y + labelSize.h / 2;
1436814368
//处理斜体字
14369-
if (style.fontStyle && style.fontStyle && style.fontStyle === "italic") {
14369+
if (style.fontStyle && style.fontStyle === "italic") {
1437014370
right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
1437114371
} else {
1437214372
right = locationPx.x + labelSize.w / 2;

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.

dist/iclient9-mapboxgl.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12959,7 +12959,7 @@ var GeoText = function (_Geometry) {
1295912959
left = locationPx.x - labelSize.w / 2;
1296012960
bottom = locationPx.y + labelSize.h / 2;
1296112961
//处理斜体字
12962-
if (style.fontStyle && style.fontStyle && style.fontStyle === "italic") {
12962+
if (style.fontStyle && style.fontStyle === "italic") {
1296312963
right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
1296412964
} else {
1296512965
right = locationPx.x + labelSize.w / 2;
@@ -26463,6 +26463,7 @@ var MapvLayer = exports.MapvLayer = function () {
2646326463

2646426464
this.map = map;
2646526465
this.renderer = new _MapvRenderer2.default(map, this, dataSet, mapVOptions);
26466+
this.mapVOptions = mapVOptions;
2646626467
this.canvas = this._createCanvas();
2646726468
this.renderer._canvasUpdate();
2646826469
this.mapContainer = map.getCanvasContainer();
@@ -26585,6 +26586,11 @@ var MapvLayer = exports.MapvLayer = function () {
2658526586
canvas.height = parseInt(this.map.getCanvas().style.height);
2658626587
canvas.style.width = this.map.getCanvas().style.width;
2658726588
canvas.style.height = this.map.getCanvas().style.height;
26589+
var global$2 = typeof window === 'undefined' ? {} : window;
26590+
var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio;
26591+
if (this.mapVOptions.context == '2d') {
26592+
canvas.getContext(this.mapVOptions.context).scale(devicePixelRatio, devicePixelRatio);
26593+
}
2658826594
return canvas;
2658926595
}
2659026596
}]);
@@ -73098,7 +73104,7 @@ var MapvRenderer = function (_BaseLayer) {
7309873104
_createClass(MapvRenderer, [{
7309973105
key: 'clickEvent',
7310073106
value: function clickEvent(e) {
73101-
var pixel = e.layerPoint;
73107+
var pixel = e.point;
7310273108
_get(MapvRenderer.prototype.__proto__ || Object.getPrototypeOf(MapvRenderer.prototype), 'clickEvent', this).call(this, pixel, e);
7310373109
}
7310473110

@@ -73111,7 +73117,7 @@ var MapvRenderer = function (_BaseLayer) {
7311173117
}, {
7311273118
key: 'mousemoveEvent',
7311373119
value: function mousemoveEvent(e) {
73114-
var pixel = e.layerPoint;
73120+
var pixel = e.point;
7311573121
_get(MapvRenderer.prototype.__proto__ || Object.getPrototypeOf(MapvRenderer.prototype), 'mousemoveEvent', this).call(this, pixel, e);
7311673122
}
7311773123

dist/iclient9-mapboxgl.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/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: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15325,7 +15325,7 @@ var GeoText = function (_Geometry) {
1532515325
left = locationPx.x - labelSize.w / 2;
1532615326
bottom = locationPx.y + labelSize.h / 2;
1532715327
//处理斜体字
15328-
if (style.fontStyle && style.fontStyle && style.fontStyle === "italic") {
15328+
if (style.fontStyle && style.fontStyle === "italic") {
1532915329
right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
1533015330
} else {
1533115331
right = locationPx.x + labelSize.w / 2;
@@ -33049,9 +33049,9 @@ var WebMap = function (_ol$Observable) {
3304933049
}
3305033050
if (layer) {
3305133051
this.addLayer(layer);
33052-
}
33053-
if (layer.labelLayer) {
33054-
this.addLayer(layer.labelLayer);
33052+
if (layer.labelLayer) {
33053+
this.addLayer(layer.labelLayer);
33054+
}
3305533055
}
3305633056
}
3305733057

@@ -33565,7 +33565,8 @@ var WebMap = function (_ol$Observable) {
3356533565
} else {
3356633566
addFeatures(sFeaturesArr);
3356733567
}
33568-
}, function () {});
33568+
}, function (err) {// eslint-disable-line no-unused-vars
33569+
});
3356933570
} else {
3357033571
var newFeautures = [],
3357133572
features = layerInfo.features;
@@ -92057,7 +92058,7 @@ module.exports = whatwgFetch;
9205792058
/* 439 */
9205892059
/***/ (function(module, exports) {
9205992060

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"}
92061+
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"}
9206192062

9206292063
/***/ }),
9206392064
/* 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.

0 commit comments

Comments
 (0)