|
|
@ -15,7 +15,7 @@ import "react-loader-spinner/dist/loader/css/react-spinner-loader.css"; |
|
|
|
import { ToastContainer, toast } from "react-toastify"; |
|
|
|
import { ToastContainer, toast } from "react-toastify"; |
|
|
|
import "react-toastify/dist/ReactToastify.css"; |
|
|
|
import "react-toastify/dist/ReactToastify.css"; |
|
|
|
import './MapMonitoring.css'; |
|
|
|
import './MapMonitoring.css'; |
|
|
|
import { BASE_SIMPRO_LUMEN_IMAGE, PROYEK_SEARCH } from '../../const/ApiConst'; |
|
|
|
import { BASE_SIMPRO_LUMEN_IMAGE_COMPANY } from '../../const/ApiConst'; |
|
|
|
import DEFAULT_USER_ICON from '../../assets/img/avatars/user.png'; |
|
|
|
import DEFAULT_USER_ICON from '../../assets/img/avatars/user.png'; |
|
|
|
import pinRouteStart from '../../assets/img/map/pin_route_green.png'; |
|
|
|
import pinRouteStart from '../../assets/img/map/pin_route_green.png'; |
|
|
|
import pinRouteEnd from '../../assets/img/map/pin_route_red.png'; |
|
|
|
import pinRouteEnd from '../../assets/img/map/pin_route_red.png'; |
|
|
@ -27,8 +27,9 @@ import 'leaflet-control-geocoder/dist/Control.Geocoder.css' |
|
|
|
import 'leaflet-control-geocoder/dist/Control.Geocoder.js' |
|
|
|
import 'leaflet-control-geocoder/dist/Control.Geocoder.js' |
|
|
|
import moment from 'moment'; |
|
|
|
import moment from 'moment'; |
|
|
|
import axios from "../../const/interceptorApi"; |
|
|
|
import axios from "../../const/interceptorApi"; |
|
|
|
|
|
|
|
|
|
|
|
const MapMonitoring = ({ ...props }) => { |
|
|
|
const MapMonitoring = ({ ...props }) => { |
|
|
|
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name='', hierarchy=[], user_name=''; |
|
|
|
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name='', hierarchy=[], user_name='', configApp={}; |
|
|
|
if (props && props.role_id && props.user_id) { |
|
|
|
if (props && props.role_id && props.user_id) { |
|
|
|
role_id = props.role_id; |
|
|
|
role_id = props.role_id; |
|
|
|
user_id = props.user_id; |
|
|
|
user_id = props.user_id; |
|
|
@ -40,6 +41,7 @@ const MapMonitoring = ({ ...props }) => { |
|
|
|
isLogin = props.isLogin; |
|
|
|
isLogin = props.isLogin; |
|
|
|
hierarchy = props.hierarchy; |
|
|
|
hierarchy = props.hierarchy; |
|
|
|
user_name = props.user_name; |
|
|
|
user_name = props.user_name; |
|
|
|
|
|
|
|
configApp = props.configApp; |
|
|
|
} |
|
|
|
} |
|
|
|
const HEADER = { |
|
|
|
const HEADER = { |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
@ -223,7 +225,7 @@ const MapMonitoring = ({ ...props }) => { |
|
|
|
const pointToLayerUserPoints = (feature, latlng) => { |
|
|
|
const pointToLayerUserPoints = (feature, latlng) => { |
|
|
|
let imgSrc = DEFAULT_USER_ICON; |
|
|
|
let imgSrc = DEFAULT_USER_ICON; |
|
|
|
if (feature && feature.properties && feature.properties.image && feature.properties.image !== '') { |
|
|
|
if (feature && feature.properties && feature.properties.image && feature.properties.image !== '') { |
|
|
|
imgSrc = `${BASE_SIMPRO_LUMEN_IMAGE}/${feature.properties.image}` |
|
|
|
imgSrc = `${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(feature.properties.image, JSON.parse(configApp).company_name, moment(feature.properties.created_at).format('YYYY-MM'))}` |
|
|
|
} |
|
|
|
} |
|
|
|
let img = `<img src="${imgSrc}" />` |
|
|
|
let img = `<img src="${imgSrc}" />` |
|
|
|
let logoMarker = L.divIcon({ |
|
|
|
let logoMarker = L.divIcon({ |
|
|
|