trying to get datepicker working but enable setting start date #93

This commit is contained in:
Nabeel Shahzad
2017-12-30 12:03:45 -06:00
parent 3fe3946e29
commit becd988343
13 changed files with 22003 additions and 24616 deletions

40
package-lock.json generated
View File

@@ -2,6 +2,9 @@
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"Leaflet.Geodesic": {
"version": "git+https://git@github.com/henrythasler/Leaflet.Geodesic.git#c5dd6d6a0ee394d0c274d2a3a09d69a11fc11b8b"
},
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
@@ -1195,6 +1198,19 @@
"hoek": "2.16.3"
}
},
"bootstrap": {
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.3.7.tgz",
"integrity": "sha1-WjiTlFSfIzMIdaOxUGVldPip63E="
},
"bootstrap-datepicker": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/bootstrap-datepicker/-/bootstrap-datepicker-1.7.1.tgz",
"integrity": "sha1-Tuf680iI2+x4NPv52+fEJ34B3a8=",
"requires": {
"jquery": "3.2.1"
}
},
"bootstrap-sass": {
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/bootstrap-sass/-/bootstrap-sass-3.3.7.tgz",
@@ -2772,6 +2788,17 @@
"tapable": "0.2.8"
}
},
"eonasdan-bootstrap-datetimepicker": {
"version": "4.17.47",
"resolved": "https://registry.npmjs.org/eonasdan-bootstrap-datetimepicker/-/eonasdan-bootstrap-datetimepicker-4.17.47.tgz",
"integrity": "sha1-ekmXAEQGUnbnll79Fvgic1IZ5zU=",
"requires": {
"bootstrap": "3.3.7",
"jquery": "3.2.1",
"moment": "2.20.1",
"moment-timezone": "0.4.1"
}
},
"errno": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz",
@@ -6270,6 +6297,19 @@
"minimist": "0.0.8"
}
},
"moment": {
"version": "2.20.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.20.1.tgz",
"integrity": "sha512-Yh9y73JRljxW5QxN08Fner68eFLxM5ynNOAw2LbIB1YAGeQzZT8QFSUvkAz609Zf+IHhhaUxqZK8dG3W/+HEvg=="
},
"moment-timezone": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.4.1.tgz",
"integrity": "sha1-gfWYw61eIs2teWtn7NjYjQ9bqgY=",
"requires": {
"moment": "2.20.1"
}
},
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",

View File

@@ -15,6 +15,7 @@
"bootstrap-sass": "^3.3.7",
"bootstrap3": "^3.3.5",
"cross-env": "^5.1.3",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
"icheck": "^1.0.2",
"jquery": "^3.2.1",
"laravel-mix": "^1.0",
@@ -22,6 +23,7 @@
"leaflet-ajax": "2.1.0",
"leaflet-rotatedmarker": "^0.2.0",
"lodash": "4.17.4",
"moment": "^2.20.1",
"pjax": "^0.2.4",
"popper.js": "^1.13.0",
"rivets": "0.9.6",

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,735 +0,0 @@
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg,
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer {
max-width: none !important;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane {
z-index: 400;
}
.leaflet-tile-pane {
z-index: 200;
}
.leaflet-overlay-pane {
z-index: 400;
}
.leaflet-shadow-pane {
z-index: 500;
}
.leaflet-marker-pane {
z-index: 600;
}
.leaflet-tooltip-pane {
z-index: 650;
}
.leaflet-popup-pane {
z-index: 700;
}
.leaflet-map-pane canvas {
z-index: 100;
}
.leaflet-map-pane svg {
z-index: 200;
}
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-tile {
will-change: opacity;
}
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0, 0, 0.25, 1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0, 0, 0.25, 1);
-o-transition: -o-transform 0.25s cubic-bezier(0, 0, 0.25, 1);
transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline: 0;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-container a.leaflet-active {
outline: 2px solid orange;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255, 255, 255, 0.5);
}
/* general typography */
.leaflet-container {
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
border-radius: 4px;
}
.leaflet-bar a,
.leaflet-bar a:hover {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path {
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.7);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover {
text-decoration: underline;
}
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale {
font-size: 11px;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
white-space: nowrap;
overflow: hidden;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
background: rgba(255, 255, 255, 0.5);
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0, 0, 0, 0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 19px;
line-height: 1.4;
}
.leaflet-popup-content p {
margin: 18px 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
padding: 4px 4px 0 0;
border: none;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma, Verdana, sans-serif;
color: #c3c3c3;
text-decoration: none;
font-weight: bold;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover {
color: #999;
}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-popup-tip-container {
margin-top: -1px;
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.leaflet-tooltip.leaflet-clickable {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}

Binary file not shown.

10253
public/assets/system/js/jquery.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -39766,6 +39766,555 @@ module.exports = (function() {
},{}]},{},[1])
(1)
});
"use strict";
// This file is part of Leaflet.Geodesic.
// Copyright (C) 2017 Henry Thasler
// based on code by Chris Veness Copyright (C) 2014 https://github.com/chrisveness/geodesy
//
// Leaflet.Geodesic is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Leaflet.Geodesic is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Leaflet.Geodesic. If not, see <http://www.gnu.org/licenses/>.
/** Extend Number object with method to convert numeric degrees to radians */
if (typeof Number.prototype.toRadians === "undefined") {
Number.prototype.toRadians = function() {
return this * Math.PI / 180
}
}
/** Extend Number object with method to convert radians to numeric (signed) degrees */
if (typeof Number.prototype.toDegrees === "undefined") {
Number.prototype.toDegrees = function() {
return this * 180 / Math.PI
}
}
const INTERSECT_LNG = 179.999 // Lng used for intersection and wrap around on map edges
L.Geodesic = L.Polyline.extend({
options: {
color: "blue",
steps: 10,
dash: 1,
wrap: true
},
initialize: function(latlngs, options) {
this.options = this._merge_options(this.options, options)
this.datum = {}
this.datum.ellipsoid = {
a: 6378137,
b: 6356752.3142,
f: 1 / 298.257223563
} // WGS-84
this._latlngs = (this.options.dash < 1) ? this._generate_GeodesicDashed(
latlngs) : this._generate_Geodesic(latlngs)
L.Polyline.prototype.initialize.call(this, this._latlngs, this.options)
},
setLatLngs: function(latlngs) {
this._latlngs = (this.options.dash < 1) ? this._generate_GeodesicDashed(
latlngs) : this._generate_Geodesic(latlngs)
L.Polyline.prototype.setLatLngs.call(this, this._latlngs)
},
/**
* Calculates some statistic values of current geodesic multipolyline
* @returns (Object} Object with several properties (e.g. overall distance)
*/
getStats: function() {
let obj = {
distance: 0,
points: 0,
polygons: this._latlngs.length
},
poly, points
for (poly = 0; poly < this._latlngs.length; poly++) {
obj.points += this._latlngs[poly].length
for (points = 0; points < (this._latlngs[poly].length - 1); points++) {
obj.distance += this._vincenty_inverse(this._latlngs[poly][points],
this._latlngs[poly][points + 1]).distance
}
}
return obj
},
/**
* Creates geodesic lines from geoJson. Replaces all current features of this instance.
* Supports LineString, MultiLineString and Polygon
* @param {Object} geojson - geosjon as object.
*/
geoJson: function(geojson) {
let normalized = L.GeoJSON.asFeature(geojson)
let features = normalized.type === "FeatureCollection" ? normalized.features : [
normalized
]
this._latlngs = []
for (let feature of features) {
let geometry = feature.type === "Feature" ? feature.geometry :
feature,
coords = geometry.coordinates
switch (geometry.type) {
case "LineString":
this._latlngs.push(this._generate_Geodesic([L.GeoJSON.coordsToLatLngs(
coords, 0)]))
break
case "MultiLineString":
case "Polygon":
this._latlngs.push(this._generate_Geodesic(L.GeoJSON.coordsToLatLngs(
coords, 1)))
break
case "Point":
case "MultiPoint":
console.log("Dude, points can't be drawn as geodesic lines...")
break
default:
console.log("Drawing " + geometry.type +
" as a geodesic is not supported. Skipping...")
}
}
L.Polyline.prototype.setLatLngs.call(this, this._latlngs)
},
/**
* Creates a great circle. Replaces all current lines.
* @param {Object} center - geographic position
* @param {number} radius - radius of the circle in metres
*/
createCircle: function(center, radius) {
let polylineIndex = 0
let prev = {
lat: 0,
lng: 0,
brg: 0
}
let step
this._latlngs = []
this._latlngs[polylineIndex] = []
let direct = this._vincenty_direct(L.latLng(center), 0, radius, this.options
.wrap)
prev = L.latLng(direct.lat, direct.lng)
this._latlngs[polylineIndex].push(prev)
for (step = 1; step <= this.options.steps;) {
direct = this._vincenty_direct(L.latLng(center), 360 / this.options
.steps * step, radius, this.options.wrap)
let gp = L.latLng(direct.lat, direct.lng)
if (Math.abs(gp.lng - prev.lng) > 180) {
let inverse = this._vincenty_inverse(prev, gp)
let sec = this._intersection(prev, inverse.initialBearing, {
lat: -89,
lng: ((gp.lng - prev.lng) > 0) ? -INTERSECT_LNG : INTERSECT_LNG
}, 0)
if (sec) {
this._latlngs[polylineIndex].push(L.latLng(sec.lat, sec.lng))
polylineIndex++
this._latlngs[polylineIndex] = []
prev = L.latLng(sec.lat, -sec.lng)
this._latlngs[polylineIndex].push(prev)
} else {
polylineIndex++
this._latlngs[polylineIndex] = []
this._latlngs[polylineIndex].push(gp)
prev = gp
step++
}
} else {
this._latlngs[polylineIndex].push(gp)
prev = gp
step++
}
}
L.Polyline.prototype.setLatLngs.call(this, this._latlngs)
},
/**
* Creates a geodesic Polyline from given coordinates
* @param {Object} latlngs - One or more polylines as an array. See Leaflet doc about Polyline
* @returns (Object} An array of arrays of geographical points.
*/
_generate_Geodesic: function(latlngs) {
let _geo = [],
_geocnt = 0,
s, poly, points, pointA, pointB
for (poly = 0; poly < latlngs.length; poly++) {
_geo[_geocnt] = []
for (points = 0; points < (latlngs[poly].length - 1); points++) {
pointA = L.latLng(latlngs[poly][points])
pointB = L.latLng(latlngs[poly][points + 1])
if (pointA.equals(pointB)) {
continue;
}
let inverse = this._vincenty_inverse(pointA, pointB)
let prev = pointA
_geo[_geocnt].push(prev)
for (s = 1; s <= this.options.steps;) {
let direct = this._vincenty_direct(pointA, inverse.initialBearing,
inverse.distance / this.options.steps * s, this.options.wrap
)
let gp = L.latLng(direct.lat, direct.lng)
if (Math.abs(gp.lng - prev.lng) > 180) {
let sec = this._intersection(pointA, inverse.initialBearing, {
lat: -89,
lng: ((gp.lng - prev.lng) > 0) ? -INTERSECT_LNG : INTERSECT_LNG
}, 0)
if (sec) {
_geo[_geocnt].push(L.latLng(sec.lat, sec.lng))
_geocnt++
_geo[_geocnt] = []
prev = L.latLng(sec.lat, -sec.lng)
_geo[_geocnt].push(prev)
} else {
_geocnt++
_geo[_geocnt] = []
_geo[_geocnt].push(gp)
prev = gp
s++
}
} else {
_geo[_geocnt].push(gp)
prev = gp
s++
}
}
}
_geocnt++
}
return _geo
},
/**
* Creates a dashed geodesic Polyline from given coordinates - under work
* @param {Object} latlngs - One or more polylines as an array. See Leaflet doc about Polyline
* @returns (Object} An array of arrays of geographical points.
*/
_generate_GeodesicDashed: function(latlngs) {
let _geo = [],
_geocnt = 0,
s, poly, points
// _geo = latlngs; // bypass
for (poly = 0; poly < latlngs.length; poly++) {
_geo[_geocnt] = []
for (points = 0; points < (latlngs[poly].length - 1); points++) {
let inverse = this._vincenty_inverse(L.latLng(latlngs[poly][
points
]), L.latLng(latlngs[poly][points + 1]))
let prev = L.latLng(latlngs[poly][points])
_geo[_geocnt].push(prev)
for (s = 1; s <= this.options.steps;) {
let direct = this._vincenty_direct(L.latLng(latlngs[poly][
points
]), inverse.initialBearing, inverse.distance / this.options
.steps * s - inverse.distance / this.options.steps * (1 -
this.options.dash), this.options.wrap)
let gp = L.latLng(direct.lat, direct.lng)
if (Math.abs(gp.lng - prev.lng) > 180) {
let sec = this._intersection(L.latLng(latlngs[poly][points]),
inverse.initialBearing, {
lat: -89,
lng: ((gp.lng - prev.lng) > 0) ? -INTERSECT_LNG : INTERSECT_LNG
}, 0)
if (sec) {
_geo[_geocnt].push(L.latLng(sec.lat, sec.lng))
_geocnt++
_geo[_geocnt] = []
prev = L.latLng(sec.lat, -sec.lng)
_geo[_geocnt].push(prev)
} else {
_geocnt++
_geo[_geocnt] = []
_geo[_geocnt].push(gp)
prev = gp
s++
}
} else {
_geo[_geocnt].push(gp)
_geocnt++
let direct2 = this._vincenty_direct(L.latLng(latlngs[poly][
points
]), inverse.initialBearing, inverse.distance / this.options
.steps * s, this.options.wrap)
_geo[_geocnt] = []
_geo[_geocnt].push(L.latLng(direct2.lat, direct2.lng))
s++
}
}
}
_geocnt++
}
return _geo
},
/**
* Vincenty direct calculation.
* based on the work of Chris Veness (https://github.com/chrisveness/geodesy)
*
* @private
* @param {number} initialBearing - Initial bearing in degrees from north.
* @param {number} distance - Distance along bearing in metres.
* @returns (Object} Object including point (destination point), finalBearing.
*/
_vincenty_direct: function(p1, initialBearing, distance, wrap) {
var φ1 = p1.lat.toRadians(),
λ1 = p1.lng.toRadians();
var α1 = initialBearing.toRadians();
var s = distance;
var a = this.datum.ellipsoid.a,
b = this.datum.ellipsoid.b,
f = this.datum.ellipsoid.f;
var sinα1 = Math.sin(α1);
var cosα1 = Math.cos(α1);
var tanU1 = (1 - f) * Math.tan(φ1),
cosU1 = 1 / Math.sqrt((1 + tanU1 * tanU1)),
sinU1 = tanU1 * cosU1;
var σ1 = Math.atan2(tanU1, cosα1);
var sinα = cosU1 * sinα1;
var cosSqα = 1 - sinα * sinα;
var uSq = cosSqα * (a * a - b * b) / (b * b);
var A = 1 + uSq / 16384 * (4096 + uSq * (-768 + uSq * (320 - 175 *
uSq)));
var B = uSq / 1024 * (256 + uSq * (-128 + uSq * (74 - 47 * uSq)));
var σ = s / (b * A),
σʹ, iterations = 0;
do {
var cos2σM = Math.cos(2 * σ1 + σ);
var sinσ = Math.sin(σ);
var cosσ = Math.cos(σ);
var Δσ = B * sinσ * (cos2σM + B / 4 * (cosσ * (-1 + 2 * cos2σM *
cos2σM) -
B / 6 * cos2σM * (-3 + 4 * sinσ * sinσ) * (-3 + 4 * cos2σM *
cos2σM)));
σʹ = σ;
σ = s / (b * A) + Δσ;
} while (Math.abs(σ - σʹ) > 1e-12 && ++iterations);
var x = sinU1 * sinσ - cosU1 * cosσ * cosα1;
var φ2 = Math.atan2(sinU1 * cosσ + cosU1 * sinσ * cosα1, (1 - f) *
Math.sqrt(sinα * sinα + x * x));
var λ = Math.atan2(sinσ * sinα1, cosU1 * cosσ - sinU1 * sinσ * cosα1);
var C = f / 16 * cosSqα * (4 + f * (4 - 3 * cosSqα));
var L = λ - (1 - C) * f * sinα *
(σ + C * sinσ * (cos2σM + C * cosσ * (-1 + 2 * cos2σM * cos2σM)));
if (wrap)
var λ2 = (λ1 + L + 3 * Math.PI) % (2 * Math.PI) - Math.PI; // normalise to -180...+180
else
var λ2 = (λ1 + L); // do not normalize
var revAz = Math.atan2(sinα, -x);
return {
lat: φ2.toDegrees(),
lng: λ2.toDegrees(),
finalBearing: revAz.toDegrees()
};
},
/**
* Vincenty inverse calculation.
* based on the work of Chris Veness (https://github.com/chrisveness/geodesy)
*
* @private
* @param {LatLng} p1 - Latitude/longitude of start point.
* @param {LatLng} p2 - Latitude/longitude of destination point.
* @returns {Object} Object including distance, initialBearing, finalBearing.
* @throws {Error} If formula failed to converge.
*/
_vincenty_inverse: function(p1, p2) {
var φ1 = p1.lat.toRadians(),
λ1 = p1.lng.toRadians();
var φ2 = p2.lat.toRadians(),
λ2 = p2.lng.toRadians();
var a = this.datum.ellipsoid.a,
b = this.datum.ellipsoid.b,
f = this.datum.ellipsoid.f;
var L = λ2 - λ1;
var tanU1 = (1 - f) * Math.tan(φ1),
cosU1 = 1 / Math.sqrt((1 + tanU1 * tanU1)),
sinU1 = tanU1 * cosU1;
var tanU2 = (1 - f) * Math.tan(φ2),
cosU2 = 1 / Math.sqrt((1 + tanU2 * tanU2)),
sinU2 = tanU2 * cosU2;
var λ = L,
λʹ, iterations = 0;
do {
var sinλ = Math.sin(λ),
cosλ = Math.cos(λ);
var sinSqσ = (cosU2 * sinλ) * (cosU2 * sinλ) + (cosU1 * sinU2 -
sinU1 * cosU2 * cosλ) * (cosU1 * sinU2 - sinU1 * cosU2 * cosλ);
var sinσ = Math.sqrt(sinSqσ);
if (sinσ == 0) return 0; // co-incident points
var cosσ = sinU1 * sinU2 + cosU1 * cosU2 * cosλ;
var σ = Math.atan2(sinσ, cosσ);
var sinα = cosU1 * cosU2 * sinλ / sinσ;
var cosSqα = 1 - sinα * sinα;
var cos2σM = cosσ - 2 * sinU1 * sinU2 / cosSqα;
if (isNaN(cos2σM)) cos2σM = 0; // equatorial line: cosSqα=0 (§6)
var C = f / 16 * cosSqα * (4 + f * (4 - 3 * cosSqα));
λʹ = λ;
λ = L + (1 - C) * f * sinα * (σ + C * sinσ * (cos2σM + C * cosσ * (-
1 + 2 * cos2σM * cos2σM)));
} while (Math.abs(λ - λʹ) > 1e-12 && ++iterations < 100);
if (iterations >= 100) {
console.log("Formula failed to converge. Altering target position.")
return this._vincenty_inverse(p1, {
lat: p2.lat,
lng: p2.lng - 0.01
})
// throw new Error('Formula failed to converge');
}
var uSq = cosSqα * (a * a - b * b) / (b * b);
var A = 1 + uSq / 16384 * (4096 + uSq * (-768 + uSq * (320 - 175 *
uSq)));
var B = uSq / 1024 * (256 + uSq * (-128 + uSq * (74 - 47 * uSq)));
var Δσ = B * sinσ * (cos2σM + B / 4 * (cosσ * (-1 + 2 * cos2σM *
cos2σM) -
B / 6 * cos2σM * (-3 + 4 * sinσ * sinσ) * (-3 + 4 * cos2σM *
cos2σM)));
var s = b * A * (σ - Δσ);
var fwdAz = Math.atan2(cosU2 * sinλ, cosU1 * sinU2 - sinU1 * cosU2 *
cosλ);
var revAz = Math.atan2(cosU1 * sinλ, -sinU1 * cosU2 + cosU1 * sinU2 *
cosλ);
s = Number(s.toFixed(3)); // round to 1mm precision
return {
distance: s,
initialBearing: fwdAz.toDegrees(),
finalBearing: revAz.toDegrees()
};
},
/**
* Returns the point of intersection of two paths defined by point and bearing.
* based on the work of Chris Veness (https://github.com/chrisveness/geodesy)
*
* @param {LatLon} p1 - First point.
* @param {number} brng1 - Initial bearing from first point.
* @param {LatLon} p2 - Second point.
* @param {number} brng2 - Initial bearing from second point.
* @returns {Object} containing lat/lng information of intersection.
*
* @example
* var p1 = LatLon(51.8853, 0.2545), brng1 = 108.55;
* var p2 = LatLon(49.0034, 2.5735), brng2 = 32.44;
* var pInt = LatLon.intersection(p1, brng1, p2, brng2); // pInt.toString(): 50.9078°N, 4.5084°E
*/
_intersection: function(p1, brng1, p2, brng2) {
// see http://williams.best.vwh.net/avform.htm#Intersection
var φ1 = p1.lat.toRadians(),
λ1 = p1.lng.toRadians();
var φ2 = p2.lat.toRadians(),
λ2 = p2.lng.toRadians();
var θ13 = Number(brng1).toRadians(),
θ23 = Number(brng2).toRadians();
var Δφ = φ2 - φ1,
Δλ = λ2 - λ1;
var δ12 = 2 * Math.asin(Math.sqrt(Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ /
2)));
if (δ12 == 0) return null;
// initial/final bearings between points
var θ1 = Math.acos((Math.sin(φ2) - Math.sin(φ1) * Math.cos(δ12)) /
(Math.sin(δ12) * Math.cos(φ1)));
if (isNaN(θ1)) θ1 = 0; // protect against rounding
var θ2 = Math.acos((Math.sin(φ1) - Math.sin(φ2) * Math.cos(δ12)) /
(Math.sin(δ12) * Math.cos(φ2)));
if (Math.sin(λ2 - λ1) > 0) {
var θ12 = θ1;
var θ21 = 2 * Math.PI - θ2;
} else {
var θ12 = 2 * Math.PI - θ1;
var θ21 = θ2;
}
var α1 = (θ13 - θ12 + Math.PI) % (2 * Math.PI) - Math.PI; // angle 2-1-3
var α2 = (θ21 - θ23 + Math.PI) % (2 * Math.PI) - Math.PI; // angle 1-2-3
if (Math.sin(α1) == 0 && Math.sin(α2) == 0) return null; // infinite intersections
if (Math.sin(α1) * Math.sin(α2) < 0) return null; // ambiguous intersection
//α1 = Math.abs(α1);
//α2 = Math.abs(α2);
// ... Ed Williams takes abs of α1/α2, but seems to break calculation?
var α3 = Math.acos(-Math.cos(α1) * Math.cos(α2) +
Math.sin(α1) * Math.sin(α2) * Math.cos(δ12));
var δ13 = Math.atan2(Math.sin(δ12) * Math.sin(α1) * Math.sin(α2),
Math.cos(α2) + Math.cos(α1) * Math.cos(α3))
var φ3 = Math.asin(Math.sin(φ1) * Math.cos(δ13) +
Math.cos(φ1) * Math.sin(δ13) * Math.cos(θ13));
var Δλ13 = Math.atan2(Math.sin(θ13) * Math.sin(δ13) * Math.cos(φ1),
Math.cos(δ13) - Math.sin(φ1) * Math.sin(φ3));
var λ3 = λ1 + Δλ13;
λ3 = (λ3 + 3 * Math.PI) % (2 * Math.PI) - Math.PI; // normalise to -180..+180º
return {
lat: φ3.toDegrees(),
lng: λ3.toDegrees()
};
},
/**
* Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1
* @param obj1
* @param obj2
* @returns obj3 a new object based on obj1 and obj2
*/
_merge_options: function(obj1, obj2) {
let obj3 = {};
for (let attrname in obj1) {
obj3[attrname] = obj1[attrname];
}
for (let attrname in obj2) {
obj3[attrname] = obj2[attrname];
}
return obj3;
}
});
L.geodesic = function(latlngs, options) {
return new L.Geodesic(latlngs, options);
};
(function() {
// save these original methods before they are overwritten
var proto_initIcon = L.Marker.prototype._initIcon;

View File

@@ -1,11 +1,13 @@
{
"/assets/admin/vendor/paper-dashboard.css": "/assets/admin/vendor/paper-dashboard.css?id=729efec551211db36219",
"/assets/frontend/css/now-ui-kit.css": "/assets/frontend/css/now-ui-kit.css?id=58ec3dc768f07fee143a",
"/assets/admin/css/vendor.min.css": "/assets/admin/css/vendor.min.css?id=f583577fe1de7a1da1e6",
"/assets/admin/js/vendor.js": "/assets/admin/js/vendor.js?id=eb27f6c829378a084072",
"/assets/system/js/jquery.js": "/assets/system/js/jquery.js?id=09dd64a64ba840c31a81",
"/assets/fonts/glyphicons-halflings-regular.woff2": "/assets/fonts/glyphicons-halflings-regular.woff2?id=b5b5055c6d812c0f9f0d",
"/assets/admin/css/vendor.min.css": "/assets/admin/css/vendor.min.css?id=b7f27b62f5cf3ebb7a65",
"/assets/admin/js/vendor.js": "/assets/admin/js/vendor.js?id=2831a0e25aded202c08c",
"/assets/admin/css/blue.png": "/assets/admin/css/blue.png?id=753a3c0dec86d3a38d9c",
"/assets/admin/css/blue@2x.png": "/assets/admin/css/blue@2x.png?id=97da23d47b838cbd4bef",
"/assets/system/js/vendor.js": "/assets/system/js/vendor.js?id=434db3f2c9beafd58bae",
"/assets/system/js/vendor.js": "/assets/system/js/vendor.js?id=022e73793e29fb2c6825",
"/assets/system/css/vendor.css": "/assets/system/css/vendor.css?id=7bd98a28084fea99e307",
"/assets/system/js/installer-vendor.js": "/assets/system/js/installer-vendor.js?id=b2bca761f222e97bf4ff"
}

View File

@@ -8,6 +8,8 @@
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="viewport" content="width=device-width" />
<script src="{!! public_asset('/assets/system/js/jquery.js') !!}"></script>
<link rel="icon" type="image/png" href="{!! public_asset('/assets/admin/img/favicon.png') !!}">
<link href='https://fonts.googleapis.com/css?family=Muli:400,300' rel='stylesheet' type='text/css'>
@@ -73,20 +75,6 @@
</body>
{{--<script src="https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="{!! public_asset('/assets/vendor/bootstrap/bootstrap.min.js') !!}" type="text/javascript"></script>
<script src="{!! public_asset('/assets/vendor/bootstrap/bootstrap-notify.js') !!}"></script>
<script src="{!! public_asset('/assets/vendor/chartist/chartist.min.js') !!}"></script>
<script src="{!! public_asset('/assets/vendor/select2/dist/js/select2.js') !!}"></script>
<script src="{!! public_asset('/assets/vendor/pjax/jquery.pjax.js') !!}"></script>
<script src="{!! public_asset('/assets/vendor/icheck/icheck.js') !!}"></script>
<script src="{!! public_asset('/assets/vendor/rivets/dist/rivets.bundled.min.js') !!}"></script>
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/js/bootstrap-editable.min.js"></script>
--}}
<script src="{!! public_asset('/assets/admin/js/vendor.js') !!}"></script>
<script src="{!! public_asset('/assets/system/js/system.js') !!}"></script>
<script src="{!! public_asset('/assets/admin/js/admin.js') !!}"></script>

View File

@@ -11,21 +11,21 @@
@foreach($settings as $setting)
<tr>
<td>
<td width="70%">
<p>{!! $setting->name !!}</p>
<p class="description">{{$setting->description}}</p></td>
<td>
@if($setting->type === 'text')
{!! Form::input('text', $setting->id, $setting->value, ['class' => 'form-control']) !!}
<td align="center">
@if($setting->type === 'date')
{!! Form::input('text', $setting->id, $setting->value, ['class' => 'form-control', 'id' => 'datepicker']) !!}
@elseif($setting->type === 'boolean' || $setting->type === 'bool')
{!! Form::hidden($setting->id, 0) !!}
{!! Form::checkbox($setting->id, null, $setting->value, ['']) !!}
{!! Form::checkbox($setting->id, null, $setting->value) !!}
@elseif($setting->type === 'int' || $setting->type === 'number')
{!! Form::number($setting->id, $setting->value, ['class'=>'form-control']) !!}
@elseif($setting->type === 'select')
{!! Form::select($setting->id,
explode(',', $setting->options),
$setting->value, ['class' => 'select2', 'style' => 'width: 100%']) !!}
$setting->value, ['class' => 'select2', 'style' => 'width: 100%; text-align: left;']) !!}
@else
{!! Form::input('text', $setting->id, $setting->value, ['class' => 'form-control']) !!}
@endif
@@ -37,8 +37,19 @@
</div>
</div>
@endforeach
<div class="pull-right">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.subfleets.index') !!}" class="btn btn-default">Cancel</a>
<div class="card">
<div class="content">
<div class="text-right">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.subfleets.index') !!}" class="btn btn-default">Cancel</a>
</div>
</div>
</div>
{!! Form::close() !!}
<script>
$(document).ready(function () {
$('#datepicker').datetimepicker({
format: "YYYY-MM-DD"
});
});
</script>

View File

@@ -16,6 +16,13 @@ mix.webpackConfig({
]
});
/**
* GENERAL FILES
*/
mix.copy('node_modules/jquery/dist/jquery.js', 'public/assets/system/js/');
mix.copy('node_modules/bootstrap3/fonts/*.woff2', 'public/assets/fonts/');
/**
* ADMIN REQUIRED FILES
*/
@@ -25,8 +32,7 @@ mix.sass('public/assets/admin/vendor/sass/paper-dashboard.scss',
.sourceMaps();
mix.styles([
'public/assets/admin/vendor/bootstrap.css',
'public/assets/admin/vendor/bootstrap-editable.css',
'node_modules/bootstrap3/dist/css/bootstrap.css',
'public/assets/admin/vendor/animate.css',
'public/assets/admin/vendor/pe-icon-7-stroke.css',
'public/assets/admin/vendor/themify-icons.css',
@@ -36,13 +42,17 @@ mix.styles([
'node_modules/icheck/skins/square/blue.css',
'node_modules/x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css',
'public/assets/admin/vendor/paper-dashboard.css',
'node_modules/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css',
], 'public/assets/admin/css/vendor.min.css').version()
.sourceMaps();
mix.scripts([
'node_modules/lodash/lodash.js',
'node_modules/jquery/dist/jquery.js',
//'node_modules/jquery/dist/jquery.js', // commented out to include separately
'node_modules/moment/moment.js',
'node_modules/bootstrap3/dist/js/bootstrap.js',
'node_modules/bootstrap3/js/collapse.js',
'node_modules/bootstrap3/js/transition.js',
'node_modules/popper.js/dist/umd/popper.js',
'node_modules/popper.js/dist/umd/popper-utils.js',
'node_modules/select2/dist/js/select2.js',
@@ -50,6 +60,8 @@ mix.scripts([
'node_modules/icheck/icheck.js',
'node_modules/pjax/pjax.js',
'node_modules/x-editable/dist/bootstrap3-editable/js/bootstrap-editable.js',
// 'node_modules/x-editable/dist/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
'node_modules/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js',
], 'public/assets/admin/js/vendor.js');
mix.copy('node_modules/icheck/skins/square/blue*.png', 'public/assets/admin/css');