Skip to main content

Location Sharing

Compatibility
This feature compatible with Better Messages 3.0.0 or higher

Messages can carry a location — a place on a map, sent into a conversation like any other attachment. The sender opens a picker, drops a pin or searches for a place, and the conversation shows an address card with an optional map preview and an Open link.

It is off by default. Nothing appears in the attachment menu until you turn it on.

What it adds#

  • A Share location entry in the attachment menu
  • A map picker with place search, nearby suggestions and a "use my current location" button
  • Coordinate rounding, so a pin can say which area someone is in rather than which building
  • Role restrictions on who may share one
  • A map preview inside the message, and an Open link to OpenStreetMap, Google Maps or Apple Maps
  • Swappable providers — the map tiles, the geocoder and the nearby-places service are all configurable

How to enable#

WP Admin → Better Messages → Settings → Location.

Location Sharing#

SettingWhat it doesDefault
Location SharingAdds Share location to the attachment menuOff
Restricted RolesThese roles cannot share a location. Locations they already sent stay visibleNone
Coordinate PrecisionRounds the coordinates before they are stored: Exact position, or rounded to about 10 m, 100 m or 1 kmExact position

Location Picker#

What the sender gets when they open Share location. The map is always there. Everything below can be switched off, and with both the search field and the suggestions off the picker becomes map-only.

SettingWhat it doesDefault
Use My Current LocationShows the button that asks the browser for the visitor's position. The browser still asks the visitor for permissionOn
High AccuracyAsks the device for its most precise fix, which uses GPS on phones. Off is faster, uses less battery, and is accurate to roughly a city blockOn
Place SearchThe field that looks up an address or place by nameOn
Nearby SuggestionsLists real places around the pin before anything is typed, nearest first, refreshing as the map movesOn
Nearby RadiusHow far around the pin to look, in metres. A city centre is busy at 300. A village needs 1000 or more400
Results Per Place ListHow many places a search or nearby list may return (1–40)8
Opening ZoomZoom the picker opens at — 1 is the whole world, 19 a single building14
Zoom On SelectionZoom the map moves to once a place is picked or the position is found16
Starting PointWhere the map opens for someone who has not moved it and has not shared their position. Set it near your audience48.85, 2.35

Shared Locations#

How a location already sent appears in the conversation. These also apply to locations shared before the feature was switched off.

SettingWhat it doesDefault
Map PreviewDraws a small map above the address. With it off the message is just the address card, and reading a conversation costs no tile requestsOn
Preview ZoomZoom level of that preview map15
Open InWhere the Open link takes the reader: OpenStreetMap, Google Maps or Apple MapsOpenStreetMap

Map provider#

Maps are drawn with Leaflet from a raster tile server, places are looked up by name through a Nominatim geocoder, and nearby places come from an Overpass endpoint.

All three default to the free OpenStreetMap services, which are meant for light traffic and ask for attribution.

A busy site should use its own endpoints

The public OpenStreetMap services are not intended to carry a production community's traffic. Point these at your own servers, or at a commercial provider, before a launch.

SettingWhat it does
Tile URLTemplate of the raster tile server. {z}, {x} and {y} are replaced with the tile coordinates. A commercial provider usually wants an access token appended
AttributionCredit printed in the corner of every map. Tile providers require this, and a link is allowed
Maximum ZoomDeepest zoom your tile server provides. Past it the map goes blank, so match it to what the provider serves
Geocoder URLBase address of a Nominatim server, used to search places by name and to name the spot under the pin
Nearby Places URLOverpass API endpoint. This is the one that answers "what is around this point", which a geocoder cannot do

Frequently asked questions#

Does it track anyone?#

No. Nothing is shared until the sender opens the picker and sends a message, and the browser asks its own permission before revealing a position. A location is a message, not a live feed.

Can I stop exact addresses being sent?#

Yes — Coordinate Precision rounds the coordinates before they are stored. At about 1 kilometre a pin says which neighbourhood someone is in and no more.

Can I let only some roles share a location?#

Restricted Roles lists the roles that cannot. Everyone else can, and anything already sent stays readable either way.

Does the map cost tile requests every time someone reads the conversation?#

Only with Map Preview on. Turn it off and a shared location renders as the address card alone.

See also#