MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




c# - Map location to application

This is a discussion on c# - Map location to application within the Development forums, part of the MapPoint 2006/2009 Discussion category; I have no problem taking a user entered (or GPS) lat/lon and putting a pushpin on a map. What ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  6 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 04-25-2008
Junior Member
White Belt
 
Join Date: Apr 2008
Posts: 3
c# - Map location to application

I have no problem taking a user entered (or GPS) lat/lon and putting a pushpin on a map. What I need to do now is allow the user to click a point on the map and have my program pickup the location of that point. Seems like this should be easy I just can't find the right method/property. Clicking on the map puts a location circle on the map but I don't think that is a pushpin, not sure what it is so don't know how to grab it. Thanks.
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 04-26-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 206
Re: c# - Map location to application

Hi Dvonrick,

I'm sure Wilfried will be along any time now to speak C#,
but basically you just want the x and y coordinates of
the mouse ... ... and make a call to map.xytolocation.

Mike Mattys
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 04-28-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,037
Re: c# - Map location to application

Hi,

Yes as Mike say you have to write a BeforeClick event handler. There you have the x,y coordinates. to have a location from it:

Code:
Location loc = MP.ActiveMap.XYToLocation(e.x, e.y);
MP is the mappoint control in this case.
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 04-28-2008
Junior Member
White Belt
 
Join Date: Apr 2008
Posts: 3
Re: c# - Map location to application

Thanks. And just to make sure I am not missing something, I will need to do the calculations to go from x/y to Lat/Lon. There is no property I can grab/method I can call?

Thanks again.
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 04-28-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 206
Re: c# - Map location to application

Dvonrick,

As soon as you do this:
Location loc = MP.ActiveMap.XYToLocation(e.x, e.y);

loc will aquire the properties:
loc.latitude
loc.longitude

(In MapPoint v2006)

Mike Mattys
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 04-28-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,037
Re: c# - Map location to application

Hey Mike,

We all really are a team. I like that
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 04-28-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 206
Re: c# - Map location to application

Hi Wilfried - Yep! Me, too!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 04-28-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 206
Re: c# - Map location to application

Well ...
I doubt that smilie would ever have gotten used anyway.

Mike Mattys
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 04-29-2008
Junior Member
White Belt
 
Join Date: Apr 2008
Posts: 3
Re: c# - Map location to application

Thanks. I had just received Mappoint 2006 and had not yet installed it prior to my last question. This makes it easier. I've done way too much low level coding in my life and am getting up to speed with some of this.

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


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/c-map-location-application-7576.html

Posted By For Type Date
America Blog » Blog Archive » MapPoint 2009 This thread Pingback 05-04-2008 07:16 AM
Sport Blog » Blog Archive » MapPoint 2009 This thread Pingback 05-04-2008 07:16 AM
News Blog » Blog Archive » MapPoint 2009 This thread Pingback 05-04-2008 07:16 AM
Newkirknuggets Blog » Blog Archive » MapPoint 2009 This thread Pingback 05-04-2008 07:15 AM
Map: Iraq Gulf War Map - MP2K Magazine This thread Refback 04-27-2008 01:14 PM
The Magazine for MapPoint - MP2K Magazine This thread Refback 04-26-2008 05:03 PM

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
How to Develop a Location-Based Application on a Pocket PC Phone Edition by Using Mic MSDN MapPoint Feed Virtual Earth Blogs 0 09-15-2007 04:06 PM
Cant See Mappoint.Application from VB Anonymous MapPoint 2006/2009 Discussion 2 04-15-2004 10:15 AM
Pb with another application Anonymous MapPoint 2006/2009 Discussion 0 12-17-2002 03:53 AM
We are designing an application that will probably.... Anonymous MapPoint 2006/2009 Discussion 1 01-19-2002 02:58 PM
I'm developing an application in VFP that uses the.... Anonymous MapPoint 2006/2009 Discussion 2 12-11-2001 05:56 AM


All times are GMT -5. The time now is 07:36 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5
MP2K Magazine
Visitor Map

Ski Holidays Canada
For superb slopes book ski holidays to Canada today. Offering stunning views and beautiful scenery, Canada is deservingly rated amongst the premier destinations for cheap ski holidays.

Travelcounselors
TravelCounsellors are a Queens award winning Travel Agent. Have a personal Travel Counselor help with your travel plans.

Holidays to Jamaica
At dealchecker.co.uk, we'll shop around for cheap holidays to Jamaica so you don't have to. We search deals from the UK’s top holiday companies all in one go. Try it for free.

Cyprus Holidays
Cyprus holidays will offer you a wealth of activities all in the most beautiful surroundings. Relish the beauty of Cyprus on a short break.

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.

Family Holidays
Family holidays can be great fun. Check out your options at Travel.co.uk

Holidays to Portugal
Want to take your family on a summer holiday? Visit On The Beach for more information on holidays to Portugal.


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