MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




How to continuosly add a GPS pushpin on MP2006?

This is a discussion on How to continuosly add a GPS pushpin on MP2006? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi everyone: I have to say Thank you!!!! for the wealth of information everyone on this post is sharing about ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (4) Thread Tools Display Modes
  4 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 10-20-2007
Junior Member
White Belt
 
Join Date: Oct 2007
Posts: 3
Question How to continuosly add a GPS pushpin on MP2006?

Hi everyone: I have to say Thank you!!!! for the wealth of information everyone on this post is sharing about mappoint. Information which for the most part, is not found anywhere else.

I am using vb6 and mp2006, and I am also new to programming. ---- Problem: I do not know how to continually display the lat/lot information coming from my GPS. I have two "Public" variables one for latitude (lat) and another one for longitude (lot) which are constantly receiving the already parsed lat/lot coordinates from the GPS, but the GetLocation method allows me to place only one pushpin on on the map. (See the last procedure below) What code do I use to place one pushpin every 1 or 2 seconds on the map based on the lat/lot info from the GPS?

code below:

--------------------------------------------------------------------------

Public lat As Double
Public lon As Double

Private Sub Form_Load()
Dim objMap As MapPointCtl.map
Set objMap = MappointControl1.NewMap(geoMapNorthAmerica)
Set objMap = MappointControl1.ActiveMap
call position_gps
End Sub

Private Sub form_unload(cancel As Integer)
MappointControl1.ActiveMap.Saved = True
End Sub

Private Sub position_gps()
Dim mymap As MapPointCtl.map
Dim myLoc As MapPointCtl.Location
Dim mypushpin As MapPointCtl.Pushpin
Set mymap = MappointControl1.ActiveMap
Set myLoc = mymap.GetLocation(lat, lon)
Set mypushpin = mymap.AddPushpin(myLoc)
mypushpin.Symbol = 83
mypushpin.Location.GoTo

End Sub

--------------------------------------------------------------------------

There is one or two similar threads, but no code is posted on the solution to this question.
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 10-21-2007
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 242
Re: How to continuosly add a GPS pushpin on MP2006?

Hi Joseph,

If you're trying to create a trail, "every one or two seconds" isn't even useful.
Besides, the refreshing of the screen will be continuous - you see no changes
until the screen is 'at rest.'

If you're only trying to track a vehicle, declare a variable as PushPin
and then change the location of the pin instead of adding new ones.

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 10-22-2007
Junior Member
White Belt
 
Join Date: Oct 2007
Posts: 3
Re: How to continuosly add a GPS pushpin on MP2006?

Thank you for your reply!

The code I have adds one pushpin to the map. How do I change/update the coordinates to a pin already on the map?

Joseph
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 10-22-2007
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 242
Re: How to continuosly add a GPS pushpin on MP2006?

Hi Joseph,

Sorry, workday ...

I believe I'd just do this:

[Aircode]
Set myLoc = mymap.GetLocation(lat, lon)
Set mypushpin.location = myLoc.location

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
  #5 (permalink)  
Old 10-23-2007
Junior Member
White Belt
 
Join Date: Oct 2007
Posts: 3
Re: How to continuosly add a GPS pushpin on MP2006?

Mike:

The code is still not compiling properly, I am getting a "variable not set" error. The object.location property seems to be the way to do it, but something I am doing is obviously wrong.

Just like you suggested, the "Programming Mappoint in .NET" book has a section which describes this process in C# , and although the code is different to VB6 the steps are similar:

currPushpin.Location = myloc; (in C#)

This is where the pushpin is supposed to keep updating its location from the myloc variable.

If I use the code you suggested:

Set myLoc = mymap.GetLocation(lat, lon)
Set mypushpin.location = myLoc.location

without adding the pushpin first with ...AddPushpin(myloc) I get a "variable not set" error.

If I use the following code:

Set myLoc = mymap.GetLocation(lat, lon)
Set mypushpin = mymap.AddPushpin(myLoc)
Set mypushpin.location = myLoc.location

I do not think it is correct to set a variable twice like that; therefore, the code does not produce the desired outcome. It just adds the pin, but no update.

Thank you again for your time and ideas. If you can think of any other way to fix this problem, any other suggestion is always welcome.

Joseph.
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 10-24-2007
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 242
Re: How to continuosly add a GPS pushpin on MP2006?

Let's say you have a menu item by the name of mnuExample
This will demonstrate how to continuously move your pushpin.

Private Sub mnuExample_Click(Index As Integer)
Dim MyMap As MapPoint.Map
Dim MyPin As MapPoint.Pushpin
Dim MyLoc As MapPoint.Location
Dim iloc As Long
Dim dlat As Double, dlon As Double

dlat = 43.223
dlon = -77.573
Set MyMap = MapCtl.Object.ActiveMap
Set MyLoc = MyMap.GetLocation(dlat, dlon, 1)
Set MyPin = MyMap.AddPushpin(MyLoc)
MyPin.Location.GoTo

For iloc = 0 To 200
Set MyPin.Location = MyMap.GetLocation(dlat, dlon, 1)
dlat = dlat + iloc / 1000
dlon = dlon + iloc / 1000
Set MyLoc = MyMap.GetLocation(dlat, dlon, 1)
MyPin.Location.GoTo
Next

Set MyLoc = Nothing
Set MyMap = Nothing
End Sub

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
Reply

Tags
add, continuosly, gps, mp2006, pushpin


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/how-continuosly-add-gps-pushpin-mp2006-6599.html

Posted By For Type Date
Programming MapPoint via .NET - MapPoint Articles - MP2K Magazine This thread Refback 10-22-2007 08:17 AM
Untitled document This thread Pingback 10-22-2007 01:08 AM
How to continuosly add a GPS pushpin on MP2006? | TheGPSBlog.info This thread Pingback 10-20-2007 11:10 PM
MapPoint Forums - MapPoint 2006, MWS, and Virtual Earth Discussion This thread Refback 10-20-2007 04:22 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
can i use mp2006 locally salmap Development 2 10-16-2007 02:12 PM
MP2006 - C# - Very SLOW closing map pcfountain Development 1 05-22-2007 11:44 AM
Add-in / MP2006 Memory Clash? Winwaed MapPoint 2006/2009 Discussion 0 11-27-2006 05:00 PM
MP2006 backward compatibility Wilfried MapPoint 2006/2009 Discussion 1 09-08-2006 03:10 AM


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

Flights from Stansted
Book cheap flights from Stansted Airport online at Holiday Hypermarket. Use our simple online booking form to take advantage of all the airport facilities

Travel Counselors
Travel Counselors are an award winning Travel Agent. Why not have a personal Travel Counselor help with your travel plans.

Cheap Holidays to Turkey
If you’re looking for cheap holidays to Turkey then dealchecker.co.uk is the place for you! Our search helps you see real prices from the UK’s top holiday companies all in one go.

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.

Balearics
Before booking to the Balearics Islands make sure you check out our travel guide online. The Balearics are renowned for their vibrant nightlife but there are also some stunning Gothic cathedrals, Stone Age ruins and fishing villages.

Cheap Travel
Travel.co.uk has some excellent offers on cheap travel. Click here.

Holidays in Gran Canaria
Have some fun in the sun on the Canary Islands! See On The Beach for information on holidays in Gran Canaria.


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