(function () { "use strict"; angular.module('app.service') .service('mapHelper', ['yaMapSettings', /** * @name mapHelper * @param yaMapSettings */ function (yaMapSettings) { this.coord2array = function (obj) { if (yaMapSettings.order === 'longlat') { return [obj.longitude, obj.latitude]; } else { return [obj.latitude, obj.longitude]; } }; this.coord2obj = function (list) { if (yaMapSettings.order === 'longlat') { return {longitude: list[0], latitude: list[1]}; } else { return {latitude: list[0], longitude: list[1]}; } }; } ]); })();