Commit 9e629ea3 authored by Joe TS Dell's avatar Joe TS Dell
Browse files

update

parent 249e91fd
......@@ -167,6 +167,15 @@
res.redirect("https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_NewYork_17/SceneServer/layers/0/")
})
app.get('/i3s', function (req, res) {
if ("i3s_resource_url" in req.params) {
res.render('geovolumes/collections.ejs',
req.params
)
} else {
res.send("Error: no i3s parameter specified")
}
})
const httpServer = http.createServer(app);
httpServer.listen(port, () => {
console.log(`HTTP Server running on port ${port}`);
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>i3s client</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="icon" type="image/ico" href="img/favicon.ico" sizes="16x16">
<link rel="stylesheet" href="https://js.arcgis.com/4.14/esri/themes/light/main.css" />
<link rel="stylesheet" href="./geoportal-i3s.css" />
<script src="https://js.arcgis.com/4.14/"></script>
<script>
var urlParams = new URLSearchParams(window.location.search);
var i3s_url = "";
require([
"esri/Map",
"esri/views/SceneView",
"esri/layers/SceneLayer",
"esri/support/actions/ActionButton"
], function (Map, SceneView, SceneLayer, ActionButton) {
// Create Map
var map = new Map({
basemap: "dark-gray",
ground: "world-elevation"
});
// Create the SceneView
var view = new SceneView({
container: "viewDiv",
map: map,
camera: {
position: [-74.0338, 40.6913, 707],
tilt: 81,
heading: 50
}
});
// Create SceneLayer and add to the map
var sceneLayer;
if (urlParams.has('i3s_resource_url')) {
i3s_url = urlParams.get('i3s_resource_url');
console.log(`loading: ${i3s_url}`)
sceneLayer = new SceneLayer({
url: i3s_url,
popupEnabled: true
});
map.add(sceneLayer);
sceneLayer.when(function () {
view.goTo(sceneLayer.fullExtent);
});
} else {
// ...
}
map.add(sceneLayer);
// Create MeshSymbol3D for symbolizing SceneLayer
var symbol = {
type: "mesh-3d", // autocasts as new MeshSymbol3D()
symbolLayers: [{
type: "fill", // autocasts as new FillSymbol3DLayer()
// If the value of material is not assigned, the default color will be grey
// material: {
// color: [244, 247, 134]
// }
}]
};
// Add the renderer to sceneLayer
sceneLayer.renderer = {
type: "simple", // autocasts as new SimpleRenderer()
symbol: symbol
};
view.ui.add("paneDiv", "top-right");
});
</script>
</head>
<body>
<div id="viewDiv"></div>
<div id="paneDiv" class="esri-widget">
<h1 style="line-height: 1em;">i3s client</h1>
<!-- <a id="tent" class="esri-button" href="./index.html" target="_blank" style="text-decoration: none; ">Back to STT
GeoPortal <br>(3D Tiles Client)</a><br /> -->
</div>
</body>
</html>
\ No newline at end of file
......@@ -75,9 +75,12 @@
<b>Links</b>: <br>
<% for(var j=0; j < collection_resource_updated_bbox["collections"][i].links.length; j++) { %>
<% if (collection_resource_updated_bbox["collections"][i].links[j]["title"]) { %>
<a href="<%= collection_resource_updated_bbox["collections"][i].links[j]["href"]%>" target="_blank">
<%= collection_resource_updated_bbox["collections"][i].links[j]["title"]%>
</a> <br>
<a href="<%= collection_resource_updated_bbox["collections"][i].links[j]["href"]%>" target="_blank"><%= collection_resource_updated_bbox["collections"][i].links[j]["title"]%></a>
<% if (collection_resource_updated_bbox["collections"][i].links[j]["title"].includes("i3s") ) { %>
<a href="i3s/?i3s_resource_url=<%= collection_resource_updated_bbox["collections"][i].links[j]["href"]%>" target="_blank"><span class="badge bg-primary">i3s client (ArcGIS JS)</span>
</a>
<% } %>
<br>
<% } %>
<% } %>
<b>Children:</b>
......@@ -101,7 +104,13 @@
<% if (collection_resource_updated_bbox["collections"][i].children[j].links[k]["title"]) { %>
<a href="<%= collection_resource_updated_bbox["collections"][i].children[j].links[k]["href"]%>" target="_blank">
<%= collection_resource_updated_bbox["collections"][i].children[j].links[k]["title"]%>
</a> <br>
</a>
<% if (collection_resource_updated_bbox["collections"][i].children[j].links[k]["title"].includes("i3s") ) { %>
<a href="<%= collection_resource_updated_bbox["collections"][i].children[j].links[k]["href"]%>" target="_blank">
i3s client by ArcGIS JS
</a>
<% } %>
<br>
<% } %>
<% } %>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment