MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Capturing Pushpin movement

This is a discussion on Capturing Pushpin movement within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am creating an application in VB.net that uses the Mappoint com control. I need to be able to do ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-31-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Capturing Pushpin movement

I am creating an application in VB.net that uses the Mappoint com control. I need to be able to do 2 things:

1. Block the user from being able to select and move pushpins(separate tasks)

2. When a pushpin is moved, I need to know that it has moved, which pin it is, and what it's new location is. I do not know how to detect pin movement.
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 02-03-2003
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Not sure if this will solve your problem but maybe it will help a little?

in the BeforeClick event you can set Cancel = True to cancel the users click. (either Right or Left Click)

This would disable the left mouse button on the map itself (prevent them from moving the pushpin) If you change it to Button =2 then you disable right click menu. If you remove the if statment and just leave Cancel = True you disable left or right click.
Code:
Private Sub MappointControl1_BeforeClick(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As Boolean)

If Button = 1 Then
Cancel = True
End If

End Sub
__________________
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 02-03-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Thank you

thank you so much. I appreciate your reply. I do have more questions, however. Is there any way to allow the user to select a pushpin, but prevent them from moving it? Also, How can I tell when a pushpin has been moved?

Thank you 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
  #4 (permalink)  
Old 02-04-2003
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Sonya,

There really is not an easy way to keep users from moving the pushpins that I know of.

You would have to come up with a cleaver way of doing it yourself. Off the top of my head I guess you could write code to check the position of pushpins against your database using the "AfterRedraw event" as a trigger, but depending of the number of pushpins your working with it may or may not be practical?
__________________
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
  #5 (permalink)  
Old 06-05-2003
Junior Member
White Belt
 
Join Date: Nov 2002
Posts: 4
selecting pushpins

Try this:
Private Sub MPC_BeforeClick(ByVal Button As Long, ByVal Shift As Long,
ByVal X As Long, ByVal Y As Long, Cancel As Boolean)

On Error Resume Next
Set oResults = MPC.ActiveMap.ObjectsFromPoint(X, Y)
For Each oResult In oResults
If TypeOf oResult Is Pushpin Then
Cancel = True

...........
You only use "Cancel=True" if it is a Pushpin what you have selected
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 06-05-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
I had an almost working method like what Manuel proposes. But then you have to account for double-clicking, overlapping pushpins, highlighting of pushpins, and other problems that escape my memory. I did go this route but went back. Moveable pushpins caused less problems that all the other issues.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 06-09-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
How to disable pushpin movement

Try this:


Private Sub mapMain_SelectionChange(ByVal sender As Object, ByVal e As AxMapPoint._IMappointCtrlEvents_SelectionChangeEve nt) Handles mapVenders.SelectionChange
Dim sp As MapPoint.Shape
Dim loc As MapPoint.Location
Try
If TypeOf (e.pNewSelection) Is MapPoint.Pushpin Then
loc = mapVenders.ActiveMap.GetLocation(80, 0) 'get a location over at the north pole
sp = mapVenders.ActiveMap.Shapes.AddShape(MapPoint.GeoA utoShapeType.geoShapeRectangle, loc, 1, 1)
sp.Select()
sp.Delete()
End If
Catch e1 As Exception
'exit gracefully
End Try
End Sub


Basically what this will do is that every time you select a pushpin then this will create a small, barely noticeable shape over at the north pole, thus shifting the selection to that shape, and then it deletes it so no traces of what happened are left. This will effectively disallow the user from moving pushpins. If you want to leave the pushpin selected, you could try reselecting it with the e.pNewSelection instance, but I'm not sure if the movement will still be disallowed that way. Obviously this is the way that you will know which pushpin was moved, but again I haven't tried if it also has the new location with it. I'm using the method above and has always worked for me, so I guess you won't have any problems with it. Good luck and hope this helps you.
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


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
Capturing Mouse Wheel Event Anonymous MapPoint Web Service and Virtual Earth 2 11-30-2005 07:31 AM
Capturing Pushpin movement huggesc MapPoint 2006/2009 Discussion 0 11-12-2003 04:08 PM
Finding Pushpin Name by clicking on the Pushpin?(MP 2002) NickSP MapPoint 2006/2009 Discussion 4 01-10-2003 12:11 PM


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

Flight Departures
Check Holiday Hypermarket to find flight departures to numerous exotic destinations. We link to details on flight departures and arrivals to help you find information fast.

Travel Counsellors
Travel Counsellors are an award winning Travel Agent. Have a personal Travel Counsellor help with your travel plans.

Cape Town Flight
Book a Cape Town Flight for great value when you book through dealchecker.co.uk. It doesn't take long to find the latest great deals for you.

Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!

Holidays
For bargain holidays to destinations including Mexico, South Africa, India and more, visit ULookUBook online today. Check out our free travel guides to help you make an informed decision for your holidays.

Cheap Travel
For cheap travel options, visit Travel.co.uk and explore the benefits of our comparison site.

Holidays to Goa
Golden beaches, coconut trees. Visit On The Beach for holidays to Goa, and experience India!


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