Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!