diff --git a/assets/css/index.css b/assets/css/index.css index cde56a8d..bc285ab5 100644 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -2,6 +2,22 @@ text-align: center; margin: auto; } + +.infoUsr { + text-align: right; + padding-left: 0 !important; + padding-right: 0 !important; +} +.arrow-icon { + width: 50%; + position: relative; + top: calc(50% - 30px); +} + +.ava { + position: relative; + top: calc(50% - 30px); +} #content2 { padding: 0; margin: 0; @@ -15,7 +31,7 @@ margin: 0; height: 100%; width: 100%; - min-height: 700px; + min-height: 650px; } .navigatorMenu { diff --git a/assets/icon_png/profile.png b/assets/icon_png/profile.png new file mode 100644 index 00000000..e1794a5b Binary files /dev/null and b/assets/icon_png/profile.png differ diff --git a/index.html b/index.html index 0f2acc56..9dabcec3 100644 --- a/index.html +++ b/index.html @@ -41,8 +41,19 @@ -
- +
+
+
+ +
+
+

Muhammad Choirul F

+

mfajri@geonet.co.id

+
+
+ +
+
@@ -75,29 +86,19 @@
Clip & Buffer Proccess -
- - - -
- +
- + + +
- +
diff --git a/main.js b/main.js index b834d240..f3da53c5 100644 --- a/main.js +++ b/main.js @@ -6,14 +6,16 @@ $(document).ready(function () { "esri/WebMap", "esri/views/MapView", "esri/widgets/Home", - "esri/widgets/LayerList" - ], (esriConfig, WebMap, MapView, Home, LayerList) => { + "esri/widgets/LayerList", + "esri/layers/GraphicsLayer", + "esri/Graphic", + "esri/rest/support/LinearUnit", + "esri/rest/geoprocessor", + ], (esriConfig, WebMap, MapView, Home, LayerList, GraphicsLayer, Graphic, LinearUnit, geoprocessor) => { esriConfig.portalUrl = "https://dev.gisportal.id/portal"; - const gpUrl = "https://dev.gisportal.id/server/rest/services/mfajri/Buffer_Sample_Geoprocessing/GPServer/Model"; - document.getElementById('procces').addEventListener('click', e => { - CLipnBuffer() - }) + const gpUrl = "https://dev.gisportal.id/server/rest/services/mfajri/Buffer_Sample_Geoprocessing/GPServer/Buffer"; + const webmap = new WebMap({ portalItem: { id: "60994025213a4874bdb2e39503c72407" @@ -27,6 +29,15 @@ $(document).ready(function () { center: [106.840837, -6.294844], }); + let polylineAtt = { + Name: "Buffer Area", + Owner: "MCF" + }; + + + const graphicsLayer = new GraphicsLayer(); + + let homeButton = new Home({ view: view, container: "HomeButton" @@ -35,7 +46,7 @@ $(document).ready(function () { let layerList = new LayerList({ view: view, listItemCreatedFunction: (event) => { - console.log(event); + // console.log(event); const item = event.item; if (item.layer.type != "group") { @@ -48,16 +59,383 @@ $(document).ready(function () { } }); - console.log(webmap.allLayers) view.ui.add(layerList, { position: "top-right" }); + const fillSymbol = { + type: "simple-fill", + color: [168, 0, 0, 0.17], + outline: null + }; + + document.getElementById('procces').addEventListener('click', e => { + CLipnBuffer() + }) + + const CLipnBuffer = function() { - // const params = { - // Pipeline_Inspection: - // } + graphicsLayer.removeAll(); + let radius = document.getElementById("radiusDistance").value; + let unit = document.getElementById("Unit").value; + const params = { + Pipeline_Inspection: { + "displayFieldName": "", + "geometryType": "esriGeometryPoint", + "spatialReference": { + "wkid": 4326, + "latestWkid": 4326 + }, + "fields": [ + { + "name": "OBJECTID", + "type": "esriFieldTypeOID", + "alias": "OBJECTID" + }, + { + "name": "globalid", + "type": "esriFieldTypeGlobalID", + "alias": "GlobalID", + "length": 38 + }, + { + "name": "easting", + "type": "esriFieldTypeDouble", + "alias": "EASTING" + }, + { + "name": "northing", + "type": "esriFieldTypeDouble", + "alias": "NORTHING" + }, + { + "name": "anomaly_category", + "type": "esriFieldTypeString", + "alias": "ANOMALY_CATEGORY", + "length": 255 + }, + { + "name": "functional_location", + "type": "esriFieldTypeString", + "alias": "FUNCTIONAL_LOCATION", + "length": 500 + }, + { + "name": "anomaly_name", + "type": "esriFieldTypeString", + "alias": "ANOMALY_NAME", + "length": 255 + }, + { + "name": "anomaly_code", + "type": "esriFieldTypeString", + "alias": "ANOMALY_CODE", + "length": 100 + }, + { + "name": "sap_notification", + "type": "esriFieldTypeString", + "alias": "SAP_NOTIFICATION", + "length": 255 + }, + { + "name": "anomaly_reff_number", + "type": "esriFieldTypeString", + "alias": "ANOMALY_REFF_NUMBER", + "length": 100 + }, + { + "name": "anomaly_close", + "type": "esriFieldTypeString", + "alias": "ANOMALY_CLOSE", + "length": 10 + }, + { + "name": "anomaly_date_created", + "type": "esriFieldTypeDate", + "alias": "ANOMALY_DATE_CREATED", + "length": 8 + }, + { + "name": "anomaly_created_by", + "type": "esriFieldTypeString", + "alias": "ANOMALY_CREATED_BY", + "length": 100 + }, + { + "name": "anomaly_desc", + "type": "esriFieldTypeString", + "alias": "ANOMALY_DESC", + "length": 255 + }, + { + "name": "anomaly_risk", + "type": "esriFieldTypeString", + "alias": "ANOMALY_RISK", + "length": 100 + }, + { + "name": "anomaly_status", + "type": "esriFieldTypeString", + "alias": "ANOMALY_STATUS", + "length": 50 + }, + { + "name": "anomaly_comment", + "type": "esriFieldTypeString", + "alias": "ANOMALY_COMMENT", + "length": 500 + }, + { + "name": "action_assign_to", + "type": "esriFieldTypeString", + "alias": "ACTION_ASSIGN_TO", + "length": 100 + }, + { + "name": "action_comment", + "type": "esriFieldTypeString", + "alias": "ACTION_COMMENT", + "length": 500 + }, + { + "name": "kp", + "type": "esriFieldTypeString", + "alias": "KP", + "length": 255 + }, + { + "name": "survey_date", + "type": "esriFieldTypeDate", + "alias": "SURVEY_DATE", + "length": 8 + }, + { + "name": "status_validated", + "type": "esriFieldTypeString", + "alias": "Status Validated", + "length": 255 + }, + { + "name": "created_date", + "type": "esriFieldTypeDate", + "alias": "created_date", + "length": 8 + }, + { + "name": "created_user", + "type": "esriFieldTypeString", + "alias": "created_user", + "length": 255 + }, + { + "name": "last_edited_date", + "type": "esriFieldTypeDate", + "alias": "last_edited_date", + "length": 8 + }, + { + "name": "last_edited_user", + "type": "esriFieldTypeString", + "alias": "last_edited_user", + "length": 255 + } + ], + "features": [ + { + "attributes": { + "OBJECTID": 809, + "EASTING": 479156.0, + "NORTHING": 9864462.0, + "ANOMALY_CATEGORY": "Row Walking Survey", + "FUNCTIONAL_LOCATION": "HDL/CPA /OIL/TRANS/8_CPA_TO_SNP", + "ANOMALY_NAME": "Corrosion Eviden", + "ANOMALY_CODE": "RWW-CE", + "SAP_NOTIFICATION": null, + "ANOMALY_REFF_NUMBER": "RWW-CE-8", + "ANOMALY_CLOSE": "No", + "ANOMALY_DATE_CREATED": 1678161600000, + "ANOMALY_CREATED_BY": "Rascal", + "ANOMALY_DESC": "Test drive", + "ANOMALY_RISK": "1 (High) - Immediate Action", + "ANOMALY_STATUS": "Open", + "ANOMALY_COMMENT": "No comment aku", + "ACTION_ASSIGN_TO": "PO/OSF/INS/PIM", + "ACTION_COMMENT": null, + "KP": null, + "SURVEY_DATE": 1678161600000, + "STATUS_VALIDATED": "Validated", + "STATUS_REVIEW": null, + "REVIEWED_BY": null, + "GlobalID": "{0AC28FE4-B997-4B36-A96F-F72AAA38E013}" + }, + "geometry": { + "x": 116.81264485400004, + "y": -1.2262399559999722 + } + }, + { + "attributes": { + "OBJECTID": 1609, + "EASTING": 479156.0, + "NORTHING": 9864462.0, + "ANOMALY_CATEGORY": "Row Walking Survey", + "FUNCTIONAL_LOCATION": "HDL/CPA /OIL/TRANS/8_CPA_TO_SNP", + "ANOMALY_NAME": "3rd Party Activity", + "ANOMALY_CODE": "RWW-3PA", + "SAP_NOTIFICATION": null, + "ANOMALY_REFF_NUMBER": "RWW-3PA-7", + "ANOMALY_CLOSE": "No", + "ANOMALY_DATE_CREATED": 1678161600000, + "ANOMALY_CREATED_BY": "Rascal", + "ANOMALY_DESC": "Test drive", + "ANOMALY_RISK": "2 (Medium) - Non-Standard Condition", + "ANOMALY_STATUS": "Open", + "ANOMALY_COMMENT": "No comment aku", + "ACTION_ASSIGN_TO": "PO/OSF/INS/PIM", + "ACTION_COMMENT": null, + "KP": null, + "SURVEY_DATE": 1678161600000, + "STATUS_VALIDATED": "Validated", + "STATUS_REVIEW": null, + "REVIEWED_BY": null, + "GlobalID": "{AC962425-CF81-4A62-AC94-2A322E4C0579}" + }, + "geometry": { + "x": 116.81264485400004, + "y": -1.2262399559999722 + } + }, + { + "attributes": { + "OBJECTID": 1610, + "EASTING": 479156.0, + "NORTHING": 9864462.0, + "ANOMALY_CATEGORY": "Row Walking Survey", + "FUNCTIONAL_LOCATION": "HDL/CPA /OIL/TRANS/8_CPA_TO_SNP", + "ANOMALY_NAME": "3rd Party Activity", + "ANOMALY_CODE": "RWW-3PA", + "SAP_NOTIFICATION": null, + "ANOMALY_REFF_NUMBER": "RWW-3PA-7", + "ANOMALY_CLOSE": "No", + "ANOMALY_DATE_CREATED": 1678161600000, + "ANOMALY_CREATED_BY": "Rascal", + "ANOMALY_DESC": "Test drive", + "ANOMALY_RISK": "2 (Medium) - Non-Standard Condition", + "ANOMALY_STATUS": "Open", + "ANOMALY_COMMENT": "No comment aku", + "ACTION_ASSIGN_TO": "PO/OSF/INS/PIM", + "ACTION_COMMENT": null, + "KP": null, + "SURVEY_DATE": 1678161600000, + "STATUS_VALIDATED": "Validated", + "STATUS_REVIEW": null, + "REVIEWED_BY": null, + "GlobalID": "{016D9D44-CA20-4EA5-8DEA-B526A4A3F538}" + }, + "geometry": { + "x": 116.81264485400004, + "y": -1.2262399559999722 + } + }, + { + "attributes": { + "OBJECTID": 3208, + "EASTING": 479156.0, + "NORTHING": 9864462.0, + "ANOMALY_CATEGORY": "Row Walking Survey", + "FUNCTIONAL_LOCATION": "HDL/CPA /OIL/TRANS/8_CPA_TO_SNP", + "ANOMALY_NAME": "Corrosion Eviden", + "ANOMALY_CODE": "RWW-CE", + "SAP_NOTIFICATION": null, + "ANOMALY_REFF_NUMBER": "RWW-CE-8", + "ANOMALY_CLOSE": "No", + "ANOMALY_DATE_CREATED": 1678161600000, + "ANOMALY_CREATED_BY": "Rascal", + "ANOMALY_DESC": "Test drive", + "ANOMALY_RISK": "1 (High) - Immediate Action", + "ANOMALY_STATUS": "Open", + "ANOMALY_COMMENT": "No comment aku", + "ACTION_ASSIGN_TO": "PO/OSF/INS/PIM", + "ACTION_COMMENT": null, + "KP": null, + "SURVEY_DATE": 1678161600000, + "STATUS_VALIDATED": "Validated", + "STATUS_REVIEW": null, + "REVIEWED_BY": null, + "GlobalID": "{49D3D5C9-B644-4868-B522-F687E6968167}" + }, + "geometry": { + "x": 116.81264485400004, + "y": -1.2262399559999722 + } + }, + { + "attributes": { + "OBJECTID": 3608, + "EASTING": 479156.0, + "NORTHING": 9864462.0, + "ANOMALY_CATEGORY": "Row Walking Survey", + "FUNCTIONAL_LOCATION": "HDL/CPA /OIL/TRANS/8_CPA_TO_SNP", + "ANOMALY_NAME": "Marker/Sign", + "ANOMALY_CODE": "RWW-SMS", + "SAP_NOTIFICATION": null, + "ANOMALY_REFF_NUMBER": "RWW-SMS-6", + "ANOMALY_CLOSE": "No", + "ANOMALY_DATE_CREATED": 1678161600000, + "ANOMALY_CREATED_BY": "Rascal", + "ANOMALY_DESC": "Test drive", + "ANOMALY_RISK": "3 (Low) - Monitoring/Observation", + "ANOMALY_STATUS": "Open", + "ANOMALY_COMMENT": "No comment aku", + "ACTION_ASSIGN_TO": "PO/OSF/INS/PIM", + "ACTION_COMMENT": null, + "KP": "kp 123", + "SURVEY_DATE": 1659326400000, + "STATUS_VALIDATED": "Validated", + "STATUS_REVIEW": null, + "REVIEWED_BY": null, + "GlobalID": "{E12BD9BE-FFDF-4D94-A39F-A4FECD8E7717}" + }, + "geometry": { + "x": 116.81264485400004, + "y": -1.2262399559999722 + } + } + ], + "exceededTransferLimit": false + }, + Distance__value_or_field_: { + "distance": radius, + "units": unit + }, + f: "pjson" + }; + geoprocessor.execute(gpUrl, params).then(drawResultData); } + + const drawResultData = function (result) { + const resultFeatures = result.results[0].value.features; + const viewshedGraphics = resultFeatures.map((feature) => { + feature.symbol = fillSymbol; + console.log(feature); + + return feature; + }); + graphicsLayer.addMany(viewshedGraphics); + webmap.add(graphicsLayer); + + view.goTo({ + target: viewshedGraphics, + tilt: 0 + }) + .catch((error) => { + if (error.name != "AbortError") { + console.error(error); + } + }); + } + });