Skip to content

Commit 014b9bc

Browse files
committed
【fix】修复openlayers 高效率点图层webgl渲染时点击闪一下的问题
1 parent b334daf commit 014b9bc

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

examples/openlayers/07_graphiclayer_webgl2.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
#title {
1515
position: absolute;
1616
color: white;
17-
left: 0;
18-
top: 30px;
1917
text-align: center;
20-
width: 100%;
18+
width: 600px;
19+
left: 0;
20+
top: 0;
21+
right: 0;
22+
margin: auto
2123
}
2224

2325
#title > h3 {

src/openlayers/overlay/Graphic.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ export class Graphic extends ImageCanvasSource {
8383

8484
if (options.onClick) {
8585
me.map.on('click', function (e) {
86+
if(me.renderer instanceof GraphicWebGLRenderer){
87+
return;
88+
}
8689
const features = me.map.getFeaturesAtPixel(e.pixel) || [];
8790
for (let index = 0; index < features.length; index++) {
8891
const graphic = features[index];

0 commit comments

Comments
 (0)