Convert coordinates from layer point to a latLng

Click on map to view the pixel position in the map layer and to convert it to a latlng.

    <script src=""></script>
    <link href="" rel="stylesheet" />
  <div style="position: relative">
    <div id="map" style="height: 400px"></div>
      var map ="map", "your_api_key_here", {
        center: [37.7858, -122.401],
        zoom: 15,
        indoorsEnabled: true,
        displayEntranceMarkers: false
      map.on("click", function(e) {
        var pixelPosition = e.layerPoint;
        var latLng = map.layerPointToLatLng(pixelPosition);
        alert("Pixel position = " + pixelPosition + "\nLatLng = " + latLng);