简体   繁体   English

MapPoint 2011- DataMap(ShadedArea)-Visual Studio

[英]MapPoint 2011- DataMap(ShadedArea) - Visual Studio

I've got a question about adding a datamap to my current map in mappoint while importing data to a dataset. 我有一个关于在将数据导入数据集中的同时将数据映射添加到mappoint中的当前地图的问题。

So, i have an excel file that has the following columns in order: ID,Name,Adress,City,Country,PostalCode,Service,MoneyImport. 因此,我有一个Excel文件 ,该文件按顺序具有以下几ID,名称,地址,城市,国家,邮政编码,服务,货币导入。

I'm creating a dataset to be used for the datamap: 我正在创建用于数据映射的数据集:

object missing = System.Reflection.Missing.Value;
MapPoint.DataSet dataset = map.DataSets.ImportData(filename, missing,
                              MapPoint.GeoCountry.geoCountryItaly,
                              MapPoint.GeoDelimiter.geoDelimiterDefault,
                              MapPoint.GeoImportFlags.geoImportExcelSheet);

I'm using the " missing " value cause the MapPoint Application when running through the normal interface* (importing from the same excel file i use here) * recognises perfectly the datafields, so i don't have the need to specify their types by myself. 我通过正常接口* (从我在此处使用的同一excel文件导入)中运行时,使用“ 缺少 ”值导致MapPoint应用程序*能够完美识别数据字段,因此我无需通过以下方式指定其类型我。

Then i'm tryin' to use this dataset in order to create the datamap i need. 然后,我正在尝试使用此数据集以创建所需的数据映射。 This map is supposed to display as shaded areas the "MONEYIMPORT field" on the map based on zoomlevel. 该地图应基于缩放级别在地图上的“ MONEYIMPORT字段”显示为阴影区域。 When using the normal mappoint interface it does it smoothly with no problem and no errors at all. 使用常规mappoint接口时,它可以顺利进行,没有问题,也没有任何错误。

 Object Import = 8;

 MapPoint.Field GainedMoney = dataset.Fields.get_Item(Import);

This two lines are ment to let me add to the GainedMoney field the values of the 8th column of excel by exctracting 'em from the dataset. 通过这两行代码,我可以通过从数据集中提取'em'将excel的第8列的值添加到GainedMoney字段中。

So further i add the datamap: 因此,进一步我添加了数据映射:

MapPoint.DataMap datamap =dataset.DisplayDataMap(MapPoint.GeoDataMapType.geoDataMapTypeShadedArea,               GainedMoney,
                ShowDataBy: MapPoint.GeoShowDataBy.geoShowByZoomLevel,
                DataRangeType: MapPoint.GeoDataRangeType.geoRangeTypeDefault,
                DataRangeOrder: MapPoint.GeoDataRangeOrder.geoRangeOrderDefault,
                ColorScheme: 13,
                CombineDataBy: MapPoint.GeoCombineDataBy.geoCombineByAdd);

So the MapPoint object model decides to throw me an error that says that the type of area i'm tryin' to add to the map cannot be recognized, so it has been impossible to add it to the map. 因此,MapPoint对象模型决定向我抛出一个错误,该错误表明无法识别要添加到地图的区域类型,因此无法将其添加到地图。

I've checked several times if the attributes i pass to the .DisplayDataMap are correct, and they are identical to the ones i choose when creating the datamap through the user interface of mappoint, and still no result gained. 我已经检查了好几次我传递给.DisplayDataMap的属性是否正确,并且它们与我通过mappoint的用户界面创建数据映射时选择的属性相同,但仍然没有获得任何结果。 Really i don't know anymore how to fix this. 真的我不知道如何解决这个问题。 If any of you would be able to help me and provide me a hint, please do so! 如果任何人都可以帮助我并提供提示,请这样做!

Thanks in advance, George. 预先感谢乔治。

There are some articles on MP2Kmag.com to help with DisplayDataMap. MP2Kmag.com上有一些文章可帮助您使用DisplayDataMap。 In particular, the arrays you pass in as parameters are tricky. 特别是,作为参数传递的数组很棘手。 Also, the book Programming MapPoint in .NET was a big help to me in dealing with the DisplayDataMap method. 另外,《。NET中的MapPoint编程》一书对我处理DisplayDataMap方法也有很大帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM