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

map.getProjection(...).fromContainerPixelToLatLng is not a function #1202

Open
sohagmahin opened this issue Oct 4, 2023 · 2 comments
Open

Comments

@sohagmahin
Copy link

I can't convert point to latlng.
Here is my code.

  function convertPointToLatLng(x, y) {
    // Function to convert screen coordinates to LatLng
    if (map.getProjection()) {
      const point = new maps.Point(x, y);
      const latLng = map.getProjection().fromContainerPixelToLatLng(point);
      return latLng;
    }
  }

Got an error like map.getProjection(...).fromContainerPixelToLatLng is not a function

@mustafairam
Copy link

same here. cannot use :

const latLng = map.getProjection().fromContainerPixelToLatLng(point);

@besch
Copy link

besch commented Apr 4, 2024

Me too

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

3 participants