Hey guys,
I am fairly new to MapPoint and even newer to Visual Basic. I am trying to produce a map with multiple symbols. I have hacked my way up to a point and now I am crashing and burning. I am having trouble with the DisplayDataMap. Her eis what I have so far.
Dim objDataSets As MapPoint.DataSets
Dim objDataSet As MapPoint.DataSet
Dim zDataSource AsString
'This array determines the value ranges for my data
Dim Legend(5) AsInteger
Legend(0) = 5000
Legend(1) = 1000
Legend(2) = 500
Legend(3) = 100
Legend(4) = 50
Legend(5) = 1
'This array has the labels for each of my 5 ranges
Dim Label(4) AsString
Label(0) = "5000 - 1000"
Label(1) = "1000 - 500"
Label(2) = "500 - 100"
Label(3) = "100 - 50"
Label(4) = "50 - 1"
'this array has integers that give my legend symbols for each range
Dim LegColor(4) AsInteger
LegColor(0) = 17
LegColor(1) = 18
LegColor(2) = 19
LegColor(3) = 20
LegColor(4) = 21
'this array has integers that give my pins color
Dim LabelColor(4) AsInteger
LabelColor(0) = 17
LabelColor(1) = 18
LabelColor(2) = 19
LabelColor(3) = 20
LabelColor(4) = 21
Dim xFieldArray(0 To 3, 0 To 1) AsObject
'Use the Address field as the other data:
xFieldArray(0, 0) = "Address Keys"
xFieldArray(0, 1) = 23
'Use the Charts field as other data:
xFieldArray(1, 0) = "Charts"
xFieldArray(1, 1) = 23
'Use the latitude field as the Latitude:
xFieldArray(2, 0) = "Latitude"
xFieldArray(2, 1) = 20
'Use the longitude field as the Longtude:
xFieldArray(3, 0) = "Longitude"
xFieldArray(3, 1) = 21
'find my workbook and sheet
zDataSource = "C:\Documents and Settings\dgoossens\Desktop\RA_LEP\MapWiz(Query).xl s!Condensed"
objDataSets = MPApp.ActiveMap.DataSets
'import data from spreadsheet
objDataSet = objDataSets.ImportData(zDataSource, xFieldArray, _
MapPoint.GeoCountry.geoCountryUnitedStates, _
MapPoint.GeoDelimiter.geoDelimiterDefault, _
MapPoint.GeoImportFlags.geoImportFirstRowIsHeading s)
'column you are selcting for multiple symbols
Dim objField As MapPoint.Field
objField = objDataSet.Fields("Charts")
'map with multple symbols
objDataSet.DisplayDataMap(MapPoint.GeoDataMapType. geoDataMapTypeMultipleSymbol, _
objField, MapPoint.GeoShowDataBy.geoShowByDefault, _
MapPoint.GeoCombineDataBy.geoCombineByCount, _
MapPoint.GeoDataRangeType.geoRangeTypeDiscreteLogR anges, _
MapPoint.GeoDataRangeOrder.geoRangeOrderLowToHigh, -1, 5, _
Legend, Label, "", LegColor, LabelColor)
The error I get is COMException Unhandled
Type Mismatch.
I have been starting at this for a while. Any hints whould be great.