the question is how to add a div element in Viewer.
the code is below.
cesium.js
import { Viewer, KmlDataSource } from "resium";
import { useState } from "react";
import styles from "../styles/Cesium.module.css";
const kml1 = ('./electric.kml');
const kml2 = ('./electric2.kml');
export default function Cesium() {
const [showKml, setShowKml] = useState(false);
const [showLabel, setShowLabel] = useState(false);
const handleToggleKml = () => {
setShowKml((prevShowKml) => !prevShowKml);
};
const handleToggleLabel = () => {
setShowLabel((prevShowLabel) => !prevShowLabel);
};
return (
<>
<Viewer full>
<KmlDataSource
data={kml1}
onLoad={(dataSource) => {
console.log(dataSource);
}}
show={showKml}
/>
<KmlDataSource
data={kml2}
onLoad={(dataSource) => {
console.log(dataSource);
}}
show={showKml}
/>
<div className={styles.buttonWrapper}>
<button onClick={handleToggleLabel} className={styles.button}>
button
</button>
{showLabel && (
<label className={styles.label}>
<input
className={styles.input}
type="checkbox"
checked={showKml}
onChange={handleToggleKml}
/>
list
</label>
)}
</div>
</Viewer>
</>
)
}
index.js
import Head from 'next/head'
import dynamic from 'next/dynamic'
const Cesium = dynamic(
() => import('../components/Cesium'),
{ ssr: false }
)
export default function Home() {
return (
<>
<Head>
<link rel="stylesheet" href="cesium/Widgets/widgets.css" />
</Head>
<Cesium />
</>
)
}
I want to add the div into the direct viewer.
Do I have to edit the library of resium or cesium?
I lost way to do that. Does anybody help me.
I tried that adding div into viewer, but that did not work.