From the SBS (質問を募集する, "I'm Taking Questions") question and answer column of volume 62, chapter 609, page 122:
D: Like "Mugiwara-ya", Law-san tends to call people with the "-ya" suffix, but in the case where the person's last name is "Tsuchiya", then does that become "Tsuchiya-ya"? Please tell me Law-san♡ P.N. HeartLoveWoman
O: Mr. Law—they're calling you --! ............. Aw he won't come-. Let me answer instead. A long time ago, around maybe the Edo period--. There was this thing called "Yagō". So if for instance, in the case where there were two Mr. commoners named "Tomekichi-san", things like "Dōgu-ya no Tomekichi" (Tomekichi of the Tool shop) or "Oke-ya no Tomekichi" (Tomekichi of the Bathtub maker); something with "~ya" would be used in place of a last name-. Like how you shout "Tamaya~" at the fireworks or "Nakamuraya" from Kabuki; have you heard of those? In other words, he just goes with the flow. Right, Law-san?
L: Yeah.
"D" denotes the reader (dokusha), "O" denotes Oda, the author, "L" denotes Law.
Essentially it's as as if Law is calling Luffy "Strawhatter" or "Strawhat guy." Like you would refer to a butcher (nikuya) or a baker (panya) by the shop they run. Note that no honorific is applied, so you cannot assume this to be polite. You could say it puts a bit if the distance between the speaker and the one they are speaking to. Much like in a MMO party where someone calls you by your class or your role instead of your character name.