Skip to content

Commit

Permalink
updates Google Maps directions URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
ebellempire committed Jan 2, 2024
1 parent ee6ea49 commit 8535aed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions curatescape-echo/custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ function rl_story_map_single($title=null, $location=null, $address=null, $hero_i
<figcaption><?php echo rl_map_caption();?></figcaption>
</figure>
<div id="map-actions">
<a class="button directions" target="_blank" rel="noopener" href="https://maps.google.com/maps?location&daddr=<?php echo $address ? urlencode(strip_tags($address)) : $location[ 'latitude' ].','.$location[ 'longitude' ];?>">
<a class="button directions" target="_blank" rel="noopener" href="https://www.google.com/maps/dir/?api=1&destination=<?php echo $address ? urlencode(strip_tags($address)) : $location[ 'latitude' ].','.$location[ 'longitude' ];?>">
<?php echo rl_icon("logo-google", null);?>
<span class="label">
<?php echo __('Open in Google Maps');?></span>
Expand Down Expand Up @@ -1201,7 +1201,7 @@ function rl_official_website($item='item')
function rl_street_address($item='item')
{
if (element_exists('Item Type Metadata', 'Street Address') && $address=metadata($item, array('Item Type Metadata','Street Address'))) {
$map_link='<a target="_blank" rel="noopener" href="https://maps.google.com/maps?saddr=current+location&daddr='.urlencode(strip_tags($address)).'">map</a>';
$map_link='<a target="_blank" rel="noopener" href="https://www.google.com/maps/dir/?api=1&destination='.urlencode(strip_tags($address)).'">map</a>';
return $address ? $address : null;
} else {
return null;
Expand Down

0 comments on commit 8535aed

Please sign in to comment.