|
6 | 6 | trackPerformance, |
7 | 7 | // @ts-ignore |
8 | 8 | } from '@camptocamp/rendering-analyzer'; |
| 9 | +import randomName from '@scaleway/random-name'; |
9 | 10 | import lilGui from 'lil-gui'; |
10 | 11 | import Map from 'ol/Map.js'; |
11 | 12 | import View from 'ol/View.js'; |
@@ -164,11 +165,13 @@ export function generatePolygons(count, numVertices) { |
164 | 165 | // Close the polygon by adding the first vertex at the end |
165 | 166 | polygonCoordinates.push(polygonCoordinates[0]); |
166 | 167 |
|
| 168 | + const label = `This area covers ${randomName()}`; |
167 | 169 | features.push({ |
168 | 170 | type: 'Feature', |
169 | 171 | properties: { |
170 | 172 | color: getRandomPaletteColor(), |
171 | 173 | ratio: Math.round(Math.random() * 100), |
| 174 | + label, |
172 | 175 | }, |
173 | 176 | geometry: { |
174 | 177 | type: 'Polygon', |
@@ -197,11 +200,13 @@ export function generatePoints(count, radius) { |
197 | 200 | for (let lon = -180; lon < 180 - size / 4; lon += size) { |
198 | 201 | for (let lat = -90; lat < 90 - size / 4; lat += size) { |
199 | 202 | const buffer = (0.3 + Math.random() * 0.2) * size * (radius / 5); // Increase the buffer for larger points |
| 203 | + const label = randomName(); |
200 | 204 | features.push({ |
201 | 205 | type: 'Feature', |
202 | 206 | properties: { |
203 | 207 | color: getRandomPaletteColor(), |
204 | 208 | radius, |
| 209 | + label, |
205 | 210 | }, |
206 | 211 | geometry: { |
207 | 212 | type: 'Point', |
@@ -254,11 +259,13 @@ export function generateLines(lineCount, curveComplexity, width) { |
254 | 259 | } |
255 | 260 | coordinates.push(...singleCurve); |
256 | 261 | } |
| 262 | + const label = `This leads to ${randomName()}`; |
257 | 263 | features.push({ |
258 | 264 | type: 'Feature', |
259 | 265 | properties: { |
260 | 266 | color: getRandomPaletteColor(), // Use deterministic color selection |
261 | 267 | width, |
| 268 | + label, |
262 | 269 | }, |
263 | 270 | geometry: { |
264 | 271 | type: 'LineString', |
|
0 commit comments