diff --git a/masks/project.html b/masks/project.html index 41b306f..c1dcaca 100755 --- a/masks/project.html +++ b/masks/project.html @@ -43,7 +43,8 @@ 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'); $('#legend').find('.line').each(function(iKey, oLegend){ @@ -254,6 +255,8 @@ function initSpotMessages(aoMessages, aoTracks) { closeOnClick: true, offset: new L.Point(0, -30) }); + + oSpot.tmp(['markers', oMsg.id_message], oMarker); }); //Legend @@ -377,18 +380,23 @@ function getPost(asPost) { { case 'message': $Body = $('
').addIcon('fa-message', true).append(asPost.lat_dms+' '+asPost.lon_dms)) - .append($('
').addIcon('fa-time', true).append(sAbsTime+self.tmp('site_tz_notice')))
- .append(
- $('', {'class':'staticmap', title: 'Click pour zoomer', src: getStaticMapUrl(asPost.latitude, asPost.longitude)})
- .data('lat', asPost.latitude)
- .data('lng', asPost.longitude)
- .click(function(){
- var $This = $(this);
- var oCenter = L.latLng(parseFloat($This.data('lat')), parseFloat($This.data('lng')));
- self.tmp('map').setOffsetView(self.tmp('map_offset'), oCenter, 13);
- })
- );
+ .append($('
').addIcon('fa-message', true).append(asPost.lat_dms+' '+asPost.lon_dms)) + .append($('
').addIcon('fa-time', true).append(sAbsTime+self.tmp('site_tz_notice')))
+ .append(
+ $('', {'class':'staticmap', title: 'Click pour zoomer', src: getStaticMapUrl(asPost.latitude, asPost.longitude)})
+ .data('lat', asPost.latitude)
+ .data('lng', asPost.longitude)
+ .click(function(){
+ var $This = $(this);
+ 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 = $('
', {'src': asPost.thumb_path, title: 'Click pour zoomer'/*, 'style':'transform:rotate('+asPost.rotate+'deg);'*/});
diff --git a/todo b/todo
index ba81ca1..fad545e 100644
--- a/todo
+++ b/todo
@@ -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
\ No newline at end of file