Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda