MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




newmap problem with Mappointcontrol in VB.NET

This is a discussion on newmap problem with Mappointcontrol in VB.NET within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I just started to test mappoint 2004 in VB.NET and have no experience in vb.net. I can put the ...


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 01-01-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
newmap problem with Mappointcontrol in VB.NET

Hi,

I just started to test mappoint 2004 in VB.NET and have no experience in vb.net.

I can put the mappointcontrol1 on the windows form , when I try to put code (in the form load event or button click event)

mappointcontrol1.newmap =>still ok

but when I add geoMapEurope this is not working anymore.

( Of course I installed mappoint 2004 europe)

vb.net put a line under geoMapEurope and gives a debug error after starting.
In vb6 it works perfect....
What can I do?

Thanks for help

Wim
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 01-02-2004
NickS's Avatar
Junior Member
White Belt
 
Join Date: Nov 2003
Posts: 10
Try This...

Place a MapPoint control on the form, and then add the following code to the 'Form1_Load':
Code:
Try
  MappointControl.NewMap(MapPoint.GeoMapRegion.geoMapEurope)
Catch ex As Exception
  MessageBox.Show(ex.Message)
End Try
(In this example the control on the form is called 'MappointControl'.)

You may want to try adding this code to a button to move to a specified lat/lon...
Code:
Dim objmap As MapPoint.Map
Dim objLoc As MapPoint.Location
Dim dblLat, dblLon As Double

dblLat = Val(txtLat.Text) 'Or just put numbers here if no textboxes
dblLon = Val(txtLon.Text)

objmap = MappointControl.ActiveMap
objLoc = objmap.GetLocation(dblLat, dblLon, Val(txtAlt.Text))
objLoc.GoTo()
(This uses three textboxes - txtLat,txtLon, and txtAlt for the lat,lon,and altitude for viewing the map.)

Hope this helps...

Nick
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 01-02-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
newmap

Hi Nick,

Thanks for your help, this way it (NewMap) works!!

I found out that Mappointcontrol.OpenMap("C:\test.ptm") works to if I save first a map.

In the object browser I found that the OpenMap method needs a string as an argument but the NewMap method needs an object.

I think this is the difference with vb6 no?

Best regards,

Wim
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 01-02-2004
NickS's Avatar
Junior Member
White Belt
 
Join Date: Nov 2003
Posts: 10
Newmap

I've only started using MP2004 with VB.Net fairly recently, and looking round the web at sample code, it seems that there are quite a few 'subtle' changes in the syntax between MP2002 and 2004. Just to make it worse, most of the code 'in the wild' is for VB6, which doesn't really help very much!!

You've probably just found your first example!
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
mappointcontrol, newmap, problem, vbnet


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
MapPointControl Windowless / VB6 Guido Mitschke MapPoint 2006/2009 Discussion 3 12-29-2005 01:13 PM
MapPointControl.ocx Anonymous MapPoint 2006/2009 Discussion 1 03-25-2005 09:46 AM
map loading problem with MappointControl.ocx yooishung MapPoint 2006/2009 Discussion 1 06-22-2004 08:34 AM
newmap yvdp MapPoint 2006/2009 Discussion 7 05-21-2004 04:48 PM
newmap slower with mappointcontrol than with Mappoint2004 ? Syd MapPoint 2006/2009 Discussion 0 10-21-2003 10:52 AM


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

Costa Brava Holiday
Beautiful kilometres of sandy beaches await you should you choose a Costa Brava holiday through UlookUbook!



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