Models & coordinates
Synchronize center and zoom, and build a location picker.
On this page
PickingInteractive exampleMapLibre
Picking#
v-model is the map center, in [latitude, longitude] order. Panning updates it even when picking is off. pickOnClick moves that center to the clicked position; centerMarker displays a fixed pin. These props do not save an address or add a marker to your array.
For a checkout picker, keep a separate confirmed value. A confirm button can copy center.value into your form. Use the click event's coordinates if you only want the clicked point rather than the current center. Both engines expose latitude-first click coordinates.
const confirmedLocation = ref<Coordinates>()
function confirmLocation() { confirmedLocation.value = [...center.value] }Reverse geocoding is a separate server-side service integration. This library displays maps and coordinates; it does not turn a point into an address.