在react-google-map库中,OverlayType常量用于定义地图上的叠加层类型,例如Marker、Polygon、Circle等。然而,由于react-google-map库已经停止维护,推荐使用@react-google-map/api库来替代。 在@react-google-map/api库中,OverlayType常量的定义方式发生了变化。它通过枚举类型的方式来定义叠加层类型,...
import { GoogleMapProvider, HeatMap, InfoWindow, MapBox, Marker, OverlayView, Polygon, } from '@googlemap-react/core' // In your component return ( <GoogleMapProvider> <MapBox apiKey="YOUR_GOOGLE_MAP_API_KEY" opts={{ center: {lat: 39, lng: 116}, zoom: 14, }} style={{ height...
EDIT: This typically isn't a problem until you need to mix and match functionality between their API and google-map-react. For instance, I used their API to draw a bunch of GeoJSON polygons, and therefore the click handlers for those polygons had to go through their API. It would be...