Add altitude on image

This commit is contained in:
2023-10-15 18:33:36 +02:00
parent 5f597647b4
commit b3cd217e28
6 changed files with 20 additions and 11 deletions

View File

@@ -76,7 +76,7 @@ class Media extends PhpObject {
if($bOwnMedia && empty($this->asMedia) || !$bOwnMedia && empty($this->asMedias) || $bConstraintArray) {
if($this->oProject->getProjectId()) {
$asParams = array(
'select' => array(Db::getId(self::MEDIA_TABLE), 'filename', 'taken_on', 'posted_on', 'timezone', 'latitude', 'longitude', 'width', 'height', 'rotate', 'type AS subtype', 'comment'),
'select' => array(Db::getId(self::MEDIA_TABLE), 'filename', 'taken_on', 'posted_on', 'timezone', 'latitude', 'longitude', 'altitude', 'width', 'height', 'rotate', 'type AS subtype', 'comment'),
'from' => self::MEDIA_TABLE,
'constraint'=> array(Db::getId(Project::PROJ_TABLE) => $this->oProject->getProjectId())
);
@@ -128,9 +128,9 @@ class Media extends PhpObject {
'taken_on' => date(Db::TIMESTAMP_FORMAT, ($asMediaInfo['taken_ts'] > 0)?$asMediaInfo['taken_ts']:$asMediaInfo['file_ts']),
'posted_on' => date(Db::TIMESTAMP_FORMAT, $asMediaInfo['file_ts']),
'timezone' => $asMediaInfo['timezone'],
'latitude' => $asMediaInfo['latitude'],
'longitude' => $asMediaInfo['longitude'],
'altitude' => $asMediaInfo['altitude'],
'latitude' => is_null($asMediaInfo['latitude'])?'NULL':$asMediaInfo['latitude'],
'longitude' => is_null($asMediaInfo['longitude'])?'NULL':$asMediaInfo['longitude'],
'altitude' => is_null($asMediaInfo['altitude'])?'NULL':$asMediaInfo['altitude'],
'width' => $asMediaInfo['width'],
'height' => $asMediaInfo['height'],
'rotate' => $asMediaInfo['rotate'],
@@ -160,9 +160,9 @@ class Media extends PhpObject {
$iHeight = 0;
$sRotate = '0';
$sTakenOn = '';
$fLat = 0;
$fLng = 0;
$iAlt = 0;
$fLat = null;
$fLng = null;
$iAlt = null;
switch($sType) {
case 'video':
$asResult = array();

View File

@@ -756,7 +756,7 @@ function addMediaMarkers(aoMedias) {
var oMarker = L.marker(L.latLng(oMedia.latitude, oMedia.longitude), {
id: oMedia.id_media,
riseOnHover: true,
icon: getDivIcon(oMedia.subtype+' fa-rotate-270')
icon: getDivIcon(oMedia.subtype)
}).addTo(self.tmp('map'));
//Tooltip
@@ -777,6 +777,13 @@ function addMediaMarkers(aoMedias) {
.append(oSpot.lang('local_time', getRelativeTime(oMedia.formatted_time_local, oMedia.day_offset))));
}
//Tooltip: Altitude
if(oMedia.altitude) {
$Tooltip.append($('<p>', {'class':'altitude'})
.addIcon('fa-altitude fa-fw fa-lg', true)
.append(oMedia.altitude+'m'));
}
$Tooltip.data('medias', [oMedia]);
oSpot.tmp(['marker-media-tooltips', oMedia.id_media], $Tooltip);

View File

@@ -3,6 +3,7 @@
## Dependencies
* php-mbstring
* php-imagick
* php-gd
* php-mysql
* php-exif
* ffprobe & ffmpeg
@@ -27,4 +28,4 @@
* Use WMTS servers directly when not using Geo Caching Server
* Allow HEIF picture format
* Vector tiles support (https://www.arcgis.com/home/item.html?id=7dc6cea0b1764a1f9af2e679f642f0f5) + Use of GL library. Use Mapbox GL JS / Maplibre GL JS / ESRI-Leaflet-vector?
* Fix .MOV playback on firefox
* Fix .MOV playback on windows firefox

View File

@@ -88,6 +88,7 @@ $fa-css-prefix: fa;
.#{$fa-css-prefix}-message-in:before { content: fa-content($fa-var-shoe-prints); }
.#{$fa-css-prefix}-time:before { content: fa-content($fa-var-clock); }
.#{$fa-css-prefix}-coords:before { content: fa-content($fa-var-compass); }
.#{$fa-css-prefix}-altitude:before { content: fa-content($fa-var-mountain); }
.#{$fa-css-prefix}-drill-video:before { content: fa-content($fa-var-play-circle); }
.#{$fa-css-prefix}-drill-image:before { content: fa-content($fa-var-search); }
.#{$fa-css-prefix}-drill-message:before { content: fa-content($fa-var-search-location); }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long