Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Move pins to dataset within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi all. I have a vb.net project that is going ok at the moment. I can pin all the data ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Move pins to dataset I have a vb.net project that is going ok at the moment. I can pin all the data from my sql that has a postcode. I am looking to add an IF statement, so if the DivisionID is "North", move the pin to odsNorth (a dataset), or IF it is "South" move the pin to odsSouth. Here is my code which will hopefully help you see what I'm jabbering on about ![]() Code:
If chkNorthDiv.Checked = True Then
oMap.DataSets.AddPushpinSet("North Division")
oDSNorth = oMap.DataSets("North Division")
oDSNorth.Symbol = symbolNorth
End If
If chkSouthDiv.Checked = True Then
oMap.DataSets.AddPushpinSet("South Division")
oDSSouth = oMap.DataSets("South Division")
oDSSouth.Symbol = symbolSouth
End If
For Each dr In dsData.Tables(0).Rows
'If NULL data in Postcode, show message box and carry on
If dr("PostCode") Is DBNull.Value Then
sw.WriteLine("Null postcode value at " & dr("ServiceID") & " " & dr("Name"))
Else
'set FindResults to look for PostCode, not long/lat and plots Pins
oFR = oMap.FindResults(dr("PostCode"))
If oFR.Count > 0 Then
oPin = oMap.AddPushpin(oFR(1), dr("Name")) 'default balloon data unless specified from checkboxes
If dr("DivisionID") = "Div-N" Then
oPin.MoveTo(oDSNorth)
End If
If dr("DivisionID") = "Div-S" Then
oPin.MoveTo(oDSSouth)
End If
Next
I am not getting an error by the way. It is still pinning all the data, but keeping them in the default "My Pushpins" |
| |||
| Re: Move pins to dataset
After much reading I got there: Code: oPin.MoveTo(oMap.DataSets.Item("North"))
Code: oPin.MoveTo(oDSNorth) ![]() |
| |||
| Re: Move pins to dataset
Hi, No, it does not reference the dataset name, it reference the dataset itself. That is not the same.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Move pins to dataset Quote:
This is a VB issue I have never quite got my head around. The problem is the brackets. "oPin.MoveTo oDSNorth" or "Call oPin.MoveTo(oDSNorth)" work "oPin.MoveTo (oDSNorth)" doesn't. But I would have expected a 438 error? (Resume next on?) Last edited by nickhoare; 1 Week Ago at 04:08 AM.. Reason: Correction |
| |||
| Re: Move pins to dataset
Hi, I don't know VB, but I like to know if someone can explain the difference. Code: 1. oPin.MoveTo oDSNorth 2. Call oPin.MoveTo(oDSNorth) 3. oPin.MoveTo (oDSNorth) What is technically the difference in brackets or no brackets in VB? (1 works, 3 does not)?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| dataset, move, pins |
| ||||
| Posted By | For | Type | Date | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 08-28-2008 12:50 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Move Shape - get new lat lon. | tfmiltz | MapPoint 2006/2009 Discussion | 4 | 11-09-2007 08:51 AM |
| Disallow to move manuell added push pins | Anonymous | MapPoint 2006/2009 Discussion | 1 | 03-02-2004 10:18 AM |
| not to move shapes | Manuel | MapPoint 2006/2009 Discussion | 2 | 05-19-2003 01:46 PM |
| Help.! How to move a pushpin in the map. | Anonymous | MapPoint 2006/2009 Discussion | 9 | 03-10-2003 05:00 PM |
| Ist it possible to get X, Y from mouse move | blackmap | MapPoint 2006/2009 Discussion | 1 | 12-16-2002 03:54 PM |
Majorca Holiday
Enjoy a Majorca holiday at a good price when you check out the offers on UlookUbook for this popular destination!
Pubs London
There are thousands of pubs in London. Fortunately you can use Qype to find the best ones nearest to you.