Skip to content

Commit

Permalink
Close popup after embeddings algorithm change
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan-anokhin committed Apr 20, 2022
1 parent 11965c5 commit 0648d03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/src/application/api/embeddings/tilesURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { EmbeddingAlgorithm } from "../../../model/embeddings";
* Get tiles URL pattern.
*/
export default function tilesURL(algorithm: EmbeddingAlgorithm): string {
return `http://localhost:5000/api/v1/embeddings/${algorithm}/tiles/{z}/{x}/{y}`;
return `/api/v1/embeddings/${algorithm}/tiles/{z}/{x}/{y}`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const useStyles = makeStyles<Theme>({
map: {
width: "100%",
height: "100%",
backgroundColor: "#aaa",
backgroundColor: "#fff",
},
});

Expand Down
4 changes: 3 additions & 1 deletion web/src/pages/DashboardPage/EmbeddingsMap/FileMarker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TilesInfo } from "../../../model/embeddings";
import { LatLng } from "leaflet";
import React, { useState } from "react";
import React, { useEffect, useState } from "react";
import { useMapEvents } from "react-leaflet";
import FileMarkerPopup from "./FileMarkerPopup";

Expand All @@ -20,6 +20,8 @@ export default function FileMarker(props: FileMarkerProps): JSX.Element | null {
},
});

useEffect(() => setPosition(null), [info.algorithm]);

return position === null ? null : (
<FileMarkerPopup
position={position}
Expand Down

0 comments on commit 0648d03

Please sign in to comment.