/*
* 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.
*
*/
import { subclass, property } from "esri/core/accessorSupport/decorators";
import { tsx } from "esri/widgets/support/widget";
import Section from "./Section";
import AppState from "../AppState";
import { Timetable } from "../widgets/Timetable/Timetable";
import Viewpoints from "../widgets/Viewpoints/Viewpoints";
import * as watchUtils from "esri/core/watchUtils";
import Handles from "esri/core/Handles";
import FeatureLayer from "esri/layers/FeatureLayer";
import * as appUtils from "../support/appUtils";
import Collection from "esri/core/Collection";
import PopupInfo from "../widgets/Popup/PopupInfo";
import WebScene from "esri/WebScene";
interface HomeSectionCtorArgs {
content?: (that: HomeSection) => any;
timetable?: Timetable;
title?: string;
showExternalPoints?: boolean;
}
@subclass("sections/HomeSection")
class HomeSection extends Section {
@property()
title = "Overview";
@property()
id = "home";
@property({ constructOnly: true })
timetable: Timetable;
@property()
private textTitle: string;
@property()
appState: AppState;
@property()
infoPointsLayer: FeatureLayer;
@property({ constructOnly: true })
showExternalPoints: boolean = false;
private handles = new Handles();
@property()
content: (that: this) => any = (that: this) => (this.appState.view.map as WebScene).portalItem.snippet;
@property({dependsOn: ["appState"], readOnly: true})
get viewpoints() {
return new Viewpoints({appState: this.appState});
}
render() {
const timetable = this.timetable ? (Opening hours