forked from emre/www_projectmycelium_com
update map with nodes dynamic
This commit is contained in:
@@ -25,7 +25,7 @@ interface RawNode {
|
|||||||
function DynamicMapContainer() {
|
function DynamicMapContainer() {
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [nodes, setNodes] = useState<GeoNode[]>([]);
|
const [nodes, setNodes] = useState<GeoNode[]>([]);
|
||||||
const API_URL = "https://gridproxy.grid.tf/nodes?healthy=true";
|
const API_URL = "https://gridproxy.grid.tf/nodes?healthy=true&size=99999";
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchNodeData() {
|
async function fetchNodeData() {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default function WorldMap({
|
|||||||
// Projects lat/lng to the SVG's 800x400 viewBox coordinates
|
// Projects lat/lng to the SVG's 800x400 viewBox coordinates
|
||||||
const projectPoint = (lat: number, lng: number) => {
|
const projectPoint = (lat: number, lng: number) => {
|
||||||
const x = (lng + 180) * (800 / 360);
|
const x = (lng + 180) * (800 / 360);
|
||||||
const y = (90 - lat) * (400 / 180);
|
const y = (90 - lat) * (400 / 180) + 45;
|
||||||
return { x, y };
|
return { x, y };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user