MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




How to send events to the MapPoint Control (in C#) ?

This is a discussion on How to send events to the MapPoint Control (in C#) ? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi I would like to be able to move the map to the right, left, down or up but programmatically, ...


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 12-20-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
How to send events to the MapPoint Control (in C#) ?

Hi

I would like to be able to move the map to the right, left, down or up but programmatically, with, if possible, functions like SendMessage/PostMessage that would be "DllImported" into a C# project + A mappoint control (2002 version).

Thank you very much if anyone has the solution to this, its urgent

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 12-25-2004
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

Possible there are other ways, but I tryed this one:

Code:
            double Lat;
            double Lon;
            Int32 x = MP.Height / 2;
            Int32 y = MP.Width / 2;
            double Alt = MP.ActiveMap.Altitude;
            Location Loc = MP.ActiveMap.XYToLocation(x, y);
            pos.CalcPos(Loc, out Lat, out Lon);
            Lat += 1;
            MP.ActiveMap.GoToLatLong(Lat, Lon, Alt);
First the center points x, y of the map are calculated, then the current Altitude. The XYToLocation gives back the Location of the current center of the map. The CalcPos routine you will find it on this site (on another name), please try a searcht to 'reverse geocoding' to find it.

Then at last I change the Latiude and call the GoToLatLong method.

But like I say it seems a little overkill. Possible there is a simple function call 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
  #3 (permalink)  
Old 12-25-2004
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

On this link you find how to calculate lat and long given a Location objectt:

http://www.mp2kmag.com/mappoint/disc...pic.asp?t=3291
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 12-25-2004
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

I found another method:
Code:
MP.ActiveMap.Pan(GeoPanCmd.geoNorth, Amount);
But the Amount raises another question. According to the help it say:
"PanFactor Optional Double. Amount to pan, expressed as a fraction of the screen width or height. "

But how large is that fraction ? I did a few experiment, and a vaule of 1 pan the map half the distance it fills on the screen.
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
Send SMS through COM Anonymous MapPoint 2006/2009 Discussion 3 06-09-2008 06:25 AM
Catch mappoint events using C++ (without MFC...) Jeurink MapPoint 2006/2009 Discussion 8 03-15-2005 04:35 AM
Triggering Events in MapPoint... joer1234 MapPoint 2006/2009 Discussion 0 09-29-2004 10:52 PM
How does Microsoft send you updates on MapPoint 20.... Anonymous MapPoint 2006/2009 Discussion 1 11-21-2001 06:53 AM
How do I send you information to be updated for yo.... Anonymous MapPoint 2006/2009 Discussion 1 11-19-2001 07:48 AM


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

Ski USA
USA ski resorts offer some of the best designed ski areas in the world. Choosing to ski in the USA will suit all types of skiers. Book great value ski holidays at Holiday Hypermarket.

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

Jamaica Holiday
Fancy a Jamaica Holiday? Then visit dealchecker.co.uk and find out what the big deal is. Book a bargain when you book online.

Holidays to St Lucia
Holidays to St Lucia will leave you smiling. The spectacular scenery and the warmth of the locals make holidays to St Lucia unforgettable.

Cheap Spain Holidays
Stay well informed when you are searching for cheap holidays online. For useful advice on when to book cheap Spain holidays make sure you look on ulookubook.com

Holidays Package
Make use of our service at Travel.co.uk to compare holidays. We can find you a package deal that will delight you.

Holidays in Florida
Take a break! Enjoy stunning coastline! Info on holidays in Florida available at On The Beach!


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