Skip to content

Commit bdc72ba

Browse files
committed
fix 漏提交(mbgl专题图相关问题)
1 parent 505a317 commit bdc72ba

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

dist/iclient9-mapboxgl.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51533,6 +51533,7 @@ var Theme3DLayer = exports.Theme3DLayer = function () {
5153351533
var layerId = this.id ? this.id : "theme3DLayer";
5153451534
if (this.map.getLayer(layerId)) {
5153551535
this.map.off('mousemove', layerId, this._onMouseMove.bind(this));
51536+
this.map.on('mouseout', layerId, this._onMouseMove.bind(this));
5153651537
this.map.removeLayer(layerId);
5153751538
}
5153851539
//移除高亮图层
@@ -51664,6 +51665,7 @@ var Theme3DLayer = exports.Theme3DLayer = function () {
5166451665

5166551666
this._selectFeatureId = null;
5166651667
map.on('mousemove', this.id, this._onMouseMove.bind(this));
51668+
map.on('mouseout', this.id, this._onMouseMove.bind(this));
5166751669
}
5166851670
}, {
5166951671
key: '_onMouseMove',
@@ -51678,14 +51680,15 @@ var Theme3DLayer = exports.Theme3DLayer = function () {
5167851680

5167951681
if (!features || features.length < 1) {
5168051682
me._clearHighlight.call(me);
51683+
me._selectFeatureId = null;
5168151684
return;
5168251685
}
5168351686
var id = features[0].id;
51684-
if (this._selectFeatureId === id) {
51687+
if (me._selectFeatureId === id) {
5168551688
return;
5168651689
}
51687-
this._selectFeatureId = id;
51688-
map.setFilter("highlightLayer", ['==', '$id', this._selectFeatureId]);
51690+
me._selectFeatureId = id;
51691+
map.setFilter("highlightLayer", ['==', '$id', me._selectFeatureId]);
5168951692
}
5169051693
}, {
5169151694
key: '_clearHighlight',

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/include-mapboxgl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
inputScript("https://cdn.bootcss.com/three.js/90/three.min.js");
5959
}
6060
if (!inArray(excludes, 'iclient9-mapboxgl')) {
61-
inputScript("../../dist/iclient9-mapboxgl.js");
61+
inputScript("../../dist/iclient9-mapboxgl.min.js");
6262
}
6363
if (inArray(includes, 'proj4')) {
6464
inputScript("https://cdn.bootcss.com/proj4js/2.4.3/proj4.js");

examples/mapboxgl/graphThemeLayer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@
429429
}
430430
contentHTML += "</div>";
431431

432-
var tempPoint = map.unproject(new window.mapboxgl.Point(e.event.x, e.event.y));
432+
var tempPoint = map.unproject({x:e.event.x, y:e.event.y});
433433
popup = new mapboxgl.Popup({closeOnClick: false})
434434
.setLngLat([tempPoint.lng, tempPoint.lat])
435435
.setHTML(contentHTML)

examples/mapboxgl/rangeTheme3DLayer.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
var host = window.isLocal ? window.server : "http://117.122.248.69:8090";
2828
var dataUrl = host + "/iserver/services/data-jingjin/rest/data";
2929

30-
var center = [116.640545, 40.531714], themeField = "POP_DENSITY99", popup;
30+
var center = [116.640545, 40.531714], themeField = "POP_DENSITY99",
31+
themeLayer, popup;
3132

3233
var map = new mapboxgl.Map({
3334
container: 'map',
@@ -86,7 +87,7 @@
8687
//创建专题图图层
8788
function createThemeLayer(data) {
8889
popup = new mapboxgl.Popup({closeOnClick: true}).addTo(map);
89-
var themeLayer = new mapboxgl.supermap.RangeTheme3DLayer("range3DThemeLayer", {
90+
themeLayer = new mapboxgl.supermap.RangeTheme3DLayer("range3DThemeLayer", {
9091
heightField: themeField,
9192
themeField: themeField,
9293
parseNumber: true,

src/mapboxgl/overlay/theme/Theme3DLayer.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ export class Theme3DLayer {
234234
var layerId = this.id ? this.id : "theme3DLayer";
235235
if (this.map.getLayer(layerId)) {
236236
this.map.off('mousemove', layerId, this._onMouseMove.bind(this));
237+
this.map.on('mouseout', layerId, this._onMouseMove.bind(this));
237238
this.map.removeLayer(layerId);
238239
}
239240
//移除高亮图层
@@ -354,6 +355,7 @@ export class Theme3DLayer {
354355

355356
this._selectFeatureId = null;
356357
map.on('mousemove', this.id, this._onMouseMove.bind(this));
358+
map.on('mouseout', this.id, this._onMouseMove.bind(this));
357359
}
358360

359361
_onMouseMove(e) {
@@ -366,14 +368,15 @@ export class Theme3DLayer {
366368

367369
if (!features || features.length < 1) {
368370
me._clearHighlight.call(me);
371+
me._selectFeatureId = null;
369372
return;
370373
}
371374
var id = features[0].id;
372-
if (this._selectFeatureId === id) {
375+
if (me._selectFeatureId === id) {
373376
return;
374377
}
375-
this._selectFeatureId = id;
376-
map.setFilter("highlightLayer", ['==', '$id', this._selectFeatureId]);
378+
me._selectFeatureId = id;
379+
map.setFilter("highlightLayer", ['==', '$id', me._selectFeatureId]);
377380
}
378381

379382
_clearHighlight() {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy