Show current location not working using leaflet

Current location not shows in MAP,

function showPosition(position) {
// alert(“test1234”)

       // alert("position")
       marker = new L.Marker([position.coords.latitude, position.coords.longitude], { bounceOnAdd: false }).addTo(map);
       var popup = L.popup()
      .setLatLng([position.coords.latitude, position.coords.longitude])
      .setContent('You are here!')

Hi @thangae,

Please take note that: there’s will be a security reason for tracking location in Web Application Development on non-SSL aka http (running localhost).

Those are the example code from our however you have to implement your own current location coding.

getLocation() gives the current location which is not fully implemented in the example due to above issue.
showPosition(position) means you have sending the lat,lng to the map to update the marker.

You can try to see my sample code here: