Class: directive directive:ngeoScaleselector

ngeo.map.module:scaleselector.directive

new directive(ngeoScaleselectorTemplateUrl)

Provides the "ngeoScaleselector" directive, a widget for selecting map scales.

Example:

<div ngeo-scaleselector="ctrl.scales" ngeo-scaleselector-map="ctrl.map">
</div>

The expression passed to the ngeo-scaleselector attribute should return an array of this form:

[20000, 10000, 5000, 2500]

That directive's partial uses Bootstrap's dropdown and dropdown-menu classes, and data-toggle="dropdown", so it is meant to be used with Bootstrap's "dropdown" jQuery plugin.

You can pass options to configure the behaviors of this element. Options is a ngeox.ScaleselectorOptions object.

Example:

<div ngeo-scaleselector="ctrl.scales"
  ngeo-scaleselector-map="ctrl.map"
  ngeo-scaleselector-options="ctrl.scaleSelectorOptions">
</div>

By default the directive uses "scaleselector.html" as its templateUrl. This can be changed by redefining the "ngeoScaleselectorTemplateUrl" value.

The directive has its own scope, but it is not isolate scope. That scope includes a reference to the directive's controller: the "scaleselectorCtrl" scope property.

The directive doesn't create any watcher. In particular the object including the scales information is now watched.

See our live example: ../examples/scaleselector.html

HTML attributes:
Name Type Description
ngeo-scaleselector Array:.<number:> The available scales.
ngeo-scaleselector-map ol.Map The map.
ngeo-scaleselector-options ngeox.ScaleselectorOptions Optional. The configuration options.
Returns:
angular.Directive

Directive Definition Object.