Community of VE/MapPoint Users and Developers
This is a discussion on SetFieldsVisibleInBalloon - how do I set up the array within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; The MS help for this includes the code: Code: Dim objDS As MapPoint.DataSet Dim strXNC As String With Me.ctrlMP.ActiveMap.DataSets strcnx ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| SetFieldsVisibleInBalloon - how do I set up the array Code: Dim objDS As MapPoint.DataSet
Dim strXNC As String
With Me.ctrlMP.ActiveMap.DataSets
strcnx = gBDD_LOCAL & "!" & "ReqSQL"
Set objDS = .LinkData(strcnx, "NUM_FDT", , geoCountryFrance, , geoImportAccessQuery)
objDS.Symbol = 26
arArray = Array(objDS.Fields(1), objDS.Fields(2), objDS.Fields(3), objDS.Fields(4))
objDS.SetFieldsVisibleInBalloon arArray
End With
Can anyone tell me how to show fields 1, 4 & 5 one day and then fields 1,2,5,8,9 the next day? e.g. using values from an array dim lbInBalloon(1 to 20) as boolean It's probably a VB thing rather than a Map Point question, but since arArray isn't even declared, it makes the 'help' very difficult to follow! Cheers -James |
| |||
|
I battled with this one for a long time also. The help files are pretty much worthless when trying to figure out how to set up the arrays. It took lots of trial and error, but I found a few obscure hints on google and came up with the following. It is VB6 code, adjust as needed. I was intentionally displaying all fields in the balloon except for the field defined as the "name" field, along with lat/long (my points were already geocoded) Let me know if you have any questions or comments. Kirk dot Dybvik at benfieldgroup dot com <snip from my routine that loads dataset> Dim vBallonFieldsArray As Variant oDataset.FieldNamesVisibleInBalloon = True vBallonFieldsArray = PrepBallonDisplayFields(oDataset) oDataset.SetFieldsVisibleInBalloon vBallonFieldsArray </snip> '************************************************* ********* Private Function PrepBallonDisplayFields(oDataset As MapPoint.DataSet) As Variant Dim FieldN() Dim sFieldName As String Dim i As Integer Dim lBalloonFieldCount As Long Dim oField As MapPoint.Field lBalloonFieldCount = 0 '*** allocate "worst case" array size ReDim FieldN(1 To oDataset.Fields.Count) For Each oField In oDataset.Fields sFieldName = UCase$(oField.Name) Select Case sFieldName Case UCase$(m_sNameField), "LATITUDE", "LONGITUDE" '*** don't display name, lat, or long in balloon... Case Else '*** add to array and increment counter lBalloonFieldCount = lBalloonFieldCount + 1 '*** IMPORTANT: need to use Set to get object reference Set FieldN(lBalloonFieldCount) = oField End Select Next '*** adjust array to desired size ReDim Preserve FieldN(1 To lBalloonFieldCount) '*** return the array as a variant PrepBallonDisplayFields = FieldN End Function |
| |||
|
string gicListUDL = Application.StartupPath + @"\..\..\Resources\MapPointConnection.udl" + "!vwGICList"; this.axMappointControl1.ActiveMap.MapStyle = MapPoint.GeoMapStyle.geoMapStyleRoadData; MapPoint.DataSet ds = this.axMappointControl1.ActiveMap.DataSets.ImportD ata(gicListUDL, null, MapPoint.GeoCountry.geoCountryMultiCountry, MapPoint.GeoDelimiter.geoDelimiterDefault, MapPoint.GeoImportFlags.geoImportAccessTable); object o1 = 1, o2 = 2, o3 = 3, o4 = 4, o5 = 5, o6 = 6, o7 = 7, o8 = 8; object[] fields = new object[8]{ds.Fields.get_Item(ref o1), ds.Fields.get_Item(ref o2), ds.Fields.get_Item(ref o3), ds.Fields.get_Item(ref o4), ds.Fields.get_Item(ref o5), ds.Fields.get_Item(ref o6), ds.Fields.get_Item(ref o7), ds.Fields.get_Item(ref o8)}; ds.SetFieldsVisibleInBalloon(fields); |
| |||
| Re: VB.NET???
Hi, Quote:
Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| array, set, setfieldsvisibleinballoon |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to access to an array of pushpins that were added ? | Jaba | MapPoint 2006/2009 Discussion | 4 | 01-13-2005 07:20 AM |
| Help! Import Custom Symbol Array | Anonymous | MapPoint 2006/2009 Discussion | 2 | 01-07-2005 04:29 PM |
| Addpolyline , Array , Visual Basic and Other languages | Anonymous | MapPoint 2006/2009 Discussion | 2 | 08-26-2004 04:58 AM |
| Importing address with an array of fields specified | jscott099 | MapPoint 2006/2009 Discussion | 1 | 12-30-2003 11:10 PM |
| array of locations | Bart Vervenne | MapPoint 2006/2009 Discussion | 3 | 04-14-2003 05:03 AM |