{"version":3,"sources":["webpack:///service_f61149ed4534c2438558.js","webpack:///webpack/bootstrap f61149ed4534c2438558","webpack:///./src/services/app.service.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","40","emissionControlAreaServiceFactory","$http","apiUrl","path","this","getEmissionControlAreas","then","response","data","harbourServiceFactory","$sessionStorage","companyCode","logonInfo","agency","getHarbours","post","company","responseType","resp","vesselServiceFactory","storage","vesselsHavingWaypointsPath","getVesselsHavingWaypoints","markerPath","getVesselMarkers","historicalMarkerPath","getHistoricalVesselMarkers","historyItems","pointsPath","getVesselPath","vesselCode","timeInHours","vesselPointsPath","getHistoricalVesselPaths","vesselInfoPath","getVesselDetails","lastReportDate","security","userRoles","roles","currentVoyagesByVesselPath","getCurrentVoyages","searchValue","bunkerConsumptionPath","getBunkerConsumption","aisPodLocation","speed","speedString","cargoServiceFactory","getCargoInfo","nextPortId","openWeatherMapDataService","getByPoint","lat","lon","count","apiKey","params","getByBoundsAndZoom","bounds","zoom","list","_southWest","lng","_northEast","bbox","join","vesselPathServiceFactory","vesselService","$interpolate","getPath","hoursInPast","lastPoint","paths","points","map","point","tooltipHtml","currentPoint","parseFloat","Lat","replace","Lon","color","weight","latlngs","vessel","type","radius","tooltip","markerServiceFactory","harbourService","$document","$q","getMarkerBackGroundColor","aisInfo","backgroundColor","calcEta","CalcEta","Date","parse","scheduleEta","ScheduleEta","Status","DestinationMatch","harbourInfoStartHtml","berthInfoHtml","harbourIcon","iconUrl","iconSize","iconAnchor","vesselHtml","createVesselIcon","angle","svg","encodeURI","normalizeId","id","weatherMarkerHtml","createWeatherIcon","city","weather","icon","createSummaryControl","L","control","summary","Control","extend","onAdd","_map","_sidebar","getElementById","DomEvent","disableClickPropagation","disableScrollPropagation","onRemove","opts","createTimestepControl","timestep","_timestep","createTimeWaypointControl","timeWaypoint","_timeWaypoint","createHistoryWaypointsControl","historyWaypoints","_historyWaypoints","getHistoricalMarkersAndPaths","items","all","harbourData","vesselData","pathData","result","markers","harbours","harbour","Code","layer","angular","copy","Berths","LAT","LON","_","every","code","BackgroundColor","width","VesselName","length","VesselIconCssColor","parseInt","Course","NextPortId","zIndexOffset","opacity","showPath","className","html","LastReportDate","riseOnHover","vesselPaths","item","push","getMarkers","mmsi","openWeatherMapApiKey","onlyWeatherMarkers","weatherData","cod","coord","message","VesselMmsi","service","$inject"],"mappings":"CAAS,SAAUA,GCIjB,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUE,OAGnC,IAAIC,GAASF,EAAiBD,IAC7BI,EAAGJ,EACHK,GAAG,EACHH,WAUD,OANAJ,GAAQE,GAAUM,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASH,GAG/DI,EAAOE,GAAI,EAGJF,EAAOD,QAvBf,GAAID,KA4BJF,GAAoBQ,EAAIT,EAGxBC,EAAoBS,EAAIP,EAGxBF,EAAoBU,EAAI,SAASP,EAASQ,EAAMC,GAC3CZ,EAAoBa,EAAEV,EAASQ,IAClCG,OAAOC,eAAeZ,EAASQ,GAC9BK,cAAc,EACdC,YAAY,EACZC,IAAKN,KAMRZ,EAAoBmB,EAAI,SAASf,GAChC,GAAIQ,GAASR,GAAUA,EAAOgB,WAC7B,WAAwB,MAAOhB,GAAgB,SAC/C,WAA8B,MAAOA,GAEtC,OADAJ,GAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASQ,EAAQC,GAAY,MAAOR,QAAOS,UAAUC,eAAejB,KAAKc,EAAQC,IAGzGtB,EAAoByB,EAAI,UAGjBzB,EAAoBA,EAAoB0B,EAAI,MDM/CC,GACA,SAAUvB,EAAQD,EAASH,GAEjC,cEpEA,WAcI,QAAS4B,GAAkCC,EAAOC,GAC9C,GAAIC,GAAOD,EAAS,kCACpBE,MAAKC,wBAA0B,WAC3B,MAAOJ,G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yC,KAAMV,EAAiB1B,EAAOqF,oBAAsB,iBAChDC,SAAStF,EAAOuF,SACpBP,KAAMhF,EAAOuE,KACb3G,WAAYoC,EAAOwF,WACnBC,aAAc,IACdC,QAAS,IACTC,UAAU,GAEdvB,EAAQtC,EAAY,cAAgB9B,EAAOuE,QACvCC,MAAO,UACPzG,IAAK0B,WAAWO,EAAO4E,IAAIjF,QAAQ,IAAK,MACxClB,IAAKgB,WAAWO,EAAO6E,IAAIlF,QAAQ,IAAK,MACxCyC,MACInC,KAAM,MACN2F,UAAW,mBACXrE,UAAW2D,EAAO,IAClB1D,YAAa0D,EAAQ,GAAI,IACzBW,KAAMpE,EAAWzB,IAErBgF,KAAMhF,EAAOuE,KACb3G,WAAYoC,EAAOwF,WACnB1I,eAAgBkD,EAAO8F,eACvBL,aAAc,IACdC,QAAS,IACTC,UAAU,EACVI,aAAa,OAKjB3B,QAASA,OA/lB7BK,QACKvL,OAAO,OACP0N,QAAQ,iBAAkBzL,GAC1ByL,QAAQ,gBAAiB/K,GACzB+K,QAAQ,oBAAqB/H,GAC7B+H,QAAQ,eAAgBlJ,GACxBkJ,QAAQ,gBAAiBxG,GACzBwG,QAAQ,4BAA6B/I,GACrC+I,QAAQ,6BAA8BlM,GAE3CA,EAAkCmM,SAAW,QAAS,cAUtD1L,EAAsB0L,SAAW,QAAS,kBAAmB,cAY7DhL,EAAqBgL,SAAW,QAAS,kBAAmB,cAqE5DnJ,EAAoBmJ,SAAW,QAAS,kBAAmB,cAY3DhJ,EAA0BgJ,SAAW,SA4BrChI,EAAyBgI,SAAW,gBAAiB,gBAwCrDzG,EAAqByG,SAAW,iBAAkB,gBAAiB,eAAgB,YAAa,4BAA6B","file":"service_f61149ed4534c2438558.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"assets/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 40);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 40:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// var angular = require('node_modules/angular/angular.js');\n\n(function () {\n 'use strict';\n\n angular.module('app').service('harbourService', harbourServiceFactory).service('vesselService', vesselServiceFactory).service('vesselPathService', vesselPathServiceFactory).service('cargoService', cargoServiceFactory).service('markerService', markerServiceFactory).service('openWeatherMapDataService', openWeatherMapDataService).service('emissionControlAreaService', emissionControlAreaServiceFactory);\n\n emissionControlAreaServiceFactory.$inject = ['$http', 'apiBaseUrl'];\n function emissionControlAreaServiceFactory($http, apiUrl) {\n var path = apiUrl + 'assets/content/json/eca.geo.json';\n this.getEmissionControlAreas = function () {\n return $http.get(path).then(function (response) {\n return response.data;\n });\n };\n }\n\n harbourServiceFactory.$inject = ['$http', '$sessionStorage', 'apiBaseUrl'];\n function harbourServiceFactory($http, $sessionStorage, apiUrl) {\n var companyCode = $sessionStorage.logonInfo.agency.companyCode;\n var path = apiUrl + 'api/harbour/HarboursDataService.asmx/GetHarboursByCompany';\n this.getHarbours = function () {\n return $http.post(path, { company: companyCode }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n }\n\n vesselServiceFactory.$inject = ['$http', '$sessionStorage', 'apiBaseUrl'];\n function vesselServiceFactory($http, $sessionStorage, apiUrl) {\n var storage = $sessionStorage;\n var vesselsHavingWaypointsPath = apiUrl + 'api/vessel/VesselsHavingWaypointsService.asmx/GetVesselsByCompany';\n this.getVesselsHavingWaypoints = function () {\n return $http.post(vesselsHavingWaypointsPath, { companyCode: storage.logonInfo.agency.companyCode }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n var markerPath = apiUrl + 'api/vessel/AisData.asmx/GetAisDataForAllVessels';\n this.getVesselMarkers = function () {\n return $http.post(markerPath, { companyCode: storage.logonInfo.agency.companyCode }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n\n var historicalMarkerPath = apiUrl + 'api/vessel/AisData.asmx/GetHistoricalAisDataForAllVessels';\n this.getHistoricalVesselMarkers = function (historyItems) {\n return $http.post(historicalMarkerPath, { companyCode: storage.logonInfo.agency.companyCode, historyItems: historyItems }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n\n var pointsPath = apiUrl + 'api/vessel/TrackPointService.asmx/GetVesselPath';\n this.getVesselPath = function (vesselCode, timeInHours) {\n return $http.post(pointsPath, { companyCode: storage.logonInfo.agency.companyCode, vesselCode: vesselCode, timeInHours: timeInHours }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n\n var vesselPointsPath = apiUrl + 'api/vessel/TrackPointService.asmx/GetHistoricalVesselPaths';\n this.getHistoricalVesselPaths = function (historyItems) {\n return $http.post(vesselPointsPath, { companyCode: storage.logonInfo.agency.companyCode, historyItems: historyItems }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n\n var vesselInfoPath = apiUrl + 'api/vessel/VesselDetailInfoService.asmx/GetVesselDetailInfoService';\n this.getVesselDetails = function (vesselCode, lastReportDate) {\n var security = storage.logonInfo.security;\n var userRoles = security ? security.roles : [];\n return $http.post(vesselInfoPath, { companyCode: storage.logonInfo.agency.companyCode, vesselCode: vesselCode, userRoles: userRoles, lastReportDate: lastReportDate }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n\n var currentVoyagesByVesselPath = apiUrl + 'api/vessel/CurrentVoyagesByVesselService.asmx/GetByCompanyAndVessel';\n this.getCurrentVoyages = function (vesselCode, searchValue) {\n return $http.post(currentVoyagesByVesselPath, { companyCode: storage.logonInfo.agency.companyCode, vesselCode: vesselCode, searchValue: searchValue }, { responseType: 'json' }).then(function (resp) {\n return resp.data.d;\n });\n };\n\n var bunkerConsumptionPath = apiUrl + 'api/vessel/VesselDetailInfoService.asmx/GetDataForCalculation';\n this.getBunkerConsumption = function (vesselCode, aisPodLocation, speed) {\n return $http.post(bunkerConsumptionPath, { companyCode: storage.logonInfo.agency.companyCode, vesselCode: vesselCode, aisPodLocation: aisPodLocation || 'n/a', speedString: speed || '0' }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n }\n\n cargoServiceFactory.$inject = ['$http', '$sessionStorage', 'apiBaseUrl'];\n function cargoServiceFactory($http, $sessionStorage, apiUrl) {\n var companyCode = $sessionStorage.logonInfo.agency.companyCode;\n var path = apiUrl + 'api/cargo/CargoService.asmx/GetCargoDataForVoyage';\n this.getCargoInfo = function (vesselCode, nextPortId) {\n return $http.post(path, { companyCode: companyCode, vesselCode: vesselCode, nextPortId: nextPortId }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n }\n\n openWeatherMapDataService.$inject = ['$http'];\n function openWeatherMapDataService($http) {\n var pathFind = 'https://api.openweathermap.org/data/2.5/find';\n this.getByPoint = function (lat, lon, count, apiKey) {\n return $http.get(pathFind, {\n params: { lat: lat, lon: lon, count: count, apiKey: apiKey }\n }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n\n // [lon-left,lat-bottom,lon-right,lat-top,zoom]\n var pathCity = 'https://api.openweathermap.org/data/2.5/box/city';\n this.getByBoundsAndZoom = function (bounds, zoom, apiKey) {\n var list = [bounds._southWest.lng, bounds._southWest.lat, bounds._northEast.lng, bounds._northEast.lat, zoom];\n var bbox = list.join(',');\n return $http.get(pathCity, {\n params: { bbox: bbox, apiKey: apiKey }\n }, { responseType: 'json' }).then(function (resp) {\n return resp.data;\n });\n };\n }\n\n vesselPathServiceFactory.$inject = ['vesselService', '$interpolate'];\n function vesselPathServiceFactory(vesselService, $interpolate) {\n // load vessel (marker.modelName) path points using web service\n this.getPath = function (vesselCode, hoursInPast) {\n return vesselService.getVesselPath(vesselCode, hoursInPast).then(function (data) {\n var paths = {};\n var points = data.d.points;\n var i = 0;\n var lastPoint;\n points.map(function (point) {\n var tooltipHtml = $interpolate('{{ Speed }} knots /  {{ Cours }} °' + '
{{ TimeStamp }}');\n var currentPoint = {\n lat: parseFloat(point.Lat.replace(',', '.')),\n lng: parseFloat(point.Lon.replace(',', '.'))\n };\n if (lastPoint) {\n paths['Point' + i++] = {\n color: 'blueviolet',\n weight: 2,\n latlngs: [lastPoint, currentPoint],\n vessel: vesselCode\n };\n }\n lastPoint = currentPoint;\n paths['Point' + i++] = {\n type: \"circleMarker\",\n radius: 1,\n latlngs: currentPoint,\n tooltip: tooltipHtml(point),\n vessel: vesselCode\n };\n });\n return paths;\n });\n };\n }\n\n markerServiceFactory.$inject = ['harbourService', 'vesselService', '$interpolate', '$document', 'openWeatherMapDataService', '$q'];\n function markerServiceFactory(harbourService, vesselService, $interpolate, $document, openWeatherMapDataService, $q) {\n var getMarkerBackGroundColor = function getMarkerBackGroundColor(aisInfo) {\n var backgroundColor = \"#ffffff\"; // white;\n var calcEta = aisInfo.CalcEta ? Date.parse(aisInfo.CalcEta.replace(/\\.|-/g, \"/\")) : \"n/a\";\n var scheduleEta = aisInfo.ScheduleEta ? Date.parse(aisInfo.ScheduleEta.replace(/\\.|-/g, \"/\")) : \"n/a\";\n\n // aisInfo.Status is written by observer service into dba.vessel_status.vs_status\n // https://support.softship.com/confluence/display/WES/Observer+Service#ObserverService-VSTAT–UpdateVesselStatus\n\n // Background color of vessel marker rendered at AIS position should be (base on vessel status):\n // 1: Sailing - calculated eta > planned eta then red otherwise green\n // 2: In Port / Cargo Operations - gray\n // 3: Sailing / Unknown - white\n // 4: Anchoring - blue\n // 5: Other Error - white\n // 6: Offhire - white - vessel cannot be found in current schedule\n // \n // AIS has its own status: 0 = underway, 1 = at anchor, 5 = moored, 8 = underway by sail\n if (aisInfo.Status === '6') {\n backgroundColor = \"#ffffff\"; // white\n } else if (aisInfo.Status === '5') {\n backgroundColor = \"#ffffff\"; // white\n } else if (aisInfo.Status === '4') {\n backgroundColor = \"#00ccff\"; // blue\n } else if (aisInfo.Status === '3') {\n backgroundColor = \"#ffffff\"; // white\n } else if (aisInfo.Status === '2') {\n backgroundColor = \"#cccccc\"; // gray\n } else if (aisInfo.Status === '1') {\n // match: aisInfo.DestinationMatch = 3\n if (!aisInfo.DestinationMatch || aisInfo.DestinationMatch !== 3 || !calcEta || !scheduleEta) {\n backgroundColor = \"#ffffff\"; // white -- we need matching destinations AND both values to be able to compare\n } else {\n if (calcEta > scheduleEta) {\n backgroundColor = \"#FF6347\"; // red -- arrival too late\n } else {\n backgroundColor = \"#00ff00\"; // lime (green) -- arrival in time\n }\n }\n }\n\n return backgroundColor;\n };\n\n var harbourInfoStartHtml = $interpolate('
' + '

{{ Name }} ({{ Code }})

');\n var berthInfoHtml = $interpolate('

{{ Name }}

' + '

  Remarks: {{ Remarks }}

' + '

  Opening hours: {{ OpeningHours }}

');\n var harbourInfoEndHtml = function harbourInfoEndHtml() {\n return '
';\n };\n\n var harbourIcon = {\n iconUrl: './assets/content/image/harbour.png',\n iconSize: [16, 16],\n iconAnchor: [8, 8]\n };\n\n // then vessel icon and text\n // load vessels using web service\n var vesselHtml = $interpolate(\"

\" + \"\" + \"{{ VesselName }}

\" + \"\");\n\n // svg vector graph\n var createVesselIcon = function createVesselIcon(color, angle) {\n var svg = \"\";\n var url = encodeURI(\"data:image/svg+xml,\" + svg).replace('#', '%23');\n var leafletIcon = {\n iconUrl: url,\n iconSize: [26, 26],\n iconAnchor: [13, 13]\n };\n return leafletIcon;\n };\n\n var normalizeId = function normalizeId(id) {\n return id.replace('-', '_').replace('+', '_').replace('.', '_').replace(',', '_');\n };\n\n var weatherMarkerHtml = $interpolate('

{{name}}

' + '

   {{weather[0].main}}

' + '

Temperature: {{main.temp}}°
' + 'Temperature min. /max.: {{main.temp_min | number}} ° / {{main.temp_max | number}} °
' + 'Humidity: {{main.humidity | number}}%
' + 'Wind: {{wind.speed | number}} m/s
' + 'Clouds: {{clouds.today | number}}%

');\n\n var createWeatherIcon = function createWeatherIcon(city) {\n return {\n iconUrl: 'https://openweathermap.org/img/w/' + city.weather[0].icon + '.png',\n iconSize: [36, 36],\n iconAnchor: [13, 13]\n };\n };\n\n this.createSummaryControl = function () {\n if (L.control.summary) return L.control.summary;\n\n L.Control.summary = L.Control.extend({\n onAdd: function onAdd(map) {\n this._map = map;\n // TODO: not elegant - $compile of html template (ng-include?)\n this._sidebar = $document[0].getElementById('sidebar');\n L.DomEvent.disableClickPropagation(this._sidebar);\n L.DomEvent.disableScrollPropagation(this._sidebar);\n return this._sidebar;\n },\n\n onRemove: function onRemove(map) {\n // nop\n }\n });\n L.control.summary = function (opts) {\n return new L.Control.summary(opts);\n };\n\n return L.control.summary;\n };\n\n this.createTimestepControl = function () {\n if (L.control.timestep) return L.control.timestep;\n\n L.Control.timestep = L.Control.extend({\n onAdd: function onAdd(map) {\n this._map = map;\n this._timestep = $document[0].getElementById('timestep');\n L.DomEvent.disableClickPropagation(this._timestep);\n L.DomEvent.disableScrollPropagation(this._timestep);\n return this._timestep;\n },\n\n onRemove: function onRemove(map) {\n // nop\n }\n });\n L.control.timestep = function (opts) {\n return new L.Control.timestep(opts);\n };\n\n return L.control.timestep;\n };\n\n this.createTimeWaypointControl = function () {\n if (L.control.timeWaypoint) return L.control.timeWaypoint;\n\n L.Control.timeWaypoint = L.Control.extend({\n onAdd: function onAdd(map) {\n this._map = map;\n this._timeWaypoint = $document[0].getElementById('timeWaypoint');\n L.DomEvent.disableClickPropagation(this._timeWaypoint);\n L.DomEvent.disableScrollPropagation(this._timeWaypoint);\n return this._timeWaypoint;\n },\n\n onRemove: function onRemove(map) {\n // nop\n }\n });\n L.control.timeWaypoint = function (opts) {\n return new L.Control.timeWaypoint(opts);\n };\n\n return L.control.timeWaypoint;\n };\n\n this.createHistoryWaypointsControl = function () {\n if (L.control.historyWaypoints) return L.control.historyWaypoints;\n\n L.Control.historyWaypoints = L.Control.extend({\n onAdd: function onAdd(map) {\n this._map = map;\n this._historyWaypoints = $document[0].getElementById('historyWaypoints');\n L.DomEvent.disableClickPropagation(this._historyWaypoints);\n L.DomEvent.disableScrollPropagation(this._historyWaypoints);\n return this._historyWaypoints;\n },\n\n onRemove: function onRemove(map) {\n // nop\n }\n });\n L.control.historyWaypoints = function (opts) {\n return new L.Control.historyWaypoints(opts);\n };\n\n return L.control.historyWaypoints;\n };\n\n this.getHistoricalMarkersAndPaths = function (items) {\n return $q.all({\n harbourData: harbourService.getHarbours(),\n vesselData: vesselService.getHistoricalVesselMarkers(items),\n pathData: vesselService.getHistoricalVesselPaths(items)\n }).then(function (result) {\n var markers = {};\n var harbours = result.harbourData.d.harbours;\n // first load harbours\n harbours.map(function (harbour) {\n if (!harbour.Code) return;\n\n markers['Harbour' + harbour.Code] = {\n layer: 'harbours',\n lat: harbour.Lat,\n lng: harbour.Lon,\n icon: angular.copy(harbourIcon),\n tooltip: harbourInfoStartHtml(harbour) + harbour.Berths.map(berthInfoHtml).join('') + harbourInfoEndHtml()\n };\n });\n\n var vesselMarkers = result.vesselData.d;\n vesselMarkers.map(function (vessel) {\n // cannnot show vessel without the coordinates\n // filter only one vessel if MMSI passed by caller\n if (!vessel.Code || !vessel.LAT || !vessel.LON) return;\n\n // skip not selcted vessels\n if (_.every(items, function (i) {\n return i.vessel.code !== vessel.Code;\n })) return;\n\n angular.extend(vessel, { BackgroundColor: getMarkerBackGroundColor(vessel) });\n var width = vessel.VesselName.length * 7 + 6;\n markers['VesselArrow' + vessel.Code] = {\n layer: 'vessels',\n lat: parseFloat(vessel.LAT.replace(',', '.')),\n lng: parseFloat(vessel.LON.replace(',', '.')),\n icon: createVesselIcon(vessel.VesselIconCssColor || 'cornflowerblue', parseInt(vessel.Course)),\n code: vessel.Code,\n nextPortId: vessel.NextPortId,\n zIndexOffset: 500,\n opacity: 0.85,\n showPath: true\n };\n markers['VesselLabel' + vessel.Code] = {\n layer: 'vessels',\n lat: parseFloat(vessel.LAT.replace(',', '.')),\n lng: parseFloat(vessel.LON.replace(',', '.')),\n icon: {\n type: 'div',\n className: 'vesselNameMarker',\n iconSize: [width, 15],\n iconAnchor: [width / 2, -12],\n html: vesselHtml(vessel)\n },\n code: vessel.Code,\n nextPortId: vessel.NextPortId,\n lastReportDate: vessel.LastReportDate,\n zIndexOffset: 600,\n opacity: 0.85,\n showPath: false,\n riseOnHover: true\n };\n });\n\n var paths = [];\n var vesselPaths = result.pathData.d;\n var i = 0;\n vesselPaths.map(function (item) {\n var lastPoint;\n item.points.map(function (point) {\n var tooltipHtml = $interpolate('Vessel: ' + item.vesselCode + '
' + '{{ Speed }} knots /  {{ Cours }} °
' + '
{{ TimeStamp }}');\n var currentPoint = {\n lat: parseFloat(point.Lat.replace(',', '.')),\n lng: parseFloat(point.Lon.replace(',', '.'))\n };\n if (currentPoint.lat && currentPoint.lng) {\n if (lastPoint) {\n paths.push({\n color: item.color,\n weight: 2,\n latlngs: [lastPoint, currentPoint],\n vessel: item.vesselCode\n });\n }\n lastPoint = currentPoint;\n paths.push({\n type: \"circleMarker\",\n color: item.color,\n radius: 1,\n latlngs: currentPoint,\n tooltip: tooltipHtml(point),\n vessel: item.vesselCode\n });\n }\n });\n });\n\n return {\n markers: markers,\n paths: paths\n };\n });\n };\n\n this.getMarkers = function (bounds, zoom, mmsi, openWeatherMapApiKey, onlyWeatherMarkers) {\n return $q.all(!onlyWeatherMarkers ? {\n harbourData: harbourService.getHarbours(),\n vesselData: vesselService.getVesselMarkers(),\n weatherData: openWeatherMapApiKey ? openWeatherMapDataService.getByBoundsAndZoom(bounds, zoom, openWeatherMapApiKey) : null\n } : {\n weatherData: openWeatherMapApiKey ? openWeatherMapDataService.getByBoundsAndZoom(bounds, zoom, openWeatherMapApiKey) : null\n }).then(function (result) {\n\n var markers = {};\n\n if (result.weatherData && result.weatherData.cod === 200) {\n var cities = result.weatherData.list;\n cities.map(function (city) {\n markers['Weather' + city.id] = {\n layer: 'weather',\n lat: parseFloat(city.coord.Lat),\n lng: parseFloat(city.coord.Lon),\n icon: createWeatherIcon(city),\n message: weatherMarkerHtml(city)\n };\n });\n }\n\n if (onlyWeatherMarkers) return {\n markers: markers\n };\n\n var harbours = result.harbourData.d.harbours;\n // first load harbours\n harbours.map(function (harbour) {\n if (!harbour.Code) return;\n\n markers['Harbour' + harbour.Code] = {\n layer: 'harbours',\n lat: harbour.Lat,\n lng: harbour.Lon,\n icon: angular.copy(harbourIcon),\n tooltip: harbourInfoStartHtml(harbour) + harbour.Berths.map(berthInfoHtml).join('') + harbourInfoEndHtml()\n };\n });\n\n var vesselMarkers = result.vesselData.d;\n vesselMarkers.map(function (vessel) {\n // cannnot show vessel without the coordinates\n // filter only one vessel if MMSI passed by caller\n if (!vessel.Code || !vessel.LAT || !vessel.LON || mmsi && mmsi !== vessel.VesselMmsi) return;\n\n angular.extend(vessel, { BackgroundColor: getMarkerBackGroundColor(vessel) });\n var width = vessel.VesselName.length * 7 + 6;\n markers[normalizeId('VesselArrow' + vessel.Code)] = {\n layer: 'vessels',\n lat: parseFloat(vessel.LAT.replace(',', '.')),\n lng: parseFloat(vessel.LON.replace(',', '.')),\n icon: createVesselIcon(vessel.VesselIconCssColor || 'cornflowerblue', parseInt(vessel.Course)),\n code: vessel.Code,\n nextPortId: vessel.NextPortId,\n zIndexOffset: 500,\n opacity: 0.85,\n showPath: true\n };\n markers[normalizeId('VesselLabel' + vessel.Code)] = {\n layer: 'vessels',\n lat: parseFloat(vessel.LAT.replace(',', '.')),\n lng: parseFloat(vessel.LON.replace(',', '.')),\n icon: {\n type: 'div',\n className: 'vesselNameMarker',\n iconSize: [width, 15],\n iconAnchor: [width / 2, -12],\n html: vesselHtml(vessel)\n },\n code: vessel.Code,\n nextPortId: vessel.NextPortId,\n lastReportDate: vessel.LastReportDate,\n zIndexOffset: 600,\n opacity: 0.85,\n showPath: false,\n riseOnHover: true\n };\n });\n\n return {\n markers: markers\n };\n });\n };\n }\n})();\n\n/***/ })\n\n/******/ });\n\n\n// WEBPACK FOOTER //\n// service_f61149ed4534c2438558.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"assets/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 40);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f61149ed4534c2438558","// var angular = require('node_modules/angular/angular.js');\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('app')\r\n .service('harbourService', harbourServiceFactory)\r\n .service('vesselService', vesselServiceFactory)\r\n .service('vesselPathService', vesselPathServiceFactory)\r\n .service('cargoService', cargoServiceFactory)\r\n .service('markerService', markerServiceFactory)\r\n .service('openWeatherMapDataService', openWeatherMapDataService)\r\n .service('emissionControlAreaService', emissionControlAreaServiceFactory);\r\n\r\n emissionControlAreaServiceFactory.$inject = ['$http', 'apiBaseUrl'];\r\n function emissionControlAreaServiceFactory($http, apiUrl) {\r\n var path = apiUrl + 'assets/content/json/eca.geo.json';\r\n this.getEmissionControlAreas = function () {\r\n return $http.get(path).then(function (response) {\r\n return response.data;\r\n });\r\n };\r\n }\r\n\r\n harbourServiceFactory.$inject = ['$http', '$sessionStorage', 'apiBaseUrl'];\r\n function harbourServiceFactory($http, $sessionStorage, apiUrl) {\r\n var companyCode = $sessionStorage.logonInfo.agency.companyCode;\r\n var path = apiUrl + 'api/harbour/HarboursDataService.asmx/GetHarboursByCompany';\r\n this.getHarbours = function () {\r\n return $http.post(path, { company: companyCode }, { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n }\r\n\r\n vesselServiceFactory.$inject = ['$http', '$sessionStorage', 'apiBaseUrl'];\r\n function vesselServiceFactory($http, $sessionStorage, apiUrl) {\r\n var storage = $sessionStorage;\r\n var vesselsHavingWaypointsPath = apiUrl + 'api/vessel/VesselsHavingWaypointsService.asmx/GetVesselsByCompany';\r\n this.getVesselsHavingWaypoints = function () {\r\n return $http.post(vesselsHavingWaypointsPath, { companyCode: storage.logonInfo.agency.companyCode }, { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n var markerPath = apiUrl + 'api/vessel/AisData.asmx/GetAisDataForAllVessels';\r\n this.getVesselMarkers = function () {\r\n return $http.post(markerPath, { companyCode: storage.logonInfo.agency.companyCode }, { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n\r\n var historicalMarkerPath = apiUrl + 'api/vessel/AisData.asmx/GetHistoricalAisDataForAllVessels';\r\n this.getHistoricalVesselMarkers = function (historyItems) {\r\n return $http.post(historicalMarkerPath, { companyCode: storage.logonInfo.agency.companyCode, historyItems: historyItems }, { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n\r\n var pointsPath = apiUrl + 'api/vessel/TrackPointService.asmx/GetVesselPath';\r\n this.getVesselPath = function (vesselCode, timeInHours) {\r\n return $http.post(pointsPath, { companyCode: storage.logonInfo.agency.companyCode, vesselCode: vesselCode, timeInHours: timeInHours }, { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n\r\n var vesselPointsPath = apiUrl + 'api/vessel/TrackPointService.asmx/GetHistoricalVesselPaths';\r\n this.getHistoricalVesselPaths = function (historyItems) {\r\n return $http.post(vesselPointsPath, { companyCode: storage.logonInfo.agency.companyCode, historyItems: historyItems }, { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n\r\n var vesselInfoPath = apiUrl + 'api/vessel/VesselDetailInfoService.asmx/GetVesselDetailInfoService';\r\n this.getVesselDetails = function (vesselCode, lastReportDate) {\r\n var security = storage.logonInfo.security;\r\n var userRoles = security ? security.roles : [];\r\n return $http.post(vesselInfoPath, { companyCode: storage.logonInfo.agency.companyCode, vesselCode: vesselCode, userRoles: userRoles, lastReportDate: lastReportDate }, { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n\r\n var currentVoyagesByVesselPath = apiUrl + 'api/vessel/CurrentVoyagesByVesselService.asmx/GetByCompanyAndVessel';\r\n this.getCurrentVoyages = function (vesselCode, searchValue) {\r\n return $http.post(currentVoyagesByVesselPath, { companyCode: storage.logonInfo.agency.companyCode, vesselCode: vesselCode, searchValue: searchValue }, { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data.d;\r\n });\r\n };\r\n\r\n var bunkerConsumptionPath = apiUrl + 'api/vessel/VesselDetailInfoService.asmx/GetDataForCalculation';\r\n this.getBunkerConsumption = function (vesselCode, aisPodLocation, speed) {\r\n return $http.post(bunkerConsumptionPath, { companyCode: storage.logonInfo.agency.companyCode, vesselCode: vesselCode, aisPodLocation: aisPodLocation || 'n/a', speedString: speed || '0'}, { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n }\r\n\r\n cargoServiceFactory.$inject = ['$http', '$sessionStorage', 'apiBaseUrl'];\r\n function cargoServiceFactory($http, $sessionStorage, apiUrl) {\r\n var companyCode = $sessionStorage.logonInfo.agency.companyCode;\r\n var path = apiUrl + 'api/cargo/CargoService.asmx/GetCargoDataForVoyage';\r\n this.getCargoInfo = function (vesselCode, nextPortId) {\r\n return $http.post(path, { companyCode: companyCode, vesselCode: vesselCode, nextPortId: nextPortId }, { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n }\r\n\r\n openWeatherMapDataService.$inject = ['$http'];\r\n function openWeatherMapDataService($http) {\r\n var pathFind = 'https://api.openweathermap.org/data/2.5/find';\r\n this.getByPoint = function (lat, lon, count, apiKey) {\r\n return $http.get(pathFind, {\r\n params: { lat: lat, lon: lon, count: count, apiKey: apiKey }\r\n },\r\n { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n\r\n // [lon-left,lat-bottom,lon-right,lat-top,zoom]\r\n var pathCity = 'https://api.openweathermap.org/data/2.5/box/city';\r\n this.getByBoundsAndZoom = function (bounds, zoom, apiKey) {\r\n var list = [bounds._southWest.lng, bounds._southWest.lat, bounds._northEast.lng, bounds._northEast.lat, zoom];\r\n var bbox = list.join(',');\r\n return $http.get(pathCity, {\r\n params: { bbox: bbox, apiKey: apiKey }\r\n },\r\n { responseType: 'json' })\r\n .then(function (resp) {\r\n return resp.data;\r\n });\r\n };\r\n }\r\n\r\n vesselPathServiceFactory.$inject = ['vesselService', '$interpolate'];\r\n function vesselPathServiceFactory(vesselService, $interpolate) {\r\n // load vessel (marker.modelName) path points using web service\r\n this.getPath = function (vesselCode, hoursInPast) {\r\n return vesselService.getVesselPath(vesselCode, hoursInPast)\r\n .then(function (data) {\r\n var paths = {};\r\n var points = data.d.points;\r\n var i = 0;\r\n var lastPoint;\r\n points.map(function (point) {\r\n var tooltipHtml = $interpolate(\r\n '{{ Speed }} knots /  {{ Cours }} °' +\r\n '
{{ TimeStamp }}');\r\n var currentPoint = {\r\n lat: parseFloat(point.Lat.replace(',', '.')),\r\n lng: parseFloat(point.Lon.replace(',', '.'))\r\n };\r\n if (lastPoint) {\r\n paths['Point' + i++] = {\r\n color: 'blueviolet',\r\n weight: 2,\r\n latlngs: [lastPoint, currentPoint],\r\n vessel: vesselCode\r\n };\r\n }\r\n lastPoint = currentPoint;\r\n paths['Point' + i++] = {\r\n type: \"circleMarker\",\r\n radius: 1,\r\n latlngs: currentPoint,\r\n tooltip: tooltipHtml(point),\r\n vessel: vesselCode\r\n };\r\n });\r\n return paths;\r\n });\r\n };\r\n }\r\n\r\n markerServiceFactory.$inject = ['harbourService', 'vesselService', '$interpolate', '$document', 'openWeatherMapDataService', '$q'];\r\n function markerServiceFactory(harbourService, vesselService, $interpolate, $document, openWeatherMapDataService, $q) {\r\n var getMarkerBackGroundColor = function (aisInfo) {\r\n var backgroundColor = \"#ffffff\"; // white;\r\n var calcEta = aisInfo.CalcEta ? Date.parse(aisInfo.CalcEta.replace(/\\.|-/g, \"/\")) : \"n/a\";\r\n var scheduleEta = aisInfo.ScheduleEta ? Date.parse(aisInfo.ScheduleEta.replace(/\\.|-/g, \"/\")) : \"n/a\";\r\n\r\n // aisInfo.Status is written by observer service into dba.vessel_status.vs_status\r\n // https://support.softship.com/confluence/display/WES/Observer+Service#ObserverService-VSTAT–UpdateVesselStatus\r\n\r\n // Background color of vessel marker rendered at AIS position should be (base on vessel status):\r\n // 1: Sailing - calculated eta > planned eta then red otherwise green\r\n // 2: In Port / Cargo Operations - gray\r\n // 3: Sailing / Unknown - white\r\n // 4: Anchoring - blue\r\n // 5: Other Error - white\r\n // 6: Offhire - white - vessel cannot be found in current schedule\r\n // \r\n // AIS has its own status: 0 = underway, 1 = at anchor, 5 = moored, 8 = underway by sail\r\n if (aisInfo.Status === '6') {\r\n backgroundColor = \"#ffffff\"; // white\r\n } else if (aisInfo.Status === '5') {\r\n backgroundColor = \"#ffffff\"; // white\r\n } else if (aisInfo.Status === '4') {\r\n backgroundColor = \"#00ccff\"; // blue\r\n } else if (aisInfo.Status === '3') {\r\n backgroundColor = \"#ffffff\"; // white\r\n } else if (aisInfo.Status === '2') {\r\n backgroundColor = \"#cccccc\"; // gray\r\n } else if (aisInfo.Status === '1') {\r\n // match: aisInfo.DestinationMatch = 3\r\n if (!aisInfo.DestinationMatch || aisInfo.DestinationMatch !== 3 || !calcEta || !scheduleEta) {\r\n backgroundColor = \"#ffffff\"; // white -- we need matching destinations AND both values to be able to compare\r\n } else {\r\n if (calcEta > scheduleEta) {\r\n backgroundColor = \"#FF6347\"; // red -- arrival too late\r\n } else {\r\n backgroundColor = \"#00ff00\"; // lime (green) -- arrival in time\r\n }\r\n }\r\n }\r\n\r\n return backgroundColor;\r\n };\r\n\r\n var harbourInfoStartHtml = $interpolate(\r\n '
' +\r\n '

{{ Name }} ({{ Code }})

');\r\n var berthInfoHtml = $interpolate('

{{ Name }}

' +\r\n '

  Remarks: {{ Remarks }}

' +\r\n '

  Opening hours: {{ OpeningHours }}

');\r\n var harbourInfoEndHtml = function () { return '
'; };\r\n\r\n var harbourIcon = {\r\n iconUrl: './assets/content/image/harbour.png',\r\n iconSize: [16, 16],\r\n iconAnchor: [8, 8]\r\n };\r\n\r\n // then vessel icon and text\r\n // load vessels using web service\r\n var vesselHtml = $interpolate(\"

\" +\r\n \"\" +\r\n \"{{ VesselName }}

\" +\r\n \"\");\r\n\r\n // svg vector graph\r\n var createVesselIcon = function (color, angle) {\r\n var svg =\r\n \"\";\r\n var url = encodeURI(\"data:image/svg+xml,\" + svg).replace('#', '%23');\r\n var leafletIcon = {\r\n iconUrl: url,\r\n iconSize: [26, 26],\r\n iconAnchor: [13, 13]\r\n };\r\n return leafletIcon;\r\n };\r\n\r\n var normalizeId = function (id) {\r\n return id.replace('-', '_').replace('+', '_').replace('.', '_').replace(',', '_');\r\n };\r\n\r\n var weatherMarkerHtml = $interpolate('

{{name}}

' +\r\n '

   {{weather[0].main}}

' +\r\n '

Temperature: {{main.temp}}°
' +\r\n 'Temperature min. /max.: {{main.temp_min | number}} ° / {{main.temp_max | number}} °
' +\r\n 'Humidity: {{main.humidity | number}}%
' +\r\n 'Wind: {{wind.speed | number}} m/s
' +\r\n 'Clouds: {{clouds.today | number}}%

');\r\n\r\n var createWeatherIcon = function (city) {\r\n return {\r\n iconUrl: 'https://openweathermap.org/img/w/' + city.weather[0].icon + '.png',\r\n iconSize: [36, 36],\r\n iconAnchor: [13, 13]\r\n };\r\n };\r\n\r\n this.createSummaryControl = function () {\r\n if (L.control.summary) return L.control.summary;\r\n\r\n L.Control.summary = L.Control.extend({\r\n onAdd: function (map) {\r\n this._map = map;\r\n // TODO: not elegant - $compile of html template (ng-include?)\r\n this._sidebar = $document[0].getElementById('sidebar');\r\n L.DomEvent.disableClickPropagation(this._sidebar);\r\n L.DomEvent.disableScrollPropagation(this._sidebar);\r\n return this._sidebar;\r\n },\r\n\r\n onRemove: function (map) {\r\n // nop\r\n }\r\n });\r\n L.control.summary = function (opts) {\r\n return new L.Control.summary(opts);\r\n };\r\n\r\n return L.control.summary;\r\n };\r\n\r\n this.createTimestepControl = function () {\r\n if (L.control.timestep) return L.control.timestep;\r\n\r\n L.Control.timestep = L.Control.extend({\r\n onAdd: function (map) {\r\n this._map = map;\r\n this._timestep = $document[0].getElementById('timestep');\r\n L.DomEvent.disableClickPropagation(this._timestep);\r\n L.DomEvent.disableScrollPropagation(this._timestep);\r\n return this._timestep;\r\n },\r\n\r\n onRemove: function (map) {\r\n // nop\r\n }\r\n });\r\n L.control.timestep = function (opts) {\r\n return new L.Control.timestep(opts);\r\n };\r\n\r\n return L.control.timestep;\r\n };\r\n\r\n this.createTimeWaypointControl = function () {\r\n if (L.control.timeWaypoint) return L.control.timeWaypoint;\r\n\r\n L.Control.timeWaypoint = L.Control.extend({\r\n onAdd: function (map) {\r\n this._map = map;\r\n this._timeWaypoint = $document[0].getElementById('timeWaypoint');\r\n L.DomEvent.disableClickPropagation(this._timeWaypoint);\r\n L.DomEvent.disableScrollPropagation(this._timeWaypoint);\r\n return this._timeWaypoint;\r\n },\r\n\r\n onRemove: function (map) {\r\n // nop\r\n }\r\n });\r\n L.control.timeWaypoint = function (opts) {\r\n return new L.Control.timeWaypoint(opts);\r\n };\r\n\r\n return L.control.timeWaypoint;\r\n };\r\n\r\n this.createHistoryWaypointsControl = function () {\r\n if (L.control.historyWaypoints) return L.control.historyWaypoints;\r\n\r\n L.Control.historyWaypoints = L.Control.extend({\r\n onAdd: function (map) {\r\n this._map = map;\r\n this._historyWaypoints = $document[0].getElementById('historyWaypoints');\r\n L.DomEvent.disableClickPropagation(this._historyWaypoints);\r\n L.DomEvent.disableScrollPropagation(this._historyWaypoints);\r\n return this._historyWaypoints;\r\n },\r\n\r\n onRemove: function (map) {\r\n // nop\r\n }\r\n });\r\n L.control.historyWaypoints = function (opts) {\r\n return new L.Control.historyWaypoints(opts);\r\n };\r\n\r\n return L.control.historyWaypoints;\r\n };\r\n\r\n this.getHistoricalMarkersAndPaths = function (items) {\r\n return $q.all({\r\n harbourData: harbourService.getHarbours(),\r\n vesselData: vesselService.getHistoricalVesselMarkers(items),\r\n pathData: vesselService.getHistoricalVesselPaths(items)\r\n })\r\n .then(function (result) {\r\n var markers = {};\r\n var harbours = result.harbourData.d.harbours;\r\n // first load harbours\r\n harbours.map(function (harbour) {\r\n if (!harbour.Code) return;\r\n\r\n markers['Harbour' + harbour.Code] = {\r\n layer: 'harbours',\r\n lat: harbour.Lat,\r\n lng: harbour.Lon,\r\n icon: angular.copy(harbourIcon),\r\n tooltip: harbourInfoStartHtml(harbour) +\r\n harbour.Berths.map(berthInfoHtml).join('') +\r\n harbourInfoEndHtml()\r\n };\r\n });\r\n\r\n var vesselMarkers = result.vesselData.d;\r\n vesselMarkers.map(function (vessel) {\r\n // cannnot show vessel without the coordinates\r\n // filter only one vessel if MMSI passed by caller\r\n if (!vessel.Code || !vessel.LAT || !vessel.LON) return;\r\n\r\n\r\n // skip not selcted vessels\r\n if (_.every(items, function (i) {\r\n return i.vessel.code !== vessel.Code;\r\n })) return;\r\n\r\n angular.extend(vessel, { BackgroundColor: getMarkerBackGroundColor(vessel) });\r\n var width = vessel.VesselName.length * 7 + 6;\r\n markers['VesselArrow' + vessel.Code] = {\r\n layer: 'vessels',\r\n lat: parseFloat(vessel.LAT.replace(',', '.')),\r\n lng: parseFloat(vessel.LON.replace(',', '.')),\r\n icon: createVesselIcon(vessel.VesselIconCssColor || 'cornflowerblue',\r\n parseInt(vessel.Course)),\r\n code: vessel.Code,\r\n nextPortId: vessel.NextPortId,\r\n zIndexOffset: 500,\r\n opacity: 0.85,\r\n showPath: true\r\n };\r\n markers['VesselLabel' + vessel.Code] = {\r\n layer: 'vessels',\r\n lat: parseFloat(vessel.LAT.replace(',', '.')),\r\n lng: parseFloat(vessel.LON.replace(',', '.')),\r\n icon: {\r\n type: 'div',\r\n className: 'vesselNameMarker',\r\n iconSize: [width, 15],\r\n iconAnchor: [width / 2, -12],\r\n html: vesselHtml(vessel)\r\n },\r\n code: vessel.Code,\r\n nextPortId: vessel.NextPortId,\r\n lastReportDate: vessel.LastReportDate,\r\n zIndexOffset: 600,\r\n opacity: 0.85,\r\n showPath: false,\r\n riseOnHover: true\r\n };\r\n });\r\n\r\n var paths = [];\r\n var vesselPaths = result.pathData.d;\r\n var i = 0;\r\n vesselPaths.map(function (item) {\r\n var lastPoint;\r\n item.points.map(function (point) {\r\n var tooltipHtml = $interpolate(\r\n 'Vessel: ' + item.vesselCode + '
' +\r\n '{{ Speed }} knots /  {{ Cours }} °
' +\r\n '
{{ TimeStamp }}');\r\n var currentPoint = {\r\n lat: parseFloat(point.Lat.replace(',', '.')),\r\n lng: parseFloat(point.Lon.replace(',', '.'))\r\n };\r\n if (currentPoint.lat && currentPoint.lng) {\r\n if (lastPoint) {\r\n paths.push({\r\n color: item.color,\r\n weight: 2,\r\n latlngs: [lastPoint, currentPoint],\r\n vessel: item.vesselCode\r\n });\r\n }\r\n lastPoint = currentPoint;\r\n paths.push({\r\n type: \"circleMarker\",\r\n color: item.color,\r\n radius: 1,\r\n latlngs: currentPoint,\r\n tooltip: tooltipHtml(point),\r\n vessel: item.vesselCode\r\n });\r\n }\r\n });\r\n });\r\n\r\n return {\r\n markers: markers,\r\n paths: paths\r\n };\r\n });\r\n };\r\n\r\n this.getMarkers = function (bounds, zoom, mmsi, openWeatherMapApiKey, onlyWeatherMarkers) {\r\n return $q.all(\r\n !onlyWeatherMarkers ?\r\n {\r\n harbourData: harbourService.getHarbours(),\r\n vesselData: vesselService.getVesselMarkers(),\r\n weatherData: openWeatherMapApiKey\r\n ? openWeatherMapDataService.getByBoundsAndZoom(\r\n bounds,\r\n zoom,\r\n openWeatherMapApiKey)\r\n : null\r\n } : {\r\n weatherData: openWeatherMapApiKey ? openWeatherMapDataService.getByBoundsAndZoom(\r\n bounds,\r\n zoom,\r\n openWeatherMapApiKey) : null\r\n })\r\n .then(function (result) {\r\n\r\n var markers = {};\r\n\r\n if (result.weatherData && result.weatherData.cod === 200) {\r\n var cities = result.weatherData.list;\r\n cities.map(function (city) {\r\n markers['Weather' + city.id] = {\r\n layer: 'weather',\r\n lat: parseFloat(city.coord.Lat),\r\n lng: parseFloat(city.coord.Lon),\r\n icon: createWeatherIcon(city),\r\n message: weatherMarkerHtml(city)\r\n };\r\n });\r\n }\r\n\r\n if (onlyWeatherMarkers) return {\r\n markers: markers\r\n };\r\n\r\n var harbours = result.harbourData.d.harbours;\r\n // first load harbours\r\n harbours.map(function (harbour) {\r\n if (!harbour.Code) return;\r\n\r\n markers['Harbour' + harbour.Code] = {\r\n layer: 'harbours',\r\n lat: harbour.Lat,\r\n lng: harbour.Lon,\r\n icon: angular.copy(harbourIcon),\r\n tooltip: harbourInfoStartHtml(harbour) +\r\n harbour.Berths.map(berthInfoHtml).join('') +\r\n harbourInfoEndHtml()\r\n };\r\n });\r\n\r\n var vesselMarkers = result.vesselData.d;\r\n vesselMarkers.map(function (vessel) {\r\n // cannnot show vessel without the coordinates\r\n // filter only one vessel if MMSI passed by caller\r\n if (!vessel.Code || !vessel.LAT || !vessel.LON\r\n || (mmsi && mmsi !== vessel.VesselMmsi)) return;\r\n\r\n angular.extend(vessel, { BackgroundColor: getMarkerBackGroundColor(vessel) });\r\n var width = vessel.VesselName.length * 7 + 6;\r\n markers[normalizeId('VesselArrow' + vessel.Code)] = {\r\n layer: 'vessels',\r\n lat: parseFloat(vessel.LAT.replace(',', '.')),\r\n lng: parseFloat(vessel.LON.replace(',', '.')),\r\n icon: createVesselIcon(vessel.VesselIconCssColor || 'cornflowerblue',\r\n parseInt(vessel.Course)),\r\n code: vessel.Code,\r\n nextPortId: vessel.NextPortId,\r\n zIndexOffset: 500,\r\n opacity: 0.85,\r\n showPath: true\r\n };\r\n markers[normalizeId('VesselLabel' + vessel.Code)] = {\r\n layer: 'vessels',\r\n lat: parseFloat(vessel.LAT.replace(',', '.')),\r\n lng: parseFloat(vessel.LON.replace(',', '.')),\r\n icon: {\r\n type: 'div',\r\n className: 'vesselNameMarker',\r\n iconSize: [width, 15],\r\n iconAnchor: [width / 2, -12],\r\n html: vesselHtml(vessel)\r\n },\r\n code: vessel.Code,\r\n nextPortId: vessel.NextPortId,\r\n lastReportDate: vessel.LastReportDate,\r\n zIndexOffset: 600,\r\n opacity: 0.85,\r\n showPath: false,\r\n riseOnHover: true\r\n };\r\n });\r\n\r\n return {\r\n markers: markers\r\n };\r\n });\r\n };\r\n }\r\n})();\n\n\n// WEBPACK FOOTER //\n// ./src/services/app.service.js"],"sourceRoot":""}