<Gpx> component
This commit is contained in:
1 parent
346b9a1186
commit
79fb39100f
7 files changed
+76
-22
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { Component, createEffect, createResource } from 'solid-js';
|
||||
|
||||
import OlMap from 'ol/Map';
|
||||
|
||||
import dispatch from '../../workers/dispatcher-main';
|
||||
//import Trk from './Trk';
|
||||
import getUri from '../../lib/ids';
|
||||
|
||||
interface Props {
|
||||
gpxId: string;
|
||||
map: () => OlMap | null;
|
||||
}
|
||||
|
||||
export const Gpx: Component<Props> = ({ map, gpxId }) => {
|
||||
const [gpx] = createResource(
|
||||
gpxId,
|
||||
async () =>
|
||||
await dispatch({
|
||||
action: 'getGpx',
|
||||
params: {
|
||||
id: gpxId,
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
createEffect(() => {
|
||||
console.log({ caller: 'Gpx', map: map(), gpxId, gpx: gpx() });
|
||||
});
|
||||
|
||||
return <></>;
|
||||
};
|
||||
|
||||
export default Gpx;
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './Gpx';
|
||||
Reference in new issue
Block a user