Skip to content

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

Description

@sohagmahin

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions