Enlarge hover event triggering surface
This commit is contained in:
@@ -45,7 +45,18 @@ class Project extends PhpObject {
|
||||
* Selected Project [-------Project 1-------][------------Project 2-------------][---------------Project 3------------------
|
||||
* Mode --P--][--------B--------][--P--][-----------B---------------][---P---][-----B-----][---------H----------
|
||||
*/
|
||||
$sQuery = "SELECT MAX(id_project) FROM projects WHERE active_to = (SELECT MIN(active_to) FROM projects WHERE active_to > NOW() OR active_to = (SELECT MAX(active_to) FROM projects))";
|
||||
$sQuery =
|
||||
"SELECT MAX(id_project) ".
|
||||
"FROM projects ".
|
||||
"WHERE active_to = (".
|
||||
"SELECT MIN(active_to) ". //Select closest project in the future
|
||||
"FROM projects ".
|
||||
"WHERE active_to > NOW() ". //Select Next project
|
||||
"OR active_to = (". //In case there is no next project, select the last one
|
||||
"SELECT MAX(active_to) ".
|
||||
"FROM projects".
|
||||
")".
|
||||
")";
|
||||
$asResult = $this->oDb->getArrayQuery($sQuery, true);
|
||||
$this->iProjectId = array_shift($asResult);
|
||||
}
|
||||
|
||||
@@ -282,10 +282,14 @@ function initSpotMessages(aoMessages, aoTracks) {
|
||||
L.control.layers(aoLayers, null, {position: 'topleft'}).addTo(oMap);
|
||||
|
||||
//Tracks, colors & popup
|
||||
var oTracks = L.geoJson(aoTracks, {
|
||||
var oActualTracks = L.geoJson(aoTracks, {
|
||||
style: function(oTrack) {
|
||||
return self.tmp(['track-type-styles', oTrack.properties.type]);
|
||||
},
|
||||
}
|
||||
}).addTo(oMap);
|
||||
|
||||
var oTracks = L.geoJson(aoTracks, {
|
||||
style: {weight: 20, opacity: 0},
|
||||
onEachFeature: function(feature, oLayer) {
|
||||
var asProperties = feature.properties;
|
||||
var $Tooltip = $('<div>', {'class':'track_tooltip'});
|
||||
@@ -348,8 +352,9 @@ function initSpotMessages(aoMessages, aoTracks) {
|
||||
|
||||
oLayer
|
||||
.bindPopup($Tooltip[0])
|
||||
.on('mouseover', function(e) {console.log(e.target);
|
||||
e.target.getPopup().setLatLng(e.latlng).openOn(self.tmp('map'));
|
||||
.on('mouseover click', function(e) {
|
||||
var oLatLng = L.GeometryUtil.closest(self.tmp('map'), e.sourceTarget, e.latlng);
|
||||
e.target.getPopup().setLatLng(oLatLng).openOn(self.tmp('map'));
|
||||
|
||||
var asTrailMarkers = self.tmp(['trail-markers', e.target.feature.properties.name]);
|
||||
var oPointStart = self.tmp('map').latLngToLayerPoint(asTrailMarkers.start.getLatLng());
|
||||
|
||||
3
script/leaflet.min.js
vendored
3
script/leaflet.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user