-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a custom function to specify popupDisplay #96
Conversation
430f08a
to
a638b66
Compare
@sagarpreet-chadha can you check this out? |
Amazing! 🎉 |
@jywarren Thanks!! Can you publish on npm? |
Awesome 🎉 , i do not have access for LBL npm registry. |
@@ -126,6 +127,12 @@ BlurredLocationDisplay = function BlurredLocationDisplay(options) { | |||
} | |||
} | |||
|
|||
function defaultPopupDisplay(obj) { | |||
var popup_content = ""; | |||
popup_content += "<h5><a href='" + obj.url + "'>" + obj.title + "</a></h5>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a follow up, let's make a check if url
and title
are present in the external API or not to avoid errors.
Can be a FTO, thanks!
Sorry, yes, will publish now! |
Done |
I have pulled out the popup data into a function that can be passed in to LBLD just as JSONparser is passed in. This lets users create whatever output they want for their API data without affecting LBLD.
This is what the default function looks like:
This is how a custom display can look like:
I will be using this in LEL for the PLpeople layer.