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

FindPushpin(Name)

This is a discussion on FindPushpin(Name) within the MapPoint Desktop Discussion forums, part of the Map Forums category; I would like some help please. My problem is I import data using 'DisplayDataMap' and that works great. The problem ...

  1. #1
    Yazzy is offline Junior Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    25

    FindPushpin(Name)

    I would like some help please.

    My problem is I import data using 'DisplayDataMap' and that works great.

    The problem comes when I have to change the Pushpinsymbol. The code I am using is listed below

    Do While Not objRS.EOF
    If objRS.Fields(10) <> "n" Then
    location = objRS.Fields(1)

    Set objLoc = objmap.FindResults(location).Item(1)

    PushpinType = objRS.Fields(10)

    Name = objRS.Fields(3)
    If IsNumeric(PushpinType) <> 0 Then 'Check if the PushpinType is standard ie numberic value
    Set objSymbol = objmap.Symbols.Item(CInt(PushpinType)) ' Convert String value to Integar. Display the standard symbol equal PushpinType value
    Else
    Set objSymbol = objmap.Symbols.Add(PushpinType) 'Display Customised Pushpin symbol
    End If

    Set objPin = objmap.FindPushpin(Name)

    At the line Set objPin = objmap.FindPushpin(Name) i get an error message

    "The requested property is unavailable"

    Could you please advise how else I can improve this?


    Many thanks in advance

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

    (I visit actively this forum in this moment because I am on holiday and
    as it is too hot outside I am improving my personal HomeDelivery system. Honestly, I find a lot of ideas here and I try as possible to share some of mine).


    Set objPin = objmap.FindPushpin(Name)
    You have to be sure that "Name" is what you have indicated when you did
    Set objPin = objmap.AddPushpin(ObjLoc, Name)



    Could you please advise how else I can improve this?
    I did that i a different way:

    I don't use DisplayDataMap.

    I have my clients stored in a database with Id , Name, address,
    number of ordered meals, Satisfaction, and so on ...

    When I want to dispaly some or all of them on the map, I read my database, and, following some conditions, I give them different symbols.
    Like this I can target my customers with suitable advertising.

    Because these conditions are always changing, I gived the same symbol for everybody in the beginning.

    When I want to display my clients in the map , I read my file and Add the pushpins I want :
    Name = Client.Id
    Set objPin = objmap.AddPushpin(ObjLoc, Name)
    objPin.Symbol = nSymbol ( )


    After, I can decide the conditions to be different,

    For example:
    Condition1 - Symbol1 if satisfaction is between 8 - 10
    Condition2 - Symbol2 if satisfaction 6 - 7
    Condition3 - Symbol3 if satisfaction 4 - 5

    ( Never I have satisfaction lower than 4 !!!!! )

    To display these new symbols with the same pushpins, I change only the symbols.

    Do while not Clients.eof ( Use your programming reading file syntax )

    Searcher = Clients.Id
    Condition = Clients.satisfaction

    IF Condition1
    Symbol = Symbol1
    END IF

    IF Condition2
    Symbol = Symbol2
    END IF

    IF Condition3
    Symbol = Symbol3
    END IF


    ChangeFoundPushPinSymbol(Searcher, Symbol, Condition)

    Next


    PROCEDURE ChangeFoundPushPinSymbol(SearcherPushPin, nNewSymbol, cNewNote="" )


    objPin = ObjMap.FindPushpin(SearcherPushPin)
    IF objPin <> Null ALORS
    objPin.Select
    objPin.Symbol = nNewSymbol
    objPin.Note = cNewNote
    END IF


    Hope this helps

    Regards

    //************************************************** ***//

    TO Calv1s

    If you understand French and love Camels and Jokes, read my
    Jokes about Camels in my WebSite and tell me how to use your ACL units:

    Adventures of Ali the Camel driver
    "Les Aventures d'Ali le Chamelier"
    www.AtlasCouscous.com

  3. #3
    Yazzy is offline Junior Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    25

    FindPushpin(Name)

    thanks Mohamed

    I have already tried that method but its takes a long time. I need a way to speed up the process

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

    I tried the two methods. And I have always faster response with my own databases outside Mappoint. Anyway I have more control when I have to debug an error.

    I've added more than 30000 pushpins in my map.
    The first time, it takes some time. But when it's saved as atlas.ptm,
    I can change in 10 seconds more than 1000 symbols.

    How did you added pushpins?

    Rgds

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. FindPushpin problem
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-29-2004, 09:13 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96