Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 5 of 5

Confused with calcpos :s

This is a discussion on Confused with calcpos :s within the MapPoint Desktop Discussion forums, part of the Map Forums category; I'm using the following to call calcpos to try and grab the long and lat of an address Code: Private ...

  1. #1
    Matrices is offline Member Yellow Belt
    Join Date
    Sep 2003
    Posts
    44

    Confused with calcpos :s

    I'm using the following to call calcpos to try and grab the long and lat of an address
    Code:
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Dim objmap As MapPoint.Map
            Dim objLoc As MapPoint.Location
            Dim lat, lon As Double
            objmap = AxMappointControl1.ActiveMap
            objLoc = objmap.FindAddressResults("Moss Lane", "Bolton", "", "", "BL1", "England")
            CalcPos(objmap, objLoc, lat, lon)
    
        End Sub
    But aparently using objloc in that manner is an invalid cast :s any help on this would be greatly appreciated

    Cheers

    M

  2. #2
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    I think FindAddressResults returns an array or set up points. Check the syntax and examples, I think you need an (1) or (0) after it.

    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  3. #3
    Matrices is offline Member Yellow Belt
    Join Date
    Sep 2003
    Posts
    44
    Aha!!! it did indeed need a (1), cheers but its not assigning the value of long and lat to the values that i declare in teh call, they're being updated as 0.0 and 0.0 when the values within the procedure are actually correct and the update of thte values is going ahead :s

    M

  4. #4
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    It's possible it's not finding a location with that address? Or try a (0), maybe the index starts at 0 and there is no second location (1).

    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  5. #5
    Matrices is offline Member Yellow Belt
    Join Date
    Sep 2003
    Posts
    44
    Its definitly finding the correct long and lat, at the moment i've adjusted it so that in the sub its writing the values to 2 labels. However, the 2 labels that are updated in the button function that calls the calcpos sub are updated as 0. Saying that at the moment its working even though its a dirty solution, I'd just like to figure out why its not returning teh values really. In vb6 there'd usually be a return dbllat, dbllon to do it, but return can't be used within a sub in vb.net apparently :s

    M

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Spatial Data Import Confused by some .shp files
    By tymitton in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 12-11-2009, 09:51 AM
  2. Some concerns about calcpos sub
    By lucci56 in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 07-18-2006, 11:44 AM
  3. Problems using CalcPos
    By Pete_ADL in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 06-21-2006, 04:12 PM
  4. Use CalcPos on a map with EXISTING pushpins ??
    By Sonicman_ in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 02-20-2006, 05:05 PM
  5. I am confused
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-28-2004, 01:45 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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