sandbox-react/leaflet/app/components/vehicleMarker.js

33 lines
654 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import {Marker,Popup} from 'react-leaflet';
import bfly from '../assets/Logo_SIB_electricindigo.svg';
const VehicleRealTimeMarker = ({ index,location }) => {
const myIcon = new L.Icon({
iconUrl: bfly,
iconRetinaUrl: bfly,
popupAnchor: [-0, -0],
iconSize: [32,45],
});
return(
<>
<Marker
index={index}
position={[location.lat,location.lon]}
icon={myIcon}
>
<Popup>
Popup
</Popup>
</Marker>
</>
);
}
export default VehicleRealTimeMarker;
VehicleRealTimeMarker.propTypes = {
index: PropTypes.number,
location: PropTypes.object
};