Add a clickable div in mapboxgl marker popup

194 views Asked by At

Hi i want to add a clickable div MapBoxGLmarker popup i have tried somthing like this way but it is not working

  const popup = new mapboxgl.Popup({ offset: 25 }).setHTML(
          `
    <div class="mappopupdiv">
      <div > <span class="popuplabel">Well</span> 
      <span> : </span>
      </div>
      <div > <span class="popuplabel">Country</span> 
      <span> : ${country}</span> 
      </div>
      <div > <span class="popuplabel">Lattitude</span>
      <span> : ${lattitude}</span>
      </div>        
      <div > <span class="popuplabel">Longitude</span>         
      <span> : ${longitude}</span>
      </div>
     '<div @click="clickhere()" id="view-full">View Full </div>'
    </div>
`
        );
       
        const marklocation = new mapboxgl.Marker(el)
          .setLngLat([longitude, lattitude])
          .addTo(this.map)
          .setPopup(popup);

but this is not working any one have any idea about this? Thanks

0

There are 0 answers