Add google map
This commit is contained in:
parent
f5c2377d6b
commit
6aa207d3d6
1 changed files with 20 additions and 1 deletions
21
single.php
21
single.php
|
|
@ -66,7 +66,26 @@
|
|||
<td><?php $ab = get_field( 'abreise' ); echo(substr($ab,6,2).'.'.substr($ab,4,2).'.'.substr($ab,0,4)) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php $location = get_field( 'ort' ); ?>
|
||||
|
||||
<h6>Location: <small><?php echo round( $location['lat'], 4 ) ?>, <?php echo round( $location['lng'], 4 ) ?></small></h6>
|
||||
|
||||
<div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>'></div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
var map;
|
||||
var map_center = {lat: <?php echo $location['lat'] ?>, lng: <?php echo $location['lng'] ?> };
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map-<?php echo $id ?>'), {
|
||||
center: map_center,
|
||||
zoom: 15
|
||||
});
|
||||
var marker = new google.maps.Marker({
|
||||
position: map_center,
|
||||
map: map
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
$args = array(
|
||||
'before' => '<div class="page-links"><span class="title">' . __( 'Pages:','hitchcock' ) . '</span>',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue