conditional statement in map tip
Hi All
Is it possible to create a conditional statement in the Feature Description map tip?
I would like to have some contact information displayed in a the map tip if the record in a field meets a certain criteria
Basically what I want to do is
if {isdenatured} = Y then
"this record is denatured please contact the dept for more details...."
Is this even possible in HTML?
Cheers
Chris
0
-
No, but that would be awesome. The workaround I've used is to write the conditional expressions in a one-to-one data link and then use the fields from there in my map tip.0 -
I have that problem also, can you elaborate or show a sample of it?
my problem, for example is:
if a value of the field is equal to 0 or null, do not show the field value and text associated with, otherwise show it.0 -
@Jeff, basically in the datalink you would specify it as a condition in the where clause. It is limited but works for yes/no cases. For example if we have a datalink named valueConnection.
select "value is null" valueNull, description, contact, category from dummyTable where value is null
Then in the map tip you would have {valueConnection.valueNull} which would input your message.
I have also used this to display workflow links conditionally. For example where an image exists in the database for a feature please display a link to allow download of that image.
@Jeff for your case in particular it might use the SQL case statement. I haven't tested this one but it should be close to correct.
select case when value is null then "value is null" valueNull else value end, description, contact, category from dummyTable where value is null0 -
Hi to all
Unfortunately my use of this strategy fails a bit with the HTML5 viewer as compared to the Silverlight viewer. With the Silverlight viewer consuming the Datalink i can include carriage returns, tabs etc in a concatenated string and have those non-visible white characters get honored on display. However the HTML5 viewer ignores the existence of those just as in any other bit of HTML
Would be great if there is a way to embed formatting characters but despite having tried a number of options, I have yet to find one that works.
Regards
Ralph0
Please sign in to leave a comment.
Comments
4 comments