code: function LocationFactory($rootScope, $window) {
    const history = $window.history;
    const service = new StatemanagerLocation($window.location, $window.history);
  
    let lastUri = service.getUriString();
    $rootScope.$watch(() => {
      const newUri = service.getUriString();
      if (lastUri !== newUri) {
        $rootScope.$evalAsync(() => {
          lastUri = newUri;
          if (history !== undefined && history.replaceState !== undefined) {
            replaceState(history, newUri);
          }
          $rootScope.$broadcast('ngeoLocationChange');
        });
      }
    });
  
    return service;
  }
docs: The factory creating the ngeo Location service.
  
  @param {angular.IScope} $rootScope The root scope.
  @param {angular.IWindowService} $window Angular window service.
  @return {StatemanagerLocation} The ngeo location service.
  @ngInject
  @private
  @hidden