Skip to content

Commit 9d027a2

Browse files
stephanheiglgithub-actions[bot]
authored andcommitted
Fix disappearing symbols when rendered over elevated raster layers.
GitOrigin-RevId: 0fde5a3116af253c209adc080207d3d37e2e193b
1 parent 4de47b7 commit 9d027a2

3 files changed

Lines changed: 208 additions & 0 deletions

File tree

src/style/style_layer/raster_style_layer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ class RasterStyleLayer extends StyleLayer {
102102
this.colorRampTexture = null;
103103
this._curRampRange = [start, end];
104104
}
105+
106+
override is3D(terrainEnabled?: boolean): boolean {
107+
return this.paint.get('raster-elevation') > 0;
108+
}
105109
}
106110

107111
export default RasterStyleLayer;
394 KB
Loading
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
{
2+
"version": 8,
3+
"metadata": {
4+
"test": {
5+
"width": 512,
6+
"height": 512,
7+
"allowed": 0.001
8+
}
9+
},
10+
"zoom": 2.35,
11+
"center": [
12+
-99.48,
13+
38.42
14+
],
15+
"pitch": 0,
16+
"fog": {
17+
"star-intensity": 0
18+
},
19+
"camera": {
20+
"camera-projection": "orthographic"
21+
},
22+
"projection": {
23+
"name": "mercator"
24+
},
25+
"sprite": "local://sprites/standard",
26+
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
27+
"sources": {
28+
"image": {
29+
"type": "raster",
30+
"tiles": [
31+
"local://tiles/1-1-0.satellite.png"
32+
],
33+
"maxzoom": 17,
34+
"tileSize": 256
35+
},
36+
"cities": {
37+
"type": "geojson",
38+
"data": {
39+
"type": "FeatureCollection",
40+
"features": [
41+
{
42+
"type": "Feature",
43+
"properties": {
44+
"name": "New York",
45+
"pop": 8336817
46+
},
47+
"geometry": {
48+
"type": "Point",
49+
"coordinates": [
50+
-74.006,
51+
40.7128
52+
]
53+
}
54+
},
55+
{
56+
"type": "Feature",
57+
"properties": {
58+
"name": "Los Angeles",
59+
"pop": 3979576
60+
},
61+
"geometry": {
62+
"type": "Point",
63+
"coordinates": [
64+
-118.2437,
65+
34.0522
66+
]
67+
}
68+
},
69+
{
70+
"type": "Feature",
71+
"properties": {
72+
"name": "Chicago",
73+
"pop": 2693976
74+
},
75+
"geometry": {
76+
"type": "Point",
77+
"coordinates": [
78+
-87.6298,
79+
41.8781
80+
]
81+
}
82+
},
83+
{
84+
"type": "Feature",
85+
"properties": {
86+
"name": "Houston",
87+
"pop": 2320268
88+
},
89+
"geometry": {
90+
"type": "Point",
91+
"coordinates": [
92+
-95.3698,
93+
29.7604
94+
]
95+
}
96+
},
97+
{
98+
"type": "Feature",
99+
"properties": {
100+
"name": "Denver",
101+
"pop": 727211
102+
},
103+
"geometry": {
104+
"type": "Point",
105+
"coordinates": [
106+
-104.9903,
107+
39.7392
108+
]
109+
}
110+
},
111+
{
112+
"type": "Feature",
113+
"properties": {
114+
"name": "Seattle",
115+
"pop": 737015
116+
},
117+
"geometry": {
118+
"type": "Point",
119+
"coordinates": [
120+
-122.3321,
121+
47.6062
122+
]
123+
}
124+
},
125+
{
126+
"type": "Feature",
127+
"properties": {
128+
"name": "Miami",
129+
"pop": 467963
130+
},
131+
"geometry": {
132+
"type": "Point",
133+
"coordinates": [
134+
-80.1918,
135+
25.7617
136+
]
137+
}
138+
}
139+
]
140+
}
141+
}
142+
},
143+
"transition": {
144+
"duration": 0
145+
},
146+
"layers": [
147+
{
148+
"id": "background",
149+
"type": "background",
150+
"paint": {
151+
"background-color": "grey"
152+
}
153+
},
154+
{
155+
"id": "image",
156+
"type": "raster",
157+
"source": "image",
158+
"paint": {
159+
"raster-fade-duration": 0,
160+
"raster-opacity": 0.5,
161+
"raster-elevation": 10000.0
162+
}
163+
},
164+
{
165+
"id": "city-circles",
166+
"type": "circle",
167+
"source": "cities",
168+
"paint": {
169+
"circle-radius": 12,
170+
"circle-color": "#ff3333",
171+
"circle-stroke-color": "#ffffff",
172+
"circle-stroke-width": 3,
173+
"circle-opacity": 1
174+
}
175+
},
176+
{
177+
"id": "city-labels",
178+
"type": "symbol",
179+
"source": "cities",
180+
"slot": "top",
181+
"layout": {
182+
"text-field": [
183+
"get",
184+
"name"
185+
],
186+
"text-size": 12,
187+
"text-offset": [
188+
0,
189+
1.5
190+
],
191+
"text-anchor": "top",
192+
"text-font": [
193+
"Open Sans Semibold",
194+
"Arial Unicode MS Bold"
195+
]
196+
},
197+
"paint": {
198+
"text-color": "#ffffff",
199+
"text-halo-color": "#000000",
200+
"text-halo-width": 1
201+
}
202+
}
203+
]
204+
}

0 commit comments

Comments
 (0)