iFrame GMaps

-photo-du-mois.php
This commit is contained in:
2022-04-03 07:37:21 +02:00
parent 36eb1fadf9
commit 01ee106fcf
5 changed files with 115 additions and 39 deletions

View File

@@ -15,20 +15,19 @@
#map{
width: 100%;
height: 400px;
}
}
#mapCanvas {
width: 100%;
height: 650px;
}
</style>
<?php include 'functions.php';
$domain = 'sentier';
localize($domain);
?>
<script src='https://code.jquery.com/jquery-3.2.1.min.js'></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB7cAx3NSH4dPM3Sx2oQeud7Zr-KaGXmLk"></script>
<?php include 'functions.php';
$domain = 'sentier';
localize($domain);
?>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBhi566YKgkoys4UAInAeNkU1pkz4JU9I8"></script>
<script src='https://code.jquery.com/jquery-3.2.1.min.js'></script>
</head>
@@ -56,25 +55,38 @@ localize($domain);
}
?>
<div id="mapCanvas"></div>
<script>
<script>
function initMap() {
var map;
var bounds = new google.maps.LatLngBounds();
var mapOptions = {
mapTypeId: 'roadmap'
// Nous définissons le type de carte (ici carte routière)
mapTypeId: 'roadmap',
// Nous activons les options de contrôle de la carte (plan, satellite...)
mapTypeControl: true,
mapTypeControlOptions: {
// Position de Plan|Satellite
position: google.maps.ControlPosition.TOP_LEFT,
// Cette option sert à définir comment les options se placent
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
zoomControl: true,
zoomControlOptions: {
position: google.maps.ControlPosition.RIGHT_CENTER,
}
};
// Display a map on the web page
map = new google.maps.Map(document.getElementById("mapCanvas"), mapOptions);
map.setTilt(100);
map.setTilt(100); //
// Multiple markers location, latitude, and longitude
var markers = [
<?php
$a = "";
for( $i = 0; $i < $rowcount; $i++) {
// '4 => icons'
$a .= '["'.$result[$i]['filename'].'", '.$result[$i]['lat'].', '.$result[$i]['long'].'],' . "\r\n";
}
$a = substr_replace($a, '', -3, 1);
@@ -87,24 +99,10 @@ localize($domain);
<?php
$b = "";
for( $i = 0; $i < $rowcount; $i++) {
/*
$thumb = host() . str_replace("photos/img", "photos/thumb", $result[$i]['filename']);
$keywords = str_replace(',', " \u{30FB} ", clean_keywords($result[$i]['keywords']));
$title = $result[$i]['title'];
$legende = $result[$i]['legende'];
$file = basename($result[$i]['filename']);
if (!empty($title)) $x = $title;
elseif (!empty($legende)) $x= $legende;
else $x = $file;
$big = host() . $result[$i]['filename'];
*/
//$tab = array();
//$tab = $result[$i];
//_pr($result[$i]);
$lb = data_for_lightbox($result[$i]);
$b .= '[\'<div class="info_content"><h3>' . htmlspecialchars($lb['title_thumb']) . '</h3><div class="gm_thumb"><a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['title']) . '" data-lcl-author="' . htmlspecialchars($lb['exif']) . '"><img src="' . $lb['thumb'] . '" /></a></div><p>' . htmlspecialchars($lb['title']) . '</p><p>' . htmlspecialchars($lb['legende']) . '</p><p>' . htmlspecialchars($lb['keywords']) . '</p></div>\'],' . "\r\n";
$b .= '[\'<div class="info_content"><h3>' . htmlspecialchars($lb['title_thumb'], ENT_QUOTES) . '</h3><div class="gm_thumb"><a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title'], ENT_QUOTES) . '" data-lcl-txt="' . htmlspecialchars($lb['title'], ENT_QUOTES) . '" data-lcl-author="' . htmlspecialchars($lb['exif'], ENT_QUOTES) . '"><img src="' . $lb['thumb'] . '" /></a></div><p>' . htmlspecialchars($lb['title'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['legende'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['keywords'], ENT_QUOTES) . '</p></div>\'],' . "\r\n";
}
$b = substr_replace($b, '', -3, 1);
echo $b;
@@ -149,7 +147,11 @@ localize($domain);
// Load initialize function
google.maps.event.addDomListener(window, 'load', initMap);
</script>
</script>
<div id="mapCanvas"></div>
<script type='text/javascript'>
$(document).ready(function() {
@@ -177,12 +179,12 @@ localize($domain);
});
</script>
<p class="navPage"><a href="index.php"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php"><?php echo gettext("Picture of the month"); ?></a></p>
<p class="navPage"><a href="index.php"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php"><?php echo gettext("Picture of the month"); ?></a></p>
<p><em><small>@sur-le-sentier.fr 2022</small></em></p>
<script src='js/lc_lightbox.min.js'></script>
<script src='js/alloy_finger.min.js'></script>
<p><em><small>@sur-le-sentier.fr 2022</small></em></p>
<script src='js/lc_lightbox.min.js'></script>
<script src='js/alloy_finger.min.js'></script>
</body>