Make multiple maps on one post possible by changing ids
This commit is contained in:
parent
c67c57effa
commit
d26917096a
1 changed files with 5 additions and 5 deletions
10
single.php
10
single.php
|
|
@ -78,16 +78,16 @@
|
||||||
<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'>
|
||||||
var map;
|
var single_map;
|
||||||
var map_center = {lat: <?php echo $location['lat'] ?>, lng: <?php echo $location['lng'] ?> };
|
var single_map_center = {lat: <?php echo $location['lat'] ?>, lng: <?php echo $location['lng'] ?> };
|
||||||
function initMap() {
|
function initMap() {
|
||||||
map = new google.maps.Map(document.getElementById('map-<?php echo $id ?>-single'), {
|
map = new google.maps.Map(document.getElementById('map-<?php echo $id ?>-single'), {
|
||||||
center: map_center,
|
center: single_map_center,
|
||||||
zoom: 15
|
zoom: 15
|
||||||
});
|
});
|
||||||
var marker = new google.maps.Marker({
|
var marker = new google.maps.Marker({
|
||||||
position: map_center,
|
position: single_map_center,
|
||||||
map: map
|
map: single_map
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue