|
|
|
@ -1,9 +1,11 @@
|
|
|
|
|
import React, { Component, Suspense, Fragment } from 'react'; |
|
|
|
|
import ReactDOM from 'react-dom'; |
|
|
|
|
import { Container, Col, Row, Button, UncontrolledTooltip, |
|
|
|
|
import { |
|
|
|
|
Container, Col, Row, Button, UncontrolledTooltip, |
|
|
|
|
Card, |
|
|
|
|
CardBody, |
|
|
|
|
CardHeader } from 'reactstrap'; |
|
|
|
|
CardHeader |
|
|
|
|
} from 'reactstrap'; |
|
|
|
|
import './Map.css'; |
|
|
|
|
import './Popup.css'; |
|
|
|
|
import './CustomScroll.css'; |
|
|
|
@ -20,16 +22,16 @@ import OlSourceTileJson from 'ol/source/TileJSON';
|
|
|
|
|
import OlLayerGroup from 'ol/layer/Group'; |
|
|
|
|
import OlSourceTileWMS from 'ol/source/TileWMS'; |
|
|
|
|
import OlSourceImageWMS from 'ol/source/ImageWMS'; |
|
|
|
|
import {fromLonLat, transformExtent, transform} from 'ol/proj'; |
|
|
|
|
import {Vector as VectorSource, XYZ as XYZSource, Cluster} from 'ol/source'; |
|
|
|
|
import { fromLonLat, transformExtent, transform } from 'ol/proj'; |
|
|
|
|
import { Vector as VectorSource, XYZ as XYZSource, Cluster } from 'ol/source'; |
|
|
|
|
import Overlay from 'ol/Overlay'; |
|
|
|
|
import { Draw, Select, Modify } from 'ol/interaction'; |
|
|
|
|
import Feature from 'ol/Feature'; |
|
|
|
|
import { Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon } from 'ol/geom'; |
|
|
|
|
import {Vector as VectorLayer} from 'ol/layer'; |
|
|
|
|
import {Circle as CircleStyle, Fill, Stroke, Style, Text, Icon as IconOl} from 'ol/style'; |
|
|
|
|
import {defaults as defaultControls, MousePosition, ScaleLine} from 'ol/control'; |
|
|
|
|
import {createStringXY, toStringXY} from 'ol/coordinate'; |
|
|
|
|
import { Vector as VectorLayer } from 'ol/layer'; |
|
|
|
|
import { Circle as CircleStyle, Fill, Stroke, Style, Text, Icon as IconOl } from 'ol/style'; |
|
|
|
|
import { defaults as defaultControls, MousePosition, ScaleLine } from 'ol/control'; |
|
|
|
|
import { createStringXY, toStringXY } from 'ol/coordinate'; |
|
|
|
|
import GeoJSON from 'ol/format/GeoJSON'; |
|
|
|
|
import WMSCapabilities from 'ol/format/WMSCapabilities'; |
|
|
|
|
|
|
|
|
@ -57,8 +59,10 @@ import DrawingTool from '../../components/DrawingTool';
|
|
|
|
|
import ImagePopup from '../../components/ImagePopup'; |
|
|
|
|
import ImageSlider from '../../components/ImageSlider'; |
|
|
|
|
import RoutingBar from '../../components/RoutingBar'; |
|
|
|
|
import { appConfig, setRequestMapHeader, layerStyleUrl, BMD_DENPASAR_MAPSERVICE_URL, IU_MAPSERVICE_URL, MAP_ID, emptyConstants, |
|
|
|
|
WMS_CAPABILITIES_URL_2 } from '../../const/MapConst.js'; |
|
|
|
|
import { |
|
|
|
|
appConfig, setRequestMapHeader, layerStyleUrl, BMD_DENPASAR_MAPSERVICE_URL, IU_MAPSERVICE_URL, MAP_ID, emptyConstants, |
|
|
|
|
WMS_CAPABILITIES_URL_2 |
|
|
|
|
} from '../../const/MapConst.js'; |
|
|
|
|
import { Icon } from '@iconify/react'; |
|
|
|
|
import imageOutline from '@iconify/icons-ion/image-outline'; |
|
|
|
|
import trashOutline from '@iconify/icons-ion/trash-outline'; |
|
|
|
@ -69,14 +73,14 @@ import createOutline from '@iconify/icons-ion/create-outline';
|
|
|
|
|
import contractIcon from '@iconify/icons-ion/contract'; |
|
|
|
|
import country_indonesia from '../../assets/json/indonesia.json'; |
|
|
|
|
import { test, getGeomType, updateMap, getLayerAttribute, getLayerColor, getRandomColor } from '../../const/GeoserverFunc.js'; |
|
|
|
|
import { API_UPDATE_MAP, API_LOAD_MAP, API_LAYER_SEARCH_LABEL, API_GET_CHART_KATEGORI, |
|
|
|
|
USERPROYEK_SEARCH, DASHBOARD_STATUS_SEARCH, DASHBOARD_PROYEK_SEARCH } from '../../const/ApiConst.js'; |
|
|
|
|
import { |
|
|
|
|
API_UPDATE_MAP, API_LOAD_MAP, API_LAYER_SEARCH_LABEL, API_GET_CHART_KATEGORI, |
|
|
|
|
USERPROYEK_SEARCH, DASHBOARD_STATUS_SEARCH, DASHBOARD_PROYEK_SEARCH |
|
|
|
|
} from '../../const/ApiConst.js'; |
|
|
|
|
import { getSalesRoutingApi, getSalesFeatures, getOfficeFeatures, getCustomerFeatures, getEmployeeFeatures, getEmployeeRoutingApi, getWaspangRoutingApi } from '../../const/GeohrApiFunc.js'; |
|
|
|
|
import { SALES_FEATURES_STYLE, CUSTOMER_FEATURES_STYLE, OFFICE_FEATURES_STYLE, ROUTE_MAP_STYLES, EMPLOYEE_FEATURES_STYLE, PROJECT_FEATURES_STYLE, WASPANG_FEATURES_STYLE } from '../../const/GeohrMapStyles.js'; |
|
|
|
|
import SweetAlert from 'react-bootstrap-sweetalert'; |
|
|
|
|
import moment from "moment"; |
|
|
|
|
import salesGeojson from '../../dummy_data/sales.geojson'; |
|
|
|
|
import routeDummy from '../../dummy_data/route2.json'; |
|
|
|
|
import { demografiTree, analisaTree } from '../../const/LayerTreeConst.js' |
|
|
|
|
import { ToastContainer, toast } from 'react-toastify'; |
|
|
|
|
import 'react-toastify/dist/ReactToastify.css'; |
|
|
|
@ -358,10 +362,10 @@ class SiopasMap extends Component {
|
|
|
|
|
routingBarVisible: false, |
|
|
|
|
isSearchingRoute: false, |
|
|
|
|
isProcessing: false, |
|
|
|
|
queryBuilderOutput:'', |
|
|
|
|
queryBuilderType:'', |
|
|
|
|
currentQbTree:'', |
|
|
|
|
currentQbType:'', |
|
|
|
|
queryBuilderOutput: '', |
|
|
|
|
queryBuilderType: '', |
|
|
|
|
currentQbTree: '', |
|
|
|
|
currentQbType: '', |
|
|
|
|
routeType: '', |
|
|
|
|
chosenProyekIds: [], |
|
|
|
|
dataStatusProyek: null, |
|
|
|
@ -381,8 +385,8 @@ class SiopasMap extends Component {
|
|
|
|
|
absensi: 0 |
|
|
|
|
}, |
|
|
|
|
panic_button: 0, |
|
|
|
|
statusRight:true, |
|
|
|
|
proggressBottom:true |
|
|
|
|
statusRight: true, |
|
|
|
|
proggressBottom: true |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
this.layers = [ |
|
|
|
@ -434,7 +438,7 @@ class SiopasMap extends Component {
|
|
|
|
|
this.olmap.on("singleclick", (evt) => { |
|
|
|
|
this.mapOnClick(evt); |
|
|
|
|
}); |
|
|
|
|
this.setState({mapProjection: this.olmap.getView().getProjection()}, () => console.log('mapProjection', this.state.mapProjection)); |
|
|
|
|
this.setState({ mapProjection: this.olmap.getView().getProjection() }, () => console.log('mapProjection', this.state.mapProjection)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
componentDidUpdate = (prevProps, prevState) => { |
|
|
|
@ -534,14 +538,14 @@ class SiopasMap extends Component {
|
|
|
|
|
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
|
|
|
|
headers: { |
|
|
|
|
'Content-Type': 'application/json', |
|
|
|
|
'Authorization': 'Bearer '+window.localStorage.getItem('token') |
|
|
|
|
'Authorization': 'Bearer ' + window.localStorage.getItem('token') |
|
|
|
|
}, |
|
|
|
|
body: JSON.stringify(payload) // body data type must match "Content-Type" header
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const result = await fetch(USERPROYEK_SEARCH, config).then(response => response.json()).then(res => res); |
|
|
|
|
if (result && result.code == 200) { |
|
|
|
|
this.setState({waspangData: result.data}, () => this.getWaspangFeatures()); |
|
|
|
|
this.setState({ waspangData: result.data }, () => this.getWaspangFeatures()); |
|
|
|
|
} else { |
|
|
|
|
toast.error('Gagal Mengambil Data!!'); |
|
|
|
|
} |
|
|
|
@ -573,7 +577,7 @@ class SiopasMap extends Component {
|
|
|
|
|
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
|
|
|
|
headers: { |
|
|
|
|
'Content-Type': 'application/json', |
|
|
|
|
'Authorization': 'Bearer '+window.localStorage.getItem('token') |
|
|
|
|
'Authorization': 'Bearer ' + window.localStorage.getItem('token') |
|
|
|
|
}, |
|
|
|
|
body: JSON.stringify(payload) // body data type must match "Content-Type" header
|
|
|
|
|
} |
|
|
|
@ -606,7 +610,7 @@ class SiopasMap extends Component {
|
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|
this.setState({dataPersentaseProyek: persentaseProyek}); |
|
|
|
|
this.setState({ dataPersentaseProyek: persentaseProyek }); |
|
|
|
|
|
|
|
|
|
const labelCostPlaning = progress_cost_planning ? progress_cost_planning.map(res => res.label) : [] |
|
|
|
|
const valueCostPlaning = progress_cost_planning ? progress_cost_planning.map(res => res.total) : [] |
|
|
|
@ -633,7 +637,7 @@ class SiopasMap extends Component {
|
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|
this.setState({dataCostProyek: costProyek}); |
|
|
|
|
this.setState({ dataCostProyek: costProyek }); |
|
|
|
|
|
|
|
|
|
const valueStatusProyek = status_proyek ? status_proyek.map(res => res.total) : [] |
|
|
|
|
|
|
|
|
@ -657,7 +661,7 @@ class SiopasMap extends Component {
|
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|
this.setState({dataStatusProyek: statusProyek}); |
|
|
|
|
this.setState({ dataStatusProyek: statusProyek }); |
|
|
|
|
} else { |
|
|
|
|
toast.error('Gagal Mengambil Data!!'); |
|
|
|
|
} |
|
|
|
@ -666,16 +670,16 @@ class SiopasMap extends Component {
|
|
|
|
|
getDailyInfo = async () => { |
|
|
|
|
const payload = { |
|
|
|
|
"columns": [ |
|
|
|
|
{"name": "created_at","logic_operator": "range","value": `${moment().format('YYYY-MM-DD')} 00:00:00`,"value1": `${moment().format('YYYY-MM-DD')} 23:59:59`,"operator": "AND"} |
|
|
|
|
{ "name": "created_at", "logic_operator": "range", "value": `${moment().format('YYYY-MM-DD')} 00:00:00`, "value1": `${moment().format('YYYY-MM-DD')} 23:59:59`, "operator": "AND" } |
|
|
|
|
], |
|
|
|
|
"paging": {"start": 0,"length": -1} |
|
|
|
|
"paging": { "start": 0, "length": -1 } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const config = { |
|
|
|
|
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
|
|
|
|
headers: { |
|
|
|
|
'Content-Type': 'application/json', |
|
|
|
|
'Authorization': 'Bearer '+window.localStorage.getItem('token') |
|
|
|
|
'Authorization': 'Bearer ' + window.localStorage.getItem('token') |
|
|
|
|
}, |
|
|
|
|
body: JSON.stringify(payload) // body data type must match "Content-Type" header
|
|
|
|
|
} |
|
|
|
@ -705,7 +709,7 @@ class SiopasMap extends Component {
|
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|
this.setState({dataStatusWaspang: statusWaspang}); |
|
|
|
|
this.setState({ dataStatusWaspang: statusWaspang }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -717,15 +721,15 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getLayerSearchLabel = async() => { |
|
|
|
|
getLayerSearchLabel = async () => { |
|
|
|
|
const param = { |
|
|
|
|
method: 'GET', |
|
|
|
|
header: JSON.stringify({'Content-Type': 'application/json'}), |
|
|
|
|
header: JSON.stringify({ 'Content-Type': 'application/json' }), |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
const result = await fetch(API_LAYER_SEARCH_LABEL, param).then(response => response.json()).then(res => res) |
|
|
|
|
if (result.data){ |
|
|
|
|
if (result.data) { |
|
|
|
|
if (result.data.length > 0) { |
|
|
|
|
this.setState({ |
|
|
|
|
searchLabelData: result.data |
|
|
|
@ -734,7 +738,7 @@ class SiopasMap extends Component {
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} catch(err) { |
|
|
|
|
} catch (err) { |
|
|
|
|
console.log(err); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -744,21 +748,21 @@ class SiopasMap extends Component {
|
|
|
|
|
let layerInfo = []; |
|
|
|
|
const param = { |
|
|
|
|
method: 'GET', |
|
|
|
|
header: JSON.stringify({'Content-Type': 'application/json'}), |
|
|
|
|
header: JSON.stringify({ 'Content-Type': 'application/json' }), |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
const result = await fetch(API_GET_CHART_KATEGORI, param).then(response => response.json()).then(res => res) |
|
|
|
|
|
|
|
|
|
if(result.data){ |
|
|
|
|
if (result.data) { |
|
|
|
|
if (result.data.length > 0) { |
|
|
|
|
for(let i=0; i < result.data.length; i++) { |
|
|
|
|
for (let i = 0; i < result.data.length; i++) { |
|
|
|
|
let layer_name = result.data[i].layer_name; |
|
|
|
|
let layer_title = result.data[i].layer_title; |
|
|
|
|
let layer_geom_type = result.data[i].layer_geom_type; |
|
|
|
|
let total_features = result.data[i].total_features; |
|
|
|
|
|
|
|
|
|
let SLD_URL = `${layerStyleUrl+layer_name}`;; |
|
|
|
|
let SLD_URL = `${layerStyleUrl + layer_name}`;; |
|
|
|
|
let reqColor = await getLayerColor(SLD_URL); |
|
|
|
|
let color = ''; |
|
|
|
|
if (reqColor.success) { |
|
|
|
@ -772,11 +776,11 @@ class SiopasMap extends Component {
|
|
|
|
|
total_features: total_features |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
this.setState({layerInfo: layerInfo}, () => console.log('layerInfo',this.state.layerInfo)); |
|
|
|
|
this.setState({ layerInfo: layerInfo }, () => console.log('layerInfo', this.state.layerInfo)); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
} catch(err) { |
|
|
|
|
} catch (err) { |
|
|
|
|
console.log(err); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -858,7 +862,7 @@ class SiopasMap extends Component {
|
|
|
|
|
if (layer.get('type') == 'layerGroup') { |
|
|
|
|
layer.getLayers().forEach((sublayer, i) => { |
|
|
|
|
if (sublayer.getVisible()) { |
|
|
|
|
url = sublayer.getSource().getGetFeatureInfoUrl(evt.coordinate, viewResolution, viewProjection, {'INFO_FORMAT': 'application/json'}); |
|
|
|
|
url = sublayer.getSource().getGetFeatureInfoUrl(evt.coordinate, viewResolution, viewProjection, { 'INFO_FORMAT': 'application/json' }); |
|
|
|
|
if (url) { |
|
|
|
|
promises.push(axios.get(url)); |
|
|
|
|
} |
|
|
|
@ -874,7 +878,7 @@ class SiopasMap extends Component {
|
|
|
|
|
console.log('hitGeojson', hitGeojson); |
|
|
|
|
} |
|
|
|
|
else if (layer.get('source_type') === "wms") { |
|
|
|
|
url = layer.getSource().getGetFeatureInfoUrl(evt.coordinate, viewResolution, viewProjection, {'INFO_FORMAT': 'application/json'}); |
|
|
|
|
url = layer.getSource().getGetFeatureInfoUrl(evt.coordinate, viewResolution, viewProjection, { 'INFO_FORMAT': 'application/json' }); |
|
|
|
|
if (url) { |
|
|
|
|
promises.push(axios.get(url)); |
|
|
|
|
} |
|
|
|
@ -887,7 +891,7 @@ class SiopasMap extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hitGeojson && hitGeojson.length > 0) { |
|
|
|
|
for (let i=0; i < hitGeojson.length; i++) { |
|
|
|
|
for (let i = 0; i < hitGeojson.length; i++) { |
|
|
|
|
let feature = hitGeojson[i]; |
|
|
|
|
|
|
|
|
|
let feat = { |
|
|
|
@ -921,7 +925,7 @@ class SiopasMap extends Component {
|
|
|
|
|
console.log('mapOnClick response promises', response); |
|
|
|
|
if (response.data !== undefined) { |
|
|
|
|
if (response.data.features.length > 0) { |
|
|
|
|
for(let i=0; i < response.data.features.length; i++) { |
|
|
|
|
for (let i = 0; i < response.data.features.length; i++) { |
|
|
|
|
featureGet.push(response.data.features[i]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -949,7 +953,7 @@ class SiopasMap extends Component {
|
|
|
|
|
removeChosenLayer = () => { |
|
|
|
|
this.olmap.getLayers().forEach((layer, i) => { |
|
|
|
|
if (layer) { |
|
|
|
|
if (layer.get('name') !== undefined && layer.get('name') === 'ChosenLayer' ) { |
|
|
|
|
if (layer.get('name') !== undefined && layer.get('name') === 'ChosenLayer') { |
|
|
|
|
layer.getSource().clear(); |
|
|
|
|
this.olmap.removeLayer(layer); |
|
|
|
|
} |
|
|
|
@ -958,13 +962,13 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
openPopupRight() { |
|
|
|
|
this.setState({popupRightVisible: true}, () => this.setActiveListFeature()); |
|
|
|
|
this.setState({ popupRightVisible: true }, () => this.setActiveListFeature()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
closePopupRight() { |
|
|
|
|
this.setState({popupRightVisible: false, popupDataTemp: []}, () => this.setActiveListFeature()); |
|
|
|
|
this.setState({ popupRightVisible: false, popupDataTemp: [] }, () => this.setActiveListFeature()); |
|
|
|
|
this.removeChosenLayer(); // selected features
|
|
|
|
|
this.setState({editGeometryVisible: false, routingBarVisible: false}); // disable editing when no ChosenLayer on Map
|
|
|
|
|
this.setState({ editGeometryVisible: false, routingBarVisible: false }); // disable editing when no ChosenLayer on Map
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*toggleImagePopup() { |
|
|
|
@ -972,7 +976,7 @@ class SiopasMap extends Component {
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
setPopupDataTemp = (feature) => { |
|
|
|
|
this.setState({popupDataTemp: [feature]}, () => this.setActiveListFeature()); |
|
|
|
|
this.setState({ popupDataTemp: [feature] }, () => this.setActiveListFeature()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
reloadPopupData = () => { |
|
|
|
@ -982,18 +986,18 @@ class SiopasMap extends Component {
|
|
|
|
|
setActiveListFeature = () => { |
|
|
|
|
if (this.state.popupRightVisible) { |
|
|
|
|
if (this.state.popupDataTemp.length === 1) { |
|
|
|
|
this.setState({activeListFeatureId: this.state.popupDataTemp[0].id}, () => { |
|
|
|
|
this.setState({ activeListFeatureId: this.state.popupDataTemp[0].id }, () => { |
|
|
|
|
let layerName = this.state.activeListFeatureId ? this.state.activeListFeatureId.substr(0, this.state.activeListFeatureId.indexOf('.')) : ''; |
|
|
|
|
this.getLayerAttribute(layerName); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
this.setState({activeListFeatureId: ''}, () => { |
|
|
|
|
this.setState({ activeListFeatureId: '' }, () => { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
this.setState({activeListFeatureId: ''}, () => { |
|
|
|
|
this.setState({ activeListFeatureId: '' }, () => { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1011,11 +1015,11 @@ class SiopasMap extends Component {
|
|
|
|
|
if (dataMap.zoom == null) { |
|
|
|
|
this.setDefaultMap(); |
|
|
|
|
} |
|
|
|
|
else if (dataMap.center_x == null && dataMap.center_y == null ) { |
|
|
|
|
else if (dataMap.center_x == null && dataMap.center_y == null) { |
|
|
|
|
this.setDefaultMap(); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
this.setState({mapZoom: dataMap.zoom, mapCenter: [dataMap.center_x, dataMap.center_y]}); |
|
|
|
|
this.setState({ mapZoom: dataMap.zoom, mapCenter: [dataMap.center_x, dataMap.center_y] }); |
|
|
|
|
this.olmap.getView().animate({ |
|
|
|
|
zoom: dataMap.zoom, |
|
|
|
|
center: [dataMap.center_x, dataMap.center_y] |
|
|
|
@ -1026,7 +1030,7 @@ class SiopasMap extends Component {
|
|
|
|
|
layersToRemove.push(layer); |
|
|
|
|
}); |
|
|
|
|
if (layersToRemove.length > 0) { |
|
|
|
|
for(let i=0; i < layersToRemove.length; i++) { |
|
|
|
|
for (let i = 0; i < layersToRemove.length; i++) { |
|
|
|
|
this.olmap.removeLayer(layersToRemove[i]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1035,7 +1039,7 @@ class SiopasMap extends Component {
|
|
|
|
|
let map_layers = dataMap.map_layers; |
|
|
|
|
if (map_layers !== undefined) { |
|
|
|
|
if (map_layers.length > 0) { |
|
|
|
|
for (let i=0; i < map_layers.length; i++) { |
|
|
|
|
for (let i = 0; i < map_layers.length; i++) { |
|
|
|
|
let newLayer = null; |
|
|
|
|
|
|
|
|
|
if (map_layers[i].layer_type !== 'base') { |
|
|
|
@ -1114,7 +1118,7 @@ class SiopasMap extends Component {
|
|
|
|
|
*/ |
|
|
|
|
let confirmation = window.confirm('Are you sure you want to save this map?'); |
|
|
|
|
let mapId = MAP_ID; // get from m_group
|
|
|
|
|
let mapTitle = localStorage.getItem('u_group')+"_map"; // get from m_group
|
|
|
|
|
let mapTitle = localStorage.getItem('u_group') + "_map"; // get from m_group
|
|
|
|
|
let mapZoom = this.olmap.getView().getZoom(); |
|
|
|
|
let mapProjection = this.olmap.getView().getProjection().code_; |
|
|
|
|
let mapCenter = this.olmap.getView().getCenter(); |
|
|
|
@ -1127,7 +1131,7 @@ class SiopasMap extends Component {
|
|
|
|
|
let count = 0; |
|
|
|
|
|
|
|
|
|
if (confirmation) { |
|
|
|
|
this.olmap.getLayers().forEach( async (layer, i) => { |
|
|
|
|
this.olmap.getLayers().forEach(async (layer, i) => { |
|
|
|
|
|
|
|
|
|
layerType = layer.get('type') !== undefined ? layer.get('type') : 'layer'; |
|
|
|
|
|
|
|
|
@ -1171,11 +1175,11 @@ class SiopasMap extends Component {
|
|
|
|
|
layer_type: layerType, |
|
|
|
|
layer_geom_type: layerGeomType, |
|
|
|
|
layer_source: { |
|
|
|
|
url: appConfig.geoserver_host+'wms', |
|
|
|
|
url: appConfig.geoserver_host + 'wms', |
|
|
|
|
params: { |
|
|
|
|
'LAYERS': appConfig.workspace_name+':'+layer.get('name'),
|
|
|
|
|
'LAYERS': appConfig.workspace_name + ':' + layer.get('name'), |
|
|
|
|
'TILED': true, |
|
|
|
|
'SLD': layerStyleUrl+layer.get('name') |
|
|
|
|
'SLD': layerStyleUrl + layer.get('name') |
|
|
|
|
}, |
|
|
|
|
serverType: 'geoserver', |
|
|
|
|
transition: 0, |
|
|
|
@ -1200,7 +1204,7 @@ class SiopasMap extends Component {
|
|
|
|
|
'center_y': center_y, |
|
|
|
|
'map_layers': mapLayers |
|
|
|
|
}; |
|
|
|
|
console.log('requestPayload',requestPayload); |
|
|
|
|
console.log('requestPayload', requestPayload); |
|
|
|
|
this.saveMapToApi(requestPayload); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -1211,20 +1215,20 @@ class SiopasMap extends Component {
|
|
|
|
|
|
|
|
|
|
const param = { |
|
|
|
|
method: 'POST', |
|
|
|
|
header: JSON.stringify({'Content-Type': 'application/json'}), |
|
|
|
|
header: JSON.stringify({ 'Content-Type': 'application/json' }), |
|
|
|
|
body: JSON.stringify(requestPayload) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
const result = await fetch(API_UPDATE_MAP, param).then(response => response.json()).then(res => res) |
|
|
|
|
if(result.data){ |
|
|
|
|
console.log('after save',result); |
|
|
|
|
this.setState({alert: true, messageAlert: result.code_message, successAlert: true, dangerAlert: false}) |
|
|
|
|
if (result.data) { |
|
|
|
|
console.log('after save', result); |
|
|
|
|
this.setState({ alert: true, messageAlert: result.code_message, successAlert: true, dangerAlert: false }) |
|
|
|
|
} else { |
|
|
|
|
this.setState({alert: true, messageAlert: result.code_message, successAlert: false, dangerAlert: true}) |
|
|
|
|
this.setState({ alert: true, messageAlert: result.code_message, successAlert: false, dangerAlert: true }) |
|
|
|
|
} |
|
|
|
|
} catch(err) { |
|
|
|
|
this.setState({alert: true, messageAlert: err.message.toString(), successAlert: false, dangerAlert: true}) |
|
|
|
|
} catch (err) { |
|
|
|
|
this.setState({ alert: true, messageAlert: err.message.toString(), successAlert: false, dangerAlert: true }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1252,7 +1256,7 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
toggleActiveStateAddGeometry = () => { |
|
|
|
|
this.setState({activeStateAddGeometry: !this.state.activeStateAddGeometry}); |
|
|
|
|
this.setState({ activeStateAddGeometry: !this.state.activeStateAddGeometry }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
printMap = () => { |
|
|
|
@ -1279,11 +1283,11 @@ class SiopasMap extends Component {
|
|
|
|
|
|
|
|
|
|
getLayerAttribute = async (layerName) => { |
|
|
|
|
const res = await getLayerAttribute(layerName); |
|
|
|
|
console.log('getLayerAttribute',res); |
|
|
|
|
console.log('getLayerAttribute', res); |
|
|
|
|
if (res.success) { |
|
|
|
|
if (res.result.data) { |
|
|
|
|
if (res.result.data.length > 0) { |
|
|
|
|
this.setState({layer_attribute: res.result.data}, () => { |
|
|
|
|
this.setState({ layer_attribute: res.result.data }, () => { |
|
|
|
|
console.log(this.state.layer_attribute); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -1295,13 +1299,13 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onCheckOpt = (state, checkedKeys) => { |
|
|
|
|
this.setState({[state]: checkedKeys}); |
|
|
|
|
this.setState({ [state]: checkedKeys }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setLayer = async (state) => { |
|
|
|
|
console.log('setLayer', state); |
|
|
|
|
|
|
|
|
|
await this.setState({isProcessing: true}); |
|
|
|
|
await this.setState({ isProcessing: true }); |
|
|
|
|
|
|
|
|
|
this.closePopupRight(); |
|
|
|
|
|
|
|
|
@ -1396,7 +1400,7 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (layersToAdd.length > 0) { |
|
|
|
|
for (let i=0; i < layersToAdd.length; i++) { |
|
|
|
|
for (let i = 0; i < layersToAdd.length; i++) { |
|
|
|
|
|
|
|
|
|
this.olmap.addLayer(layersToAdd[i]); // adding layer to exist map
|
|
|
|
|
|
|
|
|
@ -1411,7 +1415,7 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await this.setState({isProcessing: false}); |
|
|
|
|
await this.setState({ isProcessing: false }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getChildrenTree = (data) => { |
|
|
|
@ -1421,12 +1425,12 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
else if (item.laporan_plannings && item.laporan_plannings.length > 0) { |
|
|
|
|
if (this.state.checkedKeysProjectTree.includes(item.key)) { |
|
|
|
|
for (let i=0; i < item.laporan_plannings.length; i++) { |
|
|
|
|
for (let i = 0; i < item.laporan_plannings.length; i++) { |
|
|
|
|
console.log('got features!!!!!'); |
|
|
|
|
this.projectFeatures.push({ |
|
|
|
|
"type": "Feature", |
|
|
|
|
"id": `realisasi.${item.laporan_plannings[i].id}`, |
|
|
|
|
"properties": {...item.laporan_plannings[i]}, |
|
|
|
|
"properties": { ...item.laporan_plannings[i] }, |
|
|
|
|
"geometry": { |
|
|
|
|
"type": "Point", |
|
|
|
|
"coordinates": [ |
|
|
|
@ -1447,7 +1451,7 @@ class SiopasMap extends Component {
|
|
|
|
|
const { waspangData, checkedKeysProjectTree } = this.state; |
|
|
|
|
if (checkedKeysProjectTree && checkedKeysProjectTree.length > 0) { |
|
|
|
|
if (waspangData.length > 0) { |
|
|
|
|
for (let i=0; i < waspangData.length; i++) { |
|
|
|
|
for (let i = 0; i < waspangData.length; i++) { |
|
|
|
|
let item = waspangData[i]; |
|
|
|
|
if (item.last_waypoint) { |
|
|
|
|
this.waspangFeatures.push({ |
|
|
|
@ -1506,7 +1510,7 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (layersToAdd.length > 0) { |
|
|
|
|
for (let i=0; i < layersToAdd.length; i++) { |
|
|
|
|
for (let i = 0; i < layersToAdd.length; i++) { |
|
|
|
|
|
|
|
|
|
this.olmap.addLayer(layersToAdd[i]); // adding layer to exist map
|
|
|
|
|
|
|
|
|
@ -1540,7 +1544,7 @@ class SiopasMap extends Component {
|
|
|
|
|
|
|
|
|
|
if (parentObj.hasOwnProperty('children')) { |
|
|
|
|
|
|
|
|
|
for (let i=0; i < parentObj.children.length; i++) { |
|
|
|
|
for (let i = 0; i < parentObj.children.length; i++) { |
|
|
|
|
|
|
|
|
|
layersToRemove.push(parentObj.children[i].layers.name) |
|
|
|
|
} |
|
|
|
@ -1565,7 +1569,7 @@ class SiopasMap extends Component {
|
|
|
|
|
|
|
|
|
|
if (checkedKeys.includes(parentObj["key"])) { |
|
|
|
|
if (parentObj.hasOwnProperty('children')) { |
|
|
|
|
for (let i=0; i < parentObj.children.length; i++) { |
|
|
|
|
for (let i = 0; i < parentObj.children.length; i++) { |
|
|
|
|
newLayer = this.generateLayerWMSByName(parentObj.children[i].layers.name); |
|
|
|
|
if (newLayer) { |
|
|
|
|
layersToAdd.push(newLayer); |
|
|
|
@ -1608,8 +1612,8 @@ class SiopasMap extends Component {
|
|
|
|
|
}).then((text) => text); |
|
|
|
|
|
|
|
|
|
let result = new WMSCapabilities().read(getExt); |
|
|
|
|
if (result && result.Capability.Layer.Layer.find(l => l.Name === appConfig.workspace_name+':'+layerName)) { |
|
|
|
|
extent = result.Capability.Layer.Layer.find(l => l.Name === appConfig.workspace_name+':'+layerName).EX_GeographicBoundingBox; |
|
|
|
|
if (result && result.Capability.Layer.Layer.find(l => l.Name === appConfig.workspace_name + ':' + layerName)) { |
|
|
|
|
extent = result.Capability.Layer.Layer.find(l => l.Name === appConfig.workspace_name + ':' + layerName).EX_GeographicBoundingBox; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (source_type === 'geojson') { |
|
|
|
@ -1628,11 +1632,11 @@ class SiopasMap extends Component {
|
|
|
|
|
name: layerName, |
|
|
|
|
source_type: 'wms', |
|
|
|
|
source: new OlSourceTileWMS({ |
|
|
|
|
url: appConfig.geoserver_host+'wms', |
|
|
|
|
url: appConfig.geoserver_host + 'wms', |
|
|
|
|
params: { |
|
|
|
|
'LAYERS': appConfig.workspace_name+':'+layerName,
|
|
|
|
|
'LAYERS': appConfig.workspace_name + ':' + layerName, |
|
|
|
|
'TILED': true, |
|
|
|
|
'SLD': layerStyleUrl+layerName, |
|
|
|
|
'SLD': layerStyleUrl + layerName, |
|
|
|
|
}, |
|
|
|
|
serverType: 'geoserver', |
|
|
|
|
transition: 0, |
|
|
|
@ -1653,7 +1657,7 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (removeLayers.length > 0) { |
|
|
|
|
for (let i=0; i < removeLayers.length; i++) { |
|
|
|
|
for (let i = 0; i < removeLayers.length; i++) { |
|
|
|
|
this.olmap.removeLayer(removeLayers[i]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1668,19 +1672,13 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (removeLayers.length > 0) { |
|
|
|
|
for (let i=0; i < removeLayers.length; i++) { |
|
|
|
|
for (let i = 0; i < removeLayers.length; i++) { |
|
|
|
|
this.olmap.removeLayer(removeLayers[i]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getRoute = () => { |
|
|
|
|
fetch(routeDummy).then((response) => { |
|
|
|
|
response.json().then((result) => { |
|
|
|
|
console.log('getRoute', result); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showRoute = (salesRoute) => { |
|
|
|
|
const { mapProjection } = this.state; |
|
|
|
@ -1763,9 +1761,9 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
searchRouting = async (userId, dateString) => { |
|
|
|
|
await this.setState({isSearchingRoute: true, isProcessing: true}); |
|
|
|
|
await this.setState({ isSearchingRoute: true, isProcessing: true }); |
|
|
|
|
|
|
|
|
|
const {routeType} = this.state; |
|
|
|
|
const { routeType } = this.state; |
|
|
|
|
let routes = null; |
|
|
|
|
|
|
|
|
|
if (routeType === 'waspang') { |
|
|
|
@ -1773,21 +1771,21 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (routes) { |
|
|
|
|
this.setState({isSearchingRoute: false, isProcessing: false}, () => this.showRoute(routes)) |
|
|
|
|
this.setState({ isSearchingRoute: false, isProcessing: false }, () => this.showRoute(routes)) |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
this.setState({isSearchingRoute: false, isProcessing: false}, () => toast.warn("Sorry. Couldn't get user waypoint")); |
|
|
|
|
this.setState({ isSearchingRoute: false, isProcessing: false }, () => toast.warn("Sorry. Couldn't get user waypoint")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
handleQueryBuilder = (query, type, tree) => { |
|
|
|
|
console.log("query builder "+type, query); |
|
|
|
|
this.setState({ queryBuilderOutput:query, queryBuilderType:type, currentQbTree:tree,currentQbType:type }, () => { |
|
|
|
|
if(type === "Sales"){ |
|
|
|
|
console.log("query builder " + type, query); |
|
|
|
|
this.setState({ queryBuilderOutput: query, queryBuilderType: type, currentQbTree: tree, currentQbType: type }, () => { |
|
|
|
|
if (type === "Sales") { |
|
|
|
|
this.setLayer('checkedKeysSales'); |
|
|
|
|
}else if(type === "Customer"){ |
|
|
|
|
} else if (type === "Customer") { |
|
|
|
|
this.setLayer('checkedKeysCustomer'); |
|
|
|
|
}else if(type === "Office"){ |
|
|
|
|
} else if (type === "Office") { |
|
|
|
|
this.setLayer('checkedKeysOffice'); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -1795,15 +1793,16 @@ class SiopasMap extends Component {
|
|
|
|
|
|
|
|
|
|
handleQbReset = (type) => { |
|
|
|
|
this.setState({ |
|
|
|
|
queryBuilderOutput:'',
|
|
|
|
|
queryBuilderType:'',
|
|
|
|
|
currentQbTree:'', |
|
|
|
|
currentQbType:'' }, () => { |
|
|
|
|
if(type === "Sales"){ |
|
|
|
|
queryBuilderOutput: '', |
|
|
|
|
queryBuilderType: '', |
|
|
|
|
currentQbTree: '', |
|
|
|
|
currentQbType: '' |
|
|
|
|
}, () => { |
|
|
|
|
if (type === "Sales") { |
|
|
|
|
this.setLayer('checkedKeysSales'); |
|
|
|
|
}else if(type === "Customer"){ |
|
|
|
|
} else if (type === "Customer") { |
|
|
|
|
this.setLayer('checkedKeysCustomer'); |
|
|
|
|
}else if(type === "Office"){ |
|
|
|
|
} else if (type === "Office") { |
|
|
|
|
this.setLayer('checkedKeysOffice'); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -1824,7 +1823,7 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log('chosenProyekId', chosenProyekId); |
|
|
|
|
this.setState({chosenProyekIds: chosenProyekId}); |
|
|
|
|
this.setState({ chosenProyekIds: chosenProyekId }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getChosenProyekId = () => { |
|
|
|
@ -1832,7 +1831,7 @@ class SiopasMap extends Component {
|
|
|
|
|
|
|
|
|
|
if (checkedKeysProjectTree.length > 0) { |
|
|
|
|
if (checkedKeysProjectTree.includes('project-0')) { |
|
|
|
|
for (let i=0; i < projectTree[0].children.length; i++) { |
|
|
|
|
for (let i = 0; i < projectTree[0].children.length; i++) { |
|
|
|
|
this.chosenProyekTemp.push(projectTree[0].children[i].id); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1848,7 +1847,7 @@ class SiopasMap extends Component {
|
|
|
|
|
getChosenProyekIdByKey = (dataTree) => { |
|
|
|
|
const { checkedKeysProjectTree } = this.state; |
|
|
|
|
|
|
|
|
|
for (let i=0; i < dataTree.length; i++) { |
|
|
|
|
for (let i = 0; i < dataTree.length; i++) { |
|
|
|
|
if (checkedKeysProjectTree.includes(dataTree[i].key)) { |
|
|
|
|
if (dataTree[i].parent_id === undefined) { |
|
|
|
|
this.chosenProyekTemp.push(dataTree[i].id) // ambil idnya, karena dia adalah level paling atas (proyek)
|
|
|
|
@ -1869,19 +1868,19 @@ class SiopasMap extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
toggleStatusRight = () => { |
|
|
|
|
this.setState({statusRight:!this.state.statusRight}); |
|
|
|
|
this.setState({ statusRight: !this.state.statusRight }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
toggleProggresBottom = () => { |
|
|
|
|
this.setState({proggressBottom:!this.state.proggressBottom}) |
|
|
|
|
this.setState({ proggressBottom: !this.state.proggressBottom }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
closeStatusRight = () => { |
|
|
|
|
this.setState({statusRight:false}); |
|
|
|
|
this.setState({ statusRight: false }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
closeProggressBottom = () => { |
|
|
|
|
this.setState({proggressBottom:false}) |
|
|
|
|
this.setState({ proggressBottom: false }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
@ -1895,7 +1894,7 @@ class SiopasMap extends Component {
|
|
|
|
|
printMap={() => this.printMap()} |
|
|
|
|
onLogout={(e) => this.signOut(e)} |
|
|
|
|
/> |
|
|
|
|
<Container fluid style={{top: 50, position: 'absolute', overflow: 'hidden'}}> |
|
|
|
|
<Container fluid style={{ top: 50, position: 'absolute', overflow: 'hidden' }}> |
|
|
|
|
<Row> |
|
|
|
|
<Col md={this.state.statusRight ? 9 : 12} className="not-left-col"> |
|
|
|
|
<Row> |
|
|
|
@ -1912,11 +1911,11 @@ class SiopasMap extends Component {
|
|
|
|
|
draggable |
|
|
|
|
pauseOnHover |
|
|
|
|
/> |
|
|
|
|
<SweetAlert show={alert} success={successAlert} danger={dangerAlert} title={messageAlert} onConfirm={() => this.setState({alert: false, successAlert: false, dangerAlert: false})}> |
|
|
|
|
<SweetAlert show={alert} success={successAlert} danger={dangerAlert} title={messageAlert} onConfirm={() => this.setState({ alert: false, successAlert: false, dangerAlert: false })}> |
|
|
|
|
{messageAlert} |
|
|
|
|
</SweetAlert> |
|
|
|
|
|
|
|
|
|
{ this.state.isProcessing && |
|
|
|
|
{this.state.isProcessing && |
|
|
|
|
<div className="loader-container"> |
|
|
|
|
<Loader |
|
|
|
|
type="TailSpin" |
|
|
|
@ -1933,7 +1932,7 @@ class SiopasMap extends Component {
|
|
|
|
|
visible={this.state.popupRightVisible} |
|
|
|
|
mask={false} |
|
|
|
|
width={360} |
|
|
|
|
style={{ marginRight: 15, height:this.state.proggressBottom ? `50vh` : `100vh`, position: 'absolute'}} |
|
|
|
|
style={{ marginRight: 15, height: this.state.proggressBottom ? `50vh` : `100vh`, position: 'absolute' }} |
|
|
|
|
getContainer={false} |
|
|
|
|
> |
|
|
|
|
<div>{this.state.popupRightVisible ? |
|
|
|
@ -1951,14 +1950,14 @@ class SiopasMap extends Component {
|
|
|
|
|
layer_attribute={this.state.layer_attribute} |
|
|
|
|
searchLabelData={this.state.searchLabelData} |
|
|
|
|
layerInfo={this.state.layerInfo} |
|
|
|
|
toggleRoutingBarVisible={() => this.setState({routingBarVisible: !this.state.routingBarVisible})} |
|
|
|
|
setRouteType={(routeType) => this.setState({routeType: routeType})} |
|
|
|
|
toggleRoutingBarVisible={() => this.setState({ routingBarVisible: !this.state.routingBarVisible })} |
|
|
|
|
setRouteType={(routeType) => this.setState({ routeType: routeType })} |
|
|
|
|
/> : null |
|
|
|
|
}</div> |
|
|
|
|
</Drawer> |
|
|
|
|
|
|
|
|
|
<MapProvider map={this.olmap}> |
|
|
|
|
<Map className="map" id="map"/> |
|
|
|
|
<Map className="map" id="map" /> |
|
|
|
|
<MapToolbar |
|
|
|
|
className="no-print" |
|
|
|
|
olmap={this.olmap} |
|
|
|
@ -1990,17 +1989,17 @@ class SiopasMap extends Component {
|
|
|
|
|
checkedKeysProjectTree={this.state.checkedKeysProjectTree} |
|
|
|
|
salesGroupTree={this.state.salesGroupTree} |
|
|
|
|
employeeDivisionTree={this.state.employeeDivisionTree} |
|
|
|
|
setSalesGroupTree={(data) => this.setState({salesGroupTree: data})} |
|
|
|
|
setEmployeeDivisionTree={(data) => this.setState({employeeDivisionTree: data})} |
|
|
|
|
setSalesGroupTree={(data) => this.setState({ salesGroupTree: data })} |
|
|
|
|
setEmployeeDivisionTree={(data) => this.setState({ employeeDivisionTree: data })} |
|
|
|
|
showRoute={(route) => this.showRoute(route)} |
|
|
|
|
removeLayerByName={(layerName) => this.removeLayerByName(layerName)} |
|
|
|
|
setIsProcessing={(data) => this.setState({isProcessing: data})} |
|
|
|
|
setIsProcessing={(data) => this.setState({ isProcessing: data })} |
|
|
|
|
handleQueryBuilder={this.handleQueryBuilder} |
|
|
|
|
currentQbTree={this.state.currentQbTree} |
|
|
|
|
currentQbType={this.state.currentQbType} |
|
|
|
|
handleQbReset={this.handleQbReset} |
|
|
|
|
projectTree={this.state.projectTree} |
|
|
|
|
setProjectTree={(data) => this.setState({projectTree: data})} |
|
|
|
|
setProjectTree={(data) => this.setState({ projectTree: data })} |
|
|
|
|
proggressBottom={this.state.proggressBottom} |
|
|
|
|
toggleStatusRight={this.toggleStatusRight} |
|
|
|
|
toggleProggresBottom={this.toggleProggresBottom} |
|
|
|
@ -2020,15 +2019,15 @@ class SiopasMap extends Component {
|
|
|
|
|
/> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
{ this.state.routingBarVisible &&
|
|
|
|
|
{this.state.routingBarVisible && |
|
|
|
|
<RoutingBar |
|
|
|
|
salesName="test" |
|
|
|
|
toggleRoutingBarVisible={() => this.setState({routingBarVisible: !this.state.routingBarVisible})} |
|
|
|
|
toggleRoutingBarVisible={() => this.setState({ routingBarVisible: !this.state.routingBarVisible })} |
|
|
|
|
popupDataTemp={this.state.popupDataTemp} |
|
|
|
|
setPopupDataTemp={(feature) => this.props.setPopupDataTemp(feature)} |
|
|
|
|
searchRouting={(userId, dateString) => this.searchRouting(userId, dateString)} |
|
|
|
|
isSearchingRoute={this.state.isSearchingRoute} |
|
|
|
|
setRouteType={(routeType) => this.setState({routeType: routeType})} |
|
|
|
|
setRouteType={(routeType) => this.setState({ routeType: routeType })} |
|
|
|
|
/> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2045,10 +2044,10 @@ class SiopasMap extends Component {
|
|
|
|
|
</Row> |
|
|
|
|
{this.state.proggressBottom ? |
|
|
|
|
<Row> |
|
|
|
|
<Col md={6} style={{paddingRight: 0}}> |
|
|
|
|
<Card className="remove-gap-bs-card" style={{height: 'calc(100vh - 50px - (100vh / 2))'}}> |
|
|
|
|
<Col md={6} style={{ paddingRight: 0 }}> |
|
|
|
|
<Card className="remove-gap-bs-card" style={{ height: 'calc(100vh - 50px - (100vh / 2))' }}> |
|
|
|
|
<CardHeader className="panel-title"> |
|
|
|
|
<span style={{left:'50', right:'50',marginLeft:'auto',marginRight:'auto'}}>Persentase Progress Proyek</span> <span onClick={this.closeProggressBottom} style={{float:'right',marginLeft:'auto',right:0,cursor:'pointer'}}>x</span> |
|
|
|
|
<span style={{ left: '50', right: '50', marginLeft: 'auto', marginRight: 'auto' }}>Persentase Progress Proyek</span> <span onClick={this.closeProggressBottom} style={{ float: 'right', marginLeft: 'auto', right: 0, cursor: 'pointer' }}>x</span> |
|
|
|
|
</CardHeader> |
|
|
|
|
<CardBody> |
|
|
|
|
{/* <Line |
|
|
|
@ -2086,10 +2085,10 @@ class SiopasMap extends Component {
|
|
|
|
|
</CardBody> |
|
|
|
|
</Card> |
|
|
|
|
</Col> |
|
|
|
|
<Col md={6} style={{paddingLeft: 0}}> |
|
|
|
|
<Card className="remove-gap-bs-card" style={{height: 'calc(100vh - 50px - (100vh / 2))'}}> |
|
|
|
|
<Col md={6} style={{ paddingLeft: 0 }}> |
|
|
|
|
<Card className="remove-gap-bs-card" style={{ height: 'calc(100vh - 50px - (100vh / 2))' }}> |
|
|
|
|
<CardHeader className="panel-title"> |
|
|
|
|
<span style={{left:'50', right:'50',marginLeft:'auto',marginRight:'auto'}}>Progress Cost Perencanaan dan Realisasi</span> <span onClick={this.closeProggressBottom} style={{marginRight:'7px',float:'right',marginLeft:'auto',right:0,cursor:'pointer'}}>x</span> |
|
|
|
|
<span style={{ left: '50', right: '50', marginLeft: 'auto', marginRight: 'auto' }}>Progress Cost Perencanaan dan Realisasi</span> <span onClick={this.closeProggressBottom} style={{ marginRight: '7px', float: 'right', marginLeft: 'auto', right: 0, cursor: 'pointer' }}>x</span> |
|
|
|
|
</CardHeader> |
|
|
|
|
<CardBody> |
|
|
|
|
{/* <Line |
|
|
|
@ -2130,9 +2129,9 @@ class SiopasMap extends Component {
|
|
|
|
|
<Col md={3} className="not-left-col"> |
|
|
|
|
<Row> |
|
|
|
|
<Col md={12}> |
|
|
|
|
<Card className="remove-gap-bs-card" style={{height: 'calc(100vh - 40px - (100vh / 2))'}}> |
|
|
|
|
<Card className="remove-gap-bs-card" style={{ height: 'calc(100vh - 40px - (100vh / 2))' }}> |
|
|
|
|
<CardHeader className="panel-title"> |
|
|
|
|
<span style={{left:'50', right:'50',marginLeft:'auto',marginRight:'auto'}}>Status Proyek</span> <span onClick={this.closeStatusRight} style={{float:'right',marginLeft:'auto',right:0,cursor:'pointer'}}>x</span> |
|
|
|
|
<span style={{ left: '50', right: '50', marginLeft: 'auto', marginRight: 'auto' }}>Status Proyek</span> <span onClick={this.closeStatusRight} style={{ float: 'right', marginLeft: 'auto', right: 0, cursor: 'pointer' }}>x</span> |
|
|
|
|
</CardHeader> |
|
|
|
|
<CardBody> |
|
|
|
|
{/* <PieChart data={dataStatusProyek || defaultStatusProyek} /> */} |
|
|
|
@ -2152,9 +2151,9 @@ class SiopasMap extends Component {
|
|
|
|
|
</Card> |
|
|
|
|
</Col> |
|
|
|
|
<Col md={12}> |
|
|
|
|
<Card className="remove-gap-bs-card" style={{height: 'calc(100vh - 40px - (100vh / 2))'}}> |
|
|
|
|
<Card className="remove-gap-bs-card" style={{ height: 'calc(100vh - 40px - (100vh / 2))' }}> |
|
|
|
|
<CardHeader className="panel-title"> |
|
|
|
|
<span style={{left:'50', right:'50',marginLeft:'auto',marginRight:'auto'}}>Status Pengawas Lapangan</span> <span onClick={this.closeStatusRight} style={{float:'right',marginLeft:'auto',right:0,cursor:'pointer'}}>x</span> |
|
|
|
|
<span style={{ left: '50', right: '50', marginLeft: 'auto', marginRight: 'auto' }}>Status Pengawas Lapangan</span> <span onClick={this.closeStatusRight} style={{ float: 'right', marginLeft: 'auto', right: 0, cursor: 'pointer' }}>x</span> |
|
|
|
|
</CardHeader> |
|
|
|
|
<CardBody> |
|
|
|
|
{/* <Pie |
|
|
|
@ -2209,7 +2208,7 @@ class SiopasMap extends Component {
|
|
|
|
|
handleClickChart={() => console.log('click chart')} |
|
|
|
|
/> */} |
|
|
|
|
</Col> |
|
|
|
|
: null } |
|
|
|
|
: null} |
|
|
|
|
</Row> |
|
|
|
|
</Container> |
|
|
|
|
</div> |
|
|
|
|