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 10 of 10


This is a discussion on DisplayDataMap within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi all, have imported a set of records and want to show it using DisplayDataMap() as a multiple symbol map ...

  1. #1
    chpw is offline Junior Member Yellow Belt
    Join Date
    Dec 2004


    Hi all,

    have imported a set of records and want to show it using DisplayDataMap() as a multiple symbol map (geoDataMapTypeMultipleSymbol). The problem is I need exactly one symbol per record (primary key) , no combination. Which value for the showDataBy argument should I use? I've tried geoShowByLatLong and geoShowByStreetAddress and the results are okay if really all values are given and different. This may be invalidatet in further use of my application. Also the tooltip texts of the symbols are like "Amount for street adress" but it shold be "Amount by object number" where "object number" is the primary key attribute of the dataSet.
    Any hints?


    Chris Werner

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Hi Chris,

    Sorry I dont understeand your question. BTW: English is not my mother's tonque.

    Can you enlighten your problem with a few lines of code, maybe this will help me understean.

  3. #3
    chpw is offline Junior Member Yellow Belt
    Join Date
    Dec 2004


    Hi Wilfried,

    thanks for your interest. Our communication problems may stem from the language of my mother too - it's also not English but German. What I want to achieve is showing 1 pushpin for 1 imported record and avoid cummulation of multiple records into 1 symbol. The function dataSet.DisplayDataMap() have the parameter showDataBy to control this (I believe). If I understand that right a value of geoShowByRegion will combine all records with the same Region into one pushpin. But geoShowDataBy have no possible value to show the data record by record. The most similar possibilities are geoShowByLatLong and geoShowByStreetAdress. But what if I have 2 ore more records with the same street adress or geocoordinates?
    What I do is:

    lole_dataSet = this.object.activeMap.dataSets.importData(
    lole_field = lole_dataSet.fields.item(8)
    The field 8 of the imported data is a status, it should control the color of the symbol: 'READY' -> green, 'FAIL' -> red and so on. My problem is how to code this.

    Thanks again,

    Chris Werner

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Hi Chris,

    I edit your code with the "code" tags to make it more readable. Please do in future

    Yes wy dont we all learn Esperanto. It exists for so long and no country's gouverment is interested to learn it in school Oh whell they are maybe just stupid...

    About your problem. You use methods I have never used and not direct interested in to use. Therefore difficult to advice. Mostly I try out some things to learn from it myself, but I'm short in time at moment. If you dont get out of it then please reply to this topic and then it will come in front again so I see it again. If I have some more time I can try to experiment with it to get solution for you.

    As short answer for the moment I have always control all pushpins myself without mappoint doing this. But maybe this is not solution for you.

    I hope you dont mind...

  5. #5
    Fabio is offline Junior Member White Belt
    Join Date
    Oct 2005
    Hi Chris,

    I think you can try setting some parameter in DisplayDataMap function:

    I think 'DataRangeCount' value to 2 and 'ArrayOfPushpinSymbols', the last parameter, to your desired pushpin symbols.


  6. #6
    Mohamed is offline Member Green Belt
    Join Date
    Mar 2005
    Hi Chris, Fabio and Wilfried,

    If your main purpose is
    What I want to achieve is showing 1 pushpin for 1 imported record
    why don't you add your recrords as PushPins ( AddPushPin method ) one by one and select the symbol ID or picture you want for each one.
    To change a PushPin Color, you have to get his object location and choose the symbol you want.

    For that purpose, I won't use Importada wizard, neither DisplayDataMap method.

    For more details about Pushpins, customized symbols look at this topic:



  7. #7
    Loggy is offline Junior Member White Belt
    Join Date
    Aug 2006

    Multiple Symbol Map

    I encountered lots of problems with the DataSet.DisplayDataMap() method. I am using MapPoint 2006 and C# with VS 2005, but I will write here what I learned. I got the all-explaining "The parameter is incorrect." message, but I believe I know what causes it for the multiple symbol map.

    Firstly, all of the arrays must be properly sized. If you pass the parameter stating that there are 5 ranges, then in the array where you define the ranges (myranges[] below), it must have 6 numbers (array size = 6) to create the bounds on the 5 ranges. In that case, you must then pass an array of size 5 for the range names (myrangenames[]) and an array of size 5 for the symbols (symbols[]). If these sizes are off, it may throw the "parameter is incorrect" message, or it might just not work as you think. If you want 8 ranges, the symbols[] and myrangenames[] arrays should be size=8 and the myranges[] array should be size=9.

    In addition, the myranges[] array MUST be ascending order. If it is in descending order (I didn't test no order), it does not throw an error, but it does not work properly either.

    Also, if possible, step through the debugger and make sure the 2nd parameter to the method, the field parameter, is a proper MapPoint.Field object. This can also cause the "parameter is incorrect" message.

    This applies to a 5 column CSV file. I encountered problems when my fieldSpecifications array did not have the proper dimensions (for a 10 column CSV file, it should be size = [10][2]) that matched the CSV file. In addition, I made sure the headings in the first column of my csv file matched the names I gave in the fieldSpecifications, but that is probably not necessary.

    Here's my CSV file I'm importing:

    //Define field specification
    object[,] fieldSpecifications = {
                {"Latitude", MapPoint.GeoFieldType.geoFieldLatitude},
                {"Longitude", MapPoint.GeoFieldType.geoFieldLongitude},
                {"Field1", MapPoint.GeoFieldType.geoFieldData},
                {"Field2", MapPoint.GeoFieldType.geoFieldData},
                {"Field3", MapPoint.GeoFieldType.geoFieldData}
    // Import the CSV file
    MapPoint.DataSet objDataSet = map.DataSets.ImportData(
    //Define data map columns
    // This will be the index for "Field2"
    object fieldIndex = 4;
    //Now get fields
    MapPoint.Field datafield;
    datafield = objDataSet.Fields.get_Item(ref fieldIndex);
    // This creates 5 ranges
    // -100 through -90, -90 through -80, and so on
    object[] myranges = new object[6] { -100, -90, -80, -70, -60, 0 };
    // This names the 5 ranges
    object[] myrangenames = new object[5] { "-100 to -90",
                                            "-90 to -80",
                                            "-80 to -70",
                                            "-70 to -60",
                                            "-60 to 0"
    // This creates symbols for the 5 ranges in order
    // These are the symbol IDs
    // Symbol 16 applies to the range -100 to -90
    object[] symbols = new object[5] {  
    //Now display datamap
        // Display the imported data set using this mapping technique
        MapPoint.DataMap datamap = objDataSet.DisplayDataMap(
                                5,              // This should be the # of ranges        
                                myranges,       // Should be an array of size(# of ranges +1)    
                                myrangenames,   // An array of range names size(# of ranges)
                                symbols         // Array of symbols corresponding to the ranges
        // Legend name
        datamap.LegendTitle = "My Legend: Field2";
        // Display legend pane
        datamap.Application.PaneState = MapPoint.GeoPaneState.geoPaneLegend;
        // Zoom to the imported data set
    catch (Exception except)

  8. #8
    Loggy is offline Junior Member White Belt
    Join Date
    Aug 2006
    I tested my code above on a imported data set of a little more than 4000 distinct values. To import and color the data differently based on field2's value took about 2-4 seconds in debug mode.

  9. #9
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004

  10. #10
    codecus is offline Junior Member White Belt
    Join Date
    Feb 2011

    Re: DisplayDataMap


    I have created a csv file and use c++ to generate ptm file.
    The code as follows:
    DataSetPtr dsPtr = myMapPtr->DataSets->ImportData(csvfilename,"",geoCountryDefault,geoDe limiterComma,geoImportFirstRowIsHeadings);

    variant_t((IDispatch *) (ds->Fields->GetItem(&vt)), true),
    geoShowByDefault, //geoShowByLatLong,
    geoCombineByDefault, //geoCombineByNone,
    geoRangeTypeUniqueValues, //geoRangeTypeDefault,

    After create ptm file, I used MapPoint to open the ptm file. When I click data with "Show Information", I only can see Latitude/Longitude data. But my csv file has many columns (items). MapPoint does not display all the data information from csv file. I have tried all different combinations in DisplayDataMap. But I still cannot get information to display all the data.
    Is anyone know how to create ptm file to display all the csv colums (infomation) under MapPoint?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. DisplayDatamap and ArrayOfCustomValues
    By PGLRepDev in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 07-22-2010, 12:04 PM
  2. DisplayDataMap method c#
    By fletch in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-08-2005, 07:26 AM
  3. DisplayDataMap in Delphi 7
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 12-17-2004, 06:59 AM
  4. DisplayDataMap with delphi ?
    By seb24 in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 01-29-2004, 10:49 AM
  5. DisplayDataMap and C#
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 07-04-2003, 02:15 PM

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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127