Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
getBioEntitiesFeatures.ts 708 B
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,
    }),
  );
};