import { ONE } from '@/constants/common'; import { BioEntity } from '@/types/models'; import { PinType } from '@/types/pin'; import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection'; import { Feature } from 'ol'; import { getBioEntitySingleFeature } from './getBioEntitySingleFeature'; export const getBioEntitiesFeatures = ( bioEntites: BioEntity[], { pointToProjection, type, }: { pointToProjection: UsePointToProjectionResult; type: PinType; }, ): Feature[] => { return bioEntites.map((bioEntity, index) => getBioEntitySingleFeature(bioEntity, { pointToProjection, type, // pin's index number value: index + ONE, }), ); };