Infrastructure Map Server General Discussion

Infrastructure Map Server General Discussion

New Member
Posts: 1
Registered: ‎06-25-2012
Message 1 of 2 (639 Views)

Tooltip hyperlink display code

639 Views, 1 Replies
06-25-2012 06:18 AM

Hello guys, I am hoping someone can help me un-rig this code.


Basically I am working to add a hyperlink to my tooltips, no problem I was easily able to add it.


The probelm:

The hyperlink I am using is from a vendor and some of my items in the layer do not have a hyperlink. So it is displayed on every one of my items whether there is data for a link or not. This wouldnt be a big deal except for when there is not data for a link it blows up the webpage and the user loses their map view settings they where currently at.


I am wondering if there is a way to code it as an if there is data for a link then display hyperlink; if not then dont display hyperlink.


Here is what I have rigged up (very ugly and I dont like it):


'\n', '<a href=' ,  diLink , '  target="_blank">DI LINK</a>',  ' not click unless ( ', Length (diLink), ' ) > 0')


bsically I have it count the characters and spit out the # and tell them that 0 means there is not data.... This is ugly and really just not very professional.


Any ideas? I want to clean this up =)

Valued Mentor
Posts: 281
Registered: ‎10-06-2008
Message 2 of 2 (633 Views)

Re: Tooltip hyperlink display code

06-25-2012 08:24 PM in reply to: garrettswift

If the function is available in the expression editor, use the If() function


If ( [condition], [value-if-true], [value-if-false] )


So something like this:


If ( Length(diLink) > 0, Concat('<a href="',  diLink , '" target="_blank">DI LINK</a>'), '')


Will give you the hyperlink HTML if diLink isn't empty and an empty string if it is


- Jackie

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.