Skip to content

Commit 5581deb

Browse files
committed
fix mapvlayer 无法选中要素的问题
1 parent 3804e89 commit 5581deb

File tree

9 files changed

+21
-113
lines changed

9 files changed

+21
-113
lines changed

dist/iclient9-leaflet.js

Lines changed: 7 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -33390,8 +33390,7 @@ var WebMap = exports.WebMap = _leaflet2["default"].LayerGroup.extend({
3339033390
var title = layerInfo.title;
3339133391
var labelField = themeSettings.labelField,
3339233392
settings = themeSettings.settings,
33393-
isVisible = layerInfo.isVisible,
33394-
opacity = layerInfo.opacity;
33393+
isVisible = layerInfo.isVisible;
3339533394

3339633395
//目前只是同一样式
3339733396
var style;
@@ -34761,6 +34760,11 @@ var MapVLayer = exports.MapVLayer = _leaflet2["default"].Layer.extend({
3476134760
canvas.style.left = 0 + "px";
3476234761
canvas.style.pointerEvents = "none";
3476334762
canvas.style.zIndex = this.options.zIndex || 600;
34763+
var global$2 = typeof window === 'undefined' ? {} : window;
34764+
var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio;
34765+
if (this.mapVOptions.context == '2d') {
34766+
canvas.getContext(this.mapVOptions.context).scale(devicePixelRatio, devicePixelRatio);
34767+
}
3476434768
return canvas;
3476534769
},
3476634770

@@ -93983,108 +93987,7 @@ exports.names = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
9398393987
/* 467 */
9398493988
/***/ (function(module, exports) {
9398593989

93986-
module.exports = {
93987-
"_from": "proj4@2.3.15",
93988-
"_id": "proj4@2.3.15",
93989-
"_inBundle": false,
93990-
"_integrity": "sha1-WtBui8owvg/6OJpJ5FZfUfBtCJ4=",
93991-
"_location": "/proj4",
93992-
"_phantomChildren": {},
93993-
"_requested": {
93994-
"type": "version",
93995-
"registry": true,
93996-
"raw": "proj4@2.3.15",
93997-
"name": "proj4",
93998-
"escapedName": "proj4",
93999-
"rawSpec": "2.3.15",
94000-
"saveSpec": null,
94001-
"fetchSpec": "2.3.15"
94002-
},
94003-
"_requiredBy": [
94004-
"/"
94005-
],
94006-
"_resolved": "http://registry.npm.taobao.org/proj4/download/proj4-2.3.15.tgz",
94007-
"_shasum": "5ad06e8bca30be0ffa389a49e4565f51f06d089e",
94008-
"_spec": "proj4@2.3.15",
94009-
"_where": "F:\\dev\\iClient",
94010-
"author": "",
94011-
"bugs": {
94012-
"url": "https://github.com/proj4js/proj4js/issues"
94013-
},
94014-
"bundleDependencies": false,
94015-
"contributors": [
94016-
{
94017-
"name": "Mike Adair",
94018-
"email": "madair@dmsolutions.ca"
94019-
},
94020-
{
94021-
"name": "Richard Greenwood",
94022-
"email": "rich@greenwoodmap.com"
94023-
},
94024-
{
94025-
"name": "Calvin Metcalf",
94026-
"email": "calvin.metcalf@gmail.com"
94027-
},
94028-
{
94029-
"name": "Richard Marsden",
94030-
"url": "http://www.winwaed.com"
94031-
},
94032-
{
94033-
"name": "T. Mittan"
94034-
},
94035-
{
94036-
"name": "D. Steinwand"
94037-
},
94038-
{
94039-
"name": "S. Nelson"
94040-
}
94041-
],
94042-
"dependencies": {
94043-
"mgrs": "~0.0.2"
94044-
},
94045-
"deprecated": false,
94046-
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",
94047-
"devDependencies": {
94048-
"browserify": "~12.0.1",
94049-
"chai": "~1.8.1",
94050-
"curl": "git://github.com/cujojs/curl.git",
94051-
"grunt": "~0.4.2",
94052-
"grunt-browserify": "~4.0.1",
94053-
"grunt-cli": "~0.1.13",
94054-
"grunt-contrib-connect": "~0.6.0",
94055-
"grunt-contrib-jshint": "~0.8.0",
94056-
"grunt-contrib-uglify": "~0.11.1",
94057-
"grunt-mocha-phantomjs": "~0.4.0",
94058-
"istanbul": "~0.2.4",
94059-
"mocha": "~1.17.1",
94060-
"tin": "~0.4.0"
94061-
},
94062-
"directories": {
94063-
"test": "test",
94064-
"doc": "docs"
94065-
},
94066-
"homepage": "https://github.com/proj4js/proj4js#readme",
94067-
"jam": {
94068-
"main": "dist/proj4.js",
94069-
"include": [
94070-
"dist/proj4.js",
94071-
"README.md",
94072-
"AUTHORS",
94073-
"LICENSE.md"
94074-
]
94075-
},
94076-
"license": "MIT",
94077-
"main": "lib/index.js",
94078-
"name": "proj4",
94079-
"repository": {
94080-
"type": "git",
94081-
"url": "git://github.com/proj4js/proj4js.git"
94082-
},
94083-
"scripts": {
94084-
"test": "./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"
94085-
},
94086-
"version": "2.3.15"
94087-
};
93990+
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"}
9408893991

9408993992
/***/ }),
9409093993
/* 468 */

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-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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85147,7 +85147,7 @@ var MapvLayer = function (_BaiduMapLayer) {
8514785147
key: 'clickEvent',
8514885148
value: function clickEvent(e) {
8514985149
var pixel = e.pixel;
85150-
_get(MapvLayer.prototype.__proto__ || Object.getPrototypeOf(MapvLayer.prototype), 'clickEvent', this).call(this, { x: pixel[0], y: pixel[1] }, e);
85150+
_get(MapvLayer.prototype.__proto__ || Object.getPrototypeOf(MapvLayer.prototype), 'clickEvent', this).call(this, { x: pixel[0] + this.offset[0], y: pixel[1] + this.offset[1] }, e);
8515185151
}
8515285152

8515385153
/**
@@ -92030,7 +92030,7 @@ module.exports = whatwgFetch;
9203092030
/* 439 */
9203192031
/***/ (function(module, exports) {
9203292032

92033-
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"}
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"}
9203492034

9203592035
/***/ }),
9203692036
/* 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/leaflet/mapping/WebMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ export var WebMap = L.LayerGroup.extend({
625625
createLabelLayer: function (layerInfo, themeSettings) {
626626
var title = layerInfo.title;
627627
var labelField = themeSettings.labelField, settings = themeSettings.settings,
628-
isVisible = layerInfo.isVisible, opacity = layerInfo.opacity;
628+
isVisible = layerInfo.isVisible;
629629

630630
//目前只是同一样式
631631
var style;

src/leaflet/overlay/MapVLayer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ export var MapVLayer = L.Layer.extend({
197197
canvas.style.left = 0 + "px";
198198
canvas.style.pointerEvents = "none";
199199
canvas.style.zIndex = this.options.zIndex || 600;
200+
var global$2 = typeof window === 'undefined' ? {} : window;
201+
var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio;
202+
if (this.mapVOptions.context == '2d') {
203+
canvas.getContext(this.mapVOptions.context).scale(devicePixelRatio, devicePixelRatio);
204+
}
200205
return canvas;
201206
},
202207

src/openlayers/overlay/mapv/MapvLayer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ol from 'openlayers/dist/ol-debug';
22
import MapvCanvasLayer from './MapvCanvasLayer';
3-
import {baiduMapLayer,DataSet} from "mapv";
3+
import {baiduMapLayer, DataSet} from "mapv";
44

55
var BaiduMapLayer = baiduMapLayer ? baiduMapLayer.__proto__ : Function;
66
/**
@@ -77,7 +77,7 @@ export default class MapvLayer extends BaiduMapLayer {
7777
*/
7878
clickEvent(e) {
7979
var pixel = e.pixel;
80-
super.clickEvent({x: pixel[0], y: pixel[1]}, e);
80+
super.clickEvent({x: pixel[0] + this.offset[0], y: pixel[1] + this.offset[1]}, e);
8181
}
8282

8383
/**

0 commit comments

Comments
 (0)