MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




FIXED: Type Mismatch in DisplayDataMap

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-15-2005
Junior Member
White Belt
 
Join Date: Jul 2005
Posts: 3
FIXED: Type Mismatch in DisplayDataMap

Hi,

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);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 07-18-2005
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,482
Blog Entries: 1
I have always struggled with DisplayDataMap when I have tried to use it.

One thing you might consider as a workaround since it is symbols is to render each Pushpin individually.. this should be much simpler and easier to troubleshoot.

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 07-19-2005
Junior Member
White Belt
 
Join Date: Jul 2005
Posts: 3
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 07-19-2005
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,482
Blog Entries: 1
OK.. yes, it still probably can speed things up for you.

You might try coding it in VB6 or VBA/Excel first to prove that it can work for you and you have all the parameters and then port it to Delphi..

Also, search this forum for others with Delphi issues, perhaps someone here has already posted a solution.

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 07-27-2005
Junior Member
White Belt
 
Join Date: Jul 2005
Posts: 3
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!.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 08-22-2005
Junior Member
Yellow Belt
 
Join Date: Dec 2004
Posts: 25
Hi Have you solved the problem?

If not I could send a code sample in VB6?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
displaydatamap, fixed, mismatch, type


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 09:05 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55