I am trying to add a geojson layer with interactive functionality to my leaflet map. I am mostly using this (dated)blog: http://palewi.re/posts/2012/03/26/leaflet-recipe-hover-events-features-and-polygons/

My result to date:

Could anybody help me with this question:

How can I show feature.url_temp as a hyperlink in the popup?

1 Answer 1


If you mean you want this to be an actual clickable link, you are most of the way there. I would break up how you construct the content of the popup to be a little more explicit:

var hed = $("<div>", {
  css: {fontSize: "16px", marginBottom: "3px"}

var span = $("<span>", {
    text: "District " + properties.datazone + ": "

var link = $("<a>", {
  href: properties.url_temp,
  text: "click",
  target: "_blank"

You may need to shift the css around, or better yet, add ids or classes and make style declarations outside of your javascript


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.