{"size": 1080, "ext": "js", "max_stars_repo_path": "angular/directives/glStyle/glStyle.directive.js", "max_stars_repo_name": "magnolo/23demo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "angular/directives/glStyle/glStyle.directive.js", "max_issues_repo_name": "magnolo/23demo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "angular/directives/glStyle/glStyle.directive.js", "max_forks_repo_name": "magnolo/23demo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.3414634146, "max_line_length": 73, "alphanum_fraction": 0.5722222222}
export function GlStyleDirective() {
    return {
        restrict: 'A',
        scope:false,
        replace:false,
        require: '?^mapboxgl',
        link: function(scope, element, attrs, controller) {
            //
            if (!controller) {
                throw new Error('Invalid mapboxgl-directive controller');
            }
            /*
      mapbox://styles/mapbox/streets-v9
      mapbox://styles/mapbox/outdoors-v9
      mapbox://styles/mapbox/light-v9
      mapbox://styles/mapbox/dark-v9
      mapbox://styles/mapbox/satellite-v9
			mapbox://styles/mapbox/satellite-streets-v9
    */

		var mapboxglScope = controller.getMapboxGlScope();

		controller.getMap().then(function (map) {
			mapboxglScope.$watch('glStyle', function (style, oldStyle) {
				if (angular.isDefined(style) && style !== null) {
					map.setStyle(style);

					map.on('style.load', function () {
						$rootScope.$broadcast('mapboxglMap:styleChanged', {
							map: map,
							newStyle: style,
							oldStyle: oldStyle
						});
					});
				}
			}, true);
		});
        }
    }
}
