我正在尝试使用 GeoapifyGeocoderAutocomplete 来按地址获取坐标,从而相应地将显示的地图居中。我正在使用反应、反应传单和传单。GeoapifyGeocoderAutocomplete 组件本身可以正常工作,但我希望它显示在地图之上,而不仅仅是单独显示。我尝试将组件放入 Map 组件中,如下所示:
<Map>
<GeoapifyContext>
<GeoapifyGeocoderAutocomplete>
</GeoapifyGeocoderAutocomplete>
</GeoapifyContext>
<Marker> </Marker>
<Map>
如果我这样做,我可以看到标记但看不到搜索框:
<GeoapifyContext>
<GeoapifyGeocoderAutocomplete>
</GeoapifyGeocoderAutocomplete>
</GeoapifyContext>
<Map>
<Marker> </Marker>
<Map>
我可以看到地图上方的搜索框,但是当我开始输入内容时,我看不到建议的选项。我在这里想念什么?谢谢你的帮助