@@ -115,6 +115,7 @@ function makeData(
115115 ( width + height ) / 4 / ( Math . ceil ( Math . sqrt ( countPoints ) ) + 1 ) ;
116116
117117 // Generate polygons on the left bottom corner
118+ let number = 1 ;
118119 for ( let lon = bbox [ 0 ] + gridSpacing ; lon < centerLon ; lon += gridSpacing ) {
119120 for ( let lat = bbox [ 1 ] + gridSpacing ; lat < centerLat ; lat += gridSpacing ) {
120121 const buffer = ( 0.3 + Math . random ( ) * 0.2 ) * gridSpacing ;
@@ -129,11 +130,13 @@ function makeData(
129130 polygonCoordinates . push ( [ x , y ] ) ;
130131 }
131132 polygonCoordinates . push ( polygonCoordinates [ 0 ] ) ;
133+ const label = `polygon n°${ number ++ } ` ;
132134
133135 features . push ( {
134136 type : 'Feature' ,
135137 properties : {
136138 propValue : propValues [ Math . floor ( Math . random ( ) * propValues . length ) ] ,
139+ label,
137140 } ,
138141 geometry : {
139142 type : 'Polygon' ,
@@ -148,6 +151,7 @@ function makeData(
148151 type : 'Feature' ,
149152 properties : {
150153 propValue : propValues [ Math . floor ( Math . random ( ) * propValues . length ) ] ,
154+ label : '' ,
151155 } ,
152156 geometry : {
153157 type : 'LineString' ,
@@ -162,14 +166,17 @@ function makeData(
162166 } ) ;
163167
164168 // Generate points on the right top corner
169+ number = 1 ;
165170 for ( let lon = centerLon + gridSpacing ; lon < bbox [ 2 ] ; lon += gridSpacing ) {
166171 for ( let lat = bbox [ 1 ] + gridSpacing ; lat < centerLat ; lat += gridSpacing ) {
167172 const point = [ lon , lat ] ;
173+ const label = `point n°${ number ++ } ` ;
168174
169175 features . push ( {
170176 type : 'Feature' ,
171177 properties : {
172178 propValue : propValues [ Math . floor ( Math . random ( ) * propValues . length ) ] ,
179+ label,
173180 } ,
174181 geometry : {
175182 type : 'Point' ,
@@ -190,6 +197,7 @@ function makeData(
190197 */
191198 let singleCurve = [ ] ; // Create a singleCurve array outside the loop
192199
200+ number = 1 ;
193201 for ( let j = 0 ; j < countLines ; j ++ ) {
194202 const coordinates = [ ] ;
195203 for ( let i = 0 ; i < periodCount ; i ++ ) {
@@ -207,11 +215,13 @@ function makeData(
207215 }
208216 coordinates . push ( ...singleCurve ) ;
209217 }
218+ const label = `line n°${ number ++ } ` ;
210219
211220 features . push ( {
212221 type : 'Feature' ,
213222 properties : {
214223 propValue : propValues [ Math . floor ( Math . random ( ) * propValues . length ) ] ,
224+ label,
215225 } ,
216226 geometry : {
217227 type : 'LineString' ,
0 commit comments