[Bug] zoom value causing type warning when using Amazon Location Service map

Abierto
#2,541 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
aws, react, typescript
Área
frontend, web-dev

Línea de trabajo

Empieza por el manejo de zoom de initialViewState del componente Map y un estilo de mapa de Amazon Location Service, y después sigue las entradas de la pila loadTile y evaluate indicadas. Reproduce las advertencias de tipo con un valor zoom numérico y verifica que las advertencias ya no se produzcan mientras zoom siga establecido.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
Description

When I use the maplibre Map with Amazon Location Service as the tile provider I'm getting some type warnings, when passing zoom to initialViewState:

Expected value to be of type number, but found string instead.

import { Map, } from "react-map-gl/maplibre";

...

  return (
      <Map
        initialViewState={{
          longitude: longitude,
          latitude: latitude,
          zoom: 14,
        }}
        mapStyle={`https://maps.geo.eu-central-1.amazonaws.com/v2/styles/Standard/descriptor?key=${amazonApiKey}&color-scheme=Light`}
        attributionControl={false}
        style={{ width: "100%", height: "100%" }}
        onLoad={() => setLoading(false)}
        onError={(e) => {
          console.error("Error loading map:", e);
          setError(true);
        }}
      />
 )

I noticed when I use remove the zoom param or set it to undefined the warning goes away.

Expected Behavior

No type warnings should be happening when passing the zoom property.

Steps to Reproduce

Can't because I don't want to share a amazon location service api key, but using Amazon as the tile provider and then passing the zoom property to the initialViewState will show the warnings all over console.

Environment
  • Framework version: "react-map-gl": "^8.0.4",
  • Map library: "maplibre-gl": "^5.5.0",
  • Browser: Chrome Version 137.0.7151.55 (Official Build) (arm64)
  • OS: Running in Docker Container (node:20-alpine - Linux)
Logs

Stack in the console after (Expected value to be of type number, but found null instead.)

  | evaluate | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
-- | -- | -- | --
  | filter | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | populate | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | (anonymous) | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | (anonymous) | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | e | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | parse | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | (anonymous) | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | a | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | Promise.then |   |  
  | l | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | (anonymous) | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | e | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | loadTile | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | (anonymous) | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | (anonymous) | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | (anonymous) | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | e | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | processTask | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | process | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | (anonymous) | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1
  | MessageChannel._channel.port2.onmessage | @ | 1f28c7d8-fa56-4e41-85f9-18854632164e:1


Lenguaje dominante
TypeScript
Estrellas
8.5k
Forks
1.3k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de visgl/react-map-gl

Todos los issues de visgl/react-map-gl

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.