Enlarge hover event triggering surface
This commit is contained in:
1 parent
b2904b70a0
commit
76ee2f9ada
3 files changed
+24
-5
No files matched your search
+12
-1
@@ -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);
|
||||
}
|
||||
|
||||
+9
-4
@@ -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());
|
||||
|
||||
Vendored
+3
@@ -4,6 +4,9 @@
|
||||
*/
|
||||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";var i=Object.freeze;function h(t){var i,e,n,o;for(e=1,n=arguments.length;e<n;e++)for(i in o=arguments[e])t[i]=o[i];return t}Object.freeze=function(t){return t};var s=Object.create||function(t){return e.prototype=t,new e};function e(){}function a(t,i){var e=Array.prototype.slice;if(t.bind)return t.bind.apply(t,e.call(arguments,1));var n=e.call(arguments,2);return function(){return t.apply(i,n.length?n.concat(e.call(arguments)):arguments)}}var n=0;function u(t){return t._leaflet_id=t._leaflet_id||++n,t._leaflet_id}function o(t,i,e){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(e,o),o=!1)},s=function(){n?o=arguments:(t.apply(e,arguments),setTimeout(r,i),n=!0)}}function r(t,i,e){var n=i[1],o=i[0],s=n-o;return t===n&&e?t:((t-o)%s+s)%s+o}function l(){return!1}function c(t,i){var e=Math.pow(10,void 0===i?6:i);return Math.round(t*e)/e}function _(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function d(t){return _(t).split(/\s+/)}function p(t,i){for(var e in t.hasOwnProperty("options")||(t.options=t.options?s(t.options):{}),i)t.options[e]=i[e];return t.options}function m(t,i,e){var n=[];for(var o in t)n.push(encodeURIComponent(e?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(i&&-1!==i.indexOf("?")?"&":"?")+n.join("&")}var f=/\{ *([\w_-]+) *\}/g;function g(t,n){return t.replace(f,function(t,i){var e=n[i];if(void 0===e)throw new Error("No value provided for variable "+t);return"function"==typeof e&&(e=e(n)),e})}var v=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(t,i){for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1}var x="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function w(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var P=0;function b(t){var i=+new Date,e=Math.max(0,16-(i-P));return P=i+e,window.setTimeout(t,e)}var T=window.requestAnimationFrame||w("RequestAnimationFrame")||b,z=window.cancelAnimationFrame||w("CancelAnimationFrame")||w("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function M(t,i,e){if(!e||T!==b)return T.call(window,a(t,i));t.call(i)}function C(t){t&&z.call(window,t)}var E=(Object.freeze||Object)({freeze:i,extend:h,create:s,bind:a,lastId:n,stamp:u,throttle:o,wrapNum:r,falseFn:l,formatNum:c,trim:_,splitWords:d,setOptions:p,getParamString:m,template:g,isArray:v,indexOf:y,emptyImageUrl:x,requestFn:T,cancelFn:z,requestAnimFrame:M,cancelAnimFrame:C});function S(){}S.extend=function(t){function i(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var e=i.__super__=this.prototype,n=s(e);for(var o in(n.constructor=i).prototype=n,this)this.hasOwnProperty(o)&&"prototype"!==o&&"__super__"!==o&&(i[o]=this[o]);return t.statics&&(h(i,t.statics),delete t.statics),t.includes&&(function(t){if("undefined"==typeof L||!L||!L.Mixin)return;t=v(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}(t.includes),h.apply(null,[n].concat(t.includes)),delete t.includes),n.options&&(t.options=h(s(n.options),t.options)),h(n,t),n._initHooks=[],n.callInitHooks=function(){if(!this._initHooksCalled){e.callInitHooks&&e.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,i=n._initHooks.length;t<i;t++)n._initHooks[t].call(this)}},i},S.include=function(t){return h(this.prototype,t),this},S.mergeOptions=function(t){return h(this.prototype.options,t),this},S.addInitHook=function(t){var i=Array.prototype.slice.call(arguments,1),e="function"==typeof t?t:function(){this[t].apply(this,i)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(e),this};var Z={on:function(t,i,e){if("object"==typeof t)for(var n in t)this._on(n,t[n],i);else for(var o=0,s=(t=d(t)).length;o<s;o++)this._on(t[o],i,e);return this},off:function(t,i,e){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],i);else for(var o=0,s=(t=d(t)).length;o<s;o++)this._off(t[o],i,e);else delete this._events;return this},_on:function(t,i,e){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),e===this&&(e=void 0);for(var o={fn:i,ctx:e},s=n,r=0,a=s.length;r<a;r++)if(s[r].fn===i&&s[r].ctx===e)return;s.push(o)},_off:function(t,i,e){var n,o,s;if(this._events&&(n=this._events[t]))if(i){if(e===this&&(e=void 0),n)for(o=0,s=n.length;o<s;o++){var r=n[o];if(r.ctx===e&&r.fn===i)return r.fn=l,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,s=n.length;o<s;o++)n[o].fn=l;delete this._events[t]}},fire:function(t,i,e){if(!this.listens(t,e))return this;var n=h({},i,{type:t,target:this,sourceTarget:i&&i.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this.Line truncated
|
||||
|
||||
/*Leaflet.GeometryUtil - v0.9.1 - https://github.com/makinacorpus/Leaflet.GeometryUtil/blob/master/src/leaflet.geometryutil.js - */
|
||||
!function(t){var e;if("function"==typeof define&&define.amd)define(["leaflet"],t);else if("undefined"!=typeof module)e=require("leaflet"),module.exports=t(e);else{if(void 0===window.L)throw"Leaflet must be loaded first";t(window.L)}}(function(t){"use strict";return t.Polyline._flat=t.LineUtil.isFlat||t.Polyline._flat||function(e){return!t.Util.isArray(e[0])||"object"!=typeof e[0][0]&&void 0!==e[0][0]},t.GeometryUtil=t.extend(t.GeometryUtil||{},{distance:function(t,e,n){return t.latLngToLayerPoint(e).distanceTo(t.latLngToLayerPoint(n))},distanceSegment:function(e,n,r,a){var i=e.latLngToLayerPoint(n),o=e.latLngToLayerPoint(r),l=e.latLngToLayerPoint(a);return t.LineUtil.pointToSegmentDistance(i,o,l)},readableDistance:function(t,e){return"imperial"!==e?t>1e3?(t/1e3).toFixed(2)+" km":Math.ceil(t)+" m":(t*=1.09361)>1760?(t/1760).toFixed(2)+" miles":Math.ceil(t)+" yd"},belongsSegment:function(t,e,n,r){r=void 0===r?.2:r;var a=e.distanceTo(n);return(e.distanceTo(t)+t.distanceTo(n)-a)/a<r},length:function(e){var n=t.GeometryUtil.accumulatedLengths(e);return n.length>0?n[n.length-1]:0},accumulatedLengths:function(t){if("function"==typeof t.getLatLngs&&(t=t.getLatLngs()),0===t.length)return[];for(var e=0,n=[0],r=0,a=t.length-1;r<a;r++)e+=t[r].distanceTo(t[r+1]),n.push(e);return n},closestOnSegment:function(e,n,r,a){var i=e.getMaxZoom();i===1/0&&(i=e.getZoom());var o=e.project(n,i),l=e.project(r,i),s=e.project(a,i),c=t.LineUtil.closestPointOnSegment(o,l,s);return e.unproject(c,i)},closest:function(e,n,r,a){var i,o,l,s,c,u=1/0,g=null;if(n instanceof Array){if(n[0]instanceof Array&&"number"!=typeof n[0][0]){for(o=0;o<n.length;o++)(c=t.GeometryUtil.closest(e,n[o],r,a))&&c.distance<u&&(u=c.distance,g=c);return g}if(!(n[0]instanceof t.LatLng||"number"==typeof n[0][0]||"number"==typeof n[0].lat))return g;n=t.polyline(n)}if(!(n instanceof t.Polyline))return g;if(i=JSON.parse(JSON.stringify(n.getLatLngs().slice(0))),n instanceof t.Polygon){var f=function(e){if(t.Polyline._flat(e))e.push(e[0]);else for(var n=0;n<e.length;n++)f(e[n])};f(i)}if(t.Polyline._flat(i)){if(a){for(o=0,l=i.length;o<l;o++){var y=i[o];(s=t.GeometryUtil.distance(e,r,y))<u&&(u=s,(g=y).distance=s)}return g}for(o=0,l=i.length;o<l-1;o++){var L=i[o],h=i[o+1];(s=t.GeometryUtil.distanceSegment(e,r,L,h))<=u&&(u=s,(g=t.GeometryUtil.closestOnSegment(e,r,L,h)).distance=s)}return g}for(o=0;o<i.length;o++)(c=t.GeometryUtil.closest(e,i[o],r,a)).distance<u&&(u=c.distance,g=c);return g},closestLayer:function(e,n,r){for(var a=1/0,i=null,o=null,l=1/0,s=0,c=n.length;s<c;s++){var u=n[s];if(u instanceof t.LayerGroup){var g=t.GeometryUtil.closestLayer(e,u.getLayers(),r);g.distance<a&&(a=g.distance,i=g)}else"function"==typeof u.getLatLng?(o=u.getLatLng(),l=t.GeometryUtil.distance(e,r,o)):(o=t.GeometryUtil.closest(e,u,r))&&(l=o.distance),l<a&&(a=l,i={layer:u,latlng:o,distance:l})}return i},nClosestLayers:function(e,n,r,a){if((a="number"==typeof a?a:n.length)<1||n.length<1)return null;for(var i,o,l=[],s=0,c=n.length;s<c;s++){var u=n[s];if(u instanceof t.LayerGroup){var g=t.GeometryUtil.closestLayer(e,u.getLayers(),r);l.push(g)}else"function"==typeof u.getLatLng?(o=u.getLatLng(),i=t.GeometryUtil.distance(e,r,o)):(o=t.GeometryUtil.closest(e,u,r))&&(i=o.distance),l.push({layer:u,latlng:o,distance:i})}return l.sort(function(t,e){return t.distance-e.distance}),l.length>a?l.slice(0,a):l},layersWithin:function(e,n,r,a){a="number"==typeof a?a:1/0;for(var i=[],o=null,l=0,s=0,c=n.length;s<c;s++){var u=n[s];"function"==typeof u.getLatLng?(o=u.getLatLng(),l=t.GeometryUtil.distance(e,r,o)):(o=t.GeometryUtil.closest(e,u,r))&&(l=o.distance),o&&l<a&&i.push({layer:u,latlng:o,distance:l})}return i.sort(function(t,e){return t.distance-e.distance})},closestLayerSnap:function(e,n,r,a,i){a="number"==typeof a?a:1/0,i="boolean"!=typeof i||i;var o=t.GeometryUtil.closestLayer(e,n,r);if(!o||o.distance>a)return null;if(i&&"function"==typeof o.layer.getLatLngs){var l=t.GeometryUtil.closest(e,o.layer,o.latlng,!0);l.distance<a&&(o.latlng=l,o.distance=t.GeometryUtil.distance(e,l,r))}return o},interpolateOnPointSegment:function(e,n,r){return t.point(e.x*(1-r)+r*n.x,e.y*(1-r)+r*n.y)},interpolateOnLine:function(e,n,r){var a=(n=n instanceof t.Polyline?n.getLatLngs():n).length;if(a<2)return null;if(0===(r=Math.max(Math.min(r,1),0)))return{latLng:n[0]instanceof t.LatLng?n[0]:t.latLng(n[0]),predecessor:-1};if(1==r)return{latLng:n[n.length-1]instanceof t.LatLng?n[n.length-1]:t.latLng(n[n.length-1]),predecessor:n.length-2};var i=e.getMaxZoom();i===1/0&&(i=e.getZoom());for(var o=[],l=0,s=0;s<a;s++)o[s]=e.project(n[s],i),s>0&&(l+=o[s-1].distanceTo(o[s]));var c=l*r,u=0,g=0;for(s=0;g<c;s++){var f=o[s],y=o[s+1];u=g,g+=f.distanceTo(y)}if(null==f&&null==y)f=o[0],y=o[1],s=1;var L=g-u!=0?(c-u)/(g-u):0,h=t.GeometryUtil.interpolateOnPointSegment(f,y,L);return{latLng:e.unproject(h,i),predecessor:s-1}},locateOnLine:function(e,n,r){var a=n.getLatLngs();if(r.equals(a[0]))return 0;if(r.equals(a[a.length-1]))return 1;for(var i=t.GeometryULine truncated
|
||||
|
||||
/* Additional Leaflet functions */
|
||||
L.Map.include({
|
||||
setOffsetView: function (iOffsetRatioX, oCenter, iZoomLevel) {
|
||||
|
||||
Reference in new issue
Block a user