We need an Orbeon form to do the following:
- Import the Northing/Easting values from the source app (we know how to do this)
- Convert these Northing/Easting to Lat/Long via an API (e.g. https://api.getthedata.com/bng2latlong/429101/624009)
- Receive the Lat/Long values from the API
- Construct a Google Maps URL (e.g. https://www.google.com/maps/search/?api=1&query=54.63391%2C-3.20624)
I'm stuck with how to pass the Northing/Easting into the API, and how to extract the Lat/Long from the returned data (see test form https://demo.orbeon.com/demo/fr/orbeon/builder/edit/41dfb267bb328e5e40037c0ce049bd13d947cc9b)
Any help would be greatly received.
Many thanks.
PeteA
You were almost there. I think the main thing is that URL parameters in the HTTP service editor are for things that end up as
?easting=429157&northing=623009in the URL, but you want to have those values as part of the path, as in/429157/623009. To do this, you need to use the following expression for the URL, which uses value templates, and thefr:control-string-value()function (doc), which results in the following URL.I have also updated your form on demo with those changes.