Community of VE/MapPoint Users and Developers
This is a discussion on Pushpin programming question within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I've written a small utility that uses MapPoint to import pushpins into a map containing various shapes. I then can ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Pushpin programming question The problem I am having is that my MapPoint control already has "My Pushpins" which causes me to write two reports. One is for the data that I've imported and one is for the "My Pushpins" dataset. How do I go about deleting the default set? If I add the ability to manually enter a location as a pushpin, how do I define which dataset it should go into? I'm a relatively new programmer using C#, so I appreciate any help with these bone-head questions. Thanks! Ken |
| |||
|
MapPoint always adds new pushpins to the default dataset. If you delete the default "MyPushpins" it will be recreated when the next pushpin is added. If you rename "MyPushpins" MapPoint will then create "MyPushpins1" as the default dataset when the next pushpin is added. The only way seems to be to create a new dataset and move the newly added pushpin to this as below. Public Sub AddPushpin( _ ____ByVal DataSetName As String, _ ____ByVal objLoc As MapPoint.Location) Dim objPin As MapPoint.Pushpin Dim DataSetFound As Boolean Dim intX As Integer 'loop through dataset collection For intX = 1 To objMap.DataSets.Count ____'if dataset name exists ____If objMap.DataSets.Item(intX).Name = DataSetName Then ________'do not add dataset name ________DataSetFound = True ________Exit For ____End If Next intX 'if dataset name does not already exist If Not DataSetFound Then ____'add dataset name to dataset collection ____objMap.DataSets.AddPushpinSet DataSetName End If 'add pushpin to default dataset Set objPin = objMap.AddPushpin(objLoc) 'move pushpin from default dataset to required dataset objPin.MoveTo objMap.DataSets.Item(DataSetName) End Sub Sorry this is in VB but the general idea is the same. Roger |
![]() |
| Tags |
| programming, pushpin, question |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ambiguous messages ( programming or not programming? ) | Mohamed | MapPoint 2006/2009 Discussion | 1 | 06-13-2006 04:35 PM |
| Pushpin set question | NoDed | MapPoint 2006/2009 Discussion | 3 | 11-21-2005 01:34 PM |
| Lat/Long with Pushpin -- question? | onegalacticwino | Products: Pushpin Tool, Single State Mapper | 2 | 10-25-2004 10:23 AM |
| Pushpin question from newbie | Anonymous | MapPoint 2006/2009 Discussion | 1 | 03-24-2004 12:26 PM |
| pushpin note question | starbuck | MapPoint 2006/2009 Discussion | 4 | 12-03-2003 05:26 PM |