Check for nan in lat

This commit is contained in:
Markus Ankenbrand 2024-10-29 22:56:09 +01:00
parent f8f75ae653
commit d6abc8d5a5

View file

@ -75,7 +75,7 @@
<?php endif; ?> <?php endif; ?>
<?php $location = get_field( 'ort' ); ?> <?php $location = get_field( 'ort' ); ?>
<?php $locations = get_field( 'orte' ); ?> <?php $locations = get_field( 'orte' ); ?>
<?php if ( $location && (!$locations || count($locations)==0) ) : ?> <?php if ( $location && (!$locations || count($locations)==0 || is_nan($locations[0]['lat'])) ) : ?>
<div class="post-meta"> <div class="post-meta">
<div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-single'></div> <div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-single'></div>
<script type='text/javascript'> <script type='text/javascript'>
@ -94,7 +94,7 @@
</script> </script>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ( $locations && count($locations)>0 ) : ?> <?php if ( $locations && count($locations)>0 && !is_nan($locations[0]['lat'])) : ?>
<div class="post-meta"> <div class="post-meta">
<div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-multiple'></div> <div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-multiple'></div>
<script type='text/javascript'> <script type='text/javascript'>