Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 6 of 6

FIXED: Type Mismatch in DisplayDataMap

This is a discussion on FIXED: Type Mismatch in DisplayDataMap within the MapPoint Desktop 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 ...

  1. #1
    gavin is offline 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);

  2. #2
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    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
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  3. #3
    gavin is offline 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.

  4. #4
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    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
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  5. #5
    gavin is offline 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!.

  6. #6
    Yazzy is offline 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?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. DisplayDataMap
    By chpw in forum MapPoint Desktop Discussion
    Replies: 9
    Last Post: 02-14-2011, 08:26 PM
  2. Glitch in GPS Magic Fixed
    By P_Hairy in forum News and Announcements
    Replies: 0
    Last Post: 10-10-2005, 08:49 AM
  3. Zooming to a fixed number
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 09-08-2004, 02:30 PM
  4. Type Mismatch adding pushpin....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-22-2003, 11:53 AM
  5. Type mismatch error
    By starbuck in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 10-20-2003, 08:03 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96