Naimikan/angular-mapboxgl-directive

View on GitHub
src/providers/mapboxglInteractiveLayers.js

Summary

Maintainability
A
0 mins
Test Coverage
angular.module('mapboxgl-directive').provider('interactiveLayers', [function () {
  var interactiveLayers = [];

  return {
    setLayers: function (newInteractiveLayers) {
      interactiveLayers = newInteractiveLayers;
    },

    addLayer: function (newInterativeLayer) {
      interactiveLayers.push(newInterativeLayer);
    },

    $get: function () {
      return {
        layers: interactiveLayers
      };
    }
  };
}]);