Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

228
Visualizações
Mapbox GL JS - incorporating a html hyperlink into code for a pop up box

I wonder if it is possible to incorporate a url/hyperlink into the JS command for a pop-up box in Mapbox. Here is the code :

.setHTML(
'<h3>'+
currentFeature.properties.Name+'</h3>' +
'<h4>' +
currentFeature.properties.Height+'</h4>' +
'<a href="currentFeature.properties.Link">'further details+'</a>'

Where Name, Height and Link come from a Geojson file saved as .js file and these are field names, the dataset is of some 200 records.Link would refer to the url as text, but I'm not sure if this would be displayed as a hyperlink in a popup box. The error message I am getting is 'missing )after argument list, which refers to the last line of the code above.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Yes, it works fine. But your code is making the link the literal text "currentFeature.properties.Link". You should change it to:

.setHTML(
'<h3>'+
currentFeature.properties.Name+'</h3>' +
'<h4>' +
currentFeature.properties.Height+'</h4>' +
'<a href="' + currentFeature.properties.Link + '">further details</a>'
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda