Convert coordinates from latLng to layer point

Click on map to view its latlng and its converted pixel position in the map layer.

    <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 latlng = e.latlng;
        var pixelPosition = map.latLngToLayerPoint(latlng);
        alert("LatLng = " + latlng + "\n Pixel position = " + pixelPosition);