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

オープン
#2,541 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
aws, react, typescript
領域
frontend, web-dev

調査の方向性

まず、MapコンポーネントのinitialViewStateにおけるzoomの処理とAmazon Location Serviceのマップスタイルから始め、報告されたloadTileとevaluateのスタックエントリを追跡します。数値のzoomで型警告を再現し、zoomが設定されたまま警告が発生しなくなることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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


主要言語
TypeScript
スター
8.5k
フォーク
1.3k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

visgl/react-map-gl のほかの issue

visgl/react-map-gl の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。