MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Identifying Selection with Mouse

This is a discussion on Identifying Selection with Mouse within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; working in VB with a Mappoint object. I'm trying to select a starting point on a map (a lat/long position) ...


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

Today's Posts Twitter Feed 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 08-20-2002
Junior Member
White Belt
 
Join Date: Aug 2002
Posts: 2
Identifying Selection with Mouse

working in VB with a Mappoint object.

I'm trying to select a starting point on a map (a lat/long position) using my mouse pointer. It looks like I can either
click a location on a map (like a city) or draw a rectangle. Either way I need to identify the lat/long of either the selected city or upper left corner of my drawn retangle.

I have some code I downloaded off this site to identify the lat log if given zipcode for the input. My question is this: Can I return a zipcode from either of the above two selection methods? Or is there a better way to do this.
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 08-20-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
This code sample will: If you click your mouse on the map, if it is a location type it will give you a message box with the Lat/Lon.

Here is an article you need to check out: A More Compact Method for Obtaining Lat/Long. Author: Gilles Kohl

http://www.mp2kmag.com/articles.asp?ArticleID=13


'Put Gilles code in a bas module for the CalcPos function call.

'Put this in the general declatations section
Public thelat As Double
Public thelon As Double


'I'm using a Mappoint ActiveX Control named MappointControl1 on my form for this example


Private Sub MappointControl1_SelectionChange(ByVal pNewSelection As Object, ByVal pOldSelection As Object)
On Error GoTo error:
Dim objmap As MapPointCtl.Map
Dim objLoc As MapPointCtl.Location
Set objmap = MappointControl1.ActiveMap
If TypeOf objmap.Selection Is Location Then
Set objLoc = objmap.Selection

CalcPos objmap, objLoc, thelat, thelon
MsgBox thelat & " , " & thelon
End If

Exit Sub
error:
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 08-20-2002
Junior Member
White Belt
 
Join Date: Aug 2002
Posts: 2
works great!

though now I get a server busy box. It asks to "switch to" or "retry". To get out of it I must use task manager.
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 08-20-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
I think if you do something with the lat/lon other than bring it up in a message box you will not get that error. The message box is waiting for you to click "OK" keeping that SelectionChange event open gives that error.
__________________
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
Reply

Tags
identifying, mouse, selection


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
Is this possible? Identifying points within radius of terr. Kogenta MapPoint 2006/2009 Discussion 1 01-17-2006 12:56 PM
Pushpin Selection EdB MapPoint 2006/2009 Discussion 2 08-14-2005 09:25 AM
Getting dataset from user selection mic6399 MapPoint 2006/2009 Discussion 1 09-23-2004 10:59 AM
Zoom to selection? sthurlock MapPoint 2006/2009 Discussion 6 12-10-2003 06:53 PM
Have successfully exported a map selection from Ma.... Anonymous MapPoint 2006/2009 Discussion 1 09-05-2001 04:14 AM


All times are GMT -5. The time now is 11:10 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Antalya Holiday
Check out the Antalya holiday options through UlookUbook and find amazing offers that suit your pocket...



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 55 56 57 58 59