From 5607d32acf3aee6b08c0db29544ff73d3ffdc98e Mon Sep 17 00:00:00 2001 From: Jakub Pelc <57600346+kubapelc@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:13:31 +0200 Subject: [PATCH] Fix text not being occluded by the globe when overlapmode=always (#4844) * Add globe text overlap+occlusion render test * Move render test * Render test for lines * Fix overlap: always texts not being occluded by the globe * Fix icon overlap+occlusion, add render test * Add changelog entry * PR feedback --- CHANGELOG.md | 1 + src/symbol/collision_index.ts | 16 +- src/symbol/placement.ts | 11 +- .../line/expected.png | Bin 0 -> 3899 bytes .../line/style.json | 226 ++++++++++++++++++ .../point-icon/expected.png | Bin 0 -> 7958 bytes .../point-icon/style.json | 128 ++++++++++ .../point/expected.png | Bin 0 -> 4778 bytes .../point/style.json | 127 ++++++++++ 9 files changed, 497 insertions(+), 12 deletions(-) create mode 100644 test/integration/render/tests/projection/globe/text-always-overlap-occluded/line/expected.png create mode 100644 test/integration/render/tests/projection/globe/text-always-overlap-occluded/line/style.json create mode 100644 test/integration/render/tests/projection/globe/text-always-overlap-occluded/point-icon/expected.png create mode 100644 test/integration/render/tests/projection/globe/text-always-overlap-occluded/point-icon/style.json create mode 100644 test/integration/render/tests/projection/globe/text-always-overlap-occluded/point/expected.png create mode 100644 test/integration/render/tests/projection/globe/text-always-overlap-occluded/point/style.json diff --git a/CHANGELOG.md b/CHANGELOG.md index b8a0bb30ff..7ae28c50b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - _...Add new stuff here..._ ### 🐞 Bug fixes +- Fix text not being hidden behind the globe when overlap mode was set to `always` ([#4802](https://github.com/maplibre/maplibre-gl-js/issues/4802)) - _...Add new stuff here..._ ## 5.0.0-pre.2 diff --git a/src/symbol/collision_index.ts b/src/symbol/collision_index.ts index e4aece7f90..683b0c345c 100644 --- a/src/symbol/collision_index.ts +++ b/src/symbol/collision_index.ts @@ -36,6 +36,7 @@ export type PlacedBox = { box: Array; placeable: boolean; offscreen: boolean; + occluded: boolean; }; export type FeatureKey = { @@ -154,12 +155,9 @@ export class CollisionIndex { const [tlX, tlY, brX, brY] = projectedBox.box; // Conditions are ordered from the fastest to evaluate to the slowest. - let unplaceable = false; - if (pitchWithMap) { - unplaceable ||= projectedBox.allPointsOccluded; - } else { - unplaceable ||= projectedPoint.isOccluded; - } + const occluded = pitchWithMap ? projectedBox.allPointsOccluded : projectedPoint.isOccluded; + + let unplaceable = occluded; unplaceable ||= projectedPoint.perspectiveRatio < this.perspectiveRatioCutoff; unplaceable ||= !this.isInsideGrid(tlX, tlY, brX, brY); @@ -168,14 +166,16 @@ export class CollisionIndex { return { box: [tlX, tlY, brX, brY], placeable: false, - offscreen: false + offscreen: false, + occluded }; } return { box: [tlX, tlY, brX, brY], placeable: true, - offscreen: this.isOffscreen(tlX, tlY, brX, brY) + offscreen: this.isOffscreen(tlX, tlY, brX, brY), + occluded }; } diff --git a/src/symbol/placement.ts b/src/symbol/placement.ts index feba0edebb..f0baee82e2 100644 --- a/src/symbol/placement.ts +++ b/src/symbol/placement.ts @@ -472,7 +472,7 @@ export class Placement { let offscreen = true; let shift = null; - let placed: PlacedBox = {box: null, placeable: false, offscreen: null}; + let placed: PlacedBox = {box: null, placeable: false, offscreen: null, occluded: false}; let placedVerticalText = {box: null, placeable: false, offscreen: null}; let placedGlyphBoxes: PlacedBox = null; @@ -631,7 +631,8 @@ export class Placement { placedBox = { box: placedFakeGlyphBox.box, offscreen: false, - placeable: false + placeable: false, + occluded: false, }; } @@ -675,7 +676,6 @@ export class Placement { placedGlyphBoxes = placed; placeText = placedGlyphBoxes && placedGlyphBoxes.placeable; - offscreen = placedGlyphBoxes && placedGlyphBoxes.offscreen; if (symbolInstance.useRuntimeCollisionCircles) { @@ -809,7 +809,10 @@ export class Placement { if (symbolInstance.crossTileID === 0) throw new Error('symbolInstance.crossTileID can\'t be 0'); if (bucket.bucketInstanceId === 0) throw new Error('bucket.bucketInstanceId can\'t be 0'); - this.placements[symbolInstance.crossTileID] = new JointPlacement(placeText || alwaysShowText, placeIcon || alwaysShowIcon, offscreen || bucket.justReloaded); + // Do not show text or icons that are occluded by the globe, even if overlap mode is 'always'! + const textVisible: boolean = (placeText || alwaysShowText) && !(placedGlyphBoxes?.occluded); + const iconVisible = (placeIcon || alwaysShowIcon) && !(placedIconBoxes?.occluded); + this.placements[symbolInstance.crossTileID] = new JointPlacement(textVisible, iconVisible, offscreen || bucket.justReloaded); seenCrossTileIDs[symbolInstance.crossTileID] = true; }; diff --git a/test/integration/render/tests/projection/globe/text-always-overlap-occluded/line/expected.png b/test/integration/render/tests/projection/globe/text-always-overlap-occluded/line/expected.png new file mode 100644 index 0000000000000000000000000000000000000000..78f833074522b854c1f1bade6027f10b05ef454d GIT binary patch literal 3899 zcmZ`+2{_c-`$r=q*JZ|92xG>+B$YLqjF_xRqJ@SUTuah|Y&9g5Fp}Ytx}mFv#*aY~ z+44)avJ=^d>`Atf-#PQt@43(O|NWnNzR#TH^Si3du~@3IoJ7A%XUqduT&nFz1+IbLn3{Hx8;QsZl#Ha?;<|2Q=@Qs-!nrU^p<*&aF}VlBl63%D+0WzoC+n%*%TY|s2S<SGSot$3WTWevR>tlSn&Ey0qy z9MFU|GPOj3)TIQcvA$+CbX%e@{!fcOAY7F+iN-hMm`bEBG@4-NPRu9LnD-H=4hQ?w zXmW}i9$rsqB84X~W32{9>D(z|{0`)BtvgexszmE3}&@1Hh^!atBx%n}Zro=4j zo+1~Z*O&@zG*%#yt${&da*%mphijVBEhxxzb=b33B9X%mfu1s_hXXx0hvoEu+$Nmk z$N|P?t6-bxvLNt;1gr-1l%jxq>o01zGk;rlOyP}8JJpdfeM z|4IFid-!#p%kg7855Xk(nIT>=QE4Y=2-KD1{}_ZO4JeYx`++M1iT}tP7`svnnsdB` zaPfT%F4jXF_+-++2Z75 zPYfhYe)xqiL{^cOCT@1%qY`<%&wP9&Z+d{?)h=gX$k%2SGP{f@@@PFjP%fjlHugO4 zud{(+4@MKJlJbtTiZU`@q`h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xLm6NHr^65_5Y)P#2wI1}d$*HG-tdEwhW6z%3 zkbs40Mr-7*{QjHer(a)3EU|3I`@EknRIY3q!c&}^j~yo{6>Y}{ua-xVyR*S50IB&_ zD!~KL{O`Y3soW{zHfvO8@U&E3p$;SFy|g8+=xo+B>ayH z-V98fID;7YRXF^t42Y(fL!hKkrELGT6fAk7IcO_{;IE2eDhZjmrzq~9m54eIC{F4z zlaGHE;#8MdE>KS;A+P_pIOvAD*PRis;iA;s7%)GrgxZJywRStScDe9Zy(GqsCU==* zJpY0k_nn0vC!4jMhaOLfpyWUmhQ`ZsO1&(&)N~GV-2$pwcYshKv$oq*V+p9^5pvy$ zGhqfNbj{j?ICbDfXikYdC7k;0IdsPaG&z=qL#glPm`M+!B{b=^{Lhl|J?J?vVmyDlag-PcNlRN+q8ZL;fwK71IBlGU_2Fw z{UC%zxpy8lV|`VCmFbF<1NV#bk>wV&WhaEMx>pE9GLU^|?4v-erc01J5=9j#nrL!_ zJ%X1Q2d&t$Mcg9BiQ*;rbuh{f_Ql9V2F1*dksXA(lEk18&SAet1AR_Xci<)d0yDh#BbgJBI^mmn0|74xPXSGb+fW>%xB%;Rn0c94U(fux(Gr*9!k z5*gv5Hbj#CIn=U9*$r*X$rIIqUzD4%4)al$!YmBIt! kH+xS*%Kgu@>x$Sm))Jt5FEpnWJc_x9W;TR^!{;df0p+DL;Q#;t literal 0 HcmV?d00001 diff --git a/test/integration/render/tests/projection/globe/text-always-overlap-occluded/line/style.json b/test/integration/render/tests/projection/globe/text-always-overlap-occluded/line/style.json new file mode 100644 index 0000000000..6c53e44dd0 --- /dev/null +++ b/test/integration/render/tests/projection/globe/text-always-overlap-occluded/line/style.json @@ -0,0 +1,226 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256, + "width": 256 + } + }, + "sky": { + "atmosphere-blend": 0.0 + }, + "zoom": 1, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "projection": { + "type": "globe" + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Feature", + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [ + -160, + -25 + ], + [ + -160, + 25 + ] + ], + [ + [ + -140, + -25 + ], + [ + -140, + 25 + ] + ], + [ + [ + -120, + -25 + ], + [ + -120, + 25 + ] + ], + [ + [ + -250, + -25 + ], + [ + -250, + 25 + ] + ], + [ + [ + -80, + -25 + ], + [ + -80, + 25 + ] + ], + [ + [ + -60, + -25 + ], + [ + -60, + 25 + ] + ], + [ + [ + -40, + -25 + ], + [ + -40, + 25 + ] + ], + [ + [ + -20, + -25 + ], + [ + -20, + 25 + ] + ], + [ + [ + 0, + -25 + ], + [ + 0, + 25 + ] + ], + [ + [ + 20, + -25 + ], + [ + 20, + 25 + ] + ], + [ + [ + 40, + -25 + ], + [ + 40, + 25 + ] + ], + [ + [ + 60, + -25 + ], + [ + 60, + 25 + ] + ], + [ + [ + 80, + -25 + ], + [ + 80, + 25 + ] + ], + [ + [ + 100, + -25 + ], + [ + 100, + 25 + ] + ], + [ + [ + 120, + -25 + ], + [ + 120, + 25 + ] + ], + [ + [ + 140, + -25 + ], + [ + 140, + 25 + ] + ], + [ + [ + 160, + -25 + ], + [ + 160, + 25 + ] + ] + ] + } + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "blue" + } + }, + { + "id": "text", + "type": "symbol", + "source": "geojson", + "layout": { + "symbol-placement": "line-center", + "text-field": "A", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-overlap": "always" + }, + "paint": { + "text-color": "yellow" + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render/tests/projection/globe/text-always-overlap-occluded/point-icon/expected.png b/test/integration/render/tests/projection/globe/text-always-overlap-occluded/point-icon/expected.png new file mode 100644 index 0000000000000000000000000000000000000000..c6628e190ca57227d65977ea6b6c83b66cb6e549 GIT binary patch literal 7958 zcmbtZ2{=@J+aFs7S;m&aVC+lGL>XJQku{m@ORpHTXG@4Dt<=A7UCTk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Tr>$y{XSSw zpn9UH!$jDBtn|kyBfzA`jSzWDa(g{~!H6nHfx#A9sTBG{kwIWpU!6;&^ZS&82?k~@ zagqoM&2~S$4^iQRVz7yb?PY!yajG*n!%&rRqW3m)7>0=3W}diC4Ogj+pwMlXE^e2a z=!W{gBU*1mIS~}m@4HN?tPWt;gcOu2=p6%P*dA5{m zxRf2$3CnG$UOTpjD#a@Y!xOVUP`e<91|utSh%mMGc*J7}7-~`LG9{a6M{UfgV0!e*XYH<1oyNyA||oT6k% z6qW7q8v>{(p1{~(1a1&OPLrX?$E|4IZKE|XCzzL<9U=-$+HAR;VBR1f;8T=nLQKvx zP*wOPLfFv(x}hk*Aq@+7I;utm^uZcW2-Jx+@mWS`(`R_CrU2dm6M7-<)!R^<1?nIo zq|r&96L@fgaZ$&ReV~mLgjmRKvXg``sG=Z*Ly~Vbn`i@GB7*_FqBxjrQeDVF5JY}3 z@}z=HV4RJVh-OL%l~PZOUQw3Kn+sE6!lM|CK`K9UTEI}NRm4Kt_`};2Ve;lJV{2CPkWnxReG;e$KDV_ MJyXm>o#P?@1LpwfhyVZp literal 0 HcmV?d00001 diff --git a/test/integration/render/tests/projection/globe/text-always-overlap-occluded/point-icon/style.json b/test/integration/render/tests/projection/globe/text-always-overlap-occluded/point-icon/style.json new file mode 100644 index 0000000000..b2151f9535 --- /dev/null +++ b/test/integration/render/tests/projection/globe/text-always-overlap-occluded/point-icon/style.json @@ -0,0 +1,128 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256, + "width": 256 + } + }, + "sky": { + "atmosphere-blend": 0.0 + }, + "zoom": 1, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "projection": { + "type": "globe" + }, + "sprite": "local://sprites/sprite", + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Feature", + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [ + -160, + 0 + ], + [ + -140, + 0 + ], + [ + -120, + 0 + ], + [ + -100, + 0 + ], + [ + -80, + 0 + ], + [ + -60, + 0 + ], + [ + -40, + 0 + ], + [ + -20, + 0 + ], + [ + 0, + 0 + ], + [ + 20, + 0 + ], + [ + 40, + 0 + ], + [ + 60, + 0 + ], + [ + 80, + 0 + ], + [ + 100, + 0 + ], + [ + 120, + 0 + ], + [ + 140, + 0 + ], + [ + 160, + 0 + ], + [ + 180, + 0 + ] + ] + } + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "blue" + } + }, + { + "id": "text", + "type": "symbol", + "source": "geojson", + "layout": { + "symbol-placement": "point", + "icon-image": "fav-airport-18", + "icon-rotation-alignment": "viewport", + "icon-overlap": "always", + "icon-allow-overlap": true, + "icon-ignore-placement": true + }, + "paint": { + "icon-opacity": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render/tests/projection/globe/text-always-overlap-occluded/point/expected.png b/test/integration/render/tests/projection/globe/text-always-overlap-occluded/point/expected.png new file mode 100644 index 0000000000000000000000000000000000000000..17eb8eca881b49f6ff6db47c68de0d4c80ca3246 GIT binary patch literal 4778 zcmaJ_c|6qLyGKM>M2?>AGzSIEwY6lSauQOPn{3!{mOq9`hD_MOQX zWhs>{JK1FobI)<>_xj!6eck)loO#asJj;2u^L%1X;f;8A?%m14!oq7}j62Q3!U~qG zEL_{c&sky~frUlT*950;5yU!G&0X|q@$%^0vPcEzF+H91hwuBZa~;HW+&jx7sP}9q z^_P?91<&`Ik7$Q`I_O%ZJrjPa83b)wx@n5q;rQd8Vgr0c?2S0&y(@a`CPFf?2=aD` zhZcHl`u$ab&6Fy+=HauMq)aAr^|HOP5iWT++W3Vy!Xy=iq!Dq_*74EO&4?sdEHYWq z=&v*E98OWUq>YFNBk{Ycv6TJq28|mG61fr7RMBMXc-Ir`GBS|~D#ul8laO&z@`zBf z=xMchA$|6FP6X98%I~0&mOgtM8>F}07a!L{7;ED`(0RrM;)TwzpLT>8Au@_XFv2gA zD}%CsY6R>{83IW%C*jg!I(>SHiN1>)E^F6l<( zIYJaQ6_tyKxR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$Mge zsdAkc_OKs?4%MJUtmb{TFOBv8anYHc{tEV`AD<;U<@BQ*M}C_pWueMFB@zTs^I*`M zKLrIEbVWG@?PD{&zq;NOYTTXrdfwpyY~l7t;zjKDG(64>9wB^sS{lQx+)Z;!E3dcp zwlm!4Hxm{On)3V)2M1c)!*wi`(m~8uhk?sp!OipX zT26NP?#NyH(z#lXKPOiI0@C31^d&p9R9xMs|6lw1G2iS zBqTXi%jce~?n<>4Hf6Y3)}?_tqDVzXqZ!gQak}KuB>3?E_kr?%PMbD$Jm6tV zMQ3yT$NcG`0vV_>{`XVbk}k!Dpvhrus{idNU7R5bpXe@z3R_bv5K0WHn>*{seEo2f&t*Ftaws45p{ecnp&1@1j8|&S%ZI|5z5w7V;tat*nP^Ohk_ED_|u8_ATxJIX70cT^H z3d#j)nqso`4~@D?r9%aX08CVE0btr8j4GX`1FVz|q&I2Gia@U2XcQ;48x4S}tz@bX z5pty|Vu*D#2?!+7n?z;PAdrqm-Jo_ujfI5XL(& z$MM7=A+UW*3Nz#)j^)K<7)Z%f@n8=bF=`-!kFwu=*qA&0qaquP6_aBi?!f^eqOMWJ zv8W4B)DdKw)slrAc3AjRPr<;P_NC@sju z!|3B$w@`Ph$O$oe_*$NEi+G_3fJs!tN663-Ki3D{&` z0`(tuigVOZJPPa9fHgQJKrl8T=3JxfCkp?c3Ah%Xwp?gM4hpsa-=J7b4Dh&T#~dU7 E3q8%x=l}o! literal 0 HcmV?d00001 diff --git a/test/integration/render/tests/projection/globe/text-always-overlap-occluded/point/style.json b/test/integration/render/tests/projection/globe/text-always-overlap-occluded/point/style.json new file mode 100644 index 0000000000..9fc591f8d9 --- /dev/null +++ b/test/integration/render/tests/projection/globe/text-always-overlap-occluded/point/style.json @@ -0,0 +1,127 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256, + "width": 256 + } + }, + "sky": { + "atmosphere-blend": 0.0 + }, + "zoom": 1, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "projection": { + "type": "globe" + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Feature", + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [ + -160, + 0 + ], + [ + -140, + 0 + ], + [ + -120, + 0 + ], + [ + -100, + 0 + ], + [ + -80, + 0 + ], + [ + -60, + 0 + ], + [ + -40, + 0 + ], + [ + -20, + 0 + ], + [ + 0, + 0 + ], + [ + 20, + 0 + ], + [ + 40, + 0 + ], + [ + 60, + 0 + ], + [ + 80, + 0 + ], + [ + 100, + 0 + ], + [ + 120, + 0 + ], + [ + 140, + 0 + ], + [ + 160, + 0 + ], + [ + 180, + 0 + ] + ] + } + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "blue" + } + }, + { + "id": "text", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "A", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-overlap": "always" + }, + "paint": { + "text-color": "yellow" + } + } + ] +} \ No newline at end of file