hover on message (feed) triggers marker's popup

This commit is contained in:
2019-02-07 19:35:03 +01:00
parent 0a9188ca2a
commit 85774935c6
2 changed files with 21 additions and 14 deletions

View File

@@ -43,6 +43,7 @@ function initPage(asHash) {
self.tmp('feed_width', $('#feed').outerWidth(true));
self.tmp('map_offset', -1 * self.tmp('feed_width') / $('body').outerWidth(true));
self.tmp('tile_api', '?a=tile&id={id}&z={z}&x={x}&y={y}');
self.tmp('markers', 'object');
//Assign Track Type Colors
self.tmp('track-type-styles', 'object');
@@ -254,6 +255,8 @@ function initSpotMessages(aoMessages, aoTracks) {
closeOnClick: true,
offset: new L.Point(0, -30)
});
oSpot.tmp(['markers', oMsg.id_message], oMarker);
});
//Legend
@@ -388,7 +391,12 @@ function getPost(asPost) {
var oCenter = L.latLng(parseFloat($This.data('lat')), parseFloat($This.data('lng')));
self.tmp('map').setOffsetView(self.tmp('map_offset'), oCenter, 13);
})
);
)
.data('id', asPost.id_message)
.hover(function(){
var oMarker = oSpot.tmp(['markers', $(this).data('id')]);
if(oSpot.tmp('map').getBounds().contains(oMarker.getLatLng())) oMarker.togglePopup();
});
break;
case 'picture':
var $Image = $('<img>', {'src': asPost.thumb_path, title: 'Click pour zoomer'/*, 'style':'transform:rotate('+asPost.rotate+'deg);'*/});

1
todo
View File

@@ -3,5 +3,4 @@ To Do List
- Elevation chart
- Device/Spot Class
- Replace all images with FA icons
- on hover sur message : open popup on map (check zoom)
- on hover on relative time: display absolute time