MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




MP2004 - XYToLocation

This is a discussion on MP2004 - XYToLocation within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I want to know the extent of the displayed map, so I have a MapPoint control on a VB6 form ...


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 05-30-2006
Junior Member
White Belt
 
Join Date: Oct 2005
Posts: 4
MP2004 - XYToLocation

I want to know the extent of the displayed map, so I have a MapPoint control on a VB6 form and it's width and height are 900 x 900. I want to get the top left and bottom right coordinates - using of course using Gilles' CalcPos.

So I do :-

Dim X As Double
Dim Y As Double
X = 0
Y = 0
Set objLoc = MP.ActiveMap.XYToLocation(X, Y)

All OK...

X = MP.Width-1
Y = MP.Height-1
Set objLoc = MP.ActiveMap.XYToLocation(X, Y)

And our old friend -2147024809 The parameter is incorrect makes an appearance!

It will only work if you subtract 6 from Height and Width, and if you do a MouseMove and look at the X and Y the range is 0 to 893.

Any ideas why?

Andy.
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 06-01-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

You are right, I checked in my code and this is how I find the center of a map:

Code:
    int x = (MP.Width - 6) / 2;
    int y = (MP.Height - 6) / 2;
I did never search to it. I think it has to do with the 3D stile of the control (all sides 3 pixel).
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 06-05-2006
Junior Member
White Belt
 
Join Date: Oct 2005
Posts: 4
Thanks for that - I thought it was me!

Andy.
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
MP2004 and terminal services SeanB MapPoint 2006/2009 Discussion 5 10-16-2006 11:16 AM
Using MP2004 with Delphi Anonymous MapPoint 2006/2009 Discussion 13 03-02-2005 07:50 AM
Using S&T 2005 maps in MP2004 Fleet MapPoint 2006/2009 Discussion 1 11-18-2004 12:54 PM
need to check accuracy of MP2004 jaharris67 MapPoint 2006/2009 Discussion 0 09-15-2004 11:28 PM
XYToLocation Limitations Martel MapPoint 2006/2009 Discussion 2 06-07-2004 08:34 AM


All times are GMT -5. The time now is 02:37 AM.


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

Val d'Isere
For a ski holiday destination renowned for combining great skiing with a vibrant nightlife, book a holiday to Val d'Isere. Holiday Hypermarket brings you the latest great deals.

Italy Holidays
Find and book Italy Holidays with Travel Counsellors. Holiday destinations around the world including Italy.

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.

Barbados Holidays
Barbados holidays can be a wonderful break from the rat race or an exciting, action packed adventure. Plan the perfect holiday in Barbados.

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.

Holiday
For the holiday of your life, that is easy to plan, visit Travel.co.uk to see all the options.

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