我在我的项目中使用markerclusterer,但我确实收到以下错误
Error: node_modules/@googlemaps/markerclusterer/dist/algorithms/superviewport.d.ts:37:28 - error TS2339: Property 'radius' does not exist on type 'SuperClusterViewportOptions'.
37 constructor({ maxZoom, radius, viewportPadding, ...options }: SuperClusterViewportOptions);
<script
src="https://unpkg.com/@googlemaps/markerclustererplus/dist/index.min.js" async defer
></script>
"devDependencies": {
"@types/google.maps": "3.54.3"
},
"peerDependencies": {
"@angular/common": ">=16.0.3",
"@angular/core": ">=16.0.3",
"@angular/google-maps": ">=16.0.1",
"@angular/material": ">=16.0.1",
"@googlemaps/js-api-loader": "1.16.2",
"@googlemaps/markerclusterer": "2.5.1", // <-- markerclusterer
"@megaphone/bases": ">=5.9.10",
"@megaphone/pipes": ">=5.9.6",
"@megaphone/geolocation": ">=5.9.2"
},
有人有解决办法吗?
npm i --save-dev @types/supercluster @types/google.maps
angularCompilerOptions
文件中 tsconfig.json
键的值中:"angularCompilerOptions": {
...
"allowSyntheticDefaultImports": true
...
}
谢谢 gregorgabrovsek:回复