Displaying trksegs through geojson.

This commit is contained in:
vdv committed 2022-11-27 17:12:25 +01:00
1 parent ab7374f360
commit 37fd31a040
4 files changed
+41 -10

No files matched your search

+5 -4
View File
@@ -6,12 +6,13 @@ import dispatch from '../../workers/dispatcher-main';
import getUri from '../../lib/ids';
import Trkseg from '../trkseg';
import VectorSource from 'ol/source/Vector';
interface Props {
trkId: string;
map: () => OlMap | null;
vectorSource: VectorSource;
}
export const Trk: Component<Props> = ({ map, trkId }) => {
export const Trk: Component<Props> = ({ vectorSource, trkId }) => {
const [trk] = createResource(
trkId,
async () =>
@@ -24,7 +25,7 @@ export const Trk: Component<Props> = ({ map, trkId }) => {
);
createEffect(() => {
console.log({ caller: 'Trk', map: map(), trkId, trk: trk() });
console.log({ caller: 'Trk', vectorSource, trkId, trk: trk() });
});
return (
@@ -32,7 +33,7 @@ export const Trk: Component<Props> = ({ map, trkId }) => {
<For each={trk() ? trk().trkseg || [] : []}>
{(trksegId: string) => {
console.log({ caller: 'Trk / loop', trksegId });
return <Trkseg map={map} trksegId={trksegId} />;
return <Trkseg vectorSource={vectorSource} trksegId={trksegId} />;
}}
</For>
);