FindPushpin(Name)

Yazzy
08-16-2005, 06:00 PM
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
:oops:

Mohamed
08-17-2005, 04:17 AM
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 ( 8) )


After, I can decide the conditions to be different,

For example:
Condition1 - Symbol1 :lol: if satisfaction is between 8 - 10
Condition2 - Symbol2 :roll: if satisfaction 6 - 7
Condition3 - Symbol3 :evil: 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

Yazzy
08-17-2005, 04:58 AM
thanks Mohamed

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

Mohamed
08-17-2005, 05:26 AM
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

 
Web mp2kmag.com
mapforums.com