Information about Google Maps URL syntax is given here How do I link to Google Maps with a particular longitude and latitude? to create a direct link based on Latitude and Longitude. The URL must contain both /
and @
symbols.
My Laravel Blade code
<a href="https://www.google.com/maps/search/?api=1&query={{ $country->lat }},{{ $country->long }}/@{{ $country->lat }},{{ $country->long }},5z" target="_blank">
My Desired Output
https://www.google.com/maps/search/33.93911000,67.70995300/@33.93911000,67.70995300,5z
I have 3 problems, but I suspect that they are related.
- The
/
is making the URL, but gets updated and encoded as%2F
- The
@
is acting strangely, but@@
will display a single@
- The blade variable is printing on screen and failing to be interpreted.
My Actual Output
https://www.google.com/maps/search/?api=1&query=33.93911000,67.70995300/@{{ $country->lat}},67.70995300,5z
How do I display these two symbols as-is and display the interpreted variable?