Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with URL activation

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
455 Views, 2 Replies

Problem with URL activation

I am attempting to activate a URL with a mouse over feature control click
for a layer. I have done this with simple URL constructs but I would like
to be able to activate a choice of URLs based on a text field value.

In MG Studio I have used the Create/Modify Expressions editor on a layer
with:

If ( TextField = 'U1', http://URL1, http://URL2 )

When validated, I get an error 'Argument types for function 'If' are
mismatched....Result types are mismatched: the validation operation expected
'Text' but expression returned 'Unknown'

If I use the expression:

If ( 'TextField = U1', http://URL1, http://URL2 )
it is valid but always returns the second URL.

Can this be done using If or do I need to prepare a separate URL with logic
to sort out the selection?
2 REPLIES 2
Message 2 of 3
dswilson
in reply to: Anonymous

I figured this out, but it's hardly intuitive:

If ( 'FENAME LIKE''%a%''', 'http://www.dilbert.com', 'http://www.melodicrock.com' )

The boolean portion of the expression needs to be wrapped in single quotes as it's a string that needs to be evaluated.

In your case you want to do
If ( 'FENAME = ''U1''', 'http://www.dilbert.com', 'http://www.melodicrock.com' )
where all the quotes are singles so U1 has 2 leading single quotes and 3 trailing single quotes.

Regards,
Dave Edited by: dswilson on Dec 15, 2009 10:25 AM
Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks Dave. It works perfectly! Not sure why?!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums