Commit 129685ad authored by Joe TS Dell's avatar Joe TS Dell
Browse files

update

parent 9e629ea3
......@@ -49,7 +49,7 @@
{
"title": "NewYork - 3D Buildings Manhattan: i3s",
"rel": "items",
"href": "host_url/collections/NewYork/i3s",
"href": "https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_NewYork_17/SceneServer/layers/0/",
"type": "application/json+i3s"
}
],
......
......@@ -49,7 +49,7 @@
{
"title": "NewYork - 3D Buildings Manhattan: i3s",
"rel": "items",
"href": "host_url/collections/NewYork/i3s",
"href": "https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_NewYork_17/SceneServer/layers/0/",
"type": "application/json+i3s"
}
],
......@@ -66,7 +66,7 @@
{
"title": "NewYork - 3D Buildings Manhattan: i3s",
"rel": "original",
"href": "host_url/collections/NewYork/i3s",
"href": "https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_NewYork_17/SceneServer/layers/0/",
"type": "application/json+i3s"
}
]
......
......@@ -168,14 +168,26 @@
})
app.get('/i3s', function (req, res) {
if ("i3s_resource_url" in req.params) {
res.render('geovolumes/collections.ejs',
req.params
if (req.query.i3s_resource_url) {
res.render('arcgisclient.ejs',
req.query
)
} else {
res.send("Error: no i3s parameter specified")
res.send("Error: no i3s query parameter specified")
}
})
app.get('/3dtiles', function (req, res) {
if (req.query.url_3dtiles_json) {
res.render('cesiumclient.ejs',
req.query
)
} else {
res.send("Error: no url_3dtiles_json parameter specified")
}
})
app.use(express.static("static"));
app.use(express.static("3DGeoVolumes"));
const httpServer = http.createServer(app);
httpServer.listen(port, () => {
console.log(`HTTP Server running on port ${port}`);
......
#paneDiv {
padding: 10px;
max-width: 200px;
background-color: rgba(255, 255, 255, 0.8);
font-size: 1.1em;
}
\ No newline at end of file
<!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%;
}
#paneDiv {
padding: 10px;
max-width: 200px;
background-color: rgba(255, 255, 255, 0.8);
font-size: 1.1em;
}
</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" />
<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
<!DOCTYPE html>
<html>
<html lang="en">
<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>
<meta charset="utf-8">
<script src="https://cesium.com/downloads/cesiumjs/releases/1.83/Build/Cesium/Cesium.js"></script>
<link href="https://cesium.com/downloads/cesiumjs/releases/1.83/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
<!-- <script src="https://cesium.com/downloads/cesiumjs/releases/1.68/Build/Cesium/Cesium.js"></script>
<link href="https://cesium.com/downloads/cesiumjs/releases/1.68/Build/Cesium/Widgets/widgets.css" rel="stylesheet"> -->
</head>
<body>
<div id="cesiumContainer" style="width: 100%; height:100%; margin:0;"></div>
<script>
// Cesium.Ion.defaultAccessToken = '';
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");
var url_3dtiles_json = "";
var viewer = new Cesium.Viewer('cesiumContainer', {
// terrainProvider: Cesium.createWorldTerrain(),
baseLayerPicker: false,
vrButton: false,
geocoder: false,
navigationHelpButton: false,
selectionIndicator: false,
shadows: true,
timeline: true,
sceneModePicker: false,
imageryProvider: new Cesium.OpenStreetMapImageryProvider({
url: 'https://a.tile.openstreetmap.org/'
})
});
if (urlParams.has('url_3dtiles_json')) {
url_3dtiles_json = urlParams.get('url_3dtiles_json');
console.log(`loading: ${url_3dtiles_json}`)
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: url_3dtiles_json
}))
Cesium.when(tileset.readyPromise).then(function (tileset) {
viewer.flyTo(tileset)
// var cartographic = Cesium.Cartographic.fromCartesian(
// tileset.boundingSphere.center
// );
// var surface = Cesium.Cartesian3.fromRadians(
// cartographic.longitude,
// cartographic.latitude,
// 0.0
// );
// var offset = Cesium.Cartesian3.fromRadians(
// cartographic.longitude,
// cartographic.latitude,
// 50
// );
// var translation = Cesium.Cartesian3.subtract(
// offset,
// surface,
// new Cesium.Cartesian3()
// );
// tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
})
} else {
// ...
}
</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
......@@ -77,7 +77,15 @@
<% 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>
<% 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 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) <i class="bi bi-box-arrow-up-right"></i></span>
</a>
<% } %>
<% if (collection_resource_updated_bbox["collections"][i].links[j]["title"].includes("3D Tiles") ) { %>
<a href="../3dtiles/?url_3dtiles_json=<%= collection_resource_updated_bbox["collections"][i].links[j]["href"]%>" target="_blank"><span class="badge bg-warning text-dark">3D Tiles client (CesiumJS) <i class="bi bi-box-arrow-up-right"></i></span>
</a>
<% } %>
<% if (collection_resource_updated_bbox["collections"][i].links[j]["title"].includes("gltf") ) { %>
<a href="https://gltf-viewer.donmccurdy.com/#model=<%= collection_resource_updated_bbox["collections"][i].links[j]["href"]%>" target="_blank"><span class="badge bg-success">GLTF viewer (donmccurdy) <i class="bi bi-box-arrow-up-right"></i></span>
</a>
<% } %>
<br>
......@@ -103,11 +111,17 @@
<% for(var k=0; k < collection_resource_updated_bbox["collections"][i].children[j].links.length; k++) { %>
<% 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>
<%= collection_resource_updated_bbox["collections"][i].children[j].links[k]["title"]%></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 href="../i3s/?i3s_resource_url=<%= collection_resource_updated_bbox["collections"][i].children[j].links[k]["href"]%>" target="_blank"><span class="badge bg-primary">i3s client (ArcGIS JS) <i class="bi bi-box-arrow-up-right"></i></span>
</a>
<% } %>
<% if (collection_resource_updated_bbox["collections"][i].children[j].links[k]["title"].includes("3D Tiles") ) { %>
<a href="../3dtiles/?url_3dtiles_json=<%= collection_resource_updated_bbox["collections"][i].children[j].links[k]["href"]%>" target="_blank"><span class="badge bg-warning text-dark">3D Tiles client (CesiumJS) <i class="bi bi-box-arrow-up-right"></i></span>
</a>
<% } %>
<% if (collection_resource_updated_bbox["collections"][i].children[j].links[k]["title"].includes("gltf") ) { %>
<a href="https://gltf-viewer.donmccurdy.com/#model=<%= collection_resource_updated_bbox["collections"][i].children[j].links[k]["href"]%>" target="_blank"><span class="badge bg-success">GLTF viewer (donmccurdy) <i class="bi bi-box-arrow-up-right"></i></span>
</a>
<% } %>
<br>
......@@ -126,6 +140,7 @@
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous">
</script>
......
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