hover on message (feed) triggers marker's popup
This commit is contained in:
@@ -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);'*/});
|
||||
|
||||
Reference in New Issue
Block a user