PDA

View Full Version : My Pushpins !!!!!



Anonymous
09-19-2002, 10:24 AM
Hi All,

first of all thanks to everyone who has helped me out so far I am nearly there with this test.

BUT.....

Now I have been asked if when adding a Pushpin progmatically could it please not be added to the 'My Pushpins' set but instead be added to one of the 15 sets we have already loaded into the map. Can anybody help with this one as I can't seem to see how to change the Pushpin set name when you add the pin.

Thanks Dave.

John Meyer
09-19-2002, 12:55 PM
'Change ("My Pushpins") to one of your other datasets.

Dim objDataSet As MapPointCtl.DataSet
Dim objmap As MapPointCtl.Map
Set objmap = MappointControl1.ActiveMap
Set objDataSet = objmap.DataSets("My Pushpins")

Set objLoc = objmap.FindResults("Seattle, WA")(1)
Set objPushpin = objmap.AddPushpin(objLoc, "Sample")
objPushpin.MoveTo objDataSet

Joeba
09-19-2002, 12:55 PM
I just add the pushpin, and then move it to another pushpinset of my own:

Set pushP = frmMain.mpControl.ActiveMap.addPushpin(objLoc)
pushP.MoveTo frmMain.mpControl.ActiveMap.DataSets.item("PP")

hope this is what you need
greetz Joeba

Anonymous
09-20-2002, 03:09 AM
Thanks guys,

I spotted the MoveTo about 20 mins after posting (I really must read the manuals...;-) ) and after all pins have been created then just deleted the 'My Pushpins' data set and everything is as requested by the users.

blackmap
02-13-2003, 07:45 AM
What's wrong with this one?

Dim pushP As MapPointCtl.Pushpin
Set objLoc = objMap.XYToLocation(X, Y)
Set objdataset = objMap.DataSets("Objekte")
Set pushP = objMap.AddPushpin(objLoc)
pushP.MoveTo objdataset


It won't display a pushpin in my set named "Objekte"....

Puh....


Peter

blackmap
02-13-2003, 09:08 AM
Maybe the reason why is that the dataset is an imported one?
Then: How doI transfer the imported dataset into a "normal" one?

Anonymous
04-14-2003, 01:59 AM
Yeah, imported datasets aren't the same as regular pushpin data sets. They have more columns.

You can just create new pushpins. Use a recordset to loop through the imported dataset, and call AddPushpin on the normal set. Then delete the puspins in the imported dataset. It's a pain, but it works.