MapGuide/Map 3D 2011中Expression Builder中Concat的改进

MapGuide/Map 3D 2011中的Expression Builder是个很有用的工具,比如我们经常需要为图层设置ToolTip,URL连接,或者构造过滤字符串,这时都可以用可视化的Expression Builder来生成表达式。

image

点击右边的按钮即可激活Expression Builder。通过这个可视化工具你可以读取指定字段的值,并使用 + – X / 等运算符号、数学公式、字符串函数、日期函数、空间查询等等。

image

 

这个工具方便是方便,但是他的字符串相加功能实在是能搞晕一大帮人,2010的版本中Concat()函数只能接受2个参数,如果你的字符串是多个部分组成的,你不得不嵌套多个concat,后面一大堆的括号,稍不注意就会出错,比如:

concat('Parcel\nName: ', concat(RNAME, concat('\nAddress: ', RBILAD)))

 

现在好了,MapGuide/Map 3D 2011中对这个方法做了改进,你可以连接多个字符串,如:

concat('Parcel\nName: ', RNAME, '\nAddress: ', RBILAD)

是不是方便了很多? 

 

看一下详细的帮助信息,按F!可以调出详细帮助信息:

Function
CONCAT

Joins multiple strings into one.

Definition

CONCAT takes any number of arguments, which can be any property type except Geometry or Raster. The return value uses the String data type.

Use ‘\n’ to insert a line break. To include static text labels or spaces, surround them with single quotes.

When you use Concat with a Boolean property, the operation generates 1/0 (not True/False) as a result.

Syntax

CONCAT(Property, Property, ...)

Example

CONCAT(First_Name, ‘ ‘Last_Name,’\n’ ‘Address: ‘, Street_number, ‘ ‘, Street_name, ‘ ‘, Suffix)

这里例子的结果:

John Smith

Address: 123 Maple Street

 

-------------------

峻祁连(Daniel)


Related Posts Plugin for WordPress, Blogger...