MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




SetFieldsVisibleInBalloon - how do I set up the array

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-18-2004
Junior Member
White Belt
 
Join Date: Mar 2004
Posts: 7
SetFieldsVisibleInBalloon - how do I set up the array

The MS help for this includes the code:
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
In my situation, I don't know in advance which fields the user will want in the balloon.
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-25-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2004
Junior Member
Yellow Belt
 
Join Date: Mar 2004
Posts: 15
hi everyone,

I would like to do the same thing in C#.. anyone know how?!!

thanks in advance,,

Regards,
Kam
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2004
Junior Member
Yellow Belt
 
Join Date: Mar 2004
Posts: 15
Could anyone just show me how to create that array in C# please??!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-27-2005
Junior Member
White Belt
 
Join Date: Apr 2005
Posts: 2
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);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 05-16-2005
Junior Member
White Belt
 
Join Date: May 2005
Posts: 2
VB.NET???

Hi All

I'd like a VB.NET Version if anyone could knock one together please?! I've been trying for ages to get the Array working in .NET but to no avail?!!

Can somone please help!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 05-16-2005
Junior Member
White Belt
 
Join Date: May 2005
Posts: 2
VB.NET???

Hi All

I'd like a VB.NET Version if anyone could knock one together please?! I've been trying for ages to get the Array working in .NET but to no avail?!!

Can somone please help!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 05-16-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: VB.NET???

Hi,

Quote:
Originally Posted by ChrisSproston
I've been trying for ages
You must be very old by now

Quote:
to get the Array working in .NET but to no avail?!!
Euh what exacly do you wants to know ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
array, set, setfieldsvisibleinballoon


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 06:58 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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