Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any provider to integrate bing satellite imagery? #183

Open
maifeeulasad opened this issue Jan 9, 2023 · 0 comments
Open

Any provider to integrate bing satellite imagery? #183

maifeeulasad opened this issue Jan 9, 2023 · 0 comments

Comments

@maifeeulasad
Copy link

My current solution doesn't work

Source (related):

const getLatLng = (x: number, y: number, z: number) => {
    const radius = 200;

    var latRads = Math.acos(y / radius);
    var lngRads = Math.atan2(z, x);
    var lat = (Math.PI / 2 - latRads) * (180 / Math.PI);
    var lng = (Math.PI - lngRads) * (180 / Math.PI);

    return [lat, lng - 180];
  };

  const providerBing = (x: number, y: number, z: number, dpr?: number) => {
    const latLon = getLatLng(x, y, z);
    // console.debug(latLon);
    return `https://dev.virtualearth.net/REST/V1/Imagery/Map/Aerial/${latLon[0]},${latLon[1]}/${z}?ms=1024,104&key=${mapboxApiKey}`;
  };

Sandbox to quickly debug: https://codesandbox.io/s/tile-boundary-8mo96w?file=/src/App.tsx

This is more of a support question, but couldn't find that discussion tab, so I'm creating this issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant