$wpdb->prepare() doesn't actually fully support
From the Codex:
The query parameter for prepare accepts sprintf()-like placeholders. The %s (string), %d (integer) and %f (float) formats are supported.
It's not entirely obvious from that but the argument swapping formats (e.g.
%1$d) are not supported (in any case you have the incorrect syntax: it should be
%2$s instead of
"SELECT * FROM location
WHERE name LIKE %s OR name LIKE %s",
I'm assuming 'on' might be replaced by a unknown value - otherwise
$wpdb->prepare() isn't necessary. On an unrelated note, the second condition in your SQL makes the first obsolete.