MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




drag and drop pushpin

This is a discussion on drag and drop pushpin within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I want to drag a pushpin from a location to another pushpin. The idea being the user drags a vehicle ...


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 10-24-2003
starbuck's Avatar
Member
Green Belt
 
Join Date: Oct 2003
Posts: 68
drag and drop pushpin

I want to drag a pushpin from a location to another pushpin. The idea being the user drags a vehicle to a depot. Is this possible?

Also is there a way of grabbing the push pin name you have dropped onto

Thanks in advance.
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 10-31-2003
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
I hope this will get you started. For this sample you will need a circle named "MyShape" so I've included some code to create the shape, please run that code before trying the main example.

After you have you circle on the map, add a pushpin, then drag and drop it into the circle (the depot)

Good luck...

Code:
'call this sub from the MapPoint Controls AfterRedraw event

On Error Resume Next

Dim objmap As MapPointCtl.Map
Set objmap = MappointControl1.ActiveMap
Dim objShapes As MapPointCtl.Shapes
Dim objshape As MapPointCtl.Shape
Set objShapes = objmap.Shapes
Dim objRecords As MapPointCtl.Recordset
Dim objDataSet As MapPointCtl.DataSet
    
If TypeOf objmap.Selection Is Pushpin Then
Dim a_pin As MapPointCtl.Pushpin
Set a_pin = objmap.Selection
       
   
 For Each objshape In objmap.Shapes
  If objshape.Name = "MyShape" Then
    For Each objDataSet In objmap.DataSets
        Set objRecords = objDataSet.QueryShape(objshape)
        objRecords.MoveFirst
            Do Until objRecords.EOF
              If objRecords.Pushpin.Name = a_pin.Name Then
                MsgBox "You moved " & objRecords.Pushpin.Name & " (" & a_pin.Name & ") into the circle"
              End If
            objRecords.MoveNext
            Loop
    Next
  End If
 Next
End If
Code:
'Run this at startup or from a command button

Dim objmap As MapPointCtl.Map
Set objmap = MappointControl1.ActiveMap
    
Dim objShapes As MapPointCtl.Shapes
Dim objshape As MapPointCtl.Shape
Set objShapes = objmap.Shapes

Set objshape = objShapes.AddShape(geoShapeRadius, objmap.FindResults("Denver, CO").Item(1), 500, 500)
objshape.Name = "MyShape"
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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 10-31-2003
starbuck's Avatar
Member
Green Belt
 
Join Date: Oct 2003
Posts: 68
cool

Many thanks, will give that a go
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
drag, drop, pushpin


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
Drag and Drop with mappoint Ryder MapPoint 2006/2009 Discussion 1 03-11-2005 02:53 PM
Drag/Drop Anonymous MapPoint 2006/2009 Discussion 0 12-01-2004 08:04 AM
drag & drop starbuck MapPoint 2006/2009 Discussion 1 10-23-2003 12:21 PM
Mappoint 2002 OCX drop & drag Anonymous MapPoint 2006/2009 Discussion 0 08-08-2003 03:57 PM
It is possible to drag / drop (move) an PushPin on.... Anonymous MapPoint 2006/2009 Discussion 1 12-03-2001 03:54 AM


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