dasda

Kolorwanie:
Status:
1234567891011121314151617181920212223242526272829303132333435
//SET MARKERS FROM DATABASE
const markList = document.querySelector('.markdisp')
const setMarkers = (data) => {

  let html = '';
  data.forEach(doc => {
    const mark = doc.data();
    const coords = mark.geop;
    const myLat = coords.latitude;
    const myLng = coords.longitude;
    console.log(coords.latitude);
    console.log(coords.longitude);
    const li = `
      <li>
      ${myLat} ${myLng} ${mark.popup_data}
      </li>
      <Br>
    `;
    html += li;
    //ADD MARKERS FROM DATABASE
    // create the popup
    var popup = new mapboxgl.Popup().setText(mark.popup_data);
    // create DOM element for the marker
    var el = document.createElement('div');
    el.id = 'marker';
    var myLngLat = [myLng,myLat];
    // create the marker
    new mapboxgl.Marker(el)
        .setLngLat(myLngLat)
        .setPopup(popup)
        .addTo(map);

  });
  markList.innerHTML = html
};

Copyrights 2014-2020 © Wklejaj.pl Wszelkie prawa zastrzeżone.