当它应该是您按下以打开的按钮时,它看起来像这样。我正在将 react-leaflet 与 mapzen 的传单地理编码器一起使用。
import { MapControl } from 'react-leaflet'
import L from 'leaflet'
import 'leaflet-geocoder-mapzen'
export default class SearchBox extends MapControl {
componentWillMount() {
const searchBox = L.control.geocoder(<API-KEY>)
this.leafletElement = searchBox
}
}