// import { useMapEvents } from 'react-leaflet/hooks' import React, { Component } from "react"; import { MapContainer, TileLayer,Marker, Popup } from 'react-leaflet' import { friend,Hostile, iconShip,createIcon } from "./icon"; import "./OpenSeaMap.scss" import { sendMsg } from '../api'; // import icon from 'leaflet/dist/images/marker-icon.png'; class OpenSeaMap extends Component { componentDidMount() { // setInterval(() => this.setState({ time: Date.now()}), 1000) setInterval(() => this.props.parentCallback(), 3000) } handleClick(e) { // console.log(e.target) console.log("hello world"); } makeIcon(index, entity) { var icon; icon = createIcon(entity.Type,entity.Side) return ( { console.log(e.target.options.name); // will print 'FooBar' in console }, }} > {/* Omu-Aran the Head Post of Igbomina land, is a town in the Nigerian state of Kwara. It originated from Ife and currently the local government headquarters of Irepodun local government. */} ); } render() { // const positions = this.props.Positions.map((pos, index) => ( // // )); return (
{/* {positions} */} {this.props.Entities.map((pos, index) => ( this.makeIcon(index,pos) ))}
); } } export default OpenSeaMap;