The original version of this document is located at https://docs.qfield.org/how-to/navigation-and-positioning/external-routing
It can come in handy to calculate an itinerary to one of your features in the field.
By an easy configuration of your attribute form in QGIS, you can quickly access the navigation tools from Google Maps via a hyperlink when working in the field.
Workflow
🖥️ Desktop preparation
Then enter the following expression as default value:
sql
concat(
'https://www.google.com/maps/dir/?api=1&destination=',
y(transform($geometry, layer_property(@layer, 'crs'), 'EPSG:4326')),
'%2C',
x(transform($geometry, layer_property(@layer, 'crs'), 'EPSG:4326')),
'&travelmode=driving'
)
(Optional) Tick “Apply default value on update” in case you make changes to your geometry.
Show Feature Location only
sql
concat( 'https://maps.google.com?q=',
y(transform($geometry, layer_property(@layer, 'crs'),'EPSG:4326')),
'%2C',
x(transform($geometry, layer_property(@layer, 'crs'),'EPSG:4326')),
'&zoom=19&t=h')
📱 Fieldwork