title: Add markers from firebase to google map in website
body: <p><strong>Firebase data structure</strong> : </p>
  
  <p><a href="https://i.stack.imgur.com/tZTBm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tZTBm.png" alt="enter image description here"></a>
  <br/><br/>
  I need to add markers in the google map using these latlang.</p>
  
  <p><strong>My code</strong> : </p>
  
  <pre><code>    &lt;script&gt;
      var map;
  
      function initMap() {
  
          map = new google.maps.Map(document.getElementById('map'), {
            center: {lat: 6.930274, lng: 79.861618},
            zoom: 16.5,
            panControl: false,
            gestureHandling: 'greedy',
            disableDefaultUI: true,
            disableDoubleClickZoom: true,
          });
  
          var dbRef= firebase.database().ref('bins');
          dbRef.on('value', function(snapshot) {
              var snap = snapshot.val();
              var marker = new google.maps.Marker({
                position: {lat: snap.lat, lng: snap.lang},
                map: map
              });
          });
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>Nothing happened when this code runs. </p>