Community of MapPoint and Bing Maps Users and Developers
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 ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| DisplayDataMap 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? TIA Chris Werner |
| |||
|
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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz www.comfortsoftware.be MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Thanks!
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: Code: lole_dataSet = this.object.activeMap.dataSets.importData(
as_fn,
ls_field,
94,
9)
lole_field = lole_dataSet.fields.item(8)
lole_dataSet.displayDataMap(
geoDataMapTypeMultipleSymbol,
lole_field,
geoShowByLatLong,
geoCombineByDefault,
geoRangeTypeDefault,
geoRangeOrderDefault,
geoColorSchemeDefault
)
Thanks again, Chris Werner |
| |||
|
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 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...
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz www.comfortsoftware.be MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi Chris, Fabio and Wilfried, If your main purpose is Quote:
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: http://www.mp2kmag.com/mappoint/disc...ghlight=symbol Ciao |
| |||
| 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: Latitude,Longitude,Field1,Field2,Field3 32.90,-117.2,1152558003,10,100 32.91,-117.3,1152558004,11,101 ... Code: //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(
"c:\\tmp.csv",
fieldSpecifications,
MapPoint.GeoCountry.geoCountryUnitedStates,
MapPoint.GeoDelimiter.geoDelimiterDefault,
0
);
//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] {
16,
17,
18,
19,
20
};
//Now display datamap
try
{
// Display the imported data set using this mapping technique
MapPoint.DataMap datamap = objDataSet.DisplayDataMap(
MapPoint.GeoDataMapType.geoDataMapTypeMultipleSymbol,
datafield,
MapPoint.GeoShowDataBy.geoShowByLatLong,
MapPoint.GeoCombineDataBy.geoCombineByDefault,
MapPoint.GeoDataRangeType.geoRangeTypeDefault,
MapPoint.GeoDataRangeOrder.geoRangeOrderDefault,
MapPoint.GeoDataConstants.geoColorSchemeDefault,
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)
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
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
objDataSet.ZoomTo();
}
catch (Exception except)
{
MessageBox.Show(except.ToString());
}
|
| |||
|
Hi, Thanks for feedback. It will benefit others.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz www.comfortsoftware.be MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| displaydatamap |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DisplayDatamap and ArrayOfCustomValues | PGLRepDev | MapPoint Desktop Discussion | 5 | 06-21-2006 03:35 PM |
| DisplayDataMap method c# | fletch | MapPoint Desktop Discussion | 1 | 04-08-2005 06:26 AM |
| DisplayDataMap in Delphi 7 | Anonymous | MapPoint Desktop Discussion | 0 | 12-17-2004 05:59 AM |
| DisplayDataMap with delphi ? | seb24 | MapPoint Desktop Discussion | 0 | 01-29-2004 09:49 AM |
| DisplayDataMap and C# | Anonymous | MapPoint Desktop Discussion | 0 | 07-04-2003 01:15 PM |