Community of VE/MapPoint 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 ...
| |||||||
| 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 |
![]() |
| Tags |
| dataset, move, pins |
| ||||
| Posted By | For | Type | Date | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 08-28-2008 01: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 09:51 AM |
| Disallow to move manuell added push pins | Anonymous | MapPoint 2006/2009 Discussion | 1 | 03-02-2004 11:18 AM |
| not to move shapes | Manuel | MapPoint 2006/2009 Discussion | 2 | 05-19-2003 02:46 PM |
| Help.! How to move a pushpin in the map. | Anonymous | MapPoint 2006/2009 Discussion | 9 | 03-10-2003 06:00 PM |
| Ist it possible to get X, Y from mouse move | blackmap | MapPoint 2006/2009 Discussion | 1 | 12-16-2002 04:54 PM |