Skip to content

Commit ae3c0fc

Browse files
AndrewSepicpersidskiy
authored andcommitted
Fix Heatmap example
1 parent 5aadae9 commit ae3c0fc

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

Sources/Examples/All Examples/HeatmapLayerGlobeExample.swift

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,6 @@ final class HeatmapLayerGlobeExample: UIViewController, ExampleProtocol {
126126

127127
func createCircleLayer() {
128128

129-
var circleLayerSource = GeoJSONSource(id: self.earthquakeSourceId)
130-
circleLayerSource.data = .url(self.earthquakeURL)
131-
circleLayerSource.generateId = true
132-
133-
do {
134-
try mapView.mapboxMap.addSource(circleLayerSource)
135-
} catch {
136-
print("Ran into an error adding a source: \(error)")
137-
}
138-
139129
// Add circle layer
140130
var circleLayer = CircleLayer(id: self.circleLayerId, source: self.earthquakeSourceId)
141131

@@ -144,30 +134,27 @@ final class HeatmapLayerGlobeExample: UIViewController, ExampleProtocol {
144134
Exp(.interpolate) {
145135
Exp(.linear)
146136
Exp(.zoom)
147-
Exp(.literal) {
148-
7
149-
}
137+
7
150138
Exp(.interpolate) {
151139
Exp(.linear)
152-
Exp(.get) {"mag"}
140+
Exp(.get) { "mag" }
153141
1
154142
1
155143
6
156144
4
157145
}
158-
Exp(.literal) {
159-
16
160-
}
146+
16
161147
Exp(.interpolate) {
162148
Exp(.linear)
163-
Exp(.get) {"mag"}
149+
Exp(.get) { "mag" }
164150
1
165151
5
166152
6
167153
50
168154
}
169155
}
170156
)
157+
171158
circleLayer.circleRadiusTransition = StyleTransition(duration: 0.5, delay: 0)
172159
circleLayer.circleStrokeColor = .constant(StyleColor(.black))
173160
circleLayer.circleStrokeWidth = .constant(1)
@@ -179,7 +166,7 @@ final class HeatmapLayerGlobeExample: UIViewController, ExampleProtocol {
179166
Exp(.get) { "mag" }
180167
1
181168
"rgba(33.0, 102.0, 172.0, 0.0)"
182-
1
169+
2
183170
"rgb(102.0, 169.0, 207.0)"
184171
3
185172
"rgb(209.0, 229.0, 240.0)"

0 commit comments

Comments
 (0)