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

Đang mở
#2,541 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
aws, react, typescript
Lĩnh vực
frontend, web-dev

Hướng nghiên cứu

Bắt đầu với việc xử lý zoom của initialViewState trong component Map và một kiểu bản đồ của Amazon Location Service, sau đó theo dõi các mục stack loadTile và evaluate được báo cáo. Tái hiện các cảnh báo kiểu bằng một giá trị zoom dạng số và xác minh rằng các cảnh báo không còn xảy ra trong khi zoom vẫn được thiết lập.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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


Ngôn ngữ chính
TypeScript
Star
8.5k
Fork
1.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của visgl/react-map-gl

Tất cả issue của visgl/react-map-gl

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.