MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Use CalcPos on a map with EXISTING pushpins ??

This is a discussion on Use CalcPos on a map with EXISTING pushpins ?? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Is it possible to get the Location object of pushpins already on a map? Let's say I have 3500 Pushpins ...


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 Thread Tools Display Modes
  #1 (permalink)  
Old 02-16-2006
Junior Member
White Belt
 
Join Date: Feb 2006
Posts: 10
Use CalcPos on a map with EXISTING pushpins ??

Is it possible to get the Location object of pushpins already on a map?

Let's say I have 3500 Pushpins saved on a file... I would like to get the Lat/Lon of those using the CalcPos routine (VBA)...

I have used the calcpos already with success (right after creating a pishpin), I just don't know how to get the location object of pushpins already present on a map...

Thanks all in advance for your support!

Sonicman
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 02-17-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

This gets all pushpins on the map and their Location object:

Code:
            object o = 1;
            MapPoint.DataSet ds = mp.ActiveMap.DataSets.get_Item(ref o);
            Recordset rs = ds.QueryAllRecords();
            rs.MoveFirst();
            while (!rs.EOF) {
                Location loc = rs.Pushpin.Location;
                rs.MoveNext();
            }
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 02-17-2006
Junior Member
White Belt
 
Join Date: Feb 2006
Posts: 10
Thanks....

Thanks for the code !

If I understand correctly, "loc" will be the location object I am looking for right ?

I have absolutely no experience with C# code.... VB is what I know..


Sonicman
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 02-18-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Re: Thanks....

Hi,

Quote:
"loc" will be the location object I am looking for right ?
Yes correct.

Quote:
VB is what I know..
Yes but reading other code should be no problem. Writing in it is something different of course. If you have other questions just fire them
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 02-20-2006
Junior Member
White Belt
 
Join Date: Feb 2006
Posts: 10
Ok I have successfully translated you code

Here's the working code in VB format for those interested (the following displays a msgbox for each pushpin name on a current map):


Code:
Private Sub Commande0_Click()

Dim objApp As MapPoint.Application
Dim objMap As MapPoint.Map
Dim objLoc As MapPoint.Location
Dim objRecordSet As MapPoint.Recordset
Dim objDataset As MapPoint.DataSet

Set objApp = GetObject(, "Mappoint.Application.NA")
Set objMap = objApp.ActiveMap
Set objDataset = objMap.DataSets.Item(1)
Set objRecordSet = objDataset.QueryAllRecords

objApp.Visible = True
objApp.UserControl = True

objRecordSet.MoveFirst

Do Until objRecordSet.EOF
    Set objLoc = objRecordSet.Pushpin.Location
    objRecordSet.MoveNext
    MsgBox objLoc.Name
Loop

End Sub
Thanks for your help Wilfried. It is much appreciated !

Sonicman
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 02-20-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

I appreciate also your feedback. It will benefit lots of othr user. Glad your solution works
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
calcpos, existing, map, pushpins


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
Some concerns about calcpos sub lucci56 MapPoint 2006/2009 Discussion 5 07-18-2006 11:44 AM
Problems using CalcPos Pete_ADL MapPoint 2006/2009 Discussion 4 06-21-2006 04:12 PM
Looking for existing app to meet needs Anonymous MapPoint 2006/2009 Discussion 1 03-01-2004 12:44 PM
Confused with calcpos :s Matrices MapPoint 2006/2009 Discussion 4 09-25-2003 10:30 AM
Is it possible to add a new point to an existing p.... Anonymous MapPoint 2006/2009 Discussion 1 09-17-2001 02:38 AM


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


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