Hi
I have an application with 3 feature layers and a select option. When the user clicks on a polygon for example the attributes for the related fields is returned. This is fine for attributes that are text based but I cannot figure out how to show a link within the infoTemplate rather than just the full string. e.g.
var content = "<b>Classification year</b>: ${CLASSIFICATION_YEAR}" + "<br/>" + "<b>Overall classification</b>: ${OVERALL_CLASSIFICATION}" + "<br/>" + "<b>Link</b>: ${CLASS_DS_URL}"; var infoTemplate = new InfoTemplate("${WATER_BODY_NAME}", content);
The class_ds_url shows the full string but how can I amend the script so it just has a clickable 'Link'??
Help is appreciated!
Solved! Go to Solution.
Hi Olivia,
You can format the hyperlink using HTML. Ex:
var content = "<b>Classification year</b>: ${CLASSIFICATION_YEAR}" + "<br/>" + "<b>Overall classification</b>: ${OVERALL_CLASSIFICATION}" + "<br/>" + "<b>Link</b>: <a href=${CLASS_DS_URL}>Link</a>"; var infoTemplate = new InfoTemplate("${WATER_BODY_NAME}", content);
Hi Olivia,
You can format the hyperlink using HTML. Ex:
var content = "<b>Classification year</b>: ${CLASSIFICATION_YEAR}" + "<br/>" + "<b>Overall classification</b>: ${OVERALL_CLASSIFICATION}" + "<br/>" + "<b>Link</b>: <a href=${CLASS_DS_URL}>Link</a>"; var infoTemplate = new InfoTemplate("${WATER_BODY_NAME}", content);
Thank you - perfect!