From 96cd0242c1adfe921f24265a14b2363c650a2745 Mon Sep 17 00:00:00 2001 From: Isabel Kiefer Date: Tue, 20 Jun 2023 13:25:38 +0200 Subject: [PATCH 1/4] new how-to for google maps itinerary link add an automatic field in the attribute form containing a link to open google maps and navigate to or show the feature. --- documentation/how-to/itinerary.en.md | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 documentation/how-to/itinerary.en.md diff --git a/documentation/how-to/itinerary.en.md b/documentation/how-to/itinerary.en.md new file mode 100644 index 000000000..0f4224a52 --- /dev/null +++ b/documentation/how-to/itinerary.en.md @@ -0,0 +1,30 @@ +--- +title: External routing +tx_slug: documentation_how-to_routing +--- + +# 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 on the field. + +## Configure attribute form widget in QGIS +:material-monitor: Desktop preparation + +Here is an example for navigation to features of a point layer. + +Create a new field in your data table (type text). In the attribute form settings, select "attachment" as widget type. Tick "Display a hyperlink for document path (read-only)". +Then enter the following expression as default value: + +*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')* + +And tick "Apply default value on update" in case you make changes to your geometry. + +If you simply want to show your feature location in Google Maps, you can use the following expression: +*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')* + +## Usage +:material-tablet: Fieldwork + +Click on the feature on the map where you want navigation to or that you want to open in Google Maps. In the attribute form, click on the link towards Google Maps. + From 7a99eb83cfdbaebe770c43ca90ab749ad7501ac2 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Tue, 12 Sep 2023 15:41:59 +0300 Subject: [PATCH 2/4] Update documentation/how-to/itinerary.en.md --- documentation/how-to/itinerary.en.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/documentation/how-to/itinerary.en.md b/documentation/how-to/itinerary.en.md index 0f4224a52..e3c550a73 100644 --- a/documentation/how-to/itinerary.en.md +++ b/documentation/how-to/itinerary.en.md @@ -16,7 +16,15 @@ Here is an example for navigation to features of a point layer. Create a new field in your data table (type text). In the attribute form settings, select "attachment" as widget type. Tick "Display a hyperlink for document path (read-only)". Then enter the following expression as default value: -*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')* +``` +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' +) +``` And tick "Apply default value on update" in case you make changes to your geometry. From 8a58f06f4a233ba624fe82bbe2da8d197f8d3ea2 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Tue, 12 Sep 2023 15:42:05 +0300 Subject: [PATCH 3/4] Update documentation/how-to/itinerary.en.md Co-authored-by: Matthias Kuhn --- documentation/how-to/itinerary.en.md | 1 - 1 file changed, 1 deletion(-) diff --git a/documentation/how-to/itinerary.en.md b/documentation/how-to/itinerary.en.md index e3c550a73..a81baf9e1 100644 --- a/documentation/how-to/itinerary.en.md +++ b/documentation/how-to/itinerary.en.md @@ -35,4 +35,3 @@ If you simply want to show your feature location in Google Maps, you can use the :material-tablet: Fieldwork Click on the feature on the map where you want navigation to or that you want to open in Google Maps. In the attribute form, click on the link towards Google Maps. - From 8d905b12748f0fda5fe58b2dc1cff3e98e56f9a3 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Tue, 12 Sep 2023 15:52:27 +0300 Subject: [PATCH 4/4] Update documentation/how-to/itinerary.en.md Co-authored-by: Matthias Kuhn --- documentation/how-to/itinerary.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/how-to/itinerary.en.md b/documentation/how-to/itinerary.en.md index a81baf9e1..bbed64071 100644 --- a/documentation/how-to/itinerary.en.md +++ b/documentation/how-to/itinerary.en.md @@ -16,7 +16,7 @@ Here is an example for navigation to features of a point layer. Create a new field in your data table (type text). In the attribute form settings, select "attachment" as widget type. Tick "Display a hyperlink for document path (read-only)". 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')),