Skip to content

Commit

Permalink
register ECSchemaRpcInterface with web viewer template
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-polinsky committed Sep 9, 2024
1 parent 03568d9 commit 2639ce3
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/templates/cra-template-web-viewer/template/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import "./App.scss";
import type { ScreenViewport } from "@itwin/core-frontend";
import { FitViewTool, IModelApp, StandardViewId } from "@itwin/core-frontend";
import { FillCentered } from "@itwin/core-react";
import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common";
import { ProgressLinear } from "@itwin/itwinui-react";
import {
MeasurementActionToolbar,
Expand Down Expand Up @@ -37,10 +38,7 @@ import React, { useCallback, useEffect, useMemo, useState } from "react";

import { Auth } from "./Auth";
import { history } from "./history";
import {
unifiedSelectionStorage,
getSchemaContext,
} from "./selectionStorage";
import { getSchemaContext, unifiedSelectionStorage } from "./selectionStorage";

const App: React.FC = () => {
const [iModelId, setIModelId] = useState(process.env.IMJS_IMODEL_ID);
Expand Down Expand Up @@ -157,6 +155,17 @@ const App: React.FC = () => {
viewCreatorOptions={viewCreatorOptions}
enablePerformanceMonitors={true} // see description in the README (https://www.npmjs.com/package/@itwin/web-viewer-react)
onIModelAppInit={onIModelAppInit}
mapLayerOptions={{
BingMaps: {
key: "key",
value: process.env.IMJS_BING_MAPS_KEY ?? "",
},
}}
backendConfiguration={{
defaultBackend: {
rpcInterfaces: [ECSchemaRpcInterface],
},
}}
uiProviders={[
new ViewerNavigationToolsProvider(),
new ViewerContentToolsProvider({
Expand Down

0 comments on commit 2639ce3

Please sign in to comment.