import React from 'react'; import { View, StyleSheet } from 'react-native'; import { Marker, MarkerDragEvent, MarkerDragStartEndEvent, } from 'react-native-maps'; import { MapPolygonExtendedProps } from '../lib/types'; import { getMiddleCoordinates } from '../lib/helpers'; export const SubCircleMarkers = React.memo( (props: { polygon: MapPolygonExtendedProps; onDragStart: (index: number) => (e: MarkerDragStartEndEvent) => void; onDrag: (index: number) => (e: MarkerDragEvent) => void; onDragEnd: (index: number) => (e: MarkerDragStartEndEvent) => void; }) => { const middleCoordinates = getMiddleCoordinates( props.polygon.coordinates, ); return ( <> {middleCoordinates.map((coordinate, coordIndex) => ( ))} ); }, ); SubCircleMarkers.displayName = 'SubCircleMarkers'; const styles = StyleSheet.create({ subCircleMarker: { backgroundColor: 'rgba(255, 255, 255, .3)', borderRadius: 100, borderWidth: 1, borderStyle: 'dotted', width: 16, height: 16, }, });