Mapx用xml创建点图层
Mapx4.*中,并不支持xml,到5以后,创建ds支持xml了,听起来很美,但是,在网上居然没有找到一个说这个的,难道mapx就没人用了吗?
只好就着mapx的帮助,慢慢实验,比较麻烦的是xml的格式。例子中倒是有
Sample A
<xml xmlns:s="urn:schema-microsoft-com:xml-data" xmlns:ds="urn:schemas-microsoft-com:rowset" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:x="#DatsetSchema">
<!-- schema -->
<s:schema>
<s:elementType name='row' content='eltOnly'>
<s:attributeType name='StateAbbr' dt:type='string'/>
<s:attributeType name='StateName' dt:type='string'/>
<s:attributeType name='StatePop' dt:type='14'/>
<extends type='rowbase'/>
</s:elementType>
</s:schema>
<!-- data -->
<ds:data>
<x:row StateAbbr ='AK'StateName='Alaska' StatePop='550043'/>
<x:row StateAbbr ='NY' StateName='New York' StatePop='17990455'/>
</ds:data>
</xml>
Sample B
<xml xmlns="#xmldataset">
<!-- schema -->
<schema>
<elementType name='row' content='eltOnly'>
<attributeType name='StateAbbr' type='string'/>
<attributeType name='StateName' type='string'/>
<attributeType name='StatePop' type='14'/>
<extends type='rowbase'/>
</elementType>
</schema>
<data>
<row StateAbbr ='AK'StateName='Alaska'StatePop=' 550043'/>
<row StateAbbr ='NY' StateName='New York' StatePop='17990455'/>
</data>
</xml>
结果,报错,另外我的想法是要在xml中放xy的数据,所以进行改造,结果就报这个错:
看了bindlayer的属性,没有哪个跟关键字有关系的,只好在xml中找,可这个东西让人完全迷惑,还找不到有用的资料。msdn中schma的介绍又云山雾罩的,找到很多类似的,如:
rs:number=2 rs:nullable=true rs:maydefer=true rs:writeunknown=true
明显感觉应该就是这个东西控制列的属性描述,但始终找不到那个词。最终,在整个互联网上找到这么一个:
http://zhidao.baidu.com/question/10915787.html?si=1
<s:AttributeType name='ID' rs:number='1' rs:maydefer='true' rs:writeunknown='true' rs:basetable='ReadHistory'
rs:basecolumn='ID' rs:keycolumn='true' rs:autoincrement='true'>
就是我要的东西,修改xml,成功!