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 8 of 8

How to determine territory of a recently placed pushpin ?

This is a discussion on How to determine territory of a recently placed pushpin ? within the MapPoint Desktop Discussion forums, part of the Map Forums category; I know how to place pushpins and play with latitude/longitude and everything, but I am so far unable to determine ...

  1. #1
    Sonicman_ is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    10

    How to determine territory of a recently placed pushpin ?

    I know how to place pushpins and play with latitude/longitude and everything, but I am so far unable to determine the territory name for a pushpin I just placed (using VBA).

    I have about 50 territories in the united states and would like to place a pushpin, determine it's territory and delete the pushpin.

    Determining the territory is my issue. I tried doing a search but all of those who have posted this question did not get any answer. I hope i'll be more successful !

    Thank you for your help it will be greatly appreciated.

    Sonicman

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,434
    Hi,

    I hope you have more success if it can be done and someone know how. i dont...

  3. #3
    Sonicman_ is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    10

    anyone else ?

    Hi Wilfried

    thanks for posting

    Anyone else have any idea how to do this ? Or is it just not possible with mappoint ?

    Alex

  4. #4
    Sonicman_ is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    10

    Could this be adapted to work ?

    Here is some code posted by a guest on another topic. Does anyone think it could be adapted to find the territory of a pushpin ?

    Here is the code to read the linked Territory. I was wondering if some body has dome the same but with Manually created Territory

    With objMap.DataSets
    szconn = objMap.Path & "C:\MapPoint\pushpin\Terrs.xls!Sheet1!A1:E127"
    Set mpDataSet = .ImportTerritories(szconn, , geoCountryUnitedStates, , geoImportExcelA1)
    End With

    Dim objRecordset As Recordset
    Set objRecordset = mpDataSet.QueryAllRecords
    Dim strLookUp As String
    ReDim Preserve strRegion(0)
    x = 0
    'Get the values
    Dim vals As String
    objRecordset.MoveFirst
    Dim i As Integer
    Do Until objRecordset.EOF
    strLookUp = Trim(objRecordset.fields("Territory"))
    ReDim Preserve strRegion(x)
    strRegion(x) = strLookUp // I have the list here...
    x = x + 1
    End If
    objRecordset.MoveNext

    Loop

  5. #5
    Sonicman_ is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    10

    Still no solution after two weeks

    After two weeks of searching and posting I still haven't found a solution to this problem. I decided to reply to my own post again to make it sticky.
    Maybe someone will find a solution and share it ?

    Alex

  6. #6
    Mohamed is offline Member Green Belt
    Join Date
    Mar 2005
    Posts
    97
    Hi,

    After two weeks of searching and posting I still haven't found a solution to this problem. I decided to reply to my own post again to make it sticky.
    Maybe someone will find a solution and share it ?
    I have an idea but I have to test with your Data. Could u send me your file with sample Data to be sure I understand your problem.



    Mohamed@atlascouscous.com

  7. #7
    Mohamed is offline Member Green Belt
    Join Date
    Mar 2005
    Posts
    97
    Hi,

    I don't know what's your progamming language, so I give you the method I used to resolve that:

    ( By the way, Why do you add a PushinPin and delete it? It's more elegant to use the "BeforeClick" Event )

    Never mind, here is the idea :

    3 steps:

    - When you import your territories, you are obliged to have a GeoFieldType like Postal Code. So, for each Territory Name, you Know the corresponding Postal Codes ( in a file , in an Array, etc. )

    - When you add a PushPin , by a Reverse Geocoding function ( you have a lot in this forum ) , you can get the StreetAddress Property and the GeoFieldType value like the Postal Code

    - Now you do a search in the file or array where you have your territories and geoFieldTypes to find the correponding Territory Name

    Ciao

    P.S.
    If you add programatically your PushPins, it's easy to save any information you have with the NOTE property. If you put the Territory Name in the NOTE property of a PushPin, you can get that information when you want.

  8. #8
    renatoa is offline Junior Member Yellow Belt
    Join Date
    Feb 2006
    Posts
    26
    I don't know if still useful, but I developed for one of my apps a method to return the clicked territory on map (on before click event).

    Renato

    Quote Originally Posted by Sonicman_ View Post
    I know how to place pushpins and play with latitude/longitude and everything, but I am so far unable to determine the territory name for a pushpin I just placed (using VBA).

    I have about 50 territories in the united states and would like to place a pushpin, determine it's territory and delete the pushpin.

    Determining the territory is my issue. I tried doing a search but all of those who have posted this question did not get any answer. I hope i'll be more successful !

    Thank you for your help it will be greatly appreciated.

    Sonicman

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Determine if Map has been closed
    By BirdIslander in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-07-2005, 01:33 PM
  2. Extracting the corresponding Territory to a PushPin Location
    By jpendegraft in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-13-2005, 02:06 AM
  3. Which Territory is a Pushpin located?
    By johnweidauer in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-31-2005, 10:46 AM
  4. Active-X : Way to determine if pushpin is on diplayed map?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-02-2004, 09:01 AM
  5. Is there a way to determine the minimum distance b....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-22-2002, 04: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