What setting is on iphones that shows people your location?

When you text them? I know there has to be one, i was wondering how to turn it off. I know this cause i was on my friends iphone awhile ago, and when he sent and received texts you could see location. I don't believe it's the location services setting or icloud, what is this i'm thinking of? Like when someone texts you on an iphone and you can click the text and see the location,?

Added (1). galib does that apply to showing people where you are when you send them a text on an iphone too?

Turn off you Location Services from your Settings.