Community of VE/MapPoint Users and Developers
This is a discussion on FIXED: Type Mismatch in DisplayDataMap within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, Currently im using Delphi7 to link data from a CSV, one field in the CSV is the symbol# to ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| FIXED: Type Mismatch in DisplayDataMap Currently im using Delphi7 to link data from a CSV, one field in the CSV is the symbol# to use, now i know that this carnt be mapped at load so i have been trying to use DisplayDataMap but when i try to use this function with geoMapTypeMulitpleSymbol i get a "Type Mismatch" exception each time, no matter what i seem to pass to it. Id appreciate it if someone could review that paramerters im passing, the most frustating thing is. is that it all looks reasonable to me. oh i also tried moveing the array index from 1 to 4 incase it was something to do with that, it sill caused the same problem. Here is the code of the procdure that maps the data after it has been linked, Code: procedure TMapForm.MapSymbols;
var
dMap : DataMap;
DataSetToUse: DataSet;
Index: OleVariant;
DataMapType: GeoDataMapType;
DataField: Field;
ShowDataBy: GeoShowDataBy;
CombineDataBy: GeoCombineDataBy;
DataRangeType: GeoDataRangeType;
DataRangeOrder: GeoDataRangeOrder;
ColorScheme: Integer;
DataRangeCount: Integer;
ArrayOfCustomValues: OleVariant;
ArrayOfCustomNames: OleVariant;
DivideByField: OleVariant;
ArrayOfDataFieldLabels: OleVariant;
ArrayOfPushpinSymbols: OleVariant;
begin
Index := 'Index0';
DataSetToUse := mpcCameraMap.ActiveMap.DataSets.Item[Index];
DataMapType := geoDataMapTypeMultipleSymbol;
Index := 'Symbol';
DataField := DataSetToUse.Fields[Index];
ShowDataBy := geoShowByDefault;
CombineDataBy := geoCombineByNone;
DataRangeType := geoRangeTypeUniqueValues;
DataRangeOrder := geoRangeOrderLowToHigh;
ColorScheme := 0;
DataRangeCount := 4;
ArrayOfCustomValues := VarArrayCreate([0,3], varVariant);
ArrayOfCustomValues[0] := 111;
ArrayOfCustomValues[1] := 122;
ArrayOfCustomValues[2] := 123;
ArrayOfCustomValues[3] := 133;
ArrayOfCustomNames := VarArrayCreate([0,3], varVariant);
ArrayOfCustomNames[0] := 'sym0';
ArrayOfCustomNames[1] := 'sym1';
ArrayOfCustomNames[2] := 'sym2';
ArrayOfCustomNames[3] := 'sym3';
DivideByField := '';
ArrayOfDataFieldLabels := VarArrayCreate([0,3], varVariant);
ArrayOfDataFieldLabels[0] := '111';
ArrayOfDataFieldLabels[1] := '122';
ArrayOfDataFieldLabels[2] := '123';
ArrayOfDataFieldLabels[3] := '133';
ArrayOfPushpinSymbols := VarArrayCreate([0,3], varVariant);
ArrayOfPushpinSymbols[0] := 10;
ArrayOfPushpinSymbols[1] := 20;
ArrayOfPushpinSymbols[2] := 30;
ArrayOfPushpinSymbols[3] := 40;
dMap := DataSetToUse.DisplayDataMap(
DataMapType,
DataField,
ShowDataBy,
CombineDataBy,
DataRangeType,
DataRangeOrder,
ColorScheme,
DataRangeCount,
ArrayOfCustomValues,
ArrayOfCustomNames,
DivideByField,
ArrayOfDataFieldLabels,
ArrayOfPushpinSymbols);
|
| |||
|
Hi Eric, Unfortunatly that was the way we were doing it however this proved far to slow, it took 50 seconds to load 100 pushpins wiht custom symbols which is unacceptable in our application. it looked like DisplayMapData would solve this problem... gav. |
| |||
|
OK this is mainly for delphi developers however it may have some relevance to other languages. Firstly in delphi using activex you cannot have optional parameters, we found that you must use EmptyParam if you wish to pass no data, we were using NULL or ''. Ok the main reason why the above code wasnt working was that we did not need a DivideByField so used an empty string in place for this param. this is why we were getting the error because (we think) that it was looking for the field name '' which is why it threw the exception. we then found out about the EmptyParam thing and used that instead and this cured our problem. Hope this is of use to others!. |
![]() |
| Tags |
| displaydatamap, fixed, mismatch, type |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DisplayDataMap | chpw | MapPoint 2006/2009 Discussion | 8 | 09-21-2006 07:13 AM |
| Glitch in GPS Magic Fixed | P_Hairy | News and Announcements | 0 | 10-10-2005 08:49 AM |
| Zooming to a fixed number | Anonymous | MapPoint 2006/2009 Discussion | 7 | 09-08-2004 02:30 PM |
| Type Mismatch adding pushpin.... | Anonymous | MapPoint 2006/2009 Discussion | 2 | 11-22-2003 11:53 AM |
| Type mismatch error | starbuck | MapPoint 2006/2009 Discussion | 3 | 10-20-2003 08:03 AM |