Example of a building in a compelling website built on top of ArcGIS JavaScript API
This demonstrates the use of ArcGIS API 4 for JavaScript and Building Scene Layers in a compelling website.
The application presents the Turanga library in 3D. The visitor can explore the library by navigating around, and then inside, floor by floor, to discover this amazing building.
npm install
dependenciesrm -rf .git
npm run build
to compile src/js/*.ts
and src/css/*.sccs
files in the same folder and watch for changesnpm run server
launches a webserver.http://localhost:8888/
. You should see now the Building Viewer running.Create a webscene with a BuildingSceneLayer named `Building
Open src/config.tsx
in your favorite code editor
Delete all the content except the two first obscure lines
Now you need to define 2 parameters in the config to get started:
The websceneId
of the webscene you created above
export const websceneId = "YOUR WEBSCENE ID HERE";
Note that you may to also export on which portal this webscene resides if different from the ArcGis's portal: export const portalUrl = "https://your-portal-url.com";
The sections
you'd like to have in your Building Viewer (see documentation about sections). Let's start with only one section, the home page:
// first import the section:
import HomeSection = require("./sections/HomeSection");
// then export the `sections` parameter:
export const sections = [
new HomeSection({})
];
Recompile the code and reload the website.
Checkout the documentation in the docs
folder, and in particular the quick start guide.
npm
and some knowledge of Typescript
The following external libraries, APIs, open datasets and specifications were used to make this application:
Find a bug or want to request a new feature? Please let us know by submitting an issue.
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
Copyright 2019 Esri
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
A copy of the license is available in the repository's license.txt file.