forked from vincent3569/zpBootstrap
/
inc_print_googlemap.php
46 lines (44 loc) · 1.63 KB
/
inc_print_googlemap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php if (getOption('gmap_display') == 'colorbox') { ?>
<div class="alert alert-danger"><?php echo gettext_th('The theme doesn\'t support colorbox option for googlemap plugin.'); ?></div>
<?php } else {
$hasAlbumGeodata = false;
$album = $_zp_current_album;
$images = $album->getImages();
foreach ($images as $an_image) {
$image = Image::newImage($album, $an_image);
$exif = $image->getMetaData();
if ((!empty($exif['EXIFGPSLatitude'])) && (!empty($exif['EXIFGPSLongitude']))) {
$hasAlbumGeodata = true; // at least one image has geodata
}
}
// display map only if they are geodata
if ($hasAlbumGeodata == true) {
if (getOption('gmap_display') == 'hide') {
$gmap_display = 'gmap_hide';
} else if (getOption('gmap_display') == 'show') {
$gmap_display = 'gmap_show';
}
?>
<div id="gmap_accordion" class="panel-group" role="tablist">
<div class="panel panel-default">
<div id="gmap_heading" class="panel-heading" role="tab">
<h4 class="panel-title">
<a id="<?php echo $gmap_display; ?>" data-toggle="collapse" data-parent="#gmap_accordion" href="#gmap_collapse_data">
<span class="glyphicon glyphicon-map-marker"></span> <?php echo gettext('Google Map'); ?>
</a>
</h4>
</div>
</div>
<?php printGoogleMap('', 'gmap_collapse'); ?>
<script type="text/javascript">
//<![CDATA[
;$('#gmap_collapse_data').on('show.bs.collapse', function () {
$('.hidden_map').removeClass('hidden_map');
})
//]]>
</script>
</div>
<?php
}
}
?>