|
@@ -215,6 +215,15 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
.pdfobject-container {
|
|
.pdfobject-container {
|
|
|
height: 730px;
|
|
height: 730px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ #topbar {
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ padding: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #datatable-ajax_length {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -305,6 +314,7 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
geometryEngine,
|
|
geometryEngine,
|
|
|
Expand, GeoJsonLayer, PopupTemplate, Renderer, projection) => {
|
|
Expand, GeoJsonLayer, PopupTemplate, Renderer, projection) => {
|
|
|
esriConfig.apiKey = token;
|
|
esriConfig.apiKey = token;
|
|
|
|
|
+ let activeWidget = null;
|
|
|
const webscene = new WebScene({
|
|
const webscene = new WebScene({
|
|
|
portalItem: {
|
|
portalItem: {
|
|
|
id: "dea6580d8d4547df9915a822fe7f2b9d"
|
|
id: "dea6580d8d4547df9915a822fe7f2b9d"
|
|
@@ -382,7 +392,7 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
//新增量測工具
|
|
//新增量測工具
|
|
|
- var activeMeasureWidget = new DirectLineMeasurement3D({
|
|
|
|
|
|
|
+ /*var activeMeasureWidget = new DirectLineMeasurement3D({
|
|
|
view: view
|
|
view: view
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -404,7 +414,7 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
group: "top-left"
|
|
group: "top-left"
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- view.ui.add([pMeasureExpand, pMeasureExpand2], "top-left");
|
|
|
|
|
|
|
+ view.ui.add([pMeasureExpand, pMeasureExpand2], "top-left");*/
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -423,6 +433,87 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
pMeasureExpand,
|
|
pMeasureExpand,
|
|
|
"top-left"
|
|
"top-left"
|
|
|
);*/
|
|
);*/
|
|
|
|
|
+ view.ui.add("topbar", "bottom-right");
|
|
|
|
|
+
|
|
|
|
|
+ document
|
|
|
|
|
+ .getElementById("distanceButton")
|
|
|
|
|
+ .addEventListener("click", (event) => {
|
|
|
|
|
+ setActiveWidget(null);
|
|
|
|
|
+ if (!event.target.classList.contains("active")) {
|
|
|
|
|
+ setActiveWidget("distance");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setActiveButton(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ document
|
|
|
|
|
+ .getElementById("areaButton")
|
|
|
|
|
+ .addEventListener("click", (event) => {
|
|
|
|
|
+ setActiveWidget(null);
|
|
|
|
|
+ if (!event.target.classList.contains("active")) {
|
|
|
|
|
+ setActiveWidget("area");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setActiveButton(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ function setActiveWidget(type) {
|
|
|
|
|
+ switch (type) {
|
|
|
|
|
+ case "distance":
|
|
|
|
|
+ activeWidget = new DirectLineMeasurement3D({
|
|
|
|
|
+ view: view
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // skip the initial 'new measurement' button
|
|
|
|
|
+ activeWidget.viewModel.start().catch((error) => {
|
|
|
|
|
+ if (promiseUtils.isAbortError(error)) {
|
|
|
|
|
+ return; // don't display abort errors
|
|
|
|
|
+ }
|
|
|
|
|
+ throw error; // throw other errors since they are of interest
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ view.ui.add(activeWidget, "bottom-left");
|
|
|
|
|
+ setActiveButton(document.getElementById("distanceButton"));
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "area":
|
|
|
|
|
+ activeWidget = new AreaMeasurement3D({
|
|
|
|
|
+ view: view
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // skip the initial 'new measurement' button
|
|
|
|
|
+ activeWidget.viewModel.start().catch((error) => {
|
|
|
|
|
+ if (promiseUtils.isAbortError(error)) {
|
|
|
|
|
+ return; // don't display abort errors
|
|
|
|
|
+ }
|
|
|
|
|
+ throw error; // throw other errors since they are of interest
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ view.ui.add(activeWidget, "bottom-left");
|
|
|
|
|
+ setActiveButton(document.getElementById("areaButton"));
|
|
|
|
|
+ break;
|
|
|
|
|
+ case null:
|
|
|
|
|
+ if (activeWidget) {
|
|
|
|
|
+ view.ui.remove(activeWidget);
|
|
|
|
|
+ activeWidget.destroy();
|
|
|
|
|
+ activeWidget = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function setActiveButton(selectedButton) {
|
|
|
|
|
+ // focus the view to activate keyboard shortcuts for sketching
|
|
|
|
|
+ view.focus();
|
|
|
|
|
+ const elements = document.getElementsByClassName("active");
|
|
|
|
|
+ for (let i = 0; i < elements.length; i++) {
|
|
|
|
|
+ elements[i].classList.remove("active");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (selectedButton) {
|
|
|
|
|
+ selectedButton.classList.add("active");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
view.ui.add(
|
|
view.ui.add(
|
|
|
new Fullscreen({
|
|
new Fullscreen({
|
|
|
view: view,
|
|
view: view,
|
|
@@ -584,6 +675,7 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
<div id="folderPath" style="float: left;"></div>
|
|
<div id="folderPath" style="float: left;"></div>
|
|
|
<button id="reset" type="button" class="mb-xs mr-xs btn btn-default" style="float: right;"><i class="fa fa-reply"></i> 上一層</button>
|
|
<button id="reset" type="button" class="mb-xs mr-xs btn btn-default" style="float: right;"><i class="fa fa-reply"></i> 上一層</button>
|
|
|
<table style="width:99%;" class="table table-bordered table-striped" id="datatable-ajax">
|
|
<table style="width:99%;" class="table table-bordered table-striped" id="datatable-ajax">
|
|
|
|
|
+
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
|
<th id="SN">項次</th>
|
|
<th id="SN">項次</th>
|
|
@@ -643,6 +735,11 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
<div id="arcgisTab" class="tab-pane active">
|
|
<div id="arcgisTab" class="tab-pane active">
|
|
|
<div id="arcgis" class="panel-body" style="height: 730px;">
|
|
<div id="arcgis" class="panel-body" style="height: 730px;">
|
|
|
<div class="mapok" style="height:100%">
|
|
<div class="mapok" style="height:100%">
|
|
|
|
|
+ <div id="topbar" class="esri-component esri-widget">
|
|
|
|
|
+ <button id="distanceButton" class="action-button esri-icon-measure-line" type="button" title="Measure distance between two points"></button>
|
|
|
|
|
+ <button id="areaButton" class="action-button esri-icon-measure-area" type="button" title="Measure area"></button>
|
|
|
|
|
+ <button id="clear" class="action-button esri-icon-trash" title="Clear Measurements"></button>
|
|
|
|
|
+ </div>
|
|
|
<div id="viewDiv"></div>
|
|
<div id="viewDiv"></div>
|
|
|
<div id="measureExpendDiv"></div>
|
|
<div id="measureExpendDiv"></div>
|
|
|
<div id="measureExpendDiv2"></div>
|
|
<div id="measureExpendDiv2"></div>
|