Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

"As of March 1st, 2025, google.maps.places.Autocomplete is not available to new customers"

未关闭
#736 6 条评论 15 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
react, typescript
领域
api, frontend

调研方向

首先检查报告中所示的 useMapsLibrary('places') 用法和 places.Autocomplete 调用,然后将其与 Google 关于迁移到 PlaceAutocompleteElement 的指南进行比较。没有指定 repository 文件或测试,因此请先定位相关的 hook 和示例,再决定范围。完成的标准应是,受支持的 places 集成不再为新客户产生所报告的警告。

由索引模型根据 Issue 内容生成。

描述

google maps issue
Description

I noticed this in my console today trying to use the places library from the useMapsLibrary hook:

Steps to Reproduce
  const places = useMapsLibrary('places');

  useEffect(() => {
    if (!places || !inputRef.current) return;

    const options = {
      fields: ['geometry', 'name', 'formatted_address']
    };

    const autocomplete = new places.Autocomplete(inputRef.current, options);
    setPlaceAutocomplete(autocomplete);

    // If we have an initial search, trigger a search
    if (initialSearch && inputRef.current) {
      inputRef.current.value = initialSearch;

      // Use the Geocoding service to find the place
      const geocoder = new google.maps.Geocoder();
      geocoder.geocode({ address: initialSearch }, (results, status) => {
        if (status === 'OK' && results?.[0]) {
          onPlaceSelect(
            results[0] as unknown as google.maps.places.PlaceResult
          );
        }
      });
    }
  }, [places, initialSearch, onPlaceSelect]);

Environment
  • Library version: "@vis.gl/react-google-maps": "^1.5.1",
  • Google maps version: ???
  • Browser and Version: Chrome
  • OS: MacOS Sequoia 15.3.2 (24D81)
Logs
places.js:50 As of March 1st, 2025, google.maps.places.Autocomplete is not available to new customers.  
Please use google.maps.places.PlaceAutocompleteElement instead. At this time, google.maps.places.Autocomplete is not scheduled to be discontinued, but google.maps.places.PlaceAutocompleteElement is recommended over google.maps.places.Autocomplete. 
While google.maps.places.Autocomplete will continue to receive bug fixes for any major regressions, existing bugs in google.maps.places.Autocomplete will not be addressed. At least 12 months notice will be given before support is discontinued. 
Please see https://developers.google.com/maps/legacy for additional details and https://developers.google.com/maps/documentation/javascript/places-migration-overview for the migration guide. Error Component Stack
主要语言
TypeScript
星标
1.9k
派生
195
平均合并
2 天 11 小时
30 天内合并 PR
14

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

visgl/react-google-maps 的其他 Issue

查看 visgl/react-google-maps 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。