MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Pushpin programming question

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


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 07-16-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Pushpin programming question

I've written a small utility that uses MapPoint to import pushpins into a map containing various shapes. I then can report which pushpins are within a shape and which are not.

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
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 07-16-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
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 07-16-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Thanks! Maybe I'll use a C# version of this just before running my report to combine all pushpins into one dataset. This way I only get one report instead of one for each dataset.

Ken
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
programming, pushpin, question


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


All times are GMT -5. The time now is 10:38 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