As far as I can understand about location に indicates a location where something exists (as in ここに いる), but some verbs use it like つとめる and で the location on which an action takes place ( as in レストランで食事をする or 待つ) but with 寄る に is used (according to the N4 preparatory book), I don't understand why, may I ask your help with this?
- As for 待つ, it's always used with で. I don't know when to use に.
- As for 寄る, に is used in the same way as ～に行く ("go to ～"), ～に来る ("come to ～"), ～に向かう ("head to ～"), ～に送る ("send (something) to ～"), etc. It's the primary particle that marks a destination.
That said, you cannot always expect a logical answer for this kind of question. You may find this interesting:
(By the way, whenever I see "to drop by ～", I can't help feeling it's counter-intuitive...)