/* Copyright (c) 2016 Jean-Marc VIGLINO,
released under the CeCILL-B license (French BSD license)
(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).
*/
import ol from 'ol'
import ol_control_Control from 'ol/control/control'
import ol_geom_Polygon from 'ol/geom/polygon'
import ol_geom_Point from 'ol/geom/point'
import ol_interaction_Pointer from 'ol/interaction/pointer'
import ol_easing from 'ol/easing'
import ol_Map from 'ol/map'
import ol_Collection from 'ol/collection'
import ol_View from 'ol/view'
import ol_source_Vector from 'ol/source/vector'
import ol_style_Style from 'ol/style/style'
import ol_style_Circle from 'ol/style/circle'
import ol_style_Fill from 'ol/style/fill'
import ol_style_Stroke from 'ol/style/stroke'
import ol_layer_Vector from 'ol/layer/vector'
import ol_Feature from 'ol/feature'
//TODO: replace ol.animation.pan with new {ol_interaction_Interaction.pan}
//import ol_interaction_Interaction from 'ol/interaction/interaction'
/**
* OpenLayers 3 Layer Overview Control.
* The overview can rotate with map.
* Zoom levels are configurable.
* Click on the overview will center the map.
* Change width/height of the overview trough css.
*
* @constructor
* @extends {ol_control_Control}
* @param {Object=} options Control options.
* @param {ol.ProjectionLike} options.projection The projection. Default is EPSG:3857 (Spherical Mercator).
* @param {Number} options.minZoom default 0
* @param {Number} options.maxZoom default 18
* @param {boolean} options.rotation enable rotation, default false
* @param {top|bottom-left|right} options.align position
* @param {Array
} options.layers list of layers
* @param {ol.style.Style | Array. | undefined} options.style style to draw the map extent on the overveiw
* @param {bool|elastic} options.panAnimation use animation to center map on click, default true
*/
var ol_control_Overview = function(options)
{ options = options || {};
var self = this;
// API
this.minZoom = options.minZoom || 0;
this.maxZoom = options.maxZoom || 18;
this.rotation = options.rotation;
var element;
if (options.target)
{ element = $("
");
this.panel_ = $(options.target);
}
else
{ element = $("
").addClass('ol-overview ol-unselectable ol-control ol-collapsed');
if (/top/.test(options.align)) element.addClass('ol-control-top');
if (/right/.test(options.align)) element.addClass('ol-control-right');
$("