@@ -262,29 +262,42 @@ export default function App({
262
262
const { object, x, y, layer } = hoverInfo ;
263
263
264
264
let tooltipContent ;
265
-
266
265
if ( layer && layer . id === 'MapNetwork' && object ) {
267
- // GeoJsonLayer tooltip content
268
- tooltipContent = (
269
- < div >
270
- < b > NETWORK</ b > < br />
271
- < b > id: { object . properties . id } </ b > < br />
272
- < b > from: { object . properties . from } </ b > < br />
273
- < b > to: { object . properties . to } </ b > < br />
274
- < b > length: { object . properties . length } </ b > < br />
275
- < b > freespeed: { object . properties . freespeed } </ b > < br />
276
- < b > capacity: { object . properties . capacity } </ b > < br />
277
- < b > oneway: { object . properties . from } </ b > < br />
278
- < b > modes: { object . properties . from } </ b >
279
- { /* más información */ }
280
- </ div >
281
- ) ;
282
- } else if ( layer && layer . id === 'trips' && object ) {
266
+ // Verificar si el objeto es un punto (nodo) o una línea (enlace)
267
+ if ( object . geometry . type === 'Point' ) {
268
+ // GeoJsonLayer tooltip content para nodos
269
+ tooltipContent = (
270
+ < div >
271
+ < b > NODE NETWORK</ b > < br />
272
+ < b > node id: { object . properties . id } </ b > < br />
273
+ < b > position: { object . geometry . coordinates [ 0 ] } , { object . geometry . coordinates [ 1 ] } </ b > < br />
274
+ </ div >
275
+ ) ;
276
+ } else if ( object . geometry . type === 'LineString' ) {
277
+ // GeoJsonLayer tooltip content para enlaces
278
+ tooltipContent = (
279
+ < div >
280
+ < b > LINK NETWORK</ b > < br />
281
+ < b > link id: { object . properties . id } </ b > < br />
282
+ < b > from: { object . properties . from } </ b > < br />
283
+ < b > to: { object . properties . to } </ b > < br />
284
+ < b > length: { object . properties . length } </ b > < br />
285
+ < b > freespeed: { object . properties . freespeed } </ b > < br />
286
+ < b > capacity: { object . properties . capacity } </ b > < br />
287
+ < b > oneway: { object . properties . oneway } </ b > < br />
288
+ < b > modes: { object . properties . modes } </ b >
289
+ { /* más información */ }
290
+ </ div >
291
+ ) ;
292
+ }
293
+ }
294
+
295
+ else if ( layer && layer . id === 'trips' && object ) {
283
296
// TripsLayer tooltip content
284
297
tooltipContent = (
285
298
< div >
286
299
< b > EVENTS</ b > < br />
287
- < b > Vehicle id: { object . vehicle } </ b >
300
+ < b > vehicle id: { object . vehicle } </ b >
288
301
289
302
</ div >
290
303
) ;
@@ -294,23 +307,23 @@ export default function App({
294
307
< div >
295
308
< b > CUSTOM LAYER 1</ b > < br />
296
309
< b > id: { object . properties . id } </ b > < br />
297
- < b > position: { object . geometry . coordinates } </ b > < br />
310
+ < b > position: { object . geometry . coordinates [ 0 ] } , { object . geometry . coordinates [ 1 ] } </ b > < br />
298
311
</ div >
299
312
) ;
300
313
} else if ( layer && layer . id === 'CustomLayer2' && object ) {
301
314
tooltipContent = (
302
315
< div >
303
316
< b > CUSTOM LAYER 2</ b > < br />
304
317
< b > id: { object . properties . id } </ b > < br />
305
- < b > position: { object . geometry . coordinates } </ b > < br />
318
+ < b > position: { object . geometry . coordinates [ 0 ] } , { object . geometry . coordinates [ 1 ] } </ b > < br />
306
319
</ div >
307
320
) ;
308
321
} else if ( layer && layer . id === 'CustomLayer3' && object ) {
309
322
tooltipContent = (
310
323
< div >
311
324
< b > CUSTOM LAYER 3</ b > < br />
312
325
< b > id: { object . properties . id } </ b > < br />
313
- < b > position: { object . geometry . coordinates } </ b > < br />
326
+ < b > position: { object . geometry . coordinates [ 0 ] } , { object . geometry . coordinates [ 1 ] } </ b > < br />
314
327
</ div >
315
328
) ;
316
329
@@ -375,6 +388,7 @@ export default function App({
375
388
pickable : true ,
376
389
onHover : ( info ) => setHoverInfo ( info ) ,
377
390
autoHighlight : true ,
391
+ highlightColor : [ 255 , 141 , 0 , 225 ] ,
378
392
initialViewState : calculateInitialViewState ( customLayer4 ) // Aquí se establece initialViewState
379
393
380
394
} ) ,
@@ -391,6 +405,7 @@ export default function App({
391
405
widthMinPixels : widthMinPixels ,
392
406
pickable : true ,
393
407
autoHighlight : true ,
408
+ highlightColor : [ 25 , 100 , 255 , 225 ] ,
394
409
trailLength :trailLength ,
395
410
currentTime : time ,
396
411
shadowEnabled : false ,
0 commit comments