Allow customization of selected event ring on map, via config

This commit is contained in:
Franc Camps-Febrer
2019-01-31 13:19:39 -05:00
parent c2cd703f06
commit 3eed45a5ef
2 changed files with 9 additions and 5 deletions

View File

@@ -4,21 +4,23 @@ import { Portal } from 'react-portal'
class MapSelectedEvents extends React.Component {
renderMarker (event) {
const { x, y } = this.props.projectPoint([event.latitude, event.longitude])
const styles = this.props.styles
const r = styles ? styles.r : 24
return (
<g
className='location-marker'
transform={`translate(${x - 32}, ${y})`}
transform={`translate(${x - r}, ${y})`}
>
<path
className='leaflet-interactive'
stroke='#ffffff'
stroke={styles ? styles.stroke : '#ffffff'}
stroke-opacity='1'
stroke-width='3'
stroke-width={styles ? styles['stroke-width'] : 2}
stroke-linecap=''
stroke-linejoin='round'
stroke-dasharray='5,2'
stroke-dasharray={styles ? styles['stroke-dasharray'] : '2,2'}
fill='none'
d='M0,0a32,32 0 1,0 64,0 a32,32 0 1,0 -64,0 '
d={`M0,0a${r},${r} 0 1,0 ${r*2},0 a${r},${r} 0 1,0 -${r*2},0 `}
/>
</g>
)