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,IAAI,GAAG,MAAM,KAAK,CACtB,MAAO,IAET,OAAQ,IAAI,GAAG,MAAM,OAAQ,CAC3B,MAAO,EACP,MAAO,IACP,SAAU,EAAS,CAAC,EAAE,GAAK,SAInC,CACA,OAAO,CACT,CACF,CAwCsC,CAAS,GAE3C,IAAK,gDAAiD,OAxC1D,SAAkB,GAChB,IAAI,EAAQ,IAAI,GAAG,MAAM,MAAM,CAC7B,KAAM,IAAI,GAAG,MAAM,KAAK,CACtB,KAAM,OACN,KAAM,uBACN,KAAM,IAAI,GAAG,MAAM,KAAK,CACtB,MAAO,CAAC,IAAK,EAAG,IAAK,KAEvB,OAAQ,IAAI,GAAG,MAAM,OAAQ,CAC3B,MAAO,CAAC,IAAI,IAAI,IAAK,IACrB,MAAO,MAGX,OAAQ,IAAI,GAAG,MAAM,OAAQ,CAC3B,MAAO,CAAC,IAAK,IAAK,EAAG,GACrB,MAAO,MAET,KAAM,IAAI,GAAG,MAAM,KAAK,CACtB,MAAO,CAAC,IAAK,EAAG,IAAK,QAGzB,OAAO,SAAS,EAAS,GAQvB,OAPI,EAAa,GAAI,EAAM,UAAU,QAAQ,wBACxC,EAAM,UAAU,QAAQ,wBACzB,EAAQ,QACV,EAAM,UAAU,QAAQ,EAAQ,IAAI,WAAY,KAAM,EAAQ,IAAI,WAAW,IAAI,QAAQ,MAAM,KAE/F,EAAM,UAAU,SAAS,EAAQ,IAAI,WAAW,IAAI,QAAQ,MAAM,KAE7D,CACT,CACF,CASiE,CAAS,GAE1E,CACC,CArOD","file":"/npm/ol-ext@3.1.18/dist/ol-ext.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/ol-ext@3.1.18/dist/ol-ext.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * ol-ext - A set of cool extensions for OpenLayers (ol) in node modules structure\n * @description ol3,openlayers,popup,menu,symbol,renderer,filter,canvas,interaction,split,statistic,charts,pie,LayerSwitcher,toolbar,animation\n * @version v3.1.18\n * @author Jean-Marc Viglino\n * @see https://github.com/Viglino/ol-ext#,\n * @license BSD-3-Clause\n */\n/** @namespace  ol.ext\n */\n/*global ol*/\nif (window.ol && !ol.ext) {\n  ol.ext = {};\n}\n/** Inherit the prototype methods from one constructor into another.\n * replace deprecated ol method\n *\n * @param {!Function} childCtor Child constructor.\n * @param {!Function} parentCtor Parent constructor.\n * @function module:ol.inherits\n * @api\n */\nol.ext.inherits = function(child,parent) {\n  child.prototype = Object.create(parent.prototype);\n  child.prototype.constructor = child;\n};\n// Compatibilty with ol > 5 to be removed when v6 is out\nif (window.ol) {\n  if (!ol.inherits) ol.inherits = ol.ext.inherits;\n}\n/* IE Polyfill */\n// NodeList.forEach\nif (window.NodeList && !NodeList.prototype.forEach) {\n  NodeList.prototype.forEach = Array.prototype.forEach;\n}\n// Element.remove\nif (window.Element && !Element.prototype.remove) {\n  Element.prototype.remove = function() {\n    if (this.parentNode) this.parentNode.removeChild(this);\n  }\n}\n/* End Polyfill */\n\n/** Ajax request\n * @fires success\n * @fires error\n * @param {*} options\n *  @param {string} options.auth Authorisation as btoa(\"username:password\");\n *  @param {string} options.dataType The type of data that you're expecting back from the server, default JSON\n */\nol.ext.Ajax = function(options) {\n  options = options || {};\n  ol.Object.call(this);\n  this._auth = options.auth;\n  this.set('dataType', options.dataType || 'JSON');\n};\nol.ext.inherits(ol.ext.Ajax, ol.Object);\n/** Helper for get\n * @param {*} options\n *  @param {string} options.url\n *  @param {string} options.auth Authorisation as btoa(\"username:password\");\n *  @param {string} options.dataType The type of data that you're expecting back from the server, default JSON\n *  @param {string} options.success\n *  @param {string} options.error\n *  @param {*} options.options get options\n */\nol.ext.Ajax.get = function(options) {\n  var ajax = new ol.ext.Ajax(options);\n  if (options.success) ajax.on('success', function(e) { options.success(e.response, e); } );\n  if (options.error) ajax.on('error', function(e) { options.error(e); } );\n  ajax.send(options.url, options.data, options.options);\n};\n/** Helper to get cors header\n * @param {string} url\n * @param {string} callback\n */\nol.ext.Ajax.getCORS = function(url, callback) {\n  var request = new XMLHttpRequest();\n  request.open('GET', url, true);\n  request.send();\n  request.onreadystatechange = function() {\n    if (this.readyState == this.HEADERS_RECEIVED) {\n      callback(request.getResponseHeader('Access-Control-Allow-Origin'));\n    }\n  }\n};\n/** Send an ajax request (GET)\n * @fires success\n * @fires error\n * @param {string} url\n * @param {*} data Data to send to the server as key / value\n * @param {*} options a set of options that are returned in the \n *  @param {boolean} options.abort false to prevent aborting the current request, default true\n */\nol.ext.Ajax.prototype.send = function (url, data, options){\n  options = options || {};\n  var self = this;\n  // Url\n  var encode = (options.encode !== false) \n  if (encode) url = encodeURI(url);\n  // Parameters\n  var parameters = '';\n  for (var index in data) {\n    if (data.hasOwnProperty(index) && data[index]!==undefined) {\n      parameters += (parameters ? '&' : '?') + index + '=' + (encode ? encodeURIComponent(data[index]) : data[index]);\n    }\n  }\n  // Abort previous request\n  if (this._request && options.abort!==false) {\n    this._request.abort();\n  }\n  // New request\n  var ajax = this._request = new XMLHttpRequest();\n  ajax.open('GET', url + parameters, true);\n  if (options.timeout) ajax.timeout = options.timeout;\n  if (this._auth) {\n    ajax.setRequestHeader(\"Authorization\", \"Basic \" + this._auth);\n  }\n  // Load complete\n  this.dispatchEvent ({ type: 'loadstart' });\n  ajax.onload = function() {\n    self._request = null;\n    self.dispatchEvent ({ type: 'loadend' });\n    if (this.status >= 200 && this.status < 400) {\n      var response;\n      // Decode response\n      try {\n        switch (self.get('dataType')) {\n          case 'JSON': {\n            response = JSON.parse(this.response);\n            break;\n          }\n          default: {\n            response = this.response;\n          }\n        }\n      } catch(e) {\n        // Error\n        self.dispatchEvent ({ \n          type: 'error',\n          status: 0,\n          statusText: 'parsererror',\n          error: e,\n          options: options,\n          jqXHR: this\n        });\n        return;\n      }\n      // Success\n      //console.log('response',response)\n      self.dispatchEvent ({ \n        type: 'success',\n        response: response,\n        status: this.status,\n        statusText: this.statusText,\n        options: options,\n        jqXHR: this\n      });\n    } else {\n      self.dispatchEvent ({ \n        type: 'error',\n        status: this.status,\n        statusText: this.statusText,\n        options: options,\n        jqXHR: this\n      });\n    }\n  };\n  // Oops\n  ajax.ontimeout = function() {\n    self._request = null;\n    self.dispatchEvent ({ type: 'loadend' });\n    self.dispatchEvent ({ \n      type: 'error',\n      status: this.status,\n      statusText: 'Timeout',\n      options: options,\n      jqXHR: this\n    });\n  };\n  ajax.onerror = function() {\n    self._request = null;\n    self.dispatchEvent ({ type: 'loadend' });\n    self.dispatchEvent ({ \n      type: 'error',\n      status: this.status,\n      statusText: this.statusText,\n      options: options,\n      jqXHR: this\n    });\n  };\n  // GO!\n  ajax.send();\n};\n\n/** SVG filter \n * @param {*} options\n *  @param {ol.ext.SVGOperation} option.operation\n *  @param {string} option.id filter id, only to use if you want to adress the filter directly or var the lib create one, if none create a unique id\n *  @param {string} option.color color interpolation filters, linear or sRGB\n */\nol.ext.SVGFilter = function(options) {\n  options = options || {};\n  ol.Object.call(this);\n  if (!ol.ext.SVGFilter.prototype.svg) {\n    ol.ext.SVGFilter.prototype.svg = document.createElementNS( this.NS, 'svg' );\n    ol.ext.SVGFilter.prototype.svg.setAttribute('version','1.1');\n    ol.ext.SVGFilter.prototype.svg.setAttribute('width',0);\n    ol.ext.SVGFilter.prototype.svg.setAttribute('height',0);\n    ol.ext.SVGFilter.prototype.svg.style.position = 'absolute';\n    /* Firefox doesn't process hidden svg\n    ol.ext.SVGFilter.prototype.svg.style.display = 'none';\n    */\n    document.body.appendChild( ol.ext.SVGFilter.prototype.svg );\n  }\n  this.element = document.createElementNS( this.NS, 'filter' );\n  this._id = options.id || '_ol_SVGFilter_' + (ol.ext.SVGFilter.prototype._id++);\n  this.element.setAttribute( 'id', this._id );\n  if (options.color) this.element.setAttribute( 'color-interpolation-filters', options.color );\n  if (options.operation) this.addOperation(options.operation);\n  ol.ext.SVGFilter.prototype.svg.appendChild( this.element );\n};\nol.ext.inherits(ol.ext.SVGFilter, ol.Object);\nol.ext.SVGFilter.prototype.NS = \"http://www.w3.org/2000/svg\";\nol.ext.SVGFilter.prototype.svg = null;\nol.ext.SVGFilter.prototype._id = 0;\n/** Get filter ID\n * @return {string}\n */\nol.ext.SVGFilter.prototype.getId = function() {\n  return this._id;\n};\n/** Remove from DOM\n */\nol.ext.SVGFilter.prototype.remove = function() {\n  this.element.remove();\n};\n/** Add a new operation\n * @param {ol.ext.SVGOperation} operation\n */\nol.ext.SVGFilter.prototype.addOperation = function(operation) {\n  if (operation instanceof Array) {\n    operation.forEach(function(o) { this.addOperation(o) }.bind(this));\n  } else {\n    if (!(operation instanceof ol.ext.SVGOperation)) operation = new ol.ext.SVGOperation(operation);\n    this.element.appendChild( operation.geElement() );\n  }\n};\n/** Add a grayscale operation\n * @param {number} value\n */\nol.ext.SVGFilter.prototype.grayscale = function(value) {\n  this.addOperation({\n    feoperation: 'feColorMatrix',\n    type: 'saturate',\n    values: value || 0\n  });\n};\n/** Add a luminanceToAlpha operation\n * @param {*} options\n *  @param {number} options.gamma enhance gamma, default 0\n */\nol.ext.SVGFilter.prototype.luminanceToAlpha = function(options) {\n  options = options || {};\n  this.addOperation({\n    feoperation: 'feColorMatrix',\n    type: 'luminanceToAlpha'\n  });\n  if (options.gamma) {\n    this.addOperation({\n      feoperation: 'feComponentTransfer',\n      operations: [{\n        feoperation: 'feFuncA',\n        type: 'gamma', \n        amplitude: options.gamma,\n        exponent: 1,\n        offset: 0\n      }]\n    });\n  }\n};\nol.ext.SVGFilter.prototype.applyTo = function(img) {\n  var canvas = document.createElement('CANVAS');\n  canvas.width = img.naturalWidth || img.width;\n  canvas.height = img.naturalHeight || img.height;\n  canvas.getContext('2d').filter = 'url(#'+this.getId()+')';\n  canvas.getContext('2d').drawImage(img, 0, 0);\n  return canvas;\n};\n\n/** SVG filter \n * @param {string | *} attributes a list of attributes or fe operation\n *  @param {string} attributes.feoperation filter primitive tag name\n */\nol.ext.SVGOperation = function(attributes) {\n  if (typeof(attributes)==='string') attributes = { feoperation: attributes };\n  if (!attributes || !attributes.feoperation) {\n    console.error('[SVGOperation]: no operation defined.')\n    return;\n  }\n  ol.Object.call(this);\n  this._name = attributes.feoperation;\n  this.element = document.createElementNS( this.NS, this._name );\n  this.setProperties(attributes);\n  if (attributes.operations instanceof Array) this.appendChild(attributes.operations);\n};\nol.ext.inherits(ol.ext.SVGOperation, ol.Object);\nol.ext.SVGOperation.prototype.NS = \"http://www.w3.org/2000/svg\";\n/** Get filter name\n * @return {string}\n */\nol.ext.SVGOperation.prototype.getName = function() {\n  return this._name;\n};\n/** Set Filter attribute\n * @param {*} attributes\n */\nol.ext.SVGOperation.prototype.set = function(k, val) {\n  if (!/^feoperation$|^operations$/.test(k)) {\n    ol.Object.prototype.set.call(this, k, val);\n    this.element.setAttribute( k, val );\n  }\n};\n/** Set Filter attributes\n * @param {*} attributes\n */\nol.ext.SVGOperation.prototype.setProperties = function(attributes) {\n  attributes = attributes || {};\n  for (var k in attributes) {\n    this.set(k, attributes[k])\n  }\n};\n/** Get SVG  element\n * @return {Element}\n */\nol.ext.SVGOperation.prototype.geElement = function() {\n  return this.element;\n};\n/** Append a new operation\n * @param {ol.ext.SVGOperation} operation\n */\nol.ext.SVGOperation.prototype.appendChild = function(operation) {\n  if (operation instanceof Array) {\n    operation.forEach(function(o) { this.appendChild(o) }.bind(this));\n  } else {\n    if (!(operation instanceof ol.ext.SVGOperation)) operation = new ol.ext.SVGOperation(operation);\n    this.element.appendChild( operation.geElement() );\n  }\n};\n\n/** Vanilla JS helper to manipulate DOM without jQuery\n * @see https://github.com/nefe/You-Dont-Need-jQuery\n * @see https://plainjs.com/javascript/\n * @see http://youmightnotneedjquery.com/\n */\n ol.ext.element = {};\n/**\n * Create an element\n * @param {string} tagName The element tag, use 'TEXT' to create a text node\n * @param {*} options\n *  @param {string} options.className className The element class name \n *  @param {Element} options.parent Parent to append the element as child\n *  @param {Element|string} options.html Content of the element\n *  @param {string} options.* Any other attribut to add to the element\n */\nol.ext.element.create = function (tagName, options) {\n  options = options || {};\n  var elt;\n  // Create text node\n  if (tagName === 'TEXT') {\n    elt = document.createTextNode(options.html||'');\n    if (options.parent) options.parent.appendChild(elt);\n  } else {\n    // Other element\n    elt = document.createElement(tagName);\n    if (/button/i.test(tagName)) elt.setAttribute('type', 'button');\n    for (var attr in options) {\n      switch (attr) {\n        case 'className': {\n          if (options.className && options.className.trim) elt.setAttribute('class', options.className.trim());\n          break;\n        }\n        case 'html': {\n          if (options.html instanceof Element) elt.appendChild(options.html)\n          else if (options.html!==undefined) elt.innerHTML = options.html;\n          break;\n        }\n        case 'parent': {\n          if (options.parent) options.parent.appendChild(elt);\n          break;\n        }\n        case 'style': {\n          this.setStyle(elt, options.style);\n          break;\n        }\n        case 'change':\n        case 'click': {\n          ol.ext.element.addListener(elt, attr, options[attr]);\n          break;\n        }\n        case 'on': {\n          for (var e in options.on) {\n            ol.ext.element.addListener(elt, e, options.on[e]);\n          }\n          break;\n        }\n        case 'checked': {\n          elt.checked = !!options.checked;\n          break;\n        }\n        default: {\n          elt.setAttribute(attr, options[attr]);\n          break;\n        }\n      }\n    }\n  }\n  return elt;\n};\n/** Set inner html or append a child element to an element\n * @param {Element} element\n * @param {Element|string} html Content of the element\n */\nol.ext.element.setHTML = function(element, html) {\n  if (html instanceof Element) element.appendChild(html)\n  else if (html!==undefined) element.innerHTML = html;\n};\n/** Append text into an elemnt\n * @param {Element} element\n * @param {string} text text content\n */\nol.ext.element.appendText = function(element, text) {\n  element.appendChild(document.createTextNode(text||''));\n};\n/**\n * Add a set of event listener to an element\n * @param {Element} element\n * @param {string|Array<string>} eventType\n * @param {function} fn\n */\nol.ext.element.addListener = function (element, eventType, fn) {\n  if (typeof eventType === 'string') eventType = eventType.split(' ');\n  eventType.forEach(function(e) {\n    element.addEventListener(e, fn);\n  });\n};\n/**\n * Add a set of event listener to an element\n * @param {Element} element\n * @param {string|Array<string>} eventType\n * @param {function} fn\n */\nol.ext.element.removeListener = function (element, eventType, fn) {\n  if (typeof eventType === 'string') eventType = eventType.split(' ');\n  eventType.forEach(function(e) {\n    element.removeEventListener(e, fn);\n  });\n};\n/**\n * Show an element\n * @param {Element} element\n */\nol.ext.element.show = function (element) {\n  element.style.display = '';\n};\n/**\n * Hide an element\n * @param {Element} element\n */\nol.ext.element.hide = function (element) {\n  element.style.display = 'none';\n};\n/**\n * Test if an element is hihdden\n * @param {Element} element\n * @return {boolean}\n */\nol.ext.element.hidden = function (element) {\n  return ol.ext.element.getStyle(element, 'display') === 'none';\n};\n/**\n * Toggle an element\n * @param {Element} element\n */\nol.ext.element.toggle = function (element) {\n  element.style.display = (element.style.display==='none' ? '' : 'none');\n};\n/** Set style of an element\n * @param {DOMElement} el the element\n * @param {*} st list of style\n */\nol.ext.element.setStyle = function(el, st) {\n  for (var s in st) {\n    switch (s) {\n      case 'top':\n      case 'left':\n      case 'bottom':\n      case 'right':\n      case 'minWidth':\n      case 'maxWidth':\n      case 'width':\n      case 'height': {\n        if (typeof(st[s]) === 'number') {\n          el.style[s] = st[s]+'px';\n        } else {\n          el.style[s] = st[s];\n        }\n        break;\n      }\n      default: {\n        el.style[s] = st[s];\n      }\n    }\n  }\n};\n/**\n * Get style propertie of an element\n * @param {DOMElement} el the element\n * @param {string} styleProp Propertie name\n * @return {*} style value\n */\nol.ext.element.getStyle = function(el, styleProp) {\n  var value, defaultView = (el.ownerDocument || document).defaultView;\n  // W3C standard way:\n  if (defaultView && defaultView.getComputedStyle) {\n    // sanitize property name to css notation\n    // (hypen separated words eg. font-Size)\n    styleProp = styleProp.replace(/([A-Z])/g, \"-$1\").toLowerCase();\n    value = defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);\n  } else if (el.currentStyle) { // IE\n    // sanitize property name to camelCase\n    styleProp = styleProp.replace(/-(\\w)/g, function(str, letter) {\n      return letter.toUpperCase();\n    });\n    value = el.currentStyle[styleProp];\n    // convert other units to pixels on IE\n    if (/^\\d+(em|pt|%|ex)?$/i.test(value)) { \n      return (function(value) {\n        var oldLeft = el.style.left, oldRsLeft = el.runtimeStyle.left;\n        el.runtimeStyle.left = el.currentStyle.left;\n        el.style.left = value || 0;\n        value = el.style.pixelLeft + \"px\";\n        el.style.left = oldLeft;\n        el.runtimeStyle.left = oldRsLeft;\n        return value;\n      })(value);\n    }\n  }\n  if (/px$/.test(value)) return parseInt(value);\n  return value;\n};\n/** Get outerHeight of an elemen\n * @param {DOMElement} elt\n * @return {number}\n */\nol.ext.element.outerHeight = function(elt) {\n  return elt.offsetHeight + ol.ext.element.getStyle(elt, 'marginBottom')\n};\n/** Get outerWidth of an elemen\n * @param {DOMElement} elt\n * @return {number}\n */\nol.ext.element.outerWidth = function(elt) {\n  return elt.offsetWidth + ol.ext.element.getStyle(elt, 'marginLeft')\n};\n/** Get element offset rect\n * @param {DOMElement} elt\n * @return {*} \n */\nol.ext.element.offsetRect = function(elt) {\n  var rect = elt.getBoundingClientRect();\n  return {\n    top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),\n    left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0),\n    height: rect.height || (rect.bottom - rect.top),\n    width: rect.widtth || (rect.right - rect.left)\n  }\n};\n/** Make a div scrollable without scrollbar.\n * On touch devices the default behavior is preserved\n * @param {DOMElement} elt\n * @param {function} onmove a function that takes a boolean indicating that the div is scrolling\n */\nol.ext.element.scrollDiv = function(elt, options) {\n  var pos = false;\n  var speed = 0;\n  var d, dt = 0;\n  var onmove = (typeof(options.onmove) === 'function' ? options.onmove : function(){});\n  var page = options.vertical ? 'pageY' : 'pageX';\n  var scroll = options.vertical ? 'scrollTop' : 'scrollLeft';\n  var moving = false;\n  // Prevent image dragging\n  elt.querySelectorAll('img').forEach(function(i) {\n    i.ondragstart = function(){ return false; };\n  });\n  // Start scrolling\n  ol.ext.element.addListener(elt, ['mousedown'], function(e) {\n    moving = false;\n    pos = e[page];\n    dt = new Date();\n    elt.classList.add('ol-move');\n  });\n  // Register scroll\n  ol.ext.element.addListener(window, ['mousemove'], function(e) {\n    moving = true;\n    if (pos !== false) {\n      var delta = pos - e[page];\n      elt[scroll] += delta;\n      d = new Date();\n      if (d-dt) {\n        speed = (speed + delta / (d - dt))/2;\n      }\n      pos = e[page];\n      dt = d;\n      // Tell we are moving\n      if (delta) onmove(true);\n    } else {\n      // Not moving yet\n      onmove(false);\n    }\n  });\n  // Stop scrolling\n  ol.ext.element.addListener(window, ['mouseup'], function(e) {\n    if (moving) setTimeout (function() { elt.classList.remove('ol-move'); });\n    else elt.classList.remove('ol-move');\n    moving = false;\n    dt = new Date() - dt;\n    if (dt>100) {\n      // User stop: no speed\n      speed = 0;\n    } else if (dt>0) {\n      // Calculate new speed\n      speed = ((speed||0) + (pos - e[page]) / dt) / 2;\n    }\n    elt[scroll] += speed*100;\n    pos = false;\n    speed = 0;\n    dt = 0;\n  });\n  // Handle mousewheel\n  if (options.mousewheel && !elt.classList.contains('ol-touch')) {\n    ol.ext.element.addListener(elt, \n      ['mousewheel', 'DOMMouseScroll', 'onmousewheel'], \n      function(e) {\n        var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n        elt.classList.add('ol-move');\n        elt[scroll] -= delta*30;\n        elt.classList.remove('ol-move');\n        return false;\n      }\n    );\n  }\n};\n/** Dispatch an event to an Element \n * @param {string} eventName\n * @param {Element} element\n*/\nol.ext.element.dispatchEvent = function (eventName, element) {\n  var event;\n  try {\n    event = new CustomEvent(eventName);\n  } catch(e) {\n    // Try customevent on IE\n    event = document.createEvent(\"CustomEvent\");\n    event.initCustomEvent(eventName, true, true, {});\n  }\n  element.dispatchEvent(event);\n};\n\n/** Get a canvas overlay for a map (non rotated, on top of the map)\n * @param {ol.Map} map\n * @return {canvas}\n */\nol.ext.getMapCanvas = function(map) {\n  if (!map) return null;\n  var canvas = map.getViewport().getElementsByClassName('ol-fixedoverlay')[0];\n  if (!canvas) {\n    if (map.getViewport().querySelector('.ol-layers')) {\n      // Add a fixed canvas layer on top of the map\n      canvas = document.createElement('canvas');\n      canvas.className = 'ol-fixedoverlay';\n      map.getViewport().querySelector('.ol-layers').after(canvas);\n      // Clear before new compose\n      map.on('precompose', function (e){\n        canvas.width = map.getSize()[0] * e.frameState.pixelRatio;\n        canvas.height = map.getSize()[1] * e.frameState.pixelRatio;\n      });\n    } else {\n      canvas = map.getViewport().querySelector('canvas');\n    }\n  }\n  return canvas;\n};\n  \n/* See \nhttps://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Matrix_math_for_the_web\nhttps://evanw.github.io/lightgl.js/docs/matrix.html \nhttps://github.com/jlmakes/rematrix\nhttps://jsfiddle.net/2znLxda2/\n*/\n/** Matrix3D; a set of functions to handle matrix3D\n */\nol.matrix3D = {};\n/** Get transform matrix3D of an element\n * @param {Element} ele\n * @return {Array<Array<number>>}\n */\nol.matrix3D.getTransform = function(ele) {\n  var style = window.getComputedStyle(ele, null);\n  var tr = style.getPropertyValue(\"-webkit-transform\") \n    || style.getPropertyValue(\"-moz-transform\") \n    || style.getPropertyValue(\"-ms-transform\") \n    || style.getPropertyValue(\"-o-transform\") \n    || style.getPropertyValue(\"transform\");\n  var values = tr.split('(')[1].split(')')[0].split(',');\n  var mx = [ [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1] ];    \n  var i, j;\n  if (values.length === 16) {\n    for (i = 0; i < 4; ++i) {\n      for (j = 0; j < 4; ++j) {\n        mx[j][i] = +values[i * 4 + j];\n      }\n    }\n  } else {\n    for (i = 0; i < 3; ++i) {\n      for (j = 0; j < 2; ++j) {\n        mx[j][i] = +values[i * 2 + j];\n      }\n    }\n  }\n  return mx;\n};\n/** Get transform matrix3D of an element\n * @param {Element} ele\n * @return {Array<number>}\n */\nol.matrix3D.getTransformOrigin = function (ele) {\n  var style = window.getComputedStyle(ele, null);\n  var tr = style.getPropertyValue(\"-webkit-transform-origin\") \n    || style.getPropertyValue(\"-moz-transform-origin\") \n    || style.getPropertyValue(\"-ms-transform-origin\") \n    || style.getPropertyValue(\"-o-transform-origin\") \n    || style.getPropertyValue(\"transform-origin\");\n  var values = tr.split(' ');\n  var mx = [ 0, 0, 0, 1 ];\n  for (var i = 0; i < values.length; ++i) {\n    mx[i] = parseInt(values[i]);\n  }\n  return mx;\n};\n/** Compute translate matrix\n * @param {number} x\n * @param {number} y\n * @param {number} z\n * @return {Array<Array<number>>}\n */\nol.matrix3D.translateMatrix = function(x, y, z) {\n  return [\n    [1, 0, 0, x],\n    [0, 1, 0, y],\n    [0, 0, 1, z],\n    [0, 0, 0, 1]\n  ];\n};\n/** Identity matrix\n * @return {Array<Array<number>>}\n */\nol.matrix3D.identity = function() {\n  return [\n    [1, 0, 0, 0],\n    [0, 1, 0, 0],\n    [0, 0, 1, 0],\n    [0, 0, 0, 1]\n  ];\n};\n/** Round matrix\n * @param {Array<Array<number>>} mx\n * @param {number} round Rounding value, default 1E-10\n */\nol.matrix3D.roundTo = function(mx, round) {\n  if (!round) round = 1E-10;\n  var m = [[],[],[],[]];\n  for (var i=0; i<4; i++) {\n    for (var j=0; j<4; j++) {\n      m[i][j] = Math.round(mx[i][j] / round) * round;\n    }\n  }\n  return m;\n};\n/** Multiply matrix3D \n * @param {Array<Array<number>>} mx1\n * @param {Array<Array<number>>} mx2\n * @return {Array<Array<number>>} \n */\nol.matrix3D.multiply = function (mx1, mx2) {\n  var mx = [ [], [], [], [] ];\n  for (var i = 0; i < 4; ++i) {\n    for (var j = 0; j < 4; ++j) {\n      var sum = 0;\n      for (var k = 0; k < 4; ++k) {\n          sum += (mx1[k][i] * mx2[j][k]);\n      }\n      mx[j][i] = sum;\n    }\n  }\n  return mx;\n};\n/** Compute the full transform that is applied to the transformed parent: -origin o tx o origin\n * @param {Array<Array<number>>} tx transform matrix\n * @param {Array<Array<number>>} origin transform origin\n * @return {Array<Array<number>>} \n */\nol.matrix3D.computeTransformMatrix = function(tx, origin) {\n  var preTx = ol.matrix3D.translateMatrix(-origin[0], -origin[1], -origin[2]);\n  var postTx = ol.matrix3D.translateMatrix(origin[0], origin[1], origin[2]);\n  var temp1 = ol.matrix3D.multiply(preTx, tx);\n  return ol.matrix3D.multiply(temp1, postTx);\n};\n/** Apply transform to a coordinate\n * @param {Array<Array<number>>} tx\n * @param {ol.pixel} px\n */\nol.matrix3D.transformVertex = function(tx, px) {\n  var vert = [px[0], px[1], 0, 1]\n  var mx = [ ];\n  for (var i = 0; i < 4; ++i) {\n    mx[i] = 0;\n    for (var j = 0; j < 4; ++j) {\n      mx[i] += +tx[i][j] * vert[j];\n    }\n  }\n  return mx;\n}\n/** Perform the homogeneous divide to apply perspective to the points (divide x,y,z by the w component).\n * @param {Array<number>} vert\n * @return {Array<number>}\n */\nol.matrix3D.projectVertex = function(vert) {\n  var out = [ ];\n  for (var i = 0; i < 4; ++i) {\n    out[i] = vert[i] / vert[3];\n  }\n  return out;\n};\n/** Inverse a matrix3D \n * @return {Array<Array<number>>} m matrix to transform\n * @return {Array<Array<number>>}\n */\nol.matrix3D.inverse = function(m) {\n  var s0 = m[0][0] * m[1][1] - m[1][0] * m[0][1]\n  var s1 = m[0][0] * m[1][2] - m[1][0] * m[0][2]\n  var s2 = m[0][0] * m[1][3] - m[1][0] * m[0][3]\n  var s3 = m[0][1] * m[1][2] - m[1][1] * m[0][2]\n  var s4 = m[0][1] * m[1][3] - m[1][1] * m[0][3]\n  var s5 = m[0][2] * m[1][3] - m[1][2] * m[0][3]\n  var c5 = m[2][2] * m[3][3] - m[3][2] * m[2][3]\n  var c4 = m[2][1] * m[3][3] - m[3][1] * m[2][3]\n  var c3 = m[2][1] * m[3][2] - m[3][1] * m[2][2]\n  var c2 = m[2][0] * m[3][3] - m[3][0] * m[2][3]\n  var c1 = m[2][0] * m[3][2] - m[3][0] * m[2][2]\n  var c0 = m[2][0] * m[3][1] - m[3][0] * m[2][1]\n  var determinant = 1 / (s0 * c5 - s1 * c4 + s2 * c3 + s3 * c2 - s4 * c1 + s5 * c0)\n  if (isNaN(determinant) || determinant === Infinity) {\n    throw new Error('Inverse determinant attempted to divide by zero.')\n  }\n  return [\n    [\n      (m[1][1] * c5 - m[1][2] * c4 + m[1][3] * c3) * determinant,\n      (-m[0][1] * c5 + m[0][2] * c4 - m[0][3] * c3) * determinant,\n      (m[3][1] * s5 - m[3][2] * s4 + m[3][3] * s3) * determinant,\n      (-m[2][1] * s5 + m[2][2] * s4 - m[2][3] * s3) * determinant\n    ],[\n      (-m[1][0] * c5 + m[1][2] * c2 - m[1][3] * c1) * determinant,\n      (m[0][0] * c5 - m[0][2] * c2 + m[0][3] * c1) * determinant,\n      (-m[3][0] * s5 + m[3][2] * s2 - m[3][3] * s1) * determinant,\n      (m[2][0] * s5 - m[2][2] * s2 + m[2][3] * s1) * determinant\n    ],[\n      (m[1][0] * c4 - m[1][1] * c2 + m[1][3] * c0) * determinant,\n      (-m[0][0] * c4 + m[0][1] * c2 - m[0][3] * c0) * determinant,\n      (m[3][0] * s4 - m[3][1] * s2 + m[3][3] * s0) * determinant,\n      (-m[2][0] * s4 + m[2][1] * s2 - m[2][3] * s0) * determinant\n    ],[\n      (-m[1][0] * c3 + m[1][1] * c1 - m[1][2] * c0) * determinant,\n      (m[0][0] * c3 - m[0][1] * c1 + m[0][2] * c0) * determinant,\n      (-m[3][0] * s3 + m[3][1] * s1 - m[3][2] * s0) * determinant,\n      (m[2][0] * s3 - m[2][1] * s1 + m[2][2] * s0) * determinant\n    ]\n  ]\n};\n\n/* global ol */\n/* Create ol.sphere for backward compatibility with ol < 5.0\n * To use with Openlayers package\n */\nif (window.ol && !ol.sphere) {\n  ol.sphere = {};\n  ol.sphere.getDistance = function (c1, c2, radius) {\n    var sphere = new ol.Sphere(radius || 6371008.8);\n    return sphere.haversineDistance(c1, c2);\n  }\n  ol.sphere.getArea = ol.Sphere.getArea;\n  ol.sphere.getLength = ol.Sphere.getLength;\n}\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A simple filter to detect edges on images\n * @constructor\n * @requires ol.filter\n * @extends {ol.ext.SVGFilter}\n * @param {*} options\n *  @param {number} options.neighbours nb of neighbour (4 or 8), default 8\n *  @param {boolean} options.grayscale get grayscale image, default false,\n *  @param {boolean} options.alpha get alpha channel, default false\n */\nol.ext.SVGFilter.Laplacian = function(options) {\n  options = options || {};\n  ol.ext.SVGFilter.call(this, { id: options.id });\n  var operation = {\n    feoperation: 'feConvolveMatrix',\n    in: 'SourceGraphic',\n    preserveAlpha: true,\n    result: 'C1'\n  };\n  if (options.neighbours===4) {\n    operation.kernelMatrix = [\n       0, -1,  0, \n      -1,  4, -1, \n       0, -1,  0\n    ];\n  } else {\n    operation.kernelMatrix = [\n      -1, -1, -1, \n      -1,  8, -1, \n      -1, -1, -1\n    ];\n  }\n  this.addOperation(operation);\n  if (options.grayscale) this.grayscale();\n  else if (options.alpha) this.luminanceToAlpha({ gamma: options.gamma });\n};\nol.ext.inherits(ol.ext.SVGFilter.Laplacian, ol.ext.SVGFilter);\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Apply a Prewitt filter on an image\n * @constructor\n * @requires ol.filter\n * @extends {ol.ext.SVGFilter}\n * @param {*} options\n *  @param {boolean} options.grayscale get grayscale image, default false,\n *  @param {boolean} options.alpha get alpha channel, default false\n */\nol.ext.SVGFilter.Prewitt = function(options) {\n  options = options || {};\n  ol.ext.SVGFilter.call(this, { id: options.id, color: 'sRGB' });\n  var operation = {\n    feoperation: 'feConvolveMatrix',\n    in: 'SourceGraphic',\n    preserveAlpha: true,\n    order: 3\n  };\n  // Vertical\n  operation.kernelMatrix = [\n    -1, -1, -1, \n     0,  0,  0,\n     1,  1,  1\n  ];\n  operation.result = 'V1';\n  this.addOperation(operation);\n  operation.kernelMatrix = [\n     1,  1,  1, \n     0,  0,  0,\n    -1, -1, -1\n  ];\n  operation.result = 'V2';\n  this.addOperation(operation);\n  // Horizontal\n  operation.kernelMatrix = [\n    -1,  0,  1, \n    -1,  0,  1,\n    -1,  0,  1\n  ];\n  operation.result = 'H1';\n  this.addOperation(operation);\n  operation.kernelMatrix = [\n     1, -0, -1, \n     1,  0, -1,\n     1,  0, -1\n  ];\n  operation.result = 'H2';\n  this.addOperation(operation);\n  // Compose V\n  this.addOperation({\n    feoperation: 'feComposite',\n    operator: 'arithmetic',\n    in: 'V1',\n    in2: 'V2',\n    k2: 1,\n    k3: 1,\n    result: 'V'\n  });\n  // Compose H\n  this.addOperation({\n    feoperation: 'feComposite',\n    operator: 'arithmetic',\n    in: 'H1',\n    in2: 'H2',\n    k2: 1,\n    k3: 1,\n    result: 'H'\n  });\n  // Merge\n  this.addOperation({\n    feoperation: 'feBlend',\n    mode: 'lighten',\n    in: 'H',\n    in2: 'V'\n  });\n  if (options.grayscale) this.grayscale();\n  else if (options.alpha) this.luminanceToAlpha();\n};\nol.ext.inherits(ol.ext.SVGFilter.Prewitt, ol.ext.SVGFilter);\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Apply a Roberts filter on an image\n * @constructor\n * @requires ol.filter\n * @extends {ol.ext.SVGFilter}\n * @param {*} options\n *  @param {boolean} options.grayscale get grayscale image, default false,\n *  @param {boolean} options.alpha get alpha channel, default false\n */\nol.ext.SVGFilter.Roberts = function(options) {\n  options = options || {};\n  ol.ext.SVGFilter.call(this, { id: options.id, color: 'sRGB' });\n  var operation = {\n    feoperation: 'feConvolveMatrix',\n    in: 'SourceGraphic',\n    preserveAlpha: true,\n    order: 3\n  };\n  // Vertical\n  operation.kernelMatrix = [\n    -1,  0,  0, \n     0,  0,  0,\n    0,   0,  1\n  ];\n  operation.result = 'V1';\n  this.addOperation(operation);\n  operation.kernelMatrix = [\n     1,  0,  0, \n     0,  0,  0,\n     0,  0, -1\n  ];\n  operation.result = 'V2';\n  this.addOperation(operation);\n  // Horizontal\n  operation.kernelMatrix = [\n     0,  0,  1, \n     0,  0,  0,\n    -1,  0,  0\n  ];\n  operation.result = 'H1';\n  this.addOperation(operation);\n  operation.kernelMatrix = [\n     0, -0, -1, \n     0,  0,  0,\n     1,  0,  0\n  ];\n  operation.result = 'H2';\n  this.addOperation(operation);\n  // Compose V\n  this.addOperation({\n    feoperation: 'feComposite',\n    operator: 'arithmetic',\n    in: 'V1',\n    in2: 'V2',\n    k2: 1,\n    k3: 1,\n    result: 'V'\n  });\n  // Compose H\n  this.addOperation({\n    feoperation: 'feComposite',\n    operator: 'arithmetic',\n    in: 'H1',\n    in2: 'H2',\n    k2: 1,\n    k3: 1,\n    result: 'H'\n  });\n  // Merge\n  this.addOperation({\n    feoperation: 'feBlend',\n    mode: 'lighten',\n    in: 'H',\n    in2: 'V'\n  });\n  if (options.grayscale) this.grayscale();\n  else if (options.alpha) this.luminanceToAlpha();\n};\nol.ext.inherits(ol.ext.SVGFilter.Roberts, ol.ext.SVGFilter);\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Apply a sobel filter on an image\n * @constructor\n * @requires ol.filter\n * @extends {ol.ext.SVGFilter}\n * @param {*} options\n *  @param {boolean} options.grayscale get grayscale image, default false,\n *  @param {boolean} options.alpha get alpha channel, default false\n */\nol.ext.SVGFilter.Sobel = function(options) {\n  options = options || {};\n  ol.ext.SVGFilter.call(this, { id: options.id, color: 'sRGB' });\n  var operation = {\n    feoperation: 'feConvolveMatrix',\n    in: 'SourceGraphic',\n    preserveAlpha: true,\n    order: 3\n  };\n  // Vertical\n  operation.kernelMatrix = [\n    -1, -2, -1, \n     0,  0,  0,\n     1,  2,  1\n  ];\n  operation.result = 'V1';\n  this.addOperation(operation);\n  operation.kernelMatrix = [\n     1,  2,  1, \n     0,  0,  0,\n    -1, -2, -1\n  ];\n  operation.result = 'V2';\n  this.addOperation(operation);\n  // Horizontal\n  operation.kernelMatrix = [\n    -1,  0,  1, \n    -2,  0,  2,\n    -1,  0,  1\n  ];\n  operation.result = 'H1';\n  this.addOperation(operation);\n  operation.kernelMatrix = [\n     1, -0, -1, \n     2,  0, -2,\n     1,  0, -1\n  ];\n  operation.result = 'H2';\n  this.addOperation(operation);\n  // Compose V\n  this.addOperation({\n    feoperation: 'feComposite',\n    operator: 'arithmetic',\n    in: 'V1',\n    in2: 'V2',\n    k2: 1,\n    k3: 1,\n    result: 'V'\n  });\n  // Compose H\n  this.addOperation({\n    feoperation: 'feComposite',\n    operator: 'arithmetic',\n    in: 'H1',\n    in2: 'H2',\n    k2: 1,\n    k3: 1,\n    result: 'H'\n  });\n  // Merge\n  this.addOperation({\n    feoperation: 'feBlend',\n    mode: 'lighten',\n    in: 'H',\n    in2: 'V'\n  });\n  if (options.grayscale) this.grayscale();\n  else if (options.alpha) this.luminanceToAlpha({ gamma: options.gamma });\n};\nol.ext.inherits(ol.ext.SVGFilter.Sobel, ol.ext.SVGFilter);\n\n/**\n * @classdesc \n *   Attribution Control integrated in the canvas (for jpeg/png \n * @see http://www.kreidefossilien.de/webgis/dokumentation/beispiele/export-map-to-png-with-scale\n *\n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} options extend the ol.control options. \n *  @param {ol.style.Style} options.style style used to draw the title.\n */\nol.control.CanvasBase = function(options) {\n  if (!options) options = {};\n  // Define a style to draw on the canvas\n  this.setStyle(options.style);\n  ol.control.Control.call(this, options);\n}\nol.ext.inherits(ol.control.CanvasBase, ol.control.Control);\n/**\n * Remove the control from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {o.Map} map Map.\n * @api stable\n */\nol.control.CanvasBase.prototype.setMap = function (map) {\n  this.getCanvas(map);\n  var oldmap = this.getMap();\n  if (this._listener) {\n    ol.Observable.unByKey(this._listener);\n    this._listener = null;\n  }\n  ol.control.Control.prototype.setMap.call(this, map);\n  if (oldmap) oldmap.renderSync();\n  if (map) {\n    this._listener = map.on('postcompose', this._draw.bind(this));\n    // Get a canvas layer on top of the map\n  }\n};\n/** Get canvas overlay\n */\nol.control.CanvasBase.prototype.getCanvas = function(map) {\n  return ol.ext.getMapCanvas(map);\n};\n/** Get map Canvas\n * @private\n */\nol.control.CanvasBase.prototype.getContext = function(e) {\n  var ctx = e.context;\n  if (!ctx && this.getMap()) {\n    var c = this.getMap().getViewport().getElementsByClassName('ol-fixedoverlay')[0];\n    ctx = c ? c.getContext('2d') : null;\n  }\n  return ctx;\n};\n/** Set Style\n * @api\n */\nol.control.CanvasBase.prototype.setStyle = function(style) {\n  this._style = style ||  new ol.style.Style ({});\n};\n/** Get style\n * @api\n */\nol.control.CanvasBase.prototype.getStyle = function() {\n  return this._style;\n};\n/** Get stroke\n * @api\n */\nol.control.CanvasBase.prototype.getStroke = function() {\n  var t = this._style.getStroke();\n  if (!t) this._style.setStroke(new ol.style.Stroke ({ color:'#000', width:1.25 }));\n  return this._style.getStroke();\n};\n/** Get fill\n * @api\n */\nol.control.CanvasBase.prototype.getFill = function() {\n  var t = this._style.getFill();\n  if (!t) this._style.setFill(new ol.style.Fill ({ color:'#fff' }));\n  return this._style.getFill();\n};\n/** Get stroke\n * @api\n */\nol.control.CanvasBase.prototype.getTextStroke = function() {\n  var t = this._style.getText();\n  if (!t) t = new ol.style.Text({});\n  if (!t.getStroke()) t.setStroke(new ol.style.Stroke ({ color:'#fff', width:3 }));\n  return t.getStroke();\n};\n/** Get text fill\n * @api\n */\nol.control.CanvasBase.prototype.getTextFill = function() {\n  var t = this._style.getText();\n  if (!t) t = new ol.style.Text({});\n  if (!t.getFill()) t.setFill(new ol.style.Fill ({ color:'#fff', width:3 }));\n  return t.getFill();\n};\n/** Get text font\n * @api\n */\nol.control.CanvasBase.prototype.getTextFont = function() {\n  var t = this._style.getText();\n  if (!t) t = new ol.style.Text({});\n  if (!t.getFont()) t.setFont('12px sans-serif');\n  return t.getFont();\n};\n/** Draw the control on canvas\n * @private\n */\nol.control.CanvasBase.prototype._draw = function(/* e */) {\n  console.warn('[CanvasBase] draw function not implemented.');\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * This is the base class for Select controls on attributes values. \n * Abstract base class; \n * normally only used for creating subclasses and not instantiated in apps. \n *\n * @constructor\n * @extends {ol.control.Control}\n * @fires select\n * @param {Object=} options\n *  @param {string} options.className control class name\n *  @param {Element | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {ol.Collection<ol.Feature>} options.features a collection of feature to search in, the collection will be kept in date while selection\n *  @param {ol.source.Vector | Array<ol.source.Vector>} options.source the source to search in if no features set\n */\nol.control.SelectBase = function(options) {\n  if (!options) options = {};\n  this._features = this.setFeatures(options.features);\n  var element;\n  if (options.target) {\n    element = document.createElement(\"div\");\n  } else {\n    element = document.createElement(\"div\");\n    element.className = 'ol-select ol-unselectable ol-control ol-collapsed';\n    ol.ext.element.create('BUTTON', {\n      type: 'button',\n      on: {\n        'click touchstart': function(e) {\n          element.classList.toggle('ol-collapsed');\n          e.preventDefault();\n        }\n      },\n      parent: element\n    });\n  }\n  if (options.className) element.classList.add(options.className);\n  element.appendChild(options.content);\n  // OK button\n  ol.ext.element.create('BUTTON', {\n    html: options.btInfo || 'OK',\n    className: 'ol-ok',\n    on: { 'click touchstart': this.doSelect.bind(this) },\n    parent: options.content\n  });\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.setSources(options.source);\n};\nol.ext.inherits(ol.control.SelectBase, ol.control.Control);\n/** Set the current sources\n * @param {ol.source.Vector|Array<ol.source.Vector>|undefined} source\n */\nol.control.SelectBase.prototype.setSources = function (source) {\n  if (source) {\n    this.set ('source', (source instanceof Array) ? source : [source]);\n  } else {\n    this.unset('source');\n  }  \n};\n/** Set feature collection to search in\n * @param {ol.Collection<ol.Feature>} features\n */\nol.control.SelectBase.prototype.setFeatures = function (features) {\n  if (features instanceof ol.Collection) this._features = features;\n  else this._features = null;\n};\n/** Get feature collection to search in\n * @return {ol.Collection<ol.Feature>}\n */\nol.control.SelectBase.prototype.getFeatures = function () {\n  return this._features;\n};\n/** List of operators / translation\n * @api\n */\nol.control.SelectBase.prototype.operationsList = {\n  '=': '=',\n  '!=': '≠',\n  '<': '<',\n  '<=': '≤',\n  '>=': '≥',\n  '>': '>',\n  'contain': '⊂', // ∈\n  '!contain': '⊄',\t// ∉\n  'regexp': '≃',\n  '!regexp': '≄'\n};\n/** Escape string for regexp\n * @param {string} search\n * @return {string}\n */\nol.control.SelectBase.prototype._escape = function (s) {\n  return s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n};\n/**\n * Test if a feature check aconditino\n * @param {ol.Feature} f the feature to check condition\n * @param {Object} condition an object to use for test\n *  @param {string} condition.attr attribute name\n *  @param {string} condition.op operator\n *  @param {any} condition.val value to test\n * @param {boolean} usecase use case or not when testing strings\n * @return {boolean}\n * @private\n */\nol.control.SelectBase.prototype._checkCondition = function (f, condition, usecase) {\n  if (!condition.attr) return true;\n  var val = f.get(condition.attr);\n  var rex;\n  switch (condition.op) {\n    case '=':\n      rex = new RegExp('^'+this._escape(condition.val)+'$', usecase ? '' : 'i');\n      return rex.test(val);\n    case '!=':\n      rex = new RegExp('^'+this._escape(condition.val)+'$', usecase ? '' : 'i');\n      return !rex.test(val);\n    case '<':\n      return val < condition.val;\n    case '<=':\n      return val <= condition.val;\n    case '>':\n      return val > condition.val;\n      case '>=':\n      return val >= condition.val;\n    case 'contain':\n      rex = new RegExp(this._escape(condition.val), usecase ? '' : 'i');\n      return rex.test(val);\n    case '!contain':\n      rex = new RegExp(this._escape(condition.val), usecase ? '' : 'i');\n      return !rex.test(val);\n    case 'regexp':\n      rex = new RegExp(condition.val, usecase ? '' : 'i');\n      return rex.test(val);\n    case '!regexp':\n      rex = new RegExp(condition.val, usecase ? '' : 'i');\n      return !rex.test(val);\n    default:\n      return false;\n  }\n};\n/** Selection features in a list of features\n * @param {Array<ol.Feature>} result the current list of features\n * @param {Array<ol.Feature>} features to test in\n * @param {Object} condition \n *  @param {string} condition.attr attribute name\n *  @param {string} condition.op operator\n *  @param {any} condition.val value to test\n * @param {boolean} all all conditions must be valid\n * @param {boolean} usecase use case or not when testing strings\n */\nol.control.SelectBase.prototype._selectFeatures = function (result, features, conditions, all, usecase) {\n  conditions = conditions || [];\n  var f;\n  for (var i=features.length-1; f=features[i]; i--) {\n    var isok = all;\n    for (var k=0, c; c=conditions[k]; k++) {\n      if (c.attr) {\n        if (all) {\n          isok = isok && this._checkCondition(f,c,usecase);\n        }\n        else {\n          isok = isok || this._checkCondition(f,c,usecase);\n        }\n      }\n    }\n    if (isok) {\n      result.push(f);\n    } else if (this._features) {\n      this._features.removeAt(i);\n    }\n  }\n  return result;\n};\n/** Get vector source\n * @return {Array<ol.source.Vector>}\n */\nol.control.SelectBase.prototype.getSources = function () {\n  if (this.get('source')) return this.get('source');\n  var sources = [];\n  function getSources(layers) {\n    layers.forEach(function(l){\n      if (l.getLayers) {\n        getSources(l.getLayers());\n      } else if (l.getSource && l.getSource() instanceof ol.source.Vector) {\n        sources.push(l.getSource());\n      }\n    });\n  }\n  if (this.getMap()) {\n    getSources(this.getMap().getLayers());\n  }\n  return sources;\n};\n/** Select features by attributes\n * @param {*} options\n *  @param {Array<ol.source.Vector>|undefined} options.sources source to apply rules, default the select sources\n *  @param {bool} options.useCase case sensitive, default false\n *  @param {bool} options.matchAll match all conditions, default false\n *  @param {Array<conditions>} options.conditions array of conditions\n * @return {Array<ol.Feature>}\n * @fires select\n */\nol.control.SelectBase.prototype.doSelect = function (options) {\n  options = options || {};\n  var features = [];\n  if (options.features) {\n    this._selectFeatures(features, options.features, options.conditions, options.matchAll, options.useCase);\n  } else if (this._features) {\n    this._selectFeatures(features, this._features.getArray(), options.conditions, options.matchAll, options.useCase);\n  } else {\n    var sources = options.sources || this.getSources();\n    sources.forEach(function(s) {\n      this._selectFeatures(features, s.getFeatures(), options.conditions, options.matchAll, options.useCase);\n    }.bind(this));\n  }\n  this.dispatchEvent({ type:\"select\", features: features });\n  return features;\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A simple push button control\n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} options Control options.\n *  @param {String} options.className class of the control\n *  @param {String} options.title title of the control\n *  @param {String} options.name an optional name, default none\n *  @param {String} options.html html to insert in the control\n *  @param {function} options.handleClick callback when control is clicked (or use change:active event)\n */\nol.control.Button = function(options){\n  options = options || {};\n  var element = document.createElement(\"div\");\n  element.className = (options.className || '') + \" ol-button ol-unselectable ol-control\";\n  var self = this;\n  var bt = this.button_ = document.createElement(/ol-text-button/.test(options.className) ? \"div\": \"button\");\n  bt.type = \"button\";\n  if (options.title) bt.title = options.title;\n  if (options.html instanceof Element) bt.appendChild(options.html)\n  else bt.innerHTML = options.html || \"\";\n  var evtFunction = function(e) {\n    if (e && e.preventDefault) {\n      e.preventDefault();\n      e.stopPropagation();\n    }\n    if (options.handleClick) {\n      options.handleClick.call(self, e);\n    }\n  };\n  bt.addEventListener(\"click\", evtFunction);\n  bt.addEventListener(\"touchstart\", evtFunction);\n  element.appendChild(bt);\n  // Try to get a title in the button content\n  if (!options.title && bt.firstElementChild) {\n    bt.title = bt.firstElementChild.title;\n  }\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  if (options.title) {\n    this.set(\"title\", options.title);\n  }\n  if (options.title) this.set(\"title\", options.title);\n  if (options.name) this.set(\"name\", options.name);\n};\nol.ext.inherits(ol.control.Button, ol.control.Control);\n/** Set the control visibility\n* @param {boolean} b \n*/\nol.control.Button.prototype.setVisible = function (val) {\n  if (val) ol.ext.element.show(this.element);\n  else ol.ext.element.hide(this.element);\n};\n/**\n * Set the button title\n * @param {string} title\n * @returns {undefined}\n */\nol.control.Button.prototype.setTitle = function(title) {\n  this.button_.setAttribute('title', title);\n};\n/**\n * Set the button html\n * @param {string} html\n * @returns {undefined}\n */\nol.control.Button.prototype.setHtml = function(html) {\n  ol.ext.element.setHTML (this.button_, html);\n};\n/**\n * Get the button element\n * @returns {undefined}\n */\nol.control.Button.prototype.getButtonElement = function() {\n  return this.button_;\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A simple toggle control\n * The control can be created with an interaction to control its activation.\n *\n * @constructor\n * @extends {ol.control.Button}\n * @fires change:active, change:disable\n * @param {Object=} options Control options.\n *  @param {String} options.className class of the control\n *  @param {String} options.title title of the control\n *  @param {String} options.html html to insert in the control\n *  @param {ol.interaction} options.interaction interaction associated with the control\n *  @param {bool} options.active the control is created active, default false\n *  @param {bool} options.disable the control is created disabled, default false\n *  @param {ol.control.Bar} options.bar a subbar associated with the control (drawn when active if control is nested in a ol.control.Bar)\n *  @param {bool} options.autoActive the control will activate when shown in an ol.control.Bar, default false\n *  @param {function} options.onToggle callback when control is clicked (or use change:active event)\n */\nol.control.Toggle = function(options) {\n  options = options || {};\n  var self = this;\n  this.interaction_ = options.interaction;\n  if (this.interaction_) {\n    this.interaction_.setActive(options.active);\n    this.interaction_.on(\"change:active\", function() {\n      self.setActive(self.interaction_.getActive());\n    });\n  }\n  if (options.toggleFn) options.onToggle = options.toggleFn; // compat old version\n  options.handleClick = function() {\n    self.toggle();\n    if (options.onToggle) options.onToggle.call(self, self.getActive());\n  };\n  options.className = (options.className||\"\") + \" ol-toggle\";\n  ol.control.Button.call(this, options);\n  this.set(\"title\", options.title);\n  this.set (\"autoActivate\", options.autoActivate);\n  if (options.bar) {\n    this.subbar_ = options.bar;\n    this.subbar_.setTarget(this.element);\n    this.subbar_.element.classList.add(\"ol-option-bar\");\n  }\n  this.setActive (options.active);\n  this.setDisable (options.disable);\n};\nol.ext.inherits(ol.control.Toggle, ol.control.Button);\n/**\n * Set the map instance the control is associated with\n * and add interaction attached to it to this map.\n * @param {_ol_Map_} map The map instance.\n */\nol.control.Toggle.prototype.setMap = function(map) {\n  if (!map && this.getMap()) {\n    if (this.interaction_) {\n      this.getMap().removeInteraction (this.interaction_);\n    }\n    if (this.subbar_) this.getMap().removeControl (this.subbar_);\n  }\n  ol.control.Button.prototype.setMap.call(this, map);\n  if (map) {\n    if (this.interaction_) map.addInteraction (this.interaction_);\n    if (this.subbar_) map.addControl (this.subbar_);\n  }\n};\n/** Get the subbar associated with a control\n * @return {ol.control.Bar}\n */\nol.control.Toggle.prototype.getSubBar = function () {\n  return this.subbar_;\n};\n/**\n * Test if the control is disabled.\n * @return {bool}.\n * @api stable\n */\nol.control.Toggle.prototype.getDisable = function() {\n  var button = this.element.querySelector(\"button\");\n  return button && button.disabled;\n};\n/** Disable the control. If disable, the control will be deactivated too.\n* @param {bool} b disable (or enable) the control, default false (enable)\n*/\nol.control.Toggle.prototype.setDisable = function(b) {\n  if (this.getDisable()==b) return;\n  this.element.querySelector(\"button\").disabled = b;\n  if (b && this.getActive()) this.setActive(false);\n  this.dispatchEvent({ type:'change:disable', key:'disable', oldValue:!b, disable:b });\n};\n/**\n * Test if the control is active.\n * @return {bool}.\n * @api stable\n */\nol.control.Toggle.prototype.getActive = function() {\n  return this.element.classList.contains(\"ol-active\");\n};\n/** Toggle control state active/deactive\n */\nol.control.Toggle.prototype.toggle = function() {\n  if (this.getActive()) this.setActive(false);\n  else this.setActive(true);\n};\n/** Change control state\n * @param {bool} b activate or deactivate the control, default false\n */\nol.control.Toggle.prototype.setActive = function(b) {\t\n  if (this.interaction_) this.interaction_.setActive (b);\n  if (this.subbar_) this.subbar_.setActive(b);\n  if (this.getActive()===b) return;\n  if (b) this.element.classList.add(\"ol-active\");\n  else this.element.classList.remove(\"ol-active\");\n  this.dispatchEvent({ type:'change:active', key:'active', oldValue:!b, active:b });\n};\n/** Set the control interaction\n* @param {_ol_interaction_} i interaction to associate with the control\n*/\nol.control.Toggle.prototype.setInteraction = function(i) {\n  this.interaction_ = i;\n};\n/** Get the control interaction\n* @return {_ol_interaction_} interaction associated with the control\n*/\nol.control.Toggle.prototype.getInteraction = function() {\n  return this.interaction_;\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Search Control.\n * This is the base class for search controls. You can use it for simple custom search or as base to new class.\n * @see ol.control.SearchFeature\n * @see ol.control.SearchPhoton\n *\n * @constructor\n * @extends {ol.control.Control}\n * @fires select\n * @fires change:input\n * @param {Object=} options\n *  @param {string} options.className control class name\n *  @param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {string | undefined} options.title Title to use for the search button tooltip, default \"Search\"\n *  @param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *  @param {boolean | undefined} options.reverse enable reverse geocoding, default false\n *  @param {string | undefined} options.inputLabel label for the input, default none\n *  @param {string | undefined} options.collapsed search is collapsed on start, default true\n *  @param {string | undefined} options.noCollapse prevent collapsing on input blur, default false\n *  @param {number | undefined} options.typing a delay on each typing to start searching (ms) use -1 to prevent autocompletion, default 300.\n *  @param {integer | undefined} options.minLength minimum length to start searching, default 1\n *  @param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *  @param {integer | undefined} options.maxHistory maximum number of items to display in history. Set -1 if you don't want history, default maxItems\n *  @param {function} options.getTitle a function that takes a feature and return the name to display in the index.\n *  @param {function} options.autocomplete a function that take a search string and callback function to send an array\n *  @param {function} options.onselect a function called when a search is selected\n *  @param {boolean} options.centerOnSelect center map on search, default false\n *  @param {number|boolean} options.zoomOnSelect center map on search and zoom to value if zoom < value, default false\n */\nol.control.Search = function(options) {\n  var self = this;\n  if (!options) options = {};\n  if (options.typing == undefined) options.typing = 300;\n  // Class name for history\n  this._classname = options.className || 'search';\n  var classNames = (options.className||'')+ ' ol-search'\n    + (options.target ? '' : ' ol-unselectable ol-control');\n  var element = ol.ext.element.create('DIV',{\n    className: classNames \n  })\n  if (options.collapsed!==false) element.classList.add('ol-collapsed');\n  if (!options.target) {\n    this.button = document.createElement('BUTTON');\n    this.button.setAttribute('type', 'button');\n    this.button.setAttribute('title', options.title || options.label || 'Search');\n    this.button.addEventListener('click', function() {\n      element.classList.toggle('ol-collapsed');\n      if (!element.classList.contains('ol-collapsed')) {\n        element.querySelector('input.search').focus();\n        var listElements = element.querySelectorAll('li');\n        for (var i = 0; i < listElements.length; i++) {\n          listElements[i].classList.remove('select');\n        }\n        // Display history\n        if (!input.value) {\n          self.drawList_();\n        }\n      }\n    });\n    element.appendChild(this.button);\n  }\n  // Input label\n  if (options.inputLabel) {\n    var label = document.createElement(\"LABEL\");\n    label.innerText = options.inputLabel;\n    element.appendChild(label);\n  }\n  // Search input\n  var tout, cur=\"\";\n  var input = this._input = document.createElement(\"INPUT\");\n  input.setAttribute(\"type\", \"search\");\n  input.setAttribute(\"class\", \"search\");\n  input.setAttribute(\"autocomplete\", \"off\");\n  input.setAttribute(\"placeholder\", options.placeholder||\"Search...\");\n  input.addEventListener(\"change\", function(e) {\n    self.dispatchEvent({ type:\"change:input\", input:e, value:input.value });\n  });\n  var doSearch = function(e) {\n    // console.log(e.type+\" \"+e.key)'\n    var li  = element.querySelector(\"ul.autocomplete li.select\");\n    var\tval = input.value;\n    // move up/down\n    if (e.key=='ArrowDown' || e.key=='ArrowUp' || e.key=='Down' || e.key=='Up') {\n      if (li) {\n        li.classList.remove(\"select\");\n        li = (/Down/.test(e.key)) ? li.nextElementSibling : li.previousElementSibling;\n        if (li) li.classList.add(\"select\");\n      }\n      else element.querySelector(\"ul.autocomplete li\").classList.add(\"select\");\n    }\n    // Clear input\n    else if (e.type=='input' && !val) {\n      setTimeout(function(){\n        self.drawList_();\n      }, 200);\n    }\n    // Select in the list\n    else if (li && (e.type==\"search\" || e.key ==\"Enter\")) {\n      if (element.classList.contains(\"ol-control\")) input.blur();\n      li.classList.remove(\"select\");\n      cur = val;\n      self._handleSelect(self._list[li.getAttribute(\"data-search\")]);\n    }\n    // Search / autocomplete\n    else if ( (e.type==\"search\" || e.key =='Enter')\n      || (cur!=val && options.typing>=0)) {\n      // current search\n      cur = val;\n      if (cur) {\n        // prevent searching on each typing\n        if (tout) clearTimeout(tout);\n        tout = setTimeout(function() {\n          if (cur.length >= self.get(\"minLength\")) {\n            var s = self.autocomplete (cur, function(auto) { self.drawList_(auto); });\n            if (s) self.drawList_(s);\n          }\n          else self.drawList_();\n        }, options.typing);\n      }\n      else self.drawList_();\n    }\n    // Clear list selection\n    else {\n      li = element.querySelector(\"ul.autocomplete li\");\n      if (li) li.classList.remove('select');\n    }\n  };\n  input.addEventListener(\"keyup\", doSearch);\n  input.addEventListener(\"search\", doSearch);\n  input.addEventListener(\"cut\", doSearch);\n  input.addEventListener(\"paste\", doSearch);\n  input.addEventListener(\"input\", doSearch);\n  if (!options.noCollapse) {\n    input.addEventListener('blur', function() {\n      setTimeout(function(){ \n        if (input !== document.activeElement) {\n          element.classList.add('ol-collapsed');\n          this.set('reverse', false);\n          element.classList.remove('ol-revers');\n        }\n      }.bind(this), 200);\n    }.bind(this));\n    input.addEventListener('focus', function() {\n      if (!this.get('reverse')) {\n        element.classList.remove('ol-collapsed');\n        element.classList.remove('ol-revers');\n      }\n    }.bind(this));\n  }\n  element.appendChild(input);\n  // Reverse geocode\n  if (options.reverse) {\n    var reverse = ol.ext.element.create('BUTTON', {\n      type: 'button',\n      class: 'ol-revers',\n      title: 'click on the map',\n      click: function() {\n        if (!this.get('reverse')) {\n          this.set('reverse', !this.get('reverse'));\n          input.focus();\n          element.classList.add('ol-revers');\n        } else {\n          this.set('reverse', false);\n        }\n      }.bind(this)\n    });\n    element.appendChild(reverse);\n  }\n  // Autocomplete list\n  var ul = document.createElement('UL');\n  ul.classList.add('autocomplete');\n  element.appendChild(ul);\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  if (typeof (options.getTitle)=='function') this.getTitle = options.getTitle;\n  if (typeof (options.autocomplete)=='function') this.autocomplete = options.autocomplete;\n  // Options\n  this.set('copy', options.copy);\n  this.set('minLength', options.minLength || 1);\n  this.set('maxItems', options.maxItems || 10);\n  this.set('maxHistory', options.maxHistory || options.maxItems || 10);\n  // Select\n  if (options.onselect) this.on('select', options.onselect);\n  // Center on select\n  if (options.centerOnSelect) this.on('select', function(e) {\n    var map = this.getMap();\n    if (map) {\n      map.getView().setCenter(e.coordinate);\n    }\n  }.bind(this));\n  // Zoom on select\n  if (options.zoomOnSelect) this.on('select', function(e) {\n    var map = this.getMap();\n    if (map) {\n      map.getView().setCenter(e.coordinate);\n      if (map.getView().getZoom() < options.zoomOnSelect) map.getView().setZoom(options.zoomOnSelect);\n    }\n  }.bind(this));\n  // History\n  this.restoreHistory();\n  this.drawList_();\n};\nol.ext.inherits(ol.control.Search, ol.control.Control);\n/**\n * Remove the control from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.control.Search.prototype.setMap = function (map) {\n  if (this._listener) ol.Observable.unByKey(this._listener);\n\tthis._listener = null;\n  ol.control.Control.prototype.setMap.call(this, map);\n  if (map) {\n\t\tthis._listener = map.on('click', this._handleClick.bind(this));\n\t}\n};\n/** Collapse the search\n * @param {boolean} [b=true]\n * @api\n */\nol.control.Search.prototype.collapse = function (b) {\n  if (b===false) this.element.classList.remove('ol-collapsed')\n  else this.element.classList.add('ol-collapsed')\n};\n/** Get the input field\n*\t@return {Element} \n*\t@api\n*/\nol.control.Search.prototype.getInputField = function () {\n  return this._input;\n};\n/** Returns the text to be displayed in the menu\n *\t@param {any} f feature to be displayed\n *\t@return {string} the text to be displayed in the index, default f.name\n *\t@api\n */\nol.control.Search.prototype.getTitle = function (f) {\n  return f.name || \"No title\";\n};\n/** Returns title as text\n *\t@param {any} f feature to be displayed\n *\t@return {string} \n *\t@api\n */\nol.control.Search.prototype._getTitleTxt = function (f) {\n  return ol.ext.element.create('DIV', {\n    html: this.getTitle(f)\n  }).innerText;\n};\n/** Force search to refresh\n */\nol.control.Search.prototype.search = function () {\n  var search = this.element.querySelector(\"input.search\");\n  this._triggerCustomEvent('search', search);\n};\n/** Reverse geocode\n * @param {Object} event\n *  @param {ol.coordinate} event.coordinate\n * @private\n */\nol.control.Search.prototype._handleClick = function (e) {\n  if (this.get('reverse')) {\n    document.activeElement.blur();\n    this.reverseGeocode(e.coordinate);\n  }\n};\n/** Reverse geocode\n * @param {ol.coordinate} coord\n * @param {function | undefined} cback a callback function, default trigger a select event\n * @api\n */\nol.control.Search.prototype.reverseGeocode = function (/*coord, cback*/) {\n  // this._handleSelect(f);\n};\n/** Trigger custom event on elemebt\n * @param {*} eventName \n * @param {*} element \n * @private\n */\nol.control.Search.prototype._triggerCustomEvent = function (eventName, element) {\n  ol.ext.element.dispatchEvent(eventName, element);\n};\n/** Set the input value in the form (for initialisation purpose)\n*\t@param {string} value\n*\t@param {boolean} search to start a search\n*\t@api\n*/\nol.control.Search.prototype.setInput = function (value, search) {\n  var input = this.element.querySelector(\"input.search\");\n  input.value = value;\n  if (search) this._triggerCustomEvent(\"keyup\", input);\n};\n/** A line has been clicked in the menu > dispatch event\n * @param {any} f the feature, as passed in the autocomplete\n * @param {boolean} reverse true if reverse geocode\n * @param {ol.coordinate} coord\n * @param {*} options options passed to the event\n *\t@api\n */\nol.control.Search.prototype.select = function (f, reverse, coord, options) {\n  var event = { type:\"select\", search:f, reverse: !!reverse, coordinate: coord };\n  if (options) {\n    for (var i in options) {\n      event[i] = options[i];\n    }\n  }\n  this.dispatchEvent(event);\n};\n/**\n * Save history and select\n * @param {*} f \n * @param {boolean} reverse true if reverse geocode\n * @param {*} options options send in the event \n * @private\n */\nol.control.Search.prototype._handleSelect = function (f, reverse, options) {\n  if (!f) return;\n  // Save input in history\n  var hist = this.get('history');\n  // Prevent error on stringify\n  var i;\n  try {\n    var fstr = JSON.stringify(f);\n    for (i=hist.length-1; i>=0; i--) {\n      if (!hist[i] || JSON.stringify(hist[i]) === fstr) {\n        hist.splice(i,1);\n      }\n    }\n  } catch (e) {\n    for (i=hist.length-1; i>=0; i--) {\n      if (hist[i] === f) {\n        hist.splice(i,1);\n      }\n    }\n  }\n  hist.unshift(f);\n  var size = Math.max(0, this.get('maxHistory')||10) || 0;\n  while (hist.length > size) {\n    hist.pop();\n  } \n  this.saveHistory();\n  // Select feature\n  this.select(f, reverse, null, options);\n  if (reverse) {\n    this.setInput(this._getTitleTxt(f));\n    this.drawList_();\n    setTimeout(function() { this.collapse(false); }.bind(this), 300);\n  }\n};\n/** Current history */\nol.control.Search.prototype._history = {};\n/** Save history (in the localstorage)\n */\nol.control.Search.prototype.saveHistory = function () {\n  if (this.get('maxHistory')>=0) {\n    try {\n      localStorage[\"ol@search-\"+this._classname] = JSON.stringify(this.get('history'));\n    } catch (e) { /* ok */ }\n  } else {\n    localStorage.removeItem(\"ol@search-\"+this._classname);\n  }\n};\n/** Restore history (from the localstorage) \n */\nol.control.Search.prototype.restoreHistory = function () {\n  if (this._history[this._classname]) {\n    this.set('history', this._history[this._classname]);\n  } else {\n    try {\n      this._history[this._classname] = JSON.parse(localStorage[\"ol@search-\"+this._classname]);\n      this.set('history', this._history[this._classname]);\n    } catch(e) {\n      this.set('history', []);\n    }\n  }\n};\n/**\n * Remove previous history\n */\nol.control.Search.prototype.clearHistory = function () {\n  this.set('history', []);\n  this.saveHistory();\n  this.drawList_();\n};\n/**\n * Get history table\n */\nol.control.Search.prototype.getHistory = function () {\n  return this.get('history');\n};\n/** Autocomplete function\n* @param {string} s search string\n* @param {function} cback a callback function that takes an array to display in the autocomplete field (for asynchronous search)\n* @return {Array|false} an array of search solutions or false if the array is send with the cback argument (asnchronous)\n* @api\n*/\nol.control.Search.prototype.autocomplete = function (s, cback) {\n  cback ([]);\n  return false;\n  // or just return [];\n};\n/** Draw the list\n* @param {Array} auto an array of search result\n* @private\n*/\nol.control.Search.prototype.drawList_ = function (auto) {\n  var self = this;\n  var ul = this.element.querySelector(\"ul.autocomplete\");\n  ul.innerHTML = '';\n  this._list = [];\n  if (!auto) {\n    var input = this.element.querySelector(\"input.search\");\n    var value = input.value;\n    if (!value) {\n      auto = this.get('history');\n    } else {\n      return;\n    }\n    ul.setAttribute('class', 'autocomplete history');\n  } else {\n    ul.setAttribute('class', 'autocomplete');\n  }\n  var li, max = Math.min (self.get(\"maxItems\"),auto.length);\n  for (var i=0; i<max; i++) {\t\n    if (auto[i]) {\n      if (!i || !self.equalFeatures(auto[i], auto[i-1])) {\n        li = document.createElement(\"LI\");\n        li.setAttribute(\"data-search\", this._list.length);\n        this._list.push(auto[i]);\n        li.addEventListener(\"click\", function(e) {\n          self._handleSelect(self._list[e.currentTarget.getAttribute(\"data-search\")]);\n        });\n        var title = self.getTitle(auto[i]);\n        if (title instanceof Element) li.appendChild(title);\n        else li.innerHTML = title;\n        ul.appendChild(li);\n      }\n    }\n  }\n  if (max && this.get(\"copy\")) {\n    li = document.createElement(\"LI\");\n    li.classList.add(\"copy\");\n    li.innerHTML = this.get(\"copy\");\n    ul.appendChild(li);\n  }\n};\n/** Test if 2 features are equal\n * @param {any} f1\n * @param {any} f2\n * @return {boolean}\n */\nol.control.Search.prototype.equalFeatures = function (/* f1, f2 */) {\n  return false;\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * This is the base class for search controls that use a json service to search features.\n * You can use it for simple custom search or as base to new class.\n *\n * @constructor\n * @extends {ol.control.Search}\n * @fires select\n * @param {any} options extend ol.control.Search options\n *  @param {string} options.className control class name\n *  @param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *  @param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *  @param {number | undefined} options.typing a delay on each typing to start searching (ms), default 1000.\n *  @param {integer | undefined} options.minLength minimum length to start searching, default 3\n *  @param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *  @param {function | undefined} options.handleResponse Handle server response to pass the features array to the list\n *\n *  @param {string|undefined} options.url Url of the search api\n *  @param {string | undefined} options.authentication: basic authentication for the search API as btoa(\"login:pwd\")\n */\nol.control.SearchJSON = function(options) {\n  options = options || {};\n  options.className = options.className || 'JSON';\n  delete options.autocomplete;\n  options.minLength = options.minLength || 3;\n  options.typing = options.typing || 800;\n  ol.control.Search.call(this, options);\n  // Handle Mix Content Warning\n  // If the current connection is an https connection all other connections must be https either\n  var url = options.url || \"\";\n  if (window.location.protocol === \"https:\") {\n    var parser = document.createElement('a');\n    parser.href = url;\n    parser.protocol = window.location.protocol;\n    url = parser.href;\n  }\n  this.set('url', url);\n  this._ajax = new ol.ext.Ajax({ dataType:'JSON', auth: options.authentication });\n  this._ajax.on('success', function (resp) {\n    if (resp.status >= 200 && resp.status < 400) {\n      if (typeof(this._callback) === 'function') this._callback(resp.response);\n    } else {\n      if (typeof(this._callback) === 'function') this._callback(false, 'error');\n      console.log('AJAX ERROR', arguments);\n    }\n  }.bind(this));\n  this._ajax.on('error', function() {\n    if (typeof(this._callback) === 'function') this._callback(false, 'error');\n    console.log('AJAX ERROR', arguments);\n  }.bind(this));\n  // Handle searchin\n  this._ajax.on('loadstart', function() {\n    this.element.classList.add('searching');\n  }.bind(this));\n  this._ajax.on('loadend', function() {\n    this.element.classList.remove('searching');\n  }.bind(this));\n  // Overwrite handleResponse\n  if (typeof(options.handleResponse)==='function') this.handleResponse = options.handleResponse;\n};\nol.ext.inherits(ol.control.SearchJSON, ol.control.Search);\n/** Send ajax request\n * @param {string} url\n * @param {*} data\n * @param {function} cback a callback function that takes an array of {name, feature} to display in the autocomplete field\n */\nol.control.SearchJSON.prototype.ajax = function (url, data, cback, options) {\n  options = options || {};\n  this._callback = cback;\n  this._ajax.set('dataType', options.dataType || 'JSON');\n  this._ajax.send(url, data, options);\n};\n/** Autocomplete function (ajax request to the server)\n * @param {string} s search string\n * @param {function} cback a callback function that takes an array of {name, feature} to display in the autocomplete field\n */\nol.control.SearchJSON.prototype.autocomplete = function (s, cback) {\n  var data = this.requestData(s);\n  var url = encodeURI(this.get('url'));\n  this.ajax(url, data, function(resp) {\n    if (typeof(cback) === 'function') cback(this.handleResponse(resp));\n  });\n};\n/**\n * @param {string} s the search string\n * @return {Object} request data (as key:value)\n * @api\n */\nol.control.SearchJSON.prototype.requestData = function (s){\n  return { q: s };\n};\n/**\n * Handle server response to pass the features array to the display list\n * @param {any} response server response\n * @return {Array<any>} an array of feature\n * @api\n */\nol.control.SearchJSON.prototype.handleResponse = function (response) {\n  return response;\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Search places using the photon API.\n *\n * @constructor\n * @extends {ol.control.SearchJSON}\n * @fires select\n * @param {Object=} Control options.\n *  @param {string} options.className control class name\n *  @param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *  @param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *  @param {number | undefined} options.typing a delay on each typing to start searching (ms), default 1000.\n *  @param {integer | undefined} options.minLength minimum length to start searching, default 3\n *  @param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *  @param {function | undefined} options.handleResponse Handle server response to pass the features array to the list\n * \n *  @param {string|undefined} options.url Url to photon api, default \"http://photon.komoot.de/api/\"\n *  @param {string|undefined} options.lang Force preferred language, default none\n *  @param {boolean} options.position Search, with priority to geo position, default false\n *  @param {function} options.getTitle a function that takes a feature and return the name to display in the index, default return street + name + contry\n */\nol.control.SearchPhoton = function(options) {\n  options = options || {};\n  options.className = options.className || 'photon';\n  options.url = options.url || 'https://photon.komoot.io/api/';\n  options.copy = options.copy || '<a href=\"http://www.openstreetmap.org/copyright\" target=\"new\">&copy; OpenStreetMap contributors</a>';\n  ol.control.SearchJSON.call(this, options);\n  this.set('lang', options.lang);\n  this.set('position', options.position);\n};\nol.ext.inherits(ol.control.SearchPhoton, ol.control.SearchJSON);\n/** Returns the text to be displayed in the menu\n*\t@param {ol.Feature} f the feature\n*\t@return {string} the text to be displayed in the index\n*\t@api\n*/\nol.control.SearchPhoton.prototype.getTitle = function (f) {\n  var p = f.properties;\n  return (p.housenumber||\"\")\n    + \" \"+(p.street || p.name || \"\")\n    + \"<i>\"\n    + \" \"+(p.postcode||\"\")\n    + \" \"+(p.city||\"\")\n    + \" (\"+p.country\n    + \")</i>\";\n};\n/** \n * @param {string} s the search string\n * @return {Object} request data (as key:value)\n * @api\n */\nol.control.SearchPhoton.prototype.requestData = function (s) {\n  var data = {\n    q: s,\n    lang: this.get('lang'),\n    limit: this.get('maxItems')\n  }\n  // Handle position proirity\n  if (this.get('position')) {\n    var view = this.getMap().getView();\n    var pt = new ol.geom.Point(view.getCenter());\n    pt = (pt.transform (view.getProjection(), \"EPSG:4326\")).getCoordinates();\n    data.lon = pt[0];\n    data.lat = pt[1];\n  }\n  return data;\n};\n/**\n * Handle server response to pass the features array to the list\n * @param {any} response server response\n * @return {Array<any>} an array of feature\n */\nol.control.SearchPhoton.prototype.handleResponse = function (response) {\n  return response.features;\n};\n/** Prevent same feature to be drawn twice: test equality\n * @param {} f1 First feature to compare\n * @param {} f2 Second feature to compare\n * @return {boolean}\n * @api\n */\nol.control.SearchPhoton.prototype.equalFeatures = function (f1, f2) {\n  return (this.getTitle(f1) === this.getTitle(f2)\n    && f1.geometry.coordinates[0] === f2.geometry.coordinates[0]\n    && f1.geometry.coordinates[1] === f2.geometry.coordinates[1]);\n};\n/** A ligne has been clicked in the menu > dispatch event\n*\t@param {any} f the feature, as passed in the autocomplete\n*\t@api\n*/\nol.control.SearchPhoton.prototype.select = function (f) {\n  var c = f.geometry.coordinates;\n  // Add coordinate to the event\n  try {\n    c = ol.proj.transform (f.geometry.coordinates, 'EPSG:4326', this.getMap().getView().getProjection());\n  } catch(e) { /* ok */ }\n  this.dispatchEvent({ type:\"select\", search:f, coordinate: c });\n};\n/** Get data for reverse geocode \n * @param {ol.coordinate} coord\n */\nol.control.SearchPhoton.prototype.reverseData = function (coord) {\n  var lonlat = ol.proj.transform (coord, this.getMap().getView().getProjection(), 'EPSG:4326');\n  return { lon: lonlat[0], lat: lonlat[1] };\n};\n/** Reverse geocode\n * @param {ol.coordinate} coord\n * @api\n */\nol.control.SearchPhoton.prototype.reverseGeocode = function (coord, cback) {\n  this.ajax(\n    this.get('url').replace('/api/', '/reverse/').replace('/search/', '/reverse/'),\n    this.reverseData(coord),\n    function(resp) {\n      if (resp.features) resp = resp.features;\n      if (!(resp instanceof Array)) resp = [resp];\n      if (cback) {\n        cback.call(this, resp);\n      } else {\n        this._handleSelect(resp[0], true);\n        // this.setInput('', true);\n      }\n    }.bind(this)\n  );\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO,\n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Search places using the French National Base Address (BAN) API.\n *\n * @constructor\n * @extends {ol.control.SearchJSON}\n * @fires select\n * @param {any} options extend ol.control.SearchJSON options\n *\t@param {string} options.className control class name\n *\t@param {string | undefined} options.apiKey the service api key.\n *\t@param {string | undefined} options.authentication: basic authentication for the service API as btoa(\"login:pwd\")\n *\t@param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *\t@param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *\t@param {boolean | undefined} options.reverse enable reverse geocoding, default false\n *\t@param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *\t@param {number | undefined} options.typing a delay on each typing to start searching (ms), default 500.\n *\t@param {integer | undefined} options.minLength minimum length to start searching, default 3\n *\t@param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *\n *\t@param {StreetAddress|PositionOfInterest|CadastralParcel|Commune} options.type type of search. Using Commune will return the INSEE code, default StreetAddress,PositionOfInterest\n * @see {@link https://geoservices.ign.fr/documentation/geoservices/geocodage.html}\n */\nol.control.SearchGeoportail = function(options) {\n  options = options || {};\n  options.className = options.className || 'IGNF';\n  options.typing = options.typing || 500;\n  options.url = \"https://wxs.ign.fr/\"+options.apiKey+\"/ols/apis/completion\";\n  options.copy = '<a href=\"https://www.geoportail.gouv.fr/\" target=\"new\">&copy; IGN-Géoportail</a>';\n  ol.control.SearchJSON.call(this, options);\n  this.set('type', options.type || 'StreetAddress,PositionOfInterest');\n  this.set('timeout', options.timeout || 2000);\n  // Authentication\n  // this._auth = options.authentication;\n};\nol.ext.inherits(ol.control.SearchGeoportail, ol.control.SearchJSON);\n/** Reverse geocode\n * @param {ol.coordinate} coord\n * @param {function|*} options callback function called when revers located or options passed to the select event\n * @api\n */\nol.control.SearchGeoportail.prototype.reverseGeocode = function (coord, options) {\n  var lonlat = ol.proj.transform(coord, this.getMap().getView().getProjection(), 'EPSG:4326');\n  this._handleSelect({ \n    x: lonlat[0], \n    y: lonlat[1], \n    fulltext: lonlat[0].toFixed(6) + ',' + lonlat[1].toFixed(6) \n  }, true, options);\n  // Search type\n  var type = this.get('type')==='Commune' ? 'PositionOfInterest' : this.get('type') || 'StreetAddress';\n  if (/,/.test(type)) type = 'StreetAddress';\n  // request\n  var request = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n    +'<XLS xmlns:xls=\"http://www.opengis.net/xls\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns=\"http://www.opengis.net/xls\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"1.2\" xsi:schemaLocation=\"http://www.opengis.net/xls http://schemas.opengis.net/ols/1.2/olsAll.xsd\">'\n    +' <Request requestID=\"1\" version=\"1.2\" methodName=\"ReverseGeocodeRequest\" maximumResponses=\"1\" >'\n    +'  <ReverseGeocodeRequest>'\n    +'   <ReverseGeocodePreference>'+type+'</ReverseGeocodePreference>'\n    +'   <Position>'\n    +'    <gml:Point><gml:pos>'+lonlat[1]+' '+lonlat[0]+'</gml:pos></gml:Point>'\n    +'   </Position>'\n    +'  </ReverseGeocodeRequest>'\n    +' </Request>'\n    +'</XLS>';\n  this.ajax (this.get('url').replace('ols/apis/completion','geoportail/ols'), \n    { xls: request },\n    function(xml) {\n      var f = {};\n      if (!xml) {\n        f = { x: lonlat[0], y: lonlat[1], fulltext: lonlat[0].toFixed(6) + ',' + lonlat[1].toFixed(6) }\n      } else {\n        xml = xml.replace(/\\n|\\r/g,'');\n        var p = (xml.replace(/.*<gml:pos>(.*)<\\/gml:pos>.*/, \"$1\")).split(' ');\n        if (!Number(p[1]) && !Number(p[0])) {\n          f = { x: lonlat[0], y: lonlat[1], fulltext: lonlat[0].toFixed(6) + ',' + lonlat[1].toFixed(6) }\n        } else {\n          f.x = lonlat[0];\n          f.y = lonlat[1];\n          f.city = (xml.replace(/.*<Place type=\"Municipality\">([^<]*)<\\/Place>.*/, \"$1\"));\n          f.insee = (xml.replace(/.*<Place type=\"INSEE\">([^<]*)<\\/Place>.*/, \"$1\"));\n          f.zipcode = (xml.replace(/.*<PostalCode>([^<]*)<\\/PostalCode>.*/, \"$1\"));\n          if (/<Street>/.test(xml)) {\n            f.kind = '';\n            f.country = 'StreetAddress';\n            f.street = (xml.replace(/.*<Street>([^<]*)<\\/Street>.*/, \"$1\"));\n            var number = (xml.replace(/.*<Building number=\"([^\"]*).*/, \"$1\"));\n            f.fulltext = number+' '+f.street+', '+f.zipcode+' '+f.city;\n          } else {\n            f.kind = (xml.replace(/.*<Place type=\"Nature\">([^<]*)<\\/Place>.*/, \"$1\"));\n            f.country = 'PositionOfInterest';\n            f.street = '';\n            f.fulltext = f.zipcode+' '+f.city;\n          }\n        }\n      }\n      if (typeof(options)==='function') {\n        options.call(this, [f]);\n      } else {\n        this.getHistory().shift();\n        this._handleSelect(f, true, options);\n        // this.setInput('', true);\n        // this.drawList_();\n      }\n    }.bind(this), {\n      timeout: this.get('timeout'),\n      dataType: 'XML'\n    }\n  );\n};\n/** Returns the text to be displayed in the menu\n *\t@param {ol.Feature} f the feature\n *\t@return {string} the text to be displayed in the index\n *\t@api\n */\nol.control.SearchGeoportail.prototype.getTitle = function (f) {\n  return (f.fulltext);\n};\n/** \n * @param {string} s the search string\n * @return {Object} request data (as key:value)\n * @api\n */\nol.control.SearchGeoportail.prototype.requestData = function (s) {\n\treturn { \n    text: s, \n    type: this.get('type')==='Commune' ? 'PositionOfInterest' : this.get('type') || 'StreetAddress,PositionOfInterest', \n    maximumResponses: this.get('maxItems')\n  };\n};\n/**\n * Handle server response to pass the features array to the display list\n * @param {any} response server response\n * @return {Array<any>} an array of feature\n * @api\n */\nol.control.SearchGeoportail.prototype.handleResponse = function (response) {\n  var features = response.results;\n  if (this.get('type') === 'Commune') {\n    for (var i=features.length-1; i>=0; i--) {\n      if ( features[i].kind \n        && (features[i].classification>5 || features[i].kind==\"Département\") ) {\n          features.splice(i,1);\n      }\n    }\n\t}\n\treturn features;\n};\n/** A ligne has been clicked in the menu > dispatch event\n * @param {any} f the feature, as passed in the autocomplete\n * @param {boolean} reverse true if reverse geocode\n * @param {ol.coordinate} coord\n * @param {*} options options passed to the event\n *\t@api\n */\nol.control.SearchGeoportail.prototype.select = function (f, reverse, coord, options){\n  if (f.x || f.y) {\n    var c = [Number(f.x), Number(f.y)];\n    // Add coordinate to the event\n    try {\n        c = ol.proj.transform (c, 'EPSG:4326', this.getMap().getView().getProjection());\n    } catch(e) { /* ok */}\n    // Get insee commune ?\n    if (this.get('type')==='Commune') {\n      this.searchCommune(f, function () {\n        ol.control.Search.prototype.select.call(this, f, reverse, c, options);\n        //this.dispatchEvent({ type:\"select\", search:f, coordinate: c, revers: reverse, options: options });\n      });\n    } else {\n        ol.control.Search.prototype.select.call(this, f, reverse, c, options);\n        //this.dispatchEvent({ type:\"select\", search:f, coordinate: c, revers: reverse, options: options });\n    }\n  } else {\n    this.searchCommune(f);\n  }\n};\n/** Search if no position and get the INSEE code\n * @param {string} s le nom de la commune\n */\nol.control.SearchGeoportail.prototype.searchCommune = function (f, cback) {\n  var request = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n\t+'<XLS xmlns:xls=\"http://www.opengis.net/xls\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns=\"http://www.opengis.net/xls\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"1.2\" xsi:schemaLocation=\"http://www.opengis.net/xls http://schemas.opengis.net/ols/1.2/olsAll.xsd\">'\n\t\t+'<RequestHeader/>'\n\t\t+'<Request requestID=\"1\" version=\"1.2\" methodName=\"LocationUtilityService\">'\n\t\t\t+'<GeocodeRequest returnFreeForm=\"false\">'\n\t\t\t\t+'<Address countryCode=\"PositionOfInterest\">'\n\t\t\t\t+'<freeFormAddress>'+f.zipcode+' '+f.city+'+</freeFormAddress>'\n\t\t\t\t+'</Address>'\n\t\t\t+'</GeocodeRequest>'\n\t\t+'</Request>'\n\t+'</XLS>'\n  // Search \n  this.ajax (this.get('url').replace('ols/apis/completion','geoportail/ols'),\n    { 'xls': request }, \n    function(xml) {\n      if (xml) {\n        // XML to JSON\n        var parser = new DOMParser();\n        var xmlDoc = parser.parseFromString(xml,\"text/xml\");\n        var com = xmlDoc.getElementsByTagName('GeocodedAddress')[0];\n        var coord = com.getElementsByTagName('gml:Point')[0].textContent.trim().split(' ');\n        f.x = Number(coord[1]);\n        f.y = Number(coord[0]);\n        var place = com.getElementsByTagName('Place');\n        for (var i=0; i<place.length; i++) {\n          switch (place[i].attributes.type.value) {\n            case 'Nature': \n              f.kind = place[i].textContent;\n              break;\n            case 'INSEE': \n              f.insee = place[i].textContent;\n              break;\n          }\n        }\n        if (f.x || f.y) {\n          if (cback) cback.call(this, [f]);\n          else this._handleSelect(f);\n        }\n      }\n    }.bind(this),\n    { dataType: 'XML' }\n  );\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc OpenLayers 3 Layer Switcher Control.\n * @fires drawlist\n * @fires toggle\n * @fires reorder-start\n * @fires reorder-end\n * \n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} options\n *  @param {function} options.displayInLayerSwitcher function that takes a layer and return a boolean if the layer is displayed in the switcher, default test the displayInLayerSwitcher layer attribute\n *  @param {boolean} options.show_progress show a progress bar on tile layers, default false\n *  @param {boolean} options.mouseover show the panel on mouseover, default false\n *  @param {boolean} options.reordering allow layer reordering, default true\n *  @param {boolean} options.trash add a trash button to delete the layer, default false\n *  @param {function} options.oninfo callback on click on info button, if none no info button is shown DEPRECATED: use on(info) instead\n *  @param {boolean} options.extent add an extent button to zoom to the extent of the layer\n *  @param {function} options.onextent callback when click on extent, default fits view to extent\n *  @param {number} options.drawDelay delay in ms to redraw the layer (usefull to prevent flickering when manipulating the layers)\n *  @param {boolean} options.collapsed collapse the layerswitcher at beginning, default true\n *  @param {ol.layer.Group} options.layerGroup a layer group to display in the switcher, default display all layers of the map\n *\n * Layers attributes that control the switcher\n *\t- allwaysOnTop {boolean} true to force layer stay on top of the others while reordering, default false\n *\t- displayInLayerSwitcher {boolean} display in switcher, default true\n *\t- noSwitcherDelete {boolean} to prevent layer deletion (w. trash option = true), default false\n */\nol.control.LayerSwitcher = function(options) {\n  options = options || {};\n  var self = this;\n  this.dcount = 0;\n  this.show_progress = options.show_progress;\n  this.oninfo = (typeof (options.oninfo) == \"function\" ? options.oninfo: null);\n  this.onextent = (typeof (options.onextent) == \"function\" ? options.onextent: null);\n  this.hasextent = options.extent || options.onextent;\n  this.hastrash = options.trash;\n  this.reordering = (options.reordering!==false);\n  this._layers = [];\n  this._layerGroup = (options.layerGroup && options.layerGroup.getLayers) ? options.layerGroup : null;\n  // displayInLayerSwitcher\n  if (typeof(options.displayInLayerSwitcher) === 'function') {\n    this.displayInLayerSwitcher = options.displayInLayerSwitcher;\n  }\n  var element;\n  if (options.target) {\n    element = ol.ext.element.create('DIV', {\n      className: options.switcherClass || \"ol-layerswitcher\"\n    });\n  } else {\n    element = ol.ext.element.create('DIV', {\n      className: (options.switcherClass || \"ol-layerswitcher\") +' ol-unselectable ol-control'\n    });\n    if (options.collapsed !== false) element.classList.add('ol-collapsed'); \n    else element.classList.add('ol-forceopen'); \n    this.button = ol.ext.element.create('BUTTON', {\n      type: 'button',\n      parent: element\n    });\n    this.button.addEventListener('touchstart', function(e){\n      element.classList.toggle('ol-collapsed');\n      self.dispatchEvent({ type: 'toggle', collapsed: element.classList.contains('ol-collapsed') });\n      e.preventDefault(); \n      self.overflow();\n    });\n    this.button.addEventListener('click', function(){\n      element.classList.toggle('ol-forceopen');\n      element.classList.add('ol-collapsed'); \n      self.dispatchEvent({ type: 'toggle', collapsed: !element.classList.contains('ol-forceopen') });\n      self.overflow();\n    });\n    if (options.mouseover) {\n      element.addEventListener ('mouseleave', function(){ \n        element.classList.add(\"ol-collapsed\"); \n        self.dispatchEvent({ type: 'toggle', collapsed: true });\n      });\n      element.addEventListener ('mouseover', function(){ \n        element.classList.remove(\"ol-collapsed\"); \n        self.dispatchEvent({ type: 'toggle', collapsed: false });\n      });\n    }\n    this.topv = ol.ext.element.create('DIV', {\n      className: 'ol-switchertopdiv',\n      parent: element,\n      click: function() {\n        self.overflow(\"+50%\");\n      }\n    });\n    this.botv = ol.ext.element.create('DIV', {\n      className: 'ol-switcherbottomdiv',\n      parent: element,\n      click: function() {\n        self.overflow(\"-50%\");\n      }\n    });\n  }\n  this.panel_ = ol.ext.element.create ('UL', {\n    className: 'panel',\n    parent: element\n  });\n  ol.ext.element.addListener (this.panel_, 'mousewheel DOMMouseScroll onmousewheel', function(e) {\n    if (self.overflow(Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail))))) {\n      e.stopPropagation();\n      e.preventDefault();\n    }\n  });\n  this.header_ = ol.ext.element.create('LI', {\n    className: 'ol-header',\n    parent: this.panel_\n  });\n  ol.control.Control.call (this, {\n    element: element,\n    target: options.target\n  });\n  this.set('drawDelay',options.drawDelay||0);\n};\nol.ext.inherits(ol.control.LayerSwitcher, ol.control.Control);\n/** List of tips for internationalization purposes\n*/\nol.control.LayerSwitcher.prototype.tip = {\n  up: \"up/down\",\n  down: \"down\",\n  info: \"informations...\",\n  extent: \"zoom to extent\",\n  trash: \"remove layer\",\n  plus: \"expand/shrink\"\n};\n/** Test if a layer should be displayed in the switcher\n * @param {ol.layer} layer\n * @return {boolean} true if the layer is displayed\n */\nol.control.LayerSwitcher.prototype.displayInLayerSwitcher = function(layer) {\n  return (layer.get('displayInLayerSwitcher')!==false);\n};\n/**\n * Set the map instance the control is associated with.\n * @param {_ol_Map_} map The map instance.\n */\nol.control.LayerSwitcher.prototype.setMap = function(map) {\n  ol.control.Control.prototype.setMap.call(this, map);\n  this.drawPanel();\n  if (this._listener) {\n    if (this._listener) ol.Observable.unByKey(this._listener.change);\n    if (this._listener) ol.Observable.unByKey(this._listener.moveend);\n    if (this._listener) ol.Observable.unByKey(this._listener.size);\n  }\n  this._listener = null;\n  // Get change (new layer added or removed)\n  if (map) {\n    this._listener = {\n      moveend: map.on('moveend', this.viewChange.bind(this)),\n      size: map.on('change:size', this.overflow.bind(this))\n    }\n    // Listen to a layer group\n    if (this._layerGroup) {\n      this._listener.change = this._layerGroup.getLayers().on('change:length', this.drawPanel.bind(this));\n    } else  {\n      //Listen to all layers\n      this._listener.change = map.getLayerGroup().getLayers().on('change:length', this.drawPanel.bind(this));\n    }\n  }\n};\n/** Show control\n */\nol.control.LayerSwitcher.prototype.show = function() {\n  this.element.classList.add(\"ol-forceopen\");\n  this.overflow();\n};\n/** Hide control\n */\nol.control.LayerSwitcher.prototype.hide = function() {\n  this.element.classList.remove(\"ol-forceopen\");\n  this.overflow();\n};\n/** Toggle control\n */\nol.control.LayerSwitcher.prototype.toggle = function() {\n  this.element.classList.toggle(\"ol-forceopen\");\n  this.overflow();\n};\n/** Is control open\n * @return {boolean}\n */\nol.control.LayerSwitcher.prototype.isOpen = function() {\n  return this.element.classList.contains(\"ol-forceopen\");\n};\n/** Add a custom header\n * @param {Element|string} html content html\n */\nol.control.LayerSwitcher.prototype.setHeader = function(html) {\n  ol.ext.element.setHTML(this.header_, html);\n};\n/** Calculate overflow and add scrolls\n *\t@param {Number} dir scroll direction -1|0|1|'+50%'|'-50%'\n */\nol.control.LayerSwitcher.prototype.overflow = function(dir) {\t\n  if (this.button) {\n    // Nothing to show\n    if (ol.ext.element.hidden(this.panel_)) {\n      ol.ext.element.setStyle(this.element, { height: 'auto' });\n      return;\n    }\n    // Calculate offset\n    var h = ol.ext.element.outerHeight(this.element);\n    var hp = ol.ext.element.outerHeight(this.panel_);\n    var dh = this.button.offsetTop + ol.ext.element.outerHeight(this.button);\n    //var dh = this.button.position().top + this.button.outerHeight(true);\n    var top = this.panel_.offsetTop - dh;\n    if (hp > h-dh) {\n      // Bug IE: need to have an height defined\n      ol.ext.element.setStyle(this.element, { height: '100%' });\n      var lh = 2 * ol.ext.element.getStyle(this.panel_.querySelectorAll('li.visible .li-content')[0], 'height');\n      switch (dir) {\n        case 1: top += lh; break;\n        case -1: top -= lh; break;\n        case \"+50%\": top += Math.round(h/2); break;\n        case \"-50%\": top -= Math.round(h/2); break;\n        default: break;\n      }\n      // Scroll div\n      if (top+hp <= h-3*dh/2) {\n        top = h-3*dh/2-hp;\n        ol.ext.element.hide(this.botv);\n      } else {\n        ol.ext.element.show(this.botv);\n      }\n      if (top >= 0) {\n        top = 0;\n        ol.ext.element.hide(this.topv);\n      } else {\n        ol.ext.element.show(this.topv);\n      }\n      // Scroll ?\n      ol.ext.element.setStyle(this.panel_, { top: top+\"px\" });\n      return true;\n    } else {\n      ol.ext.element.setStyle(this.element, { height: \"auto\" });\n      ol.ext.element.setStyle(this.panel_, { top: 0 });\n      ol.ext.element.hide(this.botv);\n      ol.ext.element.hide(this.topv);\n      return false;\n    }\n  }\n  else return false;\n};\n/** Set the layer associated with a li\n * @param {Element} li\n * @param {ol.layer} layer\n */\nol.control.LayerSwitcher.prototype._setLayerForLI = function(li, layer) {\n  var listeners = [];\n  if (layer.getLayers) {\n    listeners.push(layer.getLayers().on('change:length', this.drawPanel.bind(this)));\n  }\n  if (li) {\n    // Handle opacity change\n    listeners.push(layer.on('change:opacity', (function() {\n      this.setLayerOpacity(layer, li);\n    }).bind(this)));\n    // Handle visibility chage\n    listeners.push(layer.on('change:visible', (function() {\n      this.setLayerVisibility(layer, li);\n    }).bind(this)));\n  }\n  // Other properties\n  listeners.push(layer.on('propertychange', (function(e) {\n    if (e.key === 'displayInLayerSwitcher'\n      || e.key === 'openInLayerSwitcher') {\n      this.drawPanel(e);\n    }\n  }).bind(this)));\n  this._layers.push({ li:li, layer:layer, listeners: listeners });\n};\n/** Set opacity for a layer\n * @param {ol.layer.Layer} layer\n * @param {Element} li the list element\n * @api\n */\nol.control.LayerSwitcher.prototype.setLayerOpacity = function(layer, li) {\n  var i = li.querySelector('.layerswitcher-opacity-cursor')\n  if (i) i.style.left = (layer.getOpacity()*100)+\"%\"\n};\n/** Set visibility for a layer\n * @param {ol.layer.Layer} layer\n * @param {Element} li the list element\n * @api\n */\nol.control.LayerSwitcher.prototype.setLayerVisibility = function(layer, li) {\n  var i = li.querySelector('.ol-visibility');\n  if (i) i.checked = layer.getVisible();\n  if (layer.getVisible()) li.classList.add('ol-visible');\n  else li.classList.remove('ol-visible');\n};\n/** Clear layers associated with li\n */\nol.control.LayerSwitcher.prototype._clearLayerForLI = function() {\n  this._layers.forEach(function (li) {\n    li.listeners.forEach(function(l) {\n      ol.Observable.unByKey(l);\n    });\n  })\n  this._layers = [];\n};\n/** Get the layer associated with a li\n * @param {Element} li\n * @return {ol.layer}\n */\nol.control.LayerSwitcher.prototype._getLayerForLI = function(li) {\n  for (var i=0, l; l=this._layers[i]; i++) {\n    if (l.li===li) return l.layer;\n  }\n  return null;\n};\n/**\n * On view change hide layer depending on resolution / extent\n * @private\n */\nol.control.LayerSwitcher.prototype.viewChange = function() {\n  this.panel_.querySelectorAll('li').forEach( function(li) {\n    var l = this._getLayerForLI(li);\n    if (l) {\n      if (this.testLayerVisibility(l)) li.classList.remove('ol-layer-hidden');\n      else li.classList.add('ol-layer-hidden');\n    }\n  }.bind(this));\n};\n/**\n *\tDraw the panel control (prevent multiple draw due to layers manipulation on the map with a delay function)\n*/\nol.control.LayerSwitcher.prototype.drawPanel = function() {\n  if (!this.getMap()) return;\n  var self = this;\n  // Multiple event simultaneously / draw once => put drawing in the event queue\n  this.dcount++;\n  setTimeout (function(){ self.drawPanel_(); }, this.get('drawDelay') || 0);\n};\n/** Delayed draw panel control \n * @private\n */\nol.control.LayerSwitcher.prototype.drawPanel_ = function() {\n  if (--this.dcount || this.dragging_) return;\n  // Remove existing layers\n  this._clearLayerForLI();\n  this.panel_.querySelectorAll('li').forEach (function(li) {\n    if (!li.classList.contains('ol-header')) li.remove();\n  }.bind(this));\n  // Draw list\n  this.drawList (this.panel_, this._layerGroup ?  this._layerGroup.getLayers() : this.getMap().getLayers());\n};\n/** Change layer visibility according to the baselayer option\n * @param {ol.layer}\n * @param {Array<ol.layer>} related layers\n */\nol.control.LayerSwitcher.prototype.switchLayerVisibility = function(l, layers) {\n  if (!l.get('baseLayer')) {\n    l.setVisible(!l.getVisible());\n  } else {\n    if (!l.getVisible()) l.setVisible(true);\n    layers.forEach(function(li) {\n      if (l!==li && li.get('baseLayer') && li.getVisible()) li.setVisible(false);\n    });\n  }\n};\n/** Check if layer is on the map (depending on zoom and extent)\n * @param {ol.layer}\n * @return {boolean}\n */\nol.control.LayerSwitcher.prototype.testLayerVisibility = function(layer) {\n  if (!this.getMap()) return true;\n  var res = this.getMap().getView().getResolution();\n  if (layer.getMaxResolution()<=res || layer.getMinResolution()>=res) {\n    return false;\n  } else {\n    var ex0 = layer.getExtent();\n    if (ex0) {\n      var ex = this.getMap().getView().calculateExtent(this.getMap().getSize());\n      return ol.extent.intersects(ex, ex0);\n    }\n    return true;\n  }\n};\n/** Start ordering the list\n*\t@param {event} e drag event\n*\t@private\n*/\nol.control.LayerSwitcher.prototype.dragOrdering_ = function(e) {\n  e.stopPropagation();\n  e.preventDefault();\n  // Get params\n  var self = this;\n  var elt = e.currentTarget.parentNode.parentNode;\n  var start = true;\n  var panel = this.panel_; \n  var pageY;\n  var pageY0 = e.pageY \n    || (e.touches && e.touches.length && e.touches[0].pageY) \n    || (e.changedTouches && e.changedTouches.length && e.changedTouches[0].pageY);\n  var target, dragElt;\n  var layer, group;\n  elt.parentNode.classList.add('drag');\n  // Stop ordering\n  function stop() {\n    if (target) {\n      // Get drag on parent\n      var drop = layer;\n      if (drop && target) {\n        var collection ;\n        if (group) collection = group.getLayers();\n        else collection = self._layerGroup ?  self._layerGroup.getLayers() : self.getMap().getLayers();\n        var layers = collection.getArray();\n        // Switch layers\n        for (var i=0; i<layers.length; i++) {\n          if (layers[i]==drop) {\n            collection.removeAt (i);\n            break;\n          }\n        }\n        for (var j=0; j<layers.length; j++) {\n          if (layers[j]==target) {\n            if (i>j) collection.insertAt (j,drop);\n            else collection.insertAt (j+1,drop);\n            break;\n          }\n        }\n      }\n      self.dispatchEvent({ type: \"reorder-end\", layer: drop, group: group });\n    }\n    elt.parentNode.querySelectorAll('li').forEach(function(li){\n      li.classList.remove('dropover');\n      li.classList.remove('dropover-after');\n      li.classList.remove('dropover-before');\n    });\n    elt.classList.remove(\"drag\");\n    elt.parentNode.classList.remove(\"drag\");\n    self.element.classList.remove('drag');\n    if (dragElt) dragElt.remove();\n    ol.ext.element.removeListener(document, 'mousemove touchmove', move);\n    ol.ext.element.removeListener(document, 'mouseup touchend touchcancel', stop);\n  }\n  // Ordering\n  function move(e) {\n    // First drag (more than 2 px) => show drag element (ghost)\n    pageY = e.pageY \n        || (e.touches && e.touches.length && e.touches[0].pageY) \n        || (e.changedTouches && e.changedTouches.length && e.changedTouches[0].pageY);\n    if (start && Math.abs(pageY0 - pageY) > 2) {\n      start = false;\n      elt.classList.add(\"drag\");\n      layer = self._getLayerForLI(elt);\n      target = false;\n      group = self._getLayerForLI(elt.parentNode.parentNode);\n      // Ghost div\n      dragElt = ol.ext.element.create('LI', { \n        className: 'ol-dragover',\n        html: elt.innerHTML,\n        style: { \n          position: \"absolute\", \n          \"z-index\": 10000, \n          left: elt.offsetLeft, \n          opacity: 0.5,\n          width: ol.ext.element.outerWidth(elt),\n          height: ol.ext.element.getStyle(elt,'height'),\n        },\n        parent: panel \n      });\n      self.element.classList.add('drag');\n      self.dispatchEvent({ type: \"reorder-start\", layer: layer, group: group });\n    }\n    // Start a new drag sequence\n    if (!start) {\n      e.preventDefault();\n      e.stopPropagation();\n      // Ghost div\n      ol.ext.element.setStyle(dragElt, { top: pageY - ol.ext.element.offsetRect(panel).top + panel.scrollTop +5 });\n      var li;\n      if (!e.touches) {\n        li = e.target;\n      } else {\n        li = document.elementFromPoint(e.touches[0].clientX, e.touches[0].clientY);\n      }\n      if (li.classList.contains(\"ol-switcherbottomdiv\")) {\n        self.overflow(-1);\n      } else if (li.classList.contains(\"ol-switchertopdiv\")) {\n        self.overflow(1);\n      }\n      // Get associated li\n      while (li && li.tagName!=='LI') {\n        li = li.parentNode;\n      }\n      if (!li || !li.classList.contains('dropover')) {\n        elt.parentNode.querySelectorAll('li').forEach(function(li) {\n          li.classList.remove('dropover');\n          li.classList.remove('dropover-after');\n          li.classList.remove('dropover-before');\n        });\n      }\n      if (li && li.parentNode.classList.contains('drag') && li !== elt) {\n        target = self._getLayerForLI(li);\n        // Don't mix layer level\n        if (target && !target.get('allwaysOnTop') == !layer.get('allwaysOnTop')) {\n          li.classList.add(\"dropover\");\n          li.classList.add((elt.offsetTop < li.offsetTop) ? 'dropover-after' : 'dropover-before');\n        } else {\n          target = false;\n        }\n        ol.ext.element.show(dragElt);\n      } else {\n        target = false;\n        if (li===elt) ol.ext.element.hide(dragElt);\n        else ol.ext.element.show(dragElt);\n      }\n      if (!target) dragElt.classList.add(\"forbidden\");\n      else dragElt.classList.remove(\"forbidden\");\n    }\n  }\n  // Start ordering\n  ol.ext.element.addListener(document, 'mousemove touchmove', move);\n  ol.ext.element.addListener(document, 'mouseup touchend touchcancel', stop);\n};\n/** Change opacity on drag \n*\t@param {event} e drag event\n*\t@private\n*/\nol.control.LayerSwitcher.prototype.dragOpacity_ = function(e) {\n  e.stopPropagation();\n  e.preventDefault();\n  var self = this\n  // Register start params\n  var elt = e.target;\n  var layer = this._getLayerForLI(elt.parentNode.parentNode.parentNode);\n  if (!layer) return;\n  var x = e.pageX \n    || (e.touches && e.touches.length && e.touches[0].pageX) \n    || (e.changedTouches && e.changedTouches.length && e.changedTouches[0].pageX);\n  var start = ol.ext.element.getStyle (elt, 'left') - x;\n  self.dragging_ = true;\n  // stop dragging\n  function stop() {\n    ol.ext.element.removeListener(document, \"mouseup touchend touchcancel\", stop);\n    ol.ext.element.removeListener(document, \"mousemove touchmove\", move);\n    self.dragging_ = false;\n  }\n  // On draggin\n  function move(e) {\n    var x = e.pageX \n      || (e.touches && e.touches.length && e.touches[0].pageX) \n      || (e.changedTouches && e.changedTouches.length && e.changedTouches[0].pageX);\n    var delta = (start + x) / ol.ext.element.getStyle(elt.parentNode, 'width');\n    var opacity = Math.max (0, Math.min(1, delta));\n    ol.ext.element.setStyle (elt, { left: (opacity*100) + \"%\" });\n    elt.parentNode.nextElementSibling.innerHTML = Math.round(opacity*100);\n    layer.setOpacity(opacity);\n  }\n  // Register move\n  ol.ext.element.addListener(document, \"mouseup touchend touchcancel\", stop);\n  ol.ext.element.addListener(document, \"mousemove touchmove\", move);\n};\n/** Render a list of layer\n * @param {Elemen} element to render\n * @layers {Array{ol.layer}} list of layer to show\n * @api stable\n */\nol.control.LayerSwitcher.prototype.drawList = function(ul, collection) {\n  var self = this;\n  var layers = collection.getArray();\n  // Change layer visibility\n  var setVisibility = function(e) {\n    e.stopPropagation();\n    e.preventDefault();\n    var l = self._getLayerForLI(this.parentNode.parentNode);\n    self.switchLayerVisibility(l, collection);\n  };\n  // Info button click\n  function onInfo(e) {\n    e.stopPropagation();\n    e.preventDefault(); \n    var l = self._getLayerForLI(this.parentNode.parentNode);\n    self.oninfo(l); \n    self.dispatchEvent({ type: \"info\", layer: l });\n  }\n  // Zoom to extent button\n  function zoomExtent(e) {\n    e.stopPropagation();\n    e.preventDefault(); \n    var l = self._getLayerForLI(this.parentNode.parentNode);\n    if (self.onextent) self.onextent(l); \n    else self.getMap().getView().fit (l.getExtent(), self.getMap().getSize()); \n    self.dispatchEvent({ type: \"extent\", layer: l });\n  }\n  // Remove a layer on trash click\n  function removeLayer(e) {\n    e.stopPropagation();\n    e.preventDefault();\n    var li = this.parentNode.parentNode.parentNode.parentNode;\n    var layer, group = self._getLayerForLI(li);\n    // Remove the layer from a group or from a map\n    if (group) {\n      layer = self._getLayerForLI(this.parentNode.parentNode);\n      group.getLayers().remove(layer);\n      if (group.getLayers().getLength()==0 && !group.get('noSwitcherDelete')) {\n        removeLayer.call(li.querySelectorAll('.layerTrash')[0], e);\n      }\n    } else {\n      li = this.parentNode.parentNode;\n      self.getMap().removeLayer(self._getLayerForLI(li));\n    }\n  }\n  // Add the layer list\n  for (var i=layers.length-1; i>=0; i--) {\n    var layer = layers[i];\n    if (!self.displayInLayerSwitcher(layer)) {\n      this._setLayerForLI(null, layer);\n      continue;\n    } \n    var li = ol.ext.element.create('LI', {\n      className: (layer.getVisible()?\"visible \":\" \")+(layer.get('baseLayer')?\"baselayer\":\"\"),\n      parent: ul\n    });\n    this._setLayerForLI(li, layer);\n    var layer_buttons = ol.ext.element.create('DIV', {\n      className: 'ol-layerswitcher-buttons',\n      parent: li\n    });\n    // Content div\n    var d = ol.ext.element.create('DIV', {\n      className: 'li-content',// + (this.testLayerVisibility(layer) ? '' : ' ol-layer-hidden'),\n      parent: li\n    });\n    // Visibility\n    ol.ext.element.create('INPUT', {\n      type: layer.get('baseLayer') ? 'radio' : 'checkbox',\n      className: 'ol-visibility',\n      checked: layer.getVisible(),\n      click: setVisibility,\n      parent: d\n    });\n    // Label\n    ol.ext.element.create('LABEL', {\n      html: layer.get(\"title\") || layer.get(\"name\"),\n      title: layer.get(\"title\") || layer.get(\"name\"),\n      click: setVisibility,\n      unselectable: 'on',\n      style: {\n        userSelect: 'none'\n      },\n      parent: d\n    }).addEventListener('selectstart', function(){ return false; });\n    //  up/down\n    if (this.reordering) {\n      if ( (i<layers.length-1 && (layer.get(\"allwaysOnTop\") || !layers[i+1].get(\"allwaysOnTop\")) )\n      || (i>0 && (!layer.get(\"allwaysOnTop\") || layers[i-1].get(\"allwaysOnTop\")) ) ) {\n        ol.ext.element.create('DIV', {\n          className: 'layerup',\n          title: this.tip.up,\n          on: { 'mousedown touchstart': function(e) { self.dragOrdering_(e) } },\n          parent: layer_buttons\n        });\n      }\n    }\n    // Show/hide sub layers\n    if (layer.getLayers) {\n      var nb = 0;\n      layer.getLayers().forEach(function(l) {\n        if (self.displayInLayerSwitcher(l)) nb++;\n      });\n      if (nb) {\n        ol.ext.element.create('DIV', {\n          className: layer.get(\"openInLayerSwitcher\") ? \"collapse-layers\" : \"expend-layers\",\n          title: this.tip.plus,\n          click: function() {\n            var l = self._getLayerForLI(this.parentNode.parentNode);\n            l.set(\"openInLayerSwitcher\", !l.get(\"openInLayerSwitcher\") )\n          },\n          parent: layer_buttons\n        });\n      }\n    }\n    // Info button\n    if (this.oninfo) {\n      ol.ext.element.create('DIV', {\n        className: 'layerInfo',\n        title: this.tip.info,\n        click: onInfo,\n        parent: layer_buttons\n      });\n    }\n    // Layer remove\n    if (this.hastrash && !layer.get(\"noSwitcherDelete\")) {\n      ol.ext.element.create('DIV', {\n        className: 'layerTrash',\n        title: this.tip.trash,\n        click: removeLayer,\n        parent: layer_buttons\n      });\n    }\n    // Layer extent\n    if (this.hasextent && layers[i].getExtent()) {\n      var ex = layers[i].getExtent();\n      if (ex.length==4 && ex[0]<ex[2] && ex[1]<ex[3]) {\n        ol.ext.element.create('DIV', {\n          className: 'layerExtent',\n          title: this.tip.extent,\n          click: zoomExtent,\n          parent: layer_buttons  \n        });\n      }\n    }\n    // Progress\n    if (this.show_progress && layer instanceof ol.layer.Tile) {\n      var p = ol.ext.element.create('DIV', {\n        className: 'layerswitcher-progress',\n        parent: d\n      });\n      this.setprogress_(layer);\n      layer.layerswitcher_progress = ol.ext.element.create('DIV', { parent: p });\n    }\n    // Opacity\n    var opacity = ol.ext.element.create('DIV', {\n      className: 'layerswitcher-opacity',\n      // Click on the opacity line\n      click: function(e){\n        if (e.target !== this) return;\n        e.stopPropagation();\n        e.preventDefault();\n        var op = Math.max ( 0, Math.min( 1, e.offsetX / ol.ext.element.getStyle(this, 'width')));\n        self._getLayerForLI(this.parentNode.parentNode).setOpacity(op);\n      },\n      parent: d\n    });\n    // Start dragging\n    ol.ext.element.create('DIV', {\n      className: 'layerswitcher-opacity-cursor',\n      style: { left: (layer.getOpacity()*100)+\"%\" },\n      on: {\n        'mousedown touchstart': function(e) { self.dragOpacity_ (e); }\n      },\n      parent: opacity\n    });\n    // Percent\n    ol.ext.element.create('DIV', {\n      className: 'layerswitcher-opacity-label',\n      html: Math.round(layer.getOpacity()*100),\n      parent: d\n    });\n    // Layer group\n    if (layer.getLayers) {\n      li.classList.add('ol-layer-group');\n      if (layer.get(\"openInLayerSwitcher\") === true) {\n        var ul2 = ol.ext.element.create('UL', {\n          parent: li\n        });\n        this.drawList (ul2, layer.getLayers());\n      }\n    }\n    else if (layer instanceof ol.layer.Vector) li.classList.add('ol-layer-vector');\n    else if (layer instanceof ol.layer.VectorTile) li.classList.add('ol-layer-vector');\n    else if (layer instanceof ol.layer.Tile) li.classList.add('ol-layer-tile');\n    else if (layer instanceof ol.layer.Image) li.classList.add('ol-layer-image');\n    else if (layer instanceof ol.layer.Heatmap) li.classList.add('ol-layer-heatmap');\n    // Dispatch a dralist event to allow customisation\n    this.dispatchEvent({ type:'drawlist', layer:layer, li:li });\n  }\n  this.viewChange();\n  if (ul === this.panel_) this.overflow();\n};\n/** Handle progress bar for a layer\n*\t@private\n*/\nol.control.LayerSwitcher.prototype.setprogress_ = function(layer) {\n  if (!layer.layerswitcher_progress) {\n    var loaded = 0;\n    var loading = 0;\n    var draw = function() {\n      if (loading === loaded) {\n        loading = loaded = 0;\n        ol.ext.element.setStyle(layer.layerswitcher_progress, { width: 0 });// layer.layerswitcher_progress.width(0);\n      } else {\n        ol.ext.element.setStyle(layer.layerswitcher_progress, { width: (loaded / loading * 100).toFixed(1) + '%' });// layer.layerswitcher_progress.css('width', (loaded / loading * 100).toFixed(1) + '%');\n      }\n    }\n    layer.getSource().on('tileloadstart', function() {\n      loading++;\n      draw();\n    });\n    layer.getSource().on('tileloadend', function() {\n      loaded++;\n      draw();\n    });\n    layer.getSource().on('tileloaderror', function() {\n      loaded++;\n      draw();\n    });\n  }\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Control bar for OL3\n * The control bar is a container for other controls. It can be used to create toolbars.\n * Control bars can be nested and combined with ol.control.Toggle to handle activate/deactivate.\n *\n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} options Control options.\n *  @param {String} options.className class of the control\n *  @param {bool} options.group is a group, default false\n *  @param {bool} options.toggleOne only one toggle control is active at a time, default false\n *  @param {bool} options.autoDeactivate used with subbar to deactivate all control when top level control deactivate, default false\n *  @param {Array<_ol_control_>} options.controls a list of control to add to the bar\n */\nol.control.Bar = function(options) {\n  if (!options) options={};\n  var element = document.createElement(\"div\");\n      element.classList.add('ol-unselectable', 'ol-control', 'ol-bar');\n  if (options.className) {\n    var classes = options.className.split(' ').filter(function(className) {\n      return className.length > 0;\n    });\n    element.classList.add.apply(element.classList, classes)\n  }\n  if (options.group) element.classList.add('ol-group');\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.set('toggleOne', options.toggleOne);\n  this.set('autoDeactivate', options.autoDeactivate);\n  this.controls_ = [];\n  if (options.controls instanceof Array) {\n    for (var i=0; i<options.controls.length; i++) {\n      this.addControl(options.controls[i]);\n    }\n  }\n};\nol.ext.inherits(ol.control.Bar, ol.control.Control);\n/** Set the control visibility\n * @param {boolean} b\n */\nol.control.Bar.prototype.setVisible = function (val) {\n  if (val) this.element.style.display = '';\n  else this.element.style.display = 'none';\n}\n/** Get the control visibility\n * @return {boolean} b\n */\nol.control.Bar.prototype.getVisible = function () {\n  return this.element.style.display != 'none';\n}\n/**\n * Set the map instance the control is associated with\n * and add its controls associated to this map.\n * @param {_ol_Map_} map The map instance.\n */\nol.control.Bar.prototype.setMap = function (map) {\n  ol.control.Control.prototype.setMap.call(this, map);\n  for (var i=0; i<this.controls_.length; i++) {\n    var c = this.controls_[i];\n    // map.addControl(c);\n    c.setMap(map);\n  }\n};\n/** Get controls in the panel\n *\t@param {Array<_ol_control_>}\n */\nol.control.Bar.prototype.getControls = function () {\n  return this.controls_;\n};\n/** Set tool bar position\n *\t@param {top|left|bottom|right} pos\n */\nol.control.Bar.prototype.setPosition = function (pos) {\n  this.element.classList.remove('ol-left', 'ol-top', 'ol-bottom', 'ol-right');\n  pos=pos.split ('-');\n  for (var i=0; i<pos.length; i++) {\n    switch (pos[i]) {\n      case 'top':\n      case 'left':\n      case 'bottom':\n      case 'right':\n        this.element.classList.add(\"ol-\"+pos[i]);\n        break;\n      default: break;\n    }\n  }\n};\n/** Add a control to the bar\n *\t@param {_ol_control_} c control to add\n */\nol.control.Bar.prototype.addControl = function (c) {\n  this.controls_.push(c);\n  c.setTarget(this.element);\n  if (this.getMap()) {\n    this.getMap().addControl(c);\n  }\n  // Activate and toogleOne\n  c.on ('change:active', function(e) { this.onActivateControl_(e, c); }.bind(this));\n  if (c.getActive) {\n    // c.dispatchEvent({ type:'change:active', key:'active', oldValue:false, active:true });\n    this.onActivateControl_({ target: c, active: c.getActive() }, c);\n  }\n};\n/** Deativate all controls in a bar\n * @param {_ol_control_} except a control\n */\nol.control.Bar.prototype.deactivateControls = function (except) {\n  for (var i=0; i<this.controls_.length; i++) {\n  if (this.controls_[i] !== except && this.controls_[i].setActive) {\n    this.controls_[i].setActive(false);\n    }\n  }\n};\nol.control.Bar.prototype.getActiveControls = function () {\n  var active = [];\n  for (var i=0, c; c=this.controls_[i]; i++) {\n    if (c.getActive && c.getActive()) active.push(c);\n  }\n  return active;\n}\n/** Auto activate/deactivate controls in the bar\n * @param {boolean} b activate/deactivate\n */\nol.control.Bar.prototype.setActive = function (b) {\n  if (!b && this.get(\"autoDeactivate\")) {\n    this.deactivateControls();\n  }\n  if (b) {\n    var ctrls = this.getControls();\n    for (var i=0, sb; (sb = ctrls[i]); i++) {\n      if (sb.get(\"autoActivate\")) sb.setActive(true);\n    }\n  }\n}\n/** Post-process an activated/deactivated control\n *\t@param {ol.event} e :an object with a target {_ol_control_} and active flag {bool}\n */\nol.control.Bar.prototype.onActivateControl_ = function (e, ctrl) {\n  if (this.get('toggleOne')) {\n    if (e.active) {\n      var n;\n      //var ctrl = e.target;\n      for (n=0; n<this.controls_.length; n++) {\n        if (this.controls_[n]===ctrl) break;\n      }\n      // Not here!\n      if (n==this.controls_.length) return;\n      this.deactivateControls (this.controls_[n]);\n    } else {\n      // No one active > test auto activate\n      if (!this.getActiveControls().length) {\n        for (var i=0, c; c=this.controls_[i]; i++) {\n          if (c.get(\"autoActivate\")) {\n            c.setActive(true);\n            break;\n          }\n        }\n      }\n    }\n  }\n};\n/**\n * @param {string} name of the control to search\n * @return {ol.control.Control}\n */\nol.control.Bar.prototype.getControlsByName = function(name) {\n  var controls = this.getControls();\n  return controls.filter(\n    function(control) {\n      return (control.get('name') === name);\n    }\n  );\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc \n *   OpenLayers 3 Attribution Control integrated in the canvas (for jpeg/png \n * @see http://www.kreidefossilien.de/webgis/dokumentation/beispiele/export-map-to-png-with-scale\n *\n * @constructor\n * @extends {ol.control.Attribution}\n * @param {Object=} options extend the ol.control.Attribution options.\n * \t@param {ol.style.Style} options.style  option is usesd to draw the text.\n */\nol.control.CanvasAttribution = function(options) {\n  if (!options) options = {};\n  ol.control.Attribution.call(this, options);\n  // Draw in canvas\n  this.setCanvas(!!options.canvas);\n  // Get style options\n  if (!options) options={};\n  if (!options.style) options.style = new ol.style.Style();\n  this.setStyle (options.style);\n}\nol.ext.inherits(ol.control.CanvasAttribution, ol.control.Attribution);\n/**\n * Draw attribution on canvas\n * @param {boolean} b draw the attribution on canvas.\n */\nol.control.CanvasAttribution.prototype.setCanvas = function (b) {\n  this.isCanvas_ = b;\n  if (b) this.setCollapsed(false);\n  this.element.style.visibility = b ? \"hidden\":\"visible\";\n  if (this.map_) this.map_.renderSync();\n};\n/** Get map Canvas\n * @private\n */\nol.control.CanvasAttribution.prototype.getContext = ol.control.CanvasBase.prototype.getContext;\n/**\n * Change the control style\n * @param {ol.style.Style} style\n */\nol.control.CanvasAttribution.prototype.setStyle = function (style) {\n  var text = style.getText();\n  this.font_ = text ? text.getFont() : \"10px sans-serif\";\n  var stroke = text ? text.getStroke() : null;\n  var fill = text ? text.getFill() : null;\n  this.fontStrokeStyle_ = stroke ? ol.color.asString(stroke.getColor()) : \"#fff\";\n  this.fontFillStyle_ = fill ? ol.color.asString(fill.getColor()) : \"#000\";\n  this.fontStrokeWidth_ = stroke ? stroke.getWidth() : 3;\n  if (this.getMap()) this.getMap().render();\n};\n/**\n * Remove the control from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.control.CanvasAttribution.prototype.setMap = function (map) {\n  ol.control.CanvasBase.prototype.getCanvas.call(this, map);\n  var oldmap = this.getMap();\n  if (this._listener) ol.Observable.unByKey(this._listener);\n  this._listener = null;\n  ol.control.ScaleLine.prototype.setMap.call(this, map);\n  if (oldmap) oldmap.renderSync();\n  // Get change (new layer added or removed)\n  if (map) {\n    this._listener = map.on('postcompose', this.drawAttribution_.bind(this));\n  }\n  this.map_ = map;\n  this.setCanvas (this.isCanvas_);\n};\n/** \n * Draw attribution in the final canvas\n * @private\n */\nol.control.CanvasAttribution.prototype.drawAttribution_ = function(e) {\n  if (!this.isCanvas_) return;\n  var ctx = this.getContext(e);\n  if (!ctx) return;\n  var text = \"\";\n  Array.prototype.slice.call(this.element.querySelectorAll('li'))\n    .filter(function(el) {\n      return el.style.display !== \"none\";\n    })\n    .map(function(el) {\n      text += (text ? \" - \":\"\") + el.textContent;\n    });\n  // Retina device\n  var ratio = e.frameState.pixelRatio;\n  ctx.save();\n  ctx.scale(ratio,ratio);\n  // Position\n  var eltRect = this.element.getBoundingClientRect();\n  var mapRect = this.getMap().getViewport().getBoundingClientRect();\n  var sc = this.getMap().getSize()[0] / mapRect.width;\n  ctx.translate((eltRect.left-mapRect.left)*sc, (eltRect.top-mapRect.top)*sc);\n  var h = this.element.clientHeight;\n  var w = this.element.clientWidth;\n  var left = w/2 + this.element.querySelectorAll('button')[0].clientWidth;\n  // Draw scale text\n  ctx.beginPath();\n    ctx.strokeStyle = this.fontStrokeStyle_;\n    ctx.fillStyle = this.fontFillStyle_;\n    ctx.lineWidth = this.fontStrokeWidth_;\n    ctx.textAlign = \"center\";\n    ctx.textBaseline =\"middle\";\n    ctx.font = this.font_;\n    ctx.strokeText(text, left, h/2);\n    ctx.fillText(text, left, h/2);\n  ctx.closePath();\n  ctx.restore();\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc \n *    OpenLayers 3 Scale Line Control integrated in the canvas (for jpeg/png \n * @see http://www.kreidefossilien.de/webgis/dokumentation/beispiele/export-map-to-png-with-scale\n *\n * @constructor\n * @extends {ol.control.ScaleLine}\n * @param {Object=} options extend the ol.control.ScaleLine options.\n * \t@param {ol.style.Style} options.style used to draw the scale line (default is black/white, 10px Arial).\n */\nol.control.CanvasScaleLine = function(options)\n{\tol.control.ScaleLine.call(this, options);\n\tthis.scaleHeight_ = 6;\n\t// Get style options\n\tif (!options) options={};\n\tif (!options.style) options.style = new ol.style.Style();\n\tthis.setStyle(options.style);\n}\nol.ext.inherits(ol.control.CanvasScaleLine, ol.control.ScaleLine);\n/** Get map Canvas\n * @private\n */\nol.control.CanvasScaleLine.prototype.getContext = ol.control.CanvasBase.prototype.getContext;\n/**\n * Remove the control from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {_ol_Map_} map Map.\n * @api stable\n */\nol.control.CanvasScaleLine.prototype.setMap = function (map)\n{\t\n\tol.control.CanvasBase.prototype.getCanvas.call(this, map);\n\tvar oldmap = this.getMap();\n\tif (this._listener) ol.Observable.unByKey(this._listener);\n\tthis._listener = null;\n\tol.control.ScaleLine.prototype.setMap.call(this, map);\n\tif (oldmap) oldmap.renderSync();\n\t// Add postcompose on the map\n\tif (map) {\n\t\tthis._listener = map.on('postcompose', this.drawScale_.bind(this));\n\t} \n\t// Hide the default DOM element\n\tthis.element.style.visibility = 'hidden';\n\tthis.olscale = this.element.querySelector(\".ol-scale-line-inner\");\n}\n/**\n * Change the control style\n * @param {_ol_style_Style_} style\n */\nol.control.CanvasScaleLine.prototype.setStyle = function (style)\n{\tvar stroke = style.getStroke();\n\tthis.strokeStyle_ = stroke ? ol.color.asString(stroke.getColor()) : \"#000\";\n\tthis.strokeWidth_ = stroke ? stroke.getWidth() : 2;\n\tvar fill = style.getFill();\n\tthis.fillStyle_ = fill ? ol.color.asString(fill.getColor()) : \"#fff\";\n\tvar text = style.getText();\n\tthis.font_ = text ? text.getFont() : \"10px Arial\";\n\tstroke = text ? text.getStroke() : null;\n\tfill = text ? text.getFill() : null;\n\tthis.fontStrokeStyle_ = stroke ? ol.color.asString(stroke.getColor()) : this.fillStyle_;\n\tthis.fontStrokeWidth_ = stroke ? stroke.getWidth() : 3;\n\tthis.fontFillStyle_ = fill ? ol.color.asString(fill.getColor()) : this.strokeStyle_;\n\t// refresh\n\tif (this.getMap()) this.getMap().render();\n}\n/** \n * Draw attribution in the final canvas\n * @private\n */\nol.control.CanvasScaleLine.prototype.drawScale_ = function(e)\n{\tif ( this.element.style.visibility!==\"hidden\" ) return;\n\tvar ctx = this.getContext(e);\n\tif (!ctx) return;\n\t// Get size of the scale div\n\tvar scalewidth = parseInt(this.olscale.style.width);\n\tif (!scalewidth) return;\n\tvar text = this.olscale.textContent;\n\tvar position = {left: this.element.offsetLeft, top: this.element.offsetTop};\n\t// Retina device\n\tvar ratio = e.frameState.pixelRatio;\n\tctx.save();\n\tctx.scale(ratio,ratio);\n\t// On top\n\tposition.top += this.element.clientHeight - this.scaleHeight_;\n\t// Draw scale text\n\tctx.beginPath();\n    ctx.strokeStyle = this.fontStrokeStyle_;\n    ctx.fillStyle = this.fontFillStyle_;\n    ctx.lineWidth = this.fontStrokeWidth_;\n    ctx.textAlign = \"center\";\n\tctx.textBaseline =\"bottom\";\n    ctx.font = this.font_;\n\tctx.strokeText(text, position.left+scalewidth/2, position.top);\n    ctx.fillText(text, position.left+scalewidth/2, position.top);\n\tctx.closePath();\n\t// Draw scale bar\n\tposition.top += 2;\n\tctx.lineWidth = this.strokeWidth_;\n\tctx.strokeStyle = this.strokeStyle_;\n\tvar max = 4;\n\tvar n = parseInt(text);\n\twhile (n%10 === 0) n/=10;\n\tif (n%5 === 0) max = 5;\n\tfor (var i=0; i<max; i++)\n\t{\tctx.beginPath();\n\t\tctx.fillStyle = i%2 ? this.fillStyle_ : this.strokeStyle_;\n\t\tctx.rect(position.left+i*scalewidth/max, position.top, scalewidth/max, this.scaleHeight_);\n\t\tctx.stroke();\n\t\tctx.fill();\n\t\tctx.closePath();\n\t}\n\tctx.restore();\n}\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * A title Control integrated in the canvas (for jpeg/png \n *\n * @constructor\n * @extends {ol.control.CanvasBase}\n * @param {Object=} options extend the ol.control options. \n *  @param {string} options.title the title, default 'Title'\n *  @param {ol.style.Style} options.style style used to draw the title.\n */\nol.control.CanvasTitle = function(options) {\n  if (!options) options = {};\n  var elt = ol.ext.element.create('DIV', {\n    className: (options.className || '') + ' ol-control-title ol-unselectable',\n    style: {\n      display: 'block',\n      visibility: 'hidden'\n    }\n  });\n  ol.control.CanvasBase.call(this, {\n    element: elt,\n    style: options.style\n  });\n  this.setTitle(options.title || 'Title');\n  this.element.style.font = this.getTextFont();\n};\nol.ext.inherits(ol.control.CanvasTitle, ol.control.CanvasBase);\n/**\n * Change the control style\n * @param {ol.style.Style} style\n */\nol.control.CanvasTitle.prototype.setStyle = function (style) {\n  ol.control.CanvasBase.prototype.setStyle.call(this, style);\n  // Element style\n  if (this.element) {\n    this.element.style.font = this.getTextFont();\n  }\n  // refresh\n  if (this.getMap()) this.getMap().render();\n};\n/**\n * Set the map title \n * @param {string} map title.\n * @api stable\n */\nol.control.CanvasTitle.prototype.setTitle = function (title) {\n  this.element.textContent = title;\n  this.set('title', title);\n  if (this.getMap()) this.getMap().renderSync();\n};\n/**\n * Get the map title \n * @param {string} map title.\n * @api stable\n */\nol.control.CanvasTitle.prototype.getTitle = function () {\n  return this.get('title');\n};\n/**\n * Set control visibility\n * @param {bool} b\n * @api stable\n */\nol.control.CanvasTitle.prototype.setVisible = function (b) {\n  this.element.style.display = (b ? 'block' : 'none');\n  if (this.getMap()) this.getMap().renderSync();\n};\n/**\n * Get control visibility\n * @return {bool} \n * @api stable\n */\nol.control.CanvasTitle.prototype.getVisible = function () {\n  return this.element.style.display !== 'none';\n};\n/** Draw title in the final canvas\n * @private\n*/\nol.control.CanvasTitle.prototype._draw = function(e) {\n  if (!this.getVisible()) return;\n  var ctx = this.getContext(e);\n\tif (!ctx) return;\n  // Retina device\n  var ratio = e.frameState.pixelRatio;\n  ctx.save();\n  ctx.scale(ratio,ratio);\n  // Position\n  var eltRect = this.element.getBoundingClientRect();\n  var mapRect = this.getMap().getViewport().getBoundingClientRect();\n  var sc = this.getMap().getSize()[0] / mapRect.width;\n  ctx.translate((eltRect.left-mapRect.left)*sc, (eltRect.top-mapRect.top)*sc);\n  var h = this.element.clientHeight;\n  var w = this.element.clientWidth;\n  var left = w/2;\n  ctx.beginPath();\n  ctx.fillStyle = ol.color.asString(this.getFill().getColor());\n  ctx.rect(0,0, w, h);\n  ctx.fill();\n  ctx.closePath();\n  ctx.beginPath();\n  ctx.fillStyle = ol.color.asString(this.getTextFill().getColor());\n  ctx.strokeStyle = ol.color.asString(this.getTextStroke().getColor());\n  ctx.lineWidth = this.getTextStroke().getWidth();\n  ctx.textAlign = 'center';\n  ctx.textBaseline = 'middle';\n  ctx.font = this.getTextFont();\n  if (ctx.lineWidth) ctx.strokeText(this.getTitle(), left, h/2);\n  ctx.fillText(this.getTitle(), left, h/2);\n  ctx.closePath();\n  ctx.restore();\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * A Control to display map center coordinates on the canvas.\n *\n * @constructor\n * @extends {ol.control.CanvasBase}\n * @param {Object=} options extend the ol.control options. \n *  @param {string} options.className CSS class name\n *  @param {ol.style.Style} options.style style used to draw in the canvas\n *  @param {ol.proj.ProjectionLike} options.projection\tProjection. Default is the view projection.\n *  @param {ol.coordinate.CoordinateFormat} options.coordinateFormat A function that takes a ol.Coordinate and transforms it into a string.\n *  @param {boolean} options.canvas true to draw in the canvas\n */\nol.control.CenterPosition = function(options) {\n  if (!options) options = {};\n  var elt = ol.ext.element.create('DIV', {\n    className: (options.className || '') + ' ol-center-position ol-unselectable',\n    style: {\n      display: 'block',\n      visibility: 'hidden'\n    }\n  });\n  ol.control.CanvasBase.call(this, {\n    element: elt,\n    style: options.style\n  });\n  this.element.style.font = this.getTextFont();\n  this.set('projection', options.projection);\n  this.setCanvas(options.canvas);\n  this._format = (typeof options.coordinateFormat === 'function') ? options.coordinateFormat : ol.coordinate.toStringXY; \n};\nol.ext.inherits(ol.control.CenterPosition, ol.control.CanvasBase);\n/**\n * Change the control style\n * @param {ol.style.Style} style\n */\nol.control.CenterPosition.prototype.setStyle = function (style) {\n  ol.control.CanvasBase.prototype.setStyle.call(this, style);\n  // Element style\n  if (this.element) {\n    this.element.style.font = this.getTextFont();\n  }\n  // refresh\n  if (this.getMap()) this.getMap().render();\n};\n/**\n * Draw on canvas\n * @param {boolean} b draw the attribution on canvas.\n */\nol.control.CenterPosition.prototype.setCanvas = function (b) {\n  this.set('canvas', b);\n\tthis.element.style.visibility = b ? \"hidden\":\"visible\";\n\tif (this.getMap()) this.getMap().renderSync();\n};\n/**\n * Set control visibility\n * @param {bool} b\n * @api stable\n */\nol.control.CenterPosition.prototype.setVisible = function (b) {\n  this.element.style.display = (b ? '' : 'none');\n  if (this.getMap()) this.getMap().renderSync();\n};\n/**\n * Get control visibility\n * @return {bool} \n * @api stable\n */\nol.control.CenterPosition.prototype.getVisible = function () {\n  return this.element.style.display !== 'none';\n};\n/** Draw position in the final canvas\n * @private\n*/\nol.control.CenterPosition.prototype._draw = function(e) {\n  if (!this.getVisible() || !this.getMap()) return;\n  // Coordinate\n  var coord = this.getMap().getView().getCenter();\n  if (this.get('projection')) coord = ol.proj.transform (coord, this.getMap().getView().getProjection(), this.get('projection'));\n  coord  = this._format(coord);\n  this.element.textContent = coord;\n  if (!this.get('canvas')) return;\n  var ctx = this.getContext(e);\n\tif (!ctx) return;\n  // Retina device\n  var ratio = e.frameState.pixelRatio;\n  ctx.save();\n  ctx.scale(ratio,ratio);\n  // Position\n  var eltRect = this.element.getBoundingClientRect();\n  var mapRect = this.getMap().getViewport().getBoundingClientRect();\n  var sc = this.getMap().getSize()[0] / mapRect.width;\n  ctx.translate((eltRect.left-mapRect.left)*sc, (eltRect.top-mapRect.top)*sc);\n  var h = this.element.clientHeight;\n  var w = this.element.clientWidth;\n  ctx.beginPath();\n  ctx.fillStyle = ol.color.asString(this.getTextFill().getColor());\n  ctx.strokeStyle = ol.color.asString(this.getTextStroke().getColor());\n  ctx.lineWidth = this.getTextStroke().getWidth();\n  ctx.textAlign = 'center';\n  ctx.textBaseline = 'middle';\n  ctx.font = this.getTextFont();\n  if (ctx.lineWidth) ctx.strokeText(coord, w/2, h/2);\n  ctx.fillText(coord, w/2, h/2);\n  ctx.closePath();\n  ctx.restore();\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Draw a compass on the map. The position/size of the control is defined in the css.\n *\n * @constructor\n * @extends {ol.control.CanvasBase}\n * @param {Object=} options Control options. The style {_ol_style_Stroke_} option is usesd to draw the text.\n *  @param {string} options.className class name for the control\n *  @param {Image} options.image an image, default use the src option or a default image\n *  @param {string} options.src image src, default use the image option or a default image\n *  @param {boolean} options.rotateVithView rotate vith view (false to show watermark), default true\n *  @param {ol.style.Stroke} options.style style to draw the lines, default draw no lines\n */\nol.control.Compass = function(options) {\n  var self = this;\n  if (!options) options = {};\n  // Initialize parent\n  var elt = document.createElement(\"div\");\n  elt.className = \"ol-compassctrl ol-unselectable ol-hidden\" + (options.className ? \" \"+options.className : \"\");\n  elt.style.position = \"absolute\";\n  elt.style.visibility = \"hidden\";\n  var style = (options.style instanceof ol.style.Stroke) ? new ol.style.Style({stroke: options.style}) : options.style;\n  if (!options.style) {\n    style = new ol.style.Style({stroke: new ol.style.Stroke({width:0}) });\n  }\n  ol.control.CanvasBase.call(this, { \n    element: elt,\n    style: style\n  });\n  this.set('rotateVithView', options.rotateWithView!==false);\n  // The image\n  if (options.image) {\n    this.img_ = options.image;\n  }\n  else if (options.src) {\n    this.img_ = new Image();\n    this.img_.onload = function(){ if (self.getMap()) self.getMap().renderSync(); }\n    this.img_.src = options.src;\n  } else {\n    this.img_ = this.defaultCompass_(this.element.clientWidth, this.getStroke().getColor());\n  }\n  // 8 angles\n  this.da_ = [];\n  for (var i=0; i<8; i++) this.da_[i] = [ Math.cos(Math.PI*i/8), Math.sin(Math.PI*i/8) ];\n};\nol.ext.inherits(ol.control.Compass, ol.control.CanvasBase);\n/**\n * Create a default image.\n * @param {number} s the size of the compass\n * @private\n */\nol.control.Compass.prototype.defaultCompass_ = function (s, color) {\n  var canvas = document.createElement('canvas');\n  var ctx = canvas.getContext(\"2d\");\n  s = canvas.width = canvas.height = s || 150;\n  var r = s/2;\n  var r2 = 0.22*r;\n  function draw (r, r2) {\n    ctx.fillStyle = color ||\"#963\";\n    ctx.beginPath();\n    ctx.moveTo (0,0); \n    ctx.lineTo (r,0); ctx.lineTo (r2,r2); ctx.moveTo (0,0);\n    ctx.lineTo (-r,0); ctx.lineTo (-r2,-r2); ctx.moveTo (0,0);\n    ctx.lineTo (0,r); ctx.lineTo (-r2,r2); ctx.moveTo (0,0);\n    ctx.lineTo (0,-r); ctx.lineTo (r2,-r2); ctx.moveTo (0,0);\n    ctx.fill();\n    ctx.stroke();\n  }\n  function draw2 (r, r2) {\n    ctx.globalCompositeOperation = \"destination-out\";\n    ctx.fillStyle = \"#fff\";\n    ctx.beginPath();\n    ctx.moveTo (0,0); \n    ctx.lineTo (r,0); ctx.lineTo (r2,-r2); ctx.moveTo (0,0);\n    ctx.lineTo (-r,0); ctx.lineTo (-r2,r2); ctx.moveTo (0,0);\n    ctx.lineTo (0,r); ctx.lineTo (r2,r2); ctx.moveTo (0,0);\n    ctx.lineTo (0,-r); ctx.lineTo (-r2,-r2); ctx.moveTo (0,0);\n    ctx.fill();\n    ctx.globalCompositeOperation=\"source-over\";\n    ctx.beginPath();\n    ctx.moveTo (0,0); \n    ctx.lineTo (r,0); ctx.lineTo (r2,-r2); ctx.moveTo (0,0);\n    ctx.lineTo (-r,0); ctx.lineTo (-r2,r2); ctx.moveTo (0,0);\n    ctx.lineTo (0,r); ctx.lineTo (r2,r2); ctx.moveTo (0,0);\n    ctx.lineTo (0,-r); ctx.lineTo (-r2,-r2); ctx.moveTo (0,0);\n    ctx.stroke();\n  }\n  ctx.translate(r,r);\n  ctx.strokeStyle = color || \"#963\";\n  ctx.lineWidth = 1.5;\n  ctx.beginPath();\n  ctx.arc (0,0, s*0.41, 0, 2*Math.PI);\n  ctx.arc (0,0, s*0.44, 0, 2*Math.PI);\n  ctx.stroke();\n  ctx.rotate(Math.PI/4)\n  draw (r*0.9, r2*0.8);\n  draw2 (r*0.9, r2*0.8);\n  ctx.rotate(-Math.PI/4)\n  draw (r, r2);\n  draw2 (r, r2);\n  return canvas;\n};\n/** Draw compass\n* @param {ol.event} e postcompose event\n* @private\n*/\nol.control.Compass.prototype._draw = function(e) {\n  var ctx = this.getContext(e);\n  if (!ctx) return;\n  var canvas = ctx.canvas;\n  // Retina device\n  var ratio = e.frameState.pixelRatio;\n  ctx.save();\n  ctx.scale(ratio,ratio);\n  var w = this.element.clientWidth;\n  var h = this.element.clientHeight;\n  var pos = {left: this.element.offsetLeft, top: this.element.offsetTop};\n  var compass = this.img_;\n  var rot = e.frameState.viewState.rotation;\n  ctx.beginPath();\n    ctx.translate(pos.left+w/2, pos.top+h/2);\n    if (this.get('rotateVithView')) ctx.rotate(rot);\n    /*\n    ctx.globalCompositeOperation = \"multiply\";\n    ctx.globalAlpha = this.opacity || 1;\n    */\n    if (this.getStroke().getWidth()) {\n      ctx.beginPath();\n        ctx.strokeStyle = this.getStroke().getColor();\n        ctx.lineWidth = this.getStroke().getWidth();\n        var m = Math.max(canvas.width, canvas.height);\n        for (var i=0; i<8; i++) {\n          ctx.moveTo (-this.da_[i][0]*m, -this.da_[i][1]*m);\n          ctx.lineTo (this.da_[i][0]*m, this.da_[i][1]*m);\n        }\n      ctx.stroke();\n    }\n    if (compass.width) {\n      ctx.drawImage (compass, -w/2, -h/2, w, h);\n    }\n  ctx.closePath();\n  ctx.restore();\n};\n\n/** \n * @classdesc\n * Application dialog\n * @extends {ol.control.Control}\n * @constructor\n * @param {*} options\n *  @param {string} options.className\n *  @param {ol.Map} options.map the map to place the dialog inside\n *  @param {Element} options.target target to place the dialog\n *  @param {boolean} options.zoom add a zoom effect\n *  @param {boolean} options.closeBox add a close button\n *  @param {number} options.max if not null add a progress bar to the dialog, default null\n *  @param {boolean} options.hideOnClick close dialog when click the background\n *  @param {boolean} options.noSubmit Prevent closing the dialog on submit\n */\nol.control.Dialog = function(options) {\n  options = options || {};\n  // Constructor\n  var element = ol.ext.element.create('DIV', {\n    className: ((options.className || '') + (options.zoom ? ' ol-zoom':'') + ' ol-ext-dialog').trim(),\n    click: function() {\n      if (this.get('hideOnClick')) this.close();\n    }.bind(this)\n  });\n  // form\n  var form = ol.ext.element.create('FORM', {\n    on: {\n      submit: this._onButton('submit')\n    },\n    parent: element\n  });\n  // Title\n  ol.ext.element.create('H2', {\n    parent: form\n  });\n  // Close box\n  ol.ext.element.create('DIV', {\n    className: 'ol-closebox',\n    click: this._onButton('cancel'),\n    parent: form\n  });\n  // Content\n  ol.ext.element.create('DIV', {\n    className: 'ol-content',\n    parent: form\n  });\n  // Progress\n  this._progress = ol.ext.element.create('DIV', {\n    className: 'ol-progress-bar',\n    style: { display: 'none' },\n    parent: form\n  });\n  this._progressbar = ol.ext.element.create('DIV', {\n    parent: this._progress\n  });\n  // Buttons\n  ol.ext.element.create('DIV', {\n    className: 'ol-buttons',\n    parent: form\n  });\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.set('closeBox', options.closeBox);\n  this.set('zoom', options.zoom);\n  this.set('hideOnClick', options.hideOnClick);\n  this.set('className', options.className);\n  this.set('closeOnSubmit', options.closeOnSubmit);\n  this.setContent(options)\n};\nol.ext.inherits(ol.control.Dialog, ol.control.Control);\n/** Show a new dialog \n * @param { * | Element | string } options options or a content to show\n *  @param {Element | string} options.content dialog content\n *  @param {string} options.title title of the dialog\n *  @param {Object} options.buttons a key/value list of button to show \n */\nol.control.Dialog.prototype.show = function(options) {\n  if (options instanceof Element || typeof(options) === 'string') {\n    options = { content: options };\n  }\n  this.setContent(options);\n  this.element.classList.add('ol-visible');\n  var input = this.element.querySelector('input[type=\"text\"],input[type=\"search\"],input[type=\"number\"]');\n  if (input) input.focus();\n  this.dispatchEvent ({ type: 'show' });\n};\n/** Open the dialog\n */\nol.control.Dialog.prototype.open = function() {\n  this.show();\n};\n/** Set the dialog content\n * @param {*} options\n *  @param {Element | String} options.content dialog content\n *  @param {string} options.title title of the dialog\n *  @param {string} options.className dialog class name\n *  @param {number} options.max if not null add a progress bar to the dialog\n *  @param {number} options.progress set the progress bar value\n *  @param {Object} options.buttons a key/value list of button to show \n */\nol.control.Dialog.prototype.setContent = function(options) {\n  if (!options) return;\n  if (typeof(options) === 'string') options = { content: options };\n  options = options || {};\n  if (options.max) this.setProgress(0, options.max);\n  if (options.progress !== undefined) this.setProgress(options.progress);\n  //this.element.className = 'ol-ext-dialog' + (this.get('zoom') ? ' ol-zoom' : '');\n  if (this.get('zoom')) this.element.classList.add('ol-zoom');\n  else this.element.classList.remove('ol-zoom');\n  if (options.className) {\n    this.element.classList.add(options.className);\n  } else if (this.get('className')) {\n    this.element.classList.add(this.get('className'));\n  }\n  var form = this.element.querySelector('form');\n  // Content\n  if (options.content !== undefined) {\n    if (options.content instanceof Element) ol.ext.element.setHTML(form.querySelector('.ol-content'), '');\n    ol.ext.element.setHTML(form.querySelector('.ol-content'), options.content || '');\n  }\n  // Title\n  if (options.title !== undefined) {\n    form.querySelector('h2').innerText = options.title || '';\n    if (options.title) {\n      form.classList.add('ol-title');\n    } else {\n      form.classList.remove('ol-title');\n    }\n  }\n  // Closebox\n  if (options.closeBox || (this.get('closeBox') && options.closeBox !== false)) {\n    form.classList.add('ol-closebox');\n  } else {\n    form.classList.remove('ol-closebox');\n  }\n  // Buttons\n  var buttons = this.element.querySelector('.ol-buttons');\n  buttons.innerHTML = '';\n  if (options.buttons) {\n    form.classList.add('ol-button');\n    for (var i in options.buttons) {\n      ol.ext.element.create ('INPUT', {\n        type: (i==='submit' ? 'submit':'button'),\n        value: options.buttons[i],\n        click: this._onButton(i),\n        parent: buttons\n      });\n    }\n  } else {\n    form.classList.remove('ol-button');\n  }\n};\n/** Set progress\n * @param {number} val\n * @param {number} max\n */\nol.control.Dialog.prototype.setProgress = function(val, max) {\n  if (max > 0) {\n    this.set('max', Number(max));\n  } else {\n    max = this.get('max');\n  }\n  if (!max) {\n    ol.ext.element.setStyle(this._progress, { display: 'none' })\n  } else {\n    var p = Math.round(val / max * 100);\n    ol.ext.element.setStyle(this._progress, { display: '' })\n    this._progressbar.className = p ? '' : 'notransition';\n    ol.ext.element.setStyle(this._progressbar, { width: p+'%' })\n  }\n};\n/** Do something on button click\n * @private\n */\nol.control.Dialog.prototype._onButton = function(button) {\n  // Dispatch a button event\n  var fn = function(e) {\n    e.preventDefault();\n    if (button!=='submit' || this.get('closeOnSubmit')!==false) this.hide();\n    var inputs = {};\n    this.element.querySelectorAll('form input').forEach (function(input) {\n      if (input.className) inputs[input.className] = input;\n    });\n    this.dispatchEvent ({ type: 'button', button: button, inputs: inputs });\n  }.bind(this);\n  return fn;\n};\n/** Close the dialog \n */\nol.control.Dialog.prototype.hide = function() {\n  this.element.classList.remove('ol-visible');\n  this.dispatchEvent ({ type: 'hide' });\n};\n/** Close the dialog \n * @method Dialog.close\n * @return {bool} true if a dialog is closed\n */\nol.control.Dialog.prototype.close = ol.control.Dialog.prototype.hide;\n/** The dialog is shown\n * @return {bool} true if a dialog is open\n */\nol.control.Dialog.prototype.isOpen = function() {\n  return (this.element.classList.contains('ol-visible'));\n};\n\n/** A simple control to disable all actions on the map.\n * The control will create an invisible div over the map.\n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} options Control options.\n *\t\t@param {String} options.class class of the control\n *\t\t@param {String} options.html html code to insert in the control\n *\t\t@param {bool} options.on the control is on\n *\t\t@param {function} options.toggleFn callback when control is clicked \n */\nol.control.Disable = function(options)\n{\toptions = options||{};\n\tvar element = document.createElement(\"div\");\n\t\t\telement.className = (options.className||\"\"+' ol-disable ol-unselectable ol-control').trim();\n\tvar stylesOptions = { top:\"0px\", left:\"0px\", right:\"0px\", bottom:\"0px\", \"zIndex\":10000, background:\"none\", display:\"none\" };\n\tObject.keys(stylesOptions).forEach(function(styleKey) {\n\t\telement.style[styleKey] = stylesOptions[styleKey];\n\t});\n\tol.control.Control.call(this,\n\t{\telement: element\n\t});\n}\nol.ext.inherits(ol.control.Disable, ol.control.Control);\n/** Test if the control is on\n * @return {bool}\n * @api stable\n */\nol.control.Disable.prototype.isOn = function()\n{\treturn this.element.classList.contains(\"ol-disable\");\n}\n/** Disable all action on the map\n * @param {bool} b, default false\n * @api stable\n */\nol.control.Disable.prototype.disableMap = function(b)\n{\tif (b) \n\t{\tthis.element.classList.add(\"ol-enable\").show();\n\t}\n\telse \n\t{\tthis.element.classList.remove(\"ol-enable\").hide();\n\t}\n}\n\n/** Control bar for editing in a layer\n * @constructor\n * @extends {ol.control.Bar}\n * @fires info\n * @param {Object=} options Control options.\n *\t@param {String} options.className class of the control\n *\t@param {String} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *\t@param {boolean} options.edition false to remove the edition tools, default true\n *\t@param {Object} options.interactions List of interactions to add to the bar \n *    ie. Select, Delete, Info, DrawPoint, DrawLine, DrawPolygon\n *    Each interaction can be an interaction or true (to get the default one) or false to remove it from bar\n *\t@param {ol.source.Vector} options.source Source for the drawn features. \n */\nol.control.EditBar = function(options) {\n  options = options || {};\n  options.interactions = options.interactions || {};\n  // New bar\n\tol.control.Bar.call(this, {\n    className: (options.className ? options.className+' ': '') + 'ol-editbar',\n    toggleOne: true,\n\t\ttarget: options.target\n  });\n  this._source = options.source;\n  // Add buttons / interaction\n  this._interactions = {};\n  this._setSelectInteraction(options);\n  if (options.edition!==false) this._setEditInteraction(options);\n  this._setModifyInteraction(options);\n};\nol.ext.inherits(ol.control.EditBar, ol.control.Bar);\n/**\n * Set the map instance the control is associated with\n * and add its controls associated to this map.\n * @param {_ol_Map_} map The map instance.\n */\nol.control.EditBar.prototype.setMap = function (map) {\n  if (this.getMap()) {\n    if (this._interactions.Delete) this.getMap().removeInteraction(this._interactions.Delete);\n    if (this._interactions.ModifySelect) this.getMap().removeInteraction(this._interactions.ModifySelect);\n  }\n  ol.control.Bar.prototype.setMap.call(this, map);\n  if (this.getMap()) {\n    if (this._interactions.Delete) this.getMap().addInteraction(this._interactions.Delete);\n    if (this._interactions.ModifySelect) this.getMap().addInteraction(this._interactions.ModifySelect);\n  }\n};\n/** Get an interaction associated with the bar\n * @param {string} name \n */\nol.control.EditBar.prototype.getInteraction = function (name) {\n  return this._interactions[name];\n};\n/** Get the option title */\nol.control.EditBar.prototype._getTitle = function (option) {\n  return (option && option.title) ? option.title : option;\n};\n/** Add selection tool:\n * 1. a toggle control with a select interaction\n * 2. an option bar to delete / get information on the selected feature\n * @private\n */\nol.control.EditBar.prototype._setSelectInteraction = function (options) {\n  var self = this;\n  // Sub bar\n  var sbar = new ol.control.Bar();\n  var selectCtrl;\n  // Delete button\n  if (options.interactions.Delete !== false) {\n    if (options.interactions.Delete instanceof ol.interaction.Delete) {\n      this._interactions.Delete = options.interactions.Delete; \n    } else {\n      this._interactions.Delete = new ol.interaction.Delete();\n    }\n    var del = this._interactions.Delete;\n    del.setActive(false);\n    if (this.getMap()) this.getMap().addInteraction(del);\n    sbar.addControl (new ol.control.Button({\n      className: 'ol-delete',\n      title: this._getTitle(options.interactions.Delete) || \"Delete\",\n      handleClick: function(e) {\n        // Delete selection\n        del.delete(selectCtrl.getInteraction().getFeatures());\n        console.log('del')\n        var evt = {\n          type: 'select',\n          selected: [],\n          deselected: selectCtrl.getInteraction().getFeatures().getArray().slice(),\n          mapBrowserEvent: e.mapBrowserEvent\n        };\n        selectCtrl.getInteraction().getFeatures().clear();\n        selectCtrl.getInteraction().dispatchEvent(evt);\n      }\n    }));\n  }\n  // Info button\n  if (options.interactions.Info !== false) {\n    sbar.addControl (new ol.control.Button({\n      className: 'ol-info',\n      title: this._getTitle(options.interactions.Info) || \"Show informations\",\n      handleClick: function() {\n        self.dispatchEvent({ \n          type: 'info', \n          features: selectCtrl.getInteraction().getFeatures() \n        });\n      }\n    }));\n  }\n  // Select button\n  if (options.interactions.Select !== false) {\n    if (options.interactions.Select instanceof ol.interaction.Select) {\n      this._interactions.Select = options.interactions.Select\n    } else {\n      this._interactions.Select = new ol.interaction.Select({\n        condition: ol.events.condition.click\n      });\n    }\n    var sel = this._interactions.Select;\n    selectCtrl = new ol.control.Toggle({\n      className: 'ol-selection',\n      title: this._getTitle(options.interactions.Select) || \"Select\",\n      interaction: sel,\n      bar: sbar.getControls().length ? sbar : undefined,\n      autoActivate:true,\n      active:true\n    });\n    this.addControl(selectCtrl);\n    sel.on('change:active', function() {\n      sel.getFeatures().clear();\n    });\n  }\n};\n/** Add editing tools\n * @private\n */ \nol.control.EditBar.prototype._setEditInteraction = function (options) {\n  if (options.interactions.DrawPoint !== false) {\n    if (options.interactions.DrawPoint instanceof ol.interaction.Draw) {\n      this._interactions.DrawPoint = options.interactions.DrawPoint;\n    } else {\n      this._interactions.DrawPoint = new ol.interaction.Draw({\n        type: 'Point',\n        source: this._source\n      });\n    }\n    var pedit = new ol.control.Toggle({\n      className: 'ol-drawpoint',\n      title: this._getTitle(options.interactions.DrawPoint) || 'Point',\n      interaction: this._interactions.DrawPoint\n    });\n    this.addControl ( pedit );\n  }\n  if (options.interactions.DrawLine !== false) {\n    if (options.interactions.DrawLine instanceof ol.interaction.Draw) {\n      this._interactions.DrawLine = options.interactions.DrawLine\n    } else {\n      this._interactions.DrawLine = new ol.interaction.Draw ({\n        type: 'LineString',\n        source: this._source,\n        // Count inserted points\n        geometryFunction: function(coordinates, geometry) {\n          if (geometry) geometry.setCoordinates(coordinates);\n          else geometry = new ol.geom.LineString(coordinates);\n          this.nbpts = geometry.getCoordinates().length;\n          return geometry;\n        }\n      });\n    }\n    var ledit = new ol.control.Toggle({\n      className: 'ol-drawline',\n      title: this._getTitle(options.interactions.DrawLine) || 'LineString',\n      interaction: this._interactions.DrawLine,\n      // Options bar associated with the control\n      bar: new ol.control.Bar ({\n        controls:[ \n          new ol.control.TextButton({\n            html: this._getTitle(options.interactions.UndoDraw) || 'undo',\n            title: this._getTitle(options.interactions.UndoDraw) || \"delete last point\",\n            handleClick: function() {\n              if (ledit.getInteraction().nbpts>1) ledit.getInteraction().removeLastPoint();\n            }\n          }),\n          new ol.control.TextButton ({\n            html: this._getTitle(options.interactions.FinishDraw) || 'finish',\n            title: this._getTitle(options.interactions.FinishDraw) || \"finish\",\n            handleClick: function() {\n              // Prevent null objects on finishDrawing\n              if (ledit.getInteraction().nbpts>2) ledit.getInteraction().finishDrawing();\n            }\n          })\n        ]\n      }) \n    });\n    this.addControl ( ledit );\n  }\n  if (options.interactions.DrawPolygon !== false) {\n    if (options.interactions.DrawPolygon instanceof ol.interaction.Draw){\n      this._interactions.DrawPolygon = options.interactions.DrawPolygon\n    } else {\n      this._interactions.DrawPolygon = new ol.interaction.Draw ({\n        type: 'Polygon',\n        source: this._source,\n        // Count inserted points\n        geometryFunction: function(coordinates, geometry) {\n          this.nbpts = coordinates[0].length;\n          if (geometry) geometry.setCoordinates([coordinates[0].concat([coordinates[0][0]])]);\n          else geometry = new ol.geom.Polygon(coordinates);\n          return geometry;\n        }\n      });\n    }\n    this._setDrawPolygon(\n      'ol-drawpolygon', \n      this._interactions.DrawPolygon, \n      this._getTitle(options.interactions.DrawPolygon) || 'Polygon', \n      options\n    );\n  }\n  // Draw hole\n  if (options.interactions.DrawHole !== false) {\n    if (options.interactions.DrawHole instanceof ol.interaction.DrawHole){\n      this._interactions.DrawHole = options.interactions.DrawHole;\n    } else {\n      this._interactions.DrawHole = new ol.interaction.DrawHole ();\n    }\n    this._setDrawPolygon(\n      'ol-drawhole', \n      this._interactions.DrawHole, \n      this._getTitle(options.interactions.DrawHole) || 'Hole', \n      options\n    );\n  }\n  // Draw regular\n  if (options.interactions.DrawRegular !== false) {\n    if (options.interactions.DrawRegular instanceof ol.interaction.DrawRegular) {\n      this._interactions.DrawRegular = options.interactions.DrawRegular\n    } else {\n      this._interactions.DrawRegular = new ol.interaction.DrawRegular ({\n        source: this._source,\n        sides: 4\n      });\n    }\n    var regular = this._interactions.DrawRegular;\n    var div = document.createElement('DIV');\n    var down = ol.ext.element.create('DIV', { parent: div });\n    ol.ext.element.addListener(down, ['click', 'touchstart'], function() {\n      var sides = regular.getSides() -1;\n      if (sides < 2) sides = 2;\n      regular.setSides (sides);\n      text.textContent = sides>2 ? sides+' pts' : 'circle';\n    }.bind(this));\n    var text = ol.ext.element.create('TEXT', { html:'4 pts', parent: div });\n    var up = ol.ext.element.create('DIV', { parent: div });\n    ol.ext.element.addListener(up, ['click', 'touchstart'], function() {\n      var sides = regular.getSides() +1;\n      if (sides<3) sides=3;\n      regular.setSides(sides);\n      text.textContent = sides+' pts';\n    }.bind(this));\n    var ctrl = new ol.control.Toggle({\n      className: 'ol-drawregular',\n      title: this._getTitle(options.interactions.DrawRegular) || 'Regular',\n      interaction: this._interactions.DrawRegular,\n      // Options bar associated with the control\n      bar: new ol.control.Bar ({\n        controls:[ \n          new ol.control.TextButton({\n            html: div\n          })\n        ]\n      }) \n    });\n    this.addControl (ctrl);\n  }\n};\n/**\n * @private\n */\nol.control.EditBar.prototype._setDrawPolygon = function (className, interaction, title, options) {\n  var fedit = new ol.control.Toggle ({\n    className: className,\n    title: title,\n    interaction: interaction,\n    // Options bar associated with the control\n    bar: new ol.control.Bar({\n      controls:[ \n        new ol.control.TextButton ({\n          html: this._getTitle(options.interactions.UndoDraw) || 'undo',\n          title: this._getTitle(options.interactions.UndoDraw) || 'undo last point',\n          handleClick: function(){\n            if (fedit.getInteraction().nbpts>1) fedit.getInteraction().removeLastPoint();\n          }\n        }),\n        new ol.control.TextButton({\n          html: this._getTitle(options.interactions.FinishDraw) || 'finish',\n          title: this._getTitle(options.interactions.FinishDraw) || 'finish',\n          handleClick: function() {\n            // Prevent null objects on finishDrawing\n            if (fedit.getInteraction().nbpts>3) fedit.getInteraction().finishDrawing();\n          }\n        })\n      ]\n    }) \n  });\n  this.addControl (fedit);\n};\n/** Add modify tools\n * @private\n */ \nol.control.EditBar.prototype._setModifyInteraction = function (options) {\n  // Modify on selected features\n  if (options.interactions.ModifySelect !== false && options.interactions.Select !== false) {\n    if (options.interactions.ModifySelect instanceof ol.interaction.ModifyFeature) {\n      this._interactions.ModifySelect = options.interactions.ModifySelect;\n    } else {\n      this._interactions.ModifySelect = new ol.interaction.ModifyFeature({\n        features: this.getInteraction('Select').getFeatures()\n      });\n    }\n    if (this.getMap()) this.getMap().addInteraction(this._interactions.ModifySelect);\n    // Activate with select\n    this._interactions.ModifySelect.setActive(this._interactions.Select.getActive());\n    this._interactions.Select.on('change:active', function() {\n      this._interactions.ModifySelect.setActive(this._interactions.Select.getActive());\n    }.bind(this));\n  }\n  if (options.interactions.Transform !== false) {\n    if (options.interactions.Transform instanceof ol.interaction.Transform) {\n      this._interactions.Transform = options.interactions.Transform;\n    } else {\n      this._interactions.Transform = new ol.interaction.Transform ({\n        addCondition: ol.events.condition.shiftKeyOnly\n      });\n    }\n    var transform = new ol.control.Toggle ({\n      html: '<i></i>',\n      className: 'ol-transform',\n      title: this._getTitle(options.interactions.Transform) || 'Transform',\n      interaction: this._interactions.Transform\n    });\n    this.addControl (transform);\n  }\n  if (options.interactions.Split !== false) {\n    if (options.interactions.Split instanceof ol.interaction.Split) {\n      this._interactions.Split = options.interactions.Split;\n    } else {\n      this._interactions.Split = new ol.interaction.Split ({\n          sources: this._source\n      });\n    }\n    var split = new ol.control.Toggle ({\n      className: 'ol-split',\n      title: this._getTitle(options.interactions.Split) || 'Split',\n      interaction: this._interactions.Split\n    });\n    this.addControl (split);\n  }\n  if (options.interactions.Offset !== false) {\n    if (options.interactions.Offset instanceof ol.interaction.Offset) {\n      this._interactions.Offset = options.interactions.Offset;\n    } else {\n      this._interactions.Offset = new ol.interaction.Offset ({\n          source: this._source\n      });\n    }\n    var offset = new ol.control.Toggle ({\n      html: '<i></i>',\n      className: 'ol-offset',\n      title: this._getTitle(options.interactions.Offset) || 'Offset',\n      interaction: this._interactions.Offset\n    });\n    this.addControl (offset);\n  }\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A simple gauge control to display level information on the map.\n *\n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} options Control options.\n *  @param {String} options.className class of the control\n *  @param {String} options.title title of the control\n *  @param {number} options.max maximum value, default 100;\n *  @param {number} options.val the value, default 0\n */\nol.control.Gauge = function(options) {\n  options = options || {};\n  var element = ol.ext.element.create('DIV', {\n    className: ((options.className||\"\") + ' ol-gauge ol-unselectable ol-control').trim()\n  });\n  this.title_ = ol.ext.element.create('SPAN', {\n    parent: element\n  });\n  var div =  ol.ext.element.create('DIV', {\n    parent: element\n  });\n  this.gauge_ = ol.ext.element.create('BUTTON', {\n    type: 'button',\n    style: { width: '0px' },\n    parent: div\n  });\n  /*\n  var element = document.createElement(\"div\");\n  element.className = ((options.className||\"\") + ' ol-gauge ol-unselectable ol-control').trim();\n  this.title_ = document.createElement(\"span\");\n  element.appendChild(this.title_);\n  this.gauge_ = document.createElement(\"button\");\n  this.gauge_.setAttribute('type','button');\n  element.appendChild(document.createElement(\"div\").appendChild(this.gauge_))\n  this.gauge_.style.width = '0px';\n  */\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.setTitle(options.title);\n  this.set(\"max\", options.max||100);\n  this.val(options.val);\n};\nol.ext.inherits(ol.control.Gauge, ol.control.Control);\n/** Set the control title\n* @param {string} title\n*/\nol.control.Gauge.prototype.setTitle = function(title) {\n  this.title_.innerHTML = title||\"\";\n  if (!title) this.title_.display = 'none';\n  else this.title_.display = '';\n};\n/** Set/get the gauge value\n* @param {number|undefined} v the value or undefined to get it\n* @return {number} the value\n*/\nol.control.Gauge.prototype.val = function(v) {\n  if (v!==undefined) {\n    this.val_ = v;\n    this.gauge_.style.width = (v/this.get('max')*100)+\"%\";\n  }\n  return this.val_;\n};\n\n/** Bookmark positions on ol maps.\n *\n * @constructor\n * @extends {ol.control.Control}\n * @fires add\n * @fires remove\n * @fires select\n * @param {} options Geobookmark's options\n *  @param {string} options.className default ol-bookmark\n *  @param {string | undefined} options.title Title to use for the button tooltip, default \"Geobookmarks\"\n *  @param {string} options.placeholder input placeholder, default Add a new geomark...\n *  @param {bool} options.editable enable modification, default true\n *  @param {string} options.namespace a namespace to save the boolmark (if more than one on a page), default ol\n *  @param {Array<any>} options.marks a list of default bookmarks: \n * @see [Geobookmark example](../../examples/control/map.control.geobookmark.html)\n * @example \nvar bm = new GeoBookmark ({ \n  marks: {\n    \"Paris\": {pos:ol.proj.transform([2.351828, 48.856578], 'EPSG:4326', 'EPSG:3857'), zoom:11, permanent: true },\n    \"London\": {pos:ol.proj.transform([-0.1275,51.507222], 'EPSG:4326', 'EPSG:3857'), zoom:12}\n  }\n});\n */\nol.control.GeoBookmark = function(options) {\n  options = options || {};\n  var self = this;\n  var element = document.createElement('div');\n  if (options.target) {\n    element.className = options.className || \"ol-bookmark\";\n  } else {\n    element.className = (options.className || \"ol-bookmark\") +\n          \" ol-unselectable ol-control ol-collapsed\";\n    element.addEventListener(\"mouseleave\", function() {\n      if (input !== document.activeElement) {\n        menu.style.display = 'none';\n      }\n    });\n    // Show bookmarks on click\n    this.button = ol.ext.element.create('BUTTON', {\n      type: 'button',\n      title: options.title || 'Geobookmarks',\n      click: function() {\n        menu.style.display = (menu.style.display === '' || menu.style.display === 'none' ? 'block': 'none');\n      }\n    });\n    element.appendChild(this.button);\n  }\n  // The menu\n  var menu = document.createElement('div');\n  element.appendChild(menu);\n  var ul = document.createElement('ul');\n  menu.appendChild(ul);\n  var input = document.createElement('input');\n  input.setAttribute(\"placeholder\", options.placeholder || \"Add a new geomark...\")\n  input.addEventListener(\"change\", function() {\n    var title = this.value;\n    if (title) {\n      self.addBookmark(title);\n      this.value = '';\n      self.dispatchEvent({\n        type: \"add\",\n        name: title\n      });\n    }\n    menu.style.display = 'none';\n  });\n  input.addEventListener(\"blur\", function() {\n    menu.style.display = 'none';\n  });\n  menu.appendChild(input);\n  // Init\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.on(\"propertychange\", function(e) {\n    if (e.key==='editable') {\n      element.className = element.className.replace(\" ol-editable\",\"\");\n      if (this.get('editable')) {\n        element.className += \" ol-editable\";\n      }\n    }\n    // console.log(e);\n  }.bind(this));\n  this.set(\"namespace\", options.namespace || 'ol');\n  this.set(\"editable\", options.editable !== false);\n  // Set default bmark\n  var bmark = {};\n  if (localStorage[this.get('namespace')+\"@bookmark\"]) {\n    bmark = JSON.parse(localStorage[this.get('namespace')+\"@bookmark\"]);\n  }\n  if (options.marks) {\n    for (var i in options.marks) {\n      bmark[i] = options.marks[i];\n    }\n  }\n  this.setBookmarks(bmark);\n};\nol.ext.inherits(ol.control.GeoBookmark, ol.control.Control);\n/** Set bookmarks\n * @param {} bmark a list of bookmarks, default retreave in the localstorage\n * @example \nbm.setBookmarks({ \n  \"Paris\": {pos:_ol_proj_.transform([2.351828, 48.856578], 'EPSG:4326', 'EPSG:3857'), zoom:11, permanent: true },\n  \"London\": {pos:_ol_proj_.transform([-0.1275,51.507222], 'EPSG:4326', 'EPSG:3857'), zoom:12}\n});\n */\nol.control.GeoBookmark.prototype.setBookmarks = function(bmark) {\n  if (!bmark) bmark = JSON.parse(localStorage[this.get('namespace')+\"@bookmark\"] || \"{}\");\n  var modify = this.get(\"editable\");\n  var ul = this.element.querySelector(\"ul\");\n  var menu = this.element.querySelector(\"div\");\n  var self = this;\n  ul.innerHTML = '';\n  for (var b in bmark) {\n    var li = document.createElement('li');\n    li.textContent = b;\n    li.setAttribute('data-bookmark', JSON.stringify(bmark[b]));\n    li.setAttribute('data-name', b);\n    li.addEventListener('click', function() {\n      var bm = JSON.parse(this.getAttribute(\"data-bookmark\"));\n      self.getMap().getView().setCenter(bm.pos);\n      self.getMap().getView().setZoom(bm.zoom);\n      self.getMap().getView().setRotation(bm.rot || 0);\n      menu.style.display = 'none';\n      self.dispatchEvent({ type: 'select', name: this.getAttribute(\"data-name\"), bookmark: bm });\n    });\n    ul.appendChild(li);\n    if (modify && !bmark[b].permanent) {\n      var button = document.createElement('button');\n      button.setAttribute('data-name', b);\n      button.setAttribute(\"title\", \"Suppr.\");\n      button.addEventListener('click', function(e) {\n        self.removeBookmark(this.getAttribute(\"data-name\"));\n        self.dispatchEvent({ type: \"remove\", name: this.getAttribute(\"data-name\") });\n        e.stopPropagation();\n      });\n      li.appendChild(button);\n    }\n  }\n  localStorage[this.get('namespace')+\"@bookmark\"] = JSON.stringify(bmark);\n};\n/** Get Geo bookmarks\n * @return {any} a list of bookmarks : { BM1:{pos:ol.coordinates, zoom: integer}, BM2:{pos:ol.coordinates, zoom: integer} }\n */\nol.control.GeoBookmark.prototype.getBookmarks = function() {\n  return JSON.parse(localStorage[this.get('namespace')+\"@bookmark\"] || \"{}\");\n};\n/** Remove a Geo bookmark\n * @param {string} name\n */\nol.control.GeoBookmark.prototype.removeBookmark = function(name) {\n  if (!name) {\n    return;\n  }\n  var bmark = this.getBookmarks();\n  delete bmark[name];\n  this.setBookmarks(bmark);\n};\n/** Add a new Geo bookmark (replace existing one if any)\n * @param {string} name name of the bookmark (display in the menu)\n * @param {*} options\n *  @param {ol.coordinate} position default current position\n *  @param {number} zoom default current map zoom\n *  @param {number} rotation default current map rotation\n *  @param {bool} permanent prevent from deletion, default false\n */\nol.control.GeoBookmark.prototype.addBookmark = function(name, position, zoom, permanent) {\n  if (!name) return;\n  var options = position;\n  var rot = this.getMap().getView().getRotation();\n  if (options && options.position) {\n    zoom = options.zoom;\n    permanent = options.permanent;\n    rot = options.rotation ;\n    position = options.position;\n  }\n  var bmark = this.getBookmarks();\n  // Don't override permanent bookmark\n  if (bmark[name] && bmark[name].permanent) return;\n  // Create or override\n  bmark[name] = {\n    pos: position || this.getMap().getView().getCenter(),\n    zoom: zoom || this.getMap().getView().getZoom(),\n    permanent: !!permanent\n  };\n  if (rot) {\n    bmark[name].rot = rot;\n  }\n  this.setBookmarks(bmark);\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO,\n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Geolocation bar\n * The control bar is a container for other controls. It can be used to create toolbars.\n * Control bars can be nested and combined with ol.control.Toggle to handle activate/deactivate.\n *\n * @constructor\n * @extends {ol.control.Bar}\n * @param {Object=} options Control bar options.\n *  @param {String} options.className class of the control\n *  @param {String} options.centerLabel label for center button, default center\n *  @param {String} options.position position of the control, default bottom-right\n */\nol.control.GeolocationBar = function(options) {\n  if (!options) options = {};\n  options.className = options.className || 'ol-geobar';\n  ol.control.Bar.call(this, options);\n  this.setPosition(options.position || 'bottom-right');\n  var element = this.element;\n  // Geolocation draw interaction\n  var interaction = new ol.interaction.GeolocationDraw({\n    source: options.source,\n    zoom: options.zoom,\n    minZoom: options.minZoom,\n    tolerance: options.tolerance,\n    followTrack: options.followTrack,\n    minAccuracy: options.minAccuracy || 10000\n  });\n  this._geolocBt = new ol.control.Toggle ({\n    className: 'geolocBt',\n    interaction: interaction,\n    onToggle: function() {\n      interaction.pause(true);\n      interaction.setFollowTrack(options.followTrack);\n      element.classList.remove('pauseTrack');\n    }\n  });\n  this.addControl(this._geolocBt);\n  this._geolocBt.setActive(false);\n  // Buttons\n  var bar = new ol.control.Bar();\n  this.addControl(bar);\n  var centerBt = new ol.control.TextButton ({\n    className: 'centerBt',\n    html: options.centerLabel ||'center',\n    handleClick: function() {\n      interaction.setFollowTrack('auto');\n    }\n  });\n  bar.addControl(centerBt);\n  var startBt = new ol.control.Button ({\n    className: 'startBt',\n    handleClick: function(){\n      interaction.pause(false);\n      interaction.setFollowTrack('auto');\n      element.classList.add('pauseTrack');\n    }\n  });\n  bar.addControl(startBt);\n  var pauseBt = new ol.control.Button ({\n    className: 'pauseBt',\n    handleClick: function(){\n      interaction.pause(true);\n      interaction.setFollowTrack('auto');\n      element.classList.remove('pauseTrack');\n    }\n  });\n  bar.addControl(pauseBt);\n  interaction.on('follow', function(e) {\n    if (e.following) {\n      element.classList.remove('centerTrack');\n    } else {\n      element.classList.add('centerTrack');\n    }\n  });\n  // Activate\n  this._geolocBt.on('change:active', function(e) {\n    if (e.active) {\n      element.classList.add('ol-active');\n    } else {\n      element.classList.remove('ol-active');\n    }\n  });\n};\nol.ext.inherits(ol.control.GeolocationBar, ol.control.Bar);\n/**\n * Remove the control from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.control.GeolocationBar.prototype.setMap = function (map) {\n  if (this._listener) ol.Observable.unByKey(this._listener);\n  this._listener = null;\n  ol.control.Bar.prototype.setMap.call(this, map);\n  // Get change (new layer added or removed)\n  if (map) {\n    this._listener = map.on('moveend', function() {\n      var geo = this.getInteraction();\n      if (geo.getActive() && geo.get('followTrack') === 'auto' && geo.path_.length) {\n        if (geo.path_[geo.path_.length-1][0] !== map.getView().getCenter()[0]) {\n          this.element.classList.add('centerTrack');\n        }\n      }\n    }.bind(this));\n  }\n};\n/** Get the ol.interaction.GeolocationDraw associatedwith the bar\n * @return {ol.interaction.GeolocationDraw}\n */\nol.control.GeolocationBar.prototype.getInteraction = function () {\n  return this._geolocBt.getInteraction();\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO,\n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Geolocation bar\n * The control bar is a container for other controls. It can be used to create toolbars.\n * Control bars can be nested and combined with ol.control.Toggle to handle activate/deactivate.\n *\n * @constructor\n * @fires tracking\n * @extends {ol.control.Toggle}\n * @param {Object=} options ol.interaction.GeolocationDraw option.\n *  @param {String} options.className class of the control\n *  @param {number} options.delay delay before removing the location in ms, delfaut 3000 (3s)\n */\nol.control.GeolocationButton = function(options) {\n  if (!options) options = {};\n  // Geolocation draw interaction\n  options.followTrack = options.followTrack || 'auto';\n  options.zoom = options.zoom || 16;\n  //options.minZoom = options.minZoom || 16;\n  var interaction = new ol.interaction.GeolocationDraw(options);\n  ol.control.Toggle.call (this, {\n    className: options.className = ((options.className || '') + ' ol-geobt').trim(),\n    interaction: interaction,\n    onToggle: function() {\n      interaction.pause(true);\n      interaction.setFollowTrack(options.followTrack || 'auto');\n    }\n  });\n  this.setActive(false);\n  interaction.on('tracking', function(e) {\n    this.dispatchEvent({ type: 'position', coordinate: e.geolocation.getPosition() });\n  }.bind(this));\n  // Timeout delay\n  var tout;\n  interaction.on('change:active', function() {\n    this.dispatchEvent({ type:'position' });\n    if (tout) {\n      clearTimeout(tout);\n      tout = null;\n    }\n    if (interaction.getActive()) {\n      tout = setTimeout(function() {\n        interaction.setActive(false);\n        tout = null;\n      }.bind(this), options.delay || 3000);\n    }\n  }.bind(this));\n};\nol.ext.inherits(ol.control.GeolocationButton, ol.control.Toggle);\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * OpenLayers 3 lobe Overview Control.\n * The globe can rotate with map (follow.) \n *\n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} options Control options.\n * \t@param {boolean} follow follow the map when center change, default false\n * \t@param {top|bottom-left|right} align position as top-left, etc.\n * \t@param {Array<ol.layer>} layers list of layers to display on the globe\n * \t@param {ol.style.Style | Array.<ol.style.Style> | undefined} style style to draw the position on the map , default a marker\n */\nol.control.Globe = function(opt_options)\n{\tvar options = opt_options || {};\n\tvar self = this;\n\t// API\n\tvar element;\n\tif (options.target)\n\t{\telement = document.createElement(\"div\");\n\t\tthis.panel_ = options.target;\n\t}\n\telse\n\t{\telement = document.createElement(\"div\");\n\t\telement.classList.add('ol-globe', 'ol-unselectable', 'ol-control');\n\t\tif (/top/.test(options.align)) element.classList.add('ol-control-top');\n\t\tif (/right/.test(options.align)) element.classList.add('ol-control-right');\n\t\tthis.panel_ = document.createElement(\"div\");\n\t\tthis.panel_.classList.add(\"panel\")\n\t\telement.appendChild(this.panel_);\n\t\tthis.pointer_ = document.createElement(\"div\");\n\t\tthis.pointer_.classList.add(\"ol-pointer\");\n\t\telement.appendChild(this.pointer_);\n\t}\n\tol.control.Control.call(this,\n\t{\telement: element,\n\t\ttarget: options.target\n\t});\n// http://openlayers.org/en/latest/examples/sphere-mollweide.html ???\n\t// Create a globe map\n\tthis.ovmap_ = new ol.Map(\n\t{\tcontrols: new ol.Collection(),\n\t\tinteractions: new ol.Collection(),\n\t\ttarget: this.panel_,\n\t\tview: new ol.View\n\t\t\t({\tzoom: 0,\n\t\t\t\tcenter: [0,0]\n\t\t\t}),\n\t\tlayers: options.layers\n\t});\n\tsetTimeout (function()\n\t{\tself.ovmap_.updateSize(); \n\t}, 0);\n\tthis.set('follow', options.follow || false);\n\t// Cache extent\n\tthis.extentLayer = new ol.layer.Vector(\n\t{\tname: 'Cache extent',\n\t\tsource: new ol.source.Vector(),\n\t\tstyle: options.style || [new ol.style.Style(\n\t\t\t\t\t{\timage: new ol.style.Circle(\n\t\t\t\t\t\t{\tfill: new ol.style.Fill({\n\t\t\t\t\t\t\t\tcolor: 'rgba(255,0,0, 1)'\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tstroke: new ol.style.Stroke(\n\t\t\t\t\t\t\t{\twidth: 7,\n\t\t\t\t\t\t\t\tcolor: 'rgba(255,0,0, 0.8)'\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tradius: 5\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t)]\n\t})\n\tthis.ovmap_.addLayer(this.extentLayer);\n};\nol.ext.inherits(ol.control.Globe, ol.control.Control);\n/**\n * Set the map instance the control associated with.\n * @param {ol.Map} map The map instance.\n */\nol.control.Globe.prototype.setMap = function(map) {\n\tif (this._listener) ol.Observable.unByKey(this._listener);\n\tthis._listener = null;\n\tol.control.Control.prototype.setMap.call(this, map);\n\t// Get change (new layer added or removed)\n\tif (map) \n\t{\tthis._listener = map.getView().on('propertychange', this.setView.bind(this));\n\t\tthis.setView();\n\t}\n};\n/** Set the globe center with the map center\n*/\nol.control.Globe.prototype.setView = function()\n{\tif (this.getMap() && this.get('follow'))\n\t{\tthis.setCenter(this.getMap().getView().getCenter());\n\t}\n}\n/** Get globe map\n*\t@return {ol.Map}\n*/\nol.control.Globe.prototype.getGlobe = function()\n{\treturn this.ovmap_;\n}\n/** Show/hide the globe\n*/\nol.control.Globe.prototype.show = function(b)\n{\tif (b!==false) this.element.classList.remove(\"ol-collapsed\");\n\telse this.element.classList.add(\"ol-collapsed\");\n\tthis.ovmap_.updateSize();\n}\n/** Set position on the map\n*\t@param {top|bottom-left|right}  align\n*/\nol.control.Globe.prototype.setPosition = function(align)\n{\tif (/top/.test(align)) this.element.classList.add(\"ol-control-top\");\n\telse this.element.classList.remove(\"ol-control-top\");\n\tif (/right/.test(align)) this.element.classList.add(\"ol-control-right\");\n\telse this.element.classList.remove(\"ol-control-right\");\n}\n/** Set the globe center\n* @param {_ol_coordinate_} center the point to center to\n* @param {boolean} show show a pointer on the map, defaylt true\n*/\nol.control.Globe.prototype.setCenter = function (center, show)\n{\tvar self = this;\n\tthis.pointer_.classList.add(\"hidden\");\n\tif (center)\n\t{\tvar map = this.ovmap_;\n\t\tvar p = map.getPixelFromCoordinate(center);\n\t\tif (p) {\n\t\t\tif (show!==false) {\n\t\t\t\tvar h = this.element.clientHeight;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tself.pointer_.style.top = String(Math.min(Math.max(p[1],0),h)) + 'px';\n\t\t\t\t\tself.pointer_.style.left = \"50%\";\n\t\t\t\t\tself.pointer_.classList.remove(\"hidden\");\n\t\t\t\t}, 800);\n\t\t\t}\n\t\t\tmap.getView().animate({ center: [center[0],0] });\n\t\t}\n\t}\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Draw a graticule on the map.\n *\n * @constructor\n * @extends {ol.control.CanvasBase}\n * @param {Object=} _ol_control_ options.\n *  @param {ol.projectionLike} options.projection projection to use for the graticule, default EPSG:4326 \n *  @param {number} options.maxResolution max resolution to display the graticule\n *  @param {ol.style.Style} options.style Style to use for drawing the graticule, default black.\n *  @param {number} options.step step beetween lines (in proj units), default 1\n *  @param {number} options.stepCoord show a coord every stepCoord, default 1\n *  @param {number} options.spacing spacing beetween lines (in px), default 40px \n *  @param {number} options.borderWidth width of the border (in px), default 5px \n *  @param {number} options.margin margin of the border (in px), default 0px \n *  @param {number} options.formatCoord a function that takes a coordinate and a position and return the formated coordinate\n */\nol.control.Graticule = function(options) {\n  if (!options) options = {};\n  // Initialize parent\n  var elt = document.createElement(\"div\");\n  elt.className = \"ol-graticule ol-unselectable ol-hidden\";\n  ol.control.CanvasBase.call(this, { element: elt });\n  this.set('projection', options.projection || 'EPSG:4326');\n  // Use to limit calculation \n  var p = new ol.proj.Projection({code:this.get('projection')});\n  var m = p.getMetersPerUnit();\n  this.fac = 1;\n  while (m/this.fac>10) {\n    this.fac *= 10;\n  }\n  this.fac = 10000/this.fac;\n  this.set('maxResolution', options.maxResolution || Infinity);\n  this.set('step', options.step || 0.1);\n  this.set('stepCoord', options.stepCoord || 1);\n  this.set('spacing', options.spacing || 40);\n  this.set('margin', options.margin || 0);\n  this.set('borderWidth', options.borderWidth || 5);\n  this.set('stroke', options.stroke!==false);\n  this.formatCoord = options.formatCoord || function(c){return c;};\n  if (options.style instanceof ol.style.Style) {\n    this.setStyle(options.style);\n  }\n  else {\n    this.setStyle(new ol.style.Style({\n      stroke: new ol.style.Stroke({ color:\"#000\", width:1 }),\n      fill: new ol.style.Fill({ color: \"#fff\" }),\n      text: new ol.style.Text({\n        stroke: new ol.style.Stroke({ color:\"#fff\", width:2 }),\n        fill: new ol.style.Fill({ color:\"#000\" }),\n      }) \n    }));\n  }\n};\nol.ext.inherits(ol.control.Graticule, ol.control.CanvasBase);\nol.control.Graticule.prototype.setStyle = function (style) {\n  this._style = style;\n};\nol.control.Graticule.prototype._draw = function (e) {\n  if (this.get('maxResolution')<e.frameState.viewState.resolution) return;\n  var ctx = this.getContext(e);\n  var canvas = ctx.canvas;\n  var ratio = e.frameState.pixelRatio;\n  var w = canvas.width/ratio;\n  var h = canvas.height/ratio;\n  var proj = this.get('projection');\n  var map = this.getMap();\n  var bbox = \n  [\tmap.getCoordinateFromPixel([0,0]),\n    map.getCoordinateFromPixel([w,0]),\n    map.getCoordinateFromPixel([w,h]),\n    map.getCoordinateFromPixel([0,h])\n  ];\n  var xmax = -Infinity;\n  var xmin = Infinity;\n  var ymax = -Infinity;\n  var ymin = Infinity;\n  for (var i=0, c; c=bbox[i]; i++)\n  {\tbbox[i] = ol.proj.transform (c, map.getView().getProjection(), proj);\n    xmax = Math.max (xmax, bbox[i][0]);\n    xmin = Math.min (xmin, bbox[i][0]);\n    ymax = Math.max (ymax, bbox[i][1]);\n    ymin = Math.min (ymin, bbox[i][1]);\n  }\n  var spacing = this.get('spacing');\n  var step = this.get('step');\n  var step2 = this.get('stepCoord');\n  var borderWidth = this.get('borderWidth');\n  var margin = this.get('margin');\n  // Limit max line draw\n  var ds = (xmax-xmin)/step*spacing;\n  if (ds>w) \n  {\tvar dt = Math.round((xmax-xmin)/w*spacing /step);\n    step *= dt;\n    if (step>this.fac) step = Math.round(step/this.fac)*this.fac;\n  }\n  xmin = (Math.floor(xmin/step))*step -step;\n  ymin = (Math.floor(ymin/step))*step -step;\n  xmax = (Math.floor(xmax/step))*step +2*step;\n  ymax = (Math.floor(ymax/step))*step +2*step;\n  var extent = ol.proj.get(proj).getExtent();\n  if (extent)\n  {\tif (xmin < extent[0]) xmin = extent[0];\n    if (ymin < extent[1]) ymin = extent[1];\n    if (xmax > extent[2]) xmax = extent[2]+step;\n    if (ymax > extent[3]) ymax = extent[3]+step;\n  }\n  var hasLines = this.getStyle().getStroke() && this.get(\"stroke\");\n  var hasText = this.getStyle().getText();\n  var hasBorder = this.getStyle().getFill();\n  ctx.save();\n    ctx.scale(ratio,ratio);\n    ctx.beginPath();\n    ctx.rect(margin, margin, w-2*margin, h-2*margin);\n    ctx.clip();\n    ctx.beginPath();\n    var txt = {top:[],left:[],bottom:[], right:[]};\n    var x, y, p, p0, p1;\n    for (x=xmin; x<xmax; x += step)\n    {\tp0 = ol.proj.transform ([x, ymin], proj, map.getView().getProjection());\n      p0 = map.getPixelFromCoordinate(p0);\n      if (hasLines) ctx.moveTo(p0[0], p0[1]);\n      p = p0;\n      for (y=ymin+step; y<=ymax; y+=step)\n      {\tp1 = ol.proj.transform ([x, y], proj, map.getView().getProjection());\n        p1 = map.getPixelFromCoordinate(p1);\n        if (hasLines) ctx.lineTo(p1[0], p1[1]);\n        if (p[1]>0 && p1[1]<0) txt.top.push([x, p]);\n        if (p[1]>h && p1[1]<h) txt.bottom.push([x,p]);\n        p = p1;\n      }\n    }\n    for (y=ymin; y<ymax; y += step)\n    {\tp0 = ol.proj.transform ([xmin, y], proj, map.getView().getProjection());\n      p0 = map.getPixelFromCoordinate(p0);\n      if (hasLines) ctx.moveTo(p0[0], p0[1]);\n      p = p0;\n      for (x=xmin+step; x<=xmax; x+=step)\n      {\tp1 = ol.proj.transform ([x, y], proj, map.getView().getProjection());\n        p1 = map.getPixelFromCoordinate(p1);\n        if (hasLines) ctx.lineTo(p1[0], p1[1]);\n        if (p[0]<0 && p1[0]>0) txt.left.push([y,p]);\n        if (p[0]<w && p1[0]>w) txt.right.push([y,p]);\n        p = p1;\n      }\n    }\n    if (hasLines)\n    {\tctx.strokeStyle = this.getStyle().getStroke().getColor();\n      ctx.lineWidth = this.getStyle().getStroke().getWidth();\n      ctx.stroke();\n    }\n    // Draw text\n    if (hasText)\n    {\n      ctx.fillStyle = this.getStyle().getText().getFill().getColor();\n      ctx.strokeStyle = this.getStyle().getText().getStroke().getColor();\n      ctx.lineWidth = this.getStyle().getText().getStroke().getWidth();\n      ctx.textAlign = 'center';\n      ctx.textBaseline = 'hanging';\n      var t, tf;\n      var offset = (hasBorder ? borderWidth : 0) + margin + 2;\n      for (i=0; t = txt.top[i]; i++) if (!(Math.round(t[0]/this.get('step'))%step2))\n      {\ttf = this.formatCoord(t[0], 'top');\n        ctx.strokeText(tf, t[1][0], offset);\n        ctx.fillText(tf, t[1][0], offset);\n      }\n      ctx.textBaseline = 'alphabetic';\n      for (i=0; t = txt.bottom[i]; i++) if (!(Math.round(t[0]/this.get('step'))%step2))\n      {\ttf = this.formatCoord(t[0], 'bottom');\n        ctx.strokeText(tf, t[1][0], h-offset);\n        ctx.fillText(tf, t[1][0], h-offset);\n      }\n      ctx.textBaseline = 'middle';\n      ctx.textAlign = 'left';\n      for (i=0; t = txt.left[i]; i++) if (!(Math.round(t[0]/this.get('step'))%step2))\n      {\ttf = this.formatCoord(t[0], 'left');\n        ctx.strokeText(tf, offset, t[1][1]);\n        ctx.fillText(tf, offset, t[1][1]);\n      }\n      ctx.textAlign = 'right';\n      for (i=0; t = txt.right[i]; i++) if (!(Math.round(t[0]/this.get('step'))%step2))\n      {\ttf = this.formatCoord(t[0], 'right');\n        ctx.strokeText(tf, w-offset, t[1][1]);\n        ctx.fillText(tf, w-offset, t[1][1]);\n      }\n    }\n    // Draw border\n    if (hasBorder)\n    {\tvar fillColor = this.getStyle().getFill().getColor();\n      var color, stroke;\n      if (stroke = this.getStyle().getStroke())\n      {\tcolor = this.getStyle().getStroke().getColor();\n      }\n      else\n      {\tcolor = fillColor;\n        fillColor = \"#fff\";\n      }\n      ctx.strokeStyle = color;\n      ctx.lineWidth = stroke ? stroke.getWidth() : 1;\n      // \n      for (i=1; i<txt.top.length; i++)\n      {\tctx.beginPath();\n        ctx.rect(txt.top[i-1][1][0], margin, txt.top[i][1][0]-txt.top[i-1][1][0], borderWidth);\n        ctx.fillStyle = Math.round(txt.top[i][0]/step)%2 ? color: fillColor;\n        ctx.fill(); \n        ctx.stroke(); \n      }\n      for (i=1; i<txt.bottom.length; i++)\n      {\tctx.beginPath();\n        ctx.rect(txt.bottom[i-1][1][0], h-borderWidth-margin, txt.bottom[i][1][0]-txt.bottom[i-1][1][0], borderWidth);\n        ctx.fillStyle = Math.round(txt.bottom[i][0]/step)%2 ? color: fillColor;\n        ctx.fill(); \n        ctx.stroke(); \n      }\n      for (i=1; i<txt.left.length; i++)\n      {\tctx.beginPath();\n        ctx.rect(margin, txt.left[i-1][1][1], borderWidth, txt.left[i][1][1]-txt.left[i-1][1][1]);\n        ctx.fillStyle = Math.round(txt.left[i][0]/step)%2 ? color: fillColor;\n        ctx.fill(); \n        ctx.stroke(); \n      }\n      for (i=1; i<txt.right.length; i++)\n      {\tctx.beginPath();\n        ctx.rect(w-borderWidth-margin, txt.right[i-1][1][1], borderWidth, txt.right[i][1][1]-txt.right[i-1][1][1]);\n        ctx.fillStyle = Math.round(txt.right[i][0]/step)%2 ? color: fillColor;\n        ctx.fill(); \n        ctx.stroke(); \n      }\n      ctx.beginPath();\n      ctx.fillStyle = color;\n      ctx.rect(margin,margin, borderWidth, borderWidth);\n      ctx.rect(margin,h-borderWidth-margin, borderWidth,borderWidth);\n      ctx.rect(w-borderWidth-margin,margin, borderWidth, borderWidth);\n      ctx.rect(w-borderWidth-margin,h-borderWidth-margin, borderWidth,borderWidth);\n      ctx.fill(); \n    }\n  ctx.restore();\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Draw a grid reference on the map and add an index.\n *\n * @constructor\n * @extends {ol.control.CanvasBase}\n * @fires select\n * @param {Object=} Control options.\n *  @param {ol.style.Style} options.style Style to use for drawing the grid (stroke and text), default black.\n *  @param {number} options.maxResolution max resolution to display the graticule\n *  @param {ol.extent} options.extent extent of the grid, required\n *  @param {ol.size} options.size number of lines and cols, required\n *  @param {number} options.margin margin to display text (in px), default 0px\n *  @param {ol.source.Vector} options.source source to use for the index, default none (use setIndex to reset the index)\n *  @param {string | function} options.property a property to display in the index or a function that takes a feature and return the name to display in the index, default 'name'.\n *  @param {function|undefined} options.sortFeatures sort function to sort 2 features in the index, default sort on property option\n *  @param {function|undefined} options.indexTitle a function that takes a feature and return the title to display in the index, default the first letter of property option\n *  @param {string} options.filterLabel label to display in the search bar, default 'filter'\n */\nol.control.GridReference = function(options) {\n  if (!options) options = {};\n  // Initialize parent\n  var elt = document.createElement(\"div\");\n  elt.className = (!options.target ? \"ol-control \":\"\") +\"ol-gridreference ol-unselectable \"+(options.className||\"\");\n  options.style = options.style || new ol.style.Style({\n    stroke: new ol.style.Stroke({ color:\"#000\", width:1 }),\n    text: new ol.style.Text({\n      font: \"bold 14px Arial\",\n      stroke: new ol.style.Stroke({ color:\"#fff\", width:2 }),\n      fill: new ol.style.Fill({ color:\"#000\" }),\n    })\n  });\n  ol.control.CanvasBase.call(this, {\n    element: elt,\n    target: options.target,\n    style: options.style\n  });\n  if (typeof (options.property)=='function') this.getFeatureName = options.property;\n  if (typeof (options.sortFeatures)=='function') this.sortFeatures = options.sortFeatures;\n  if (typeof (options.indexTitle)=='function') this.indexTitle = options.indexTitle;\n  // Set index using the source\n  this.source_ = options.source;\n  if (options.source) {\n    this.setIndex(options.source.getFeatures(), options);\n    // reload on ready\n    options.source.once('change',function() {\n      if (options.source.getState() === 'ready'){\n        this.setIndex(options.source.getFeatures(), options);\n      }\n    }.bind(this));\n  }\n  // Options\n  this.set('maxResolution', options.maxResolution || Infinity);\n  this.set('extent', options.extent);\n  this.set('size', options.size);\n  this.set('margin', options.margin || 0);\n  this.set('property', options.property || 'name');\n  this.set('filterLabel', options.filterLabel || 'filter');\n};\nol.ext.inherits(ol.control.GridReference, ol.control.CanvasBase);\n/** Returns the text to be displayed in the index\n * @param {ol.Feature} f the feature\n * @return {string} the text to be displayed in the index\n * @api\n */\nol.control.GridReference.prototype.getFeatureName = function (f) {\n  return f.get(this.get('property')||'name');\n};\n/** Sort function\n * @param {ol.Feature} a first feature\n * @param {ol.Feature} b second feature\n * @return {Number} 0 if a==b, -1 if a<b, 1 if a>b\n * @api\n */\nol.control.GridReference.prototype.sortFeatures = function (a,b) {\n  return (this.getFeatureName(a) == this.getFeatureName(b)) ? 0 : (this.getFeatureName(a) < this.getFeatureName(b)) ? -1 : 1; \n};\n/** Get the feature title\n * @param {ol.Feature} f\n * @return the first letter of the eature name (getFeatureName)\n * @api\n */\nol.control.GridReference.prototype.indexTitle = function (f) {\n  return this.getFeatureName(f).charAt(0);\n};\n/** Display features in the index\n * @param { Array<ol.Feature> | ol.Collection<ol.Feature> } features\n */\nol.control.GridReference.prototype.setIndex = function (features) {\n  if (!this.getMap()) return;\n  var self = this;\n  if (features.getArray) features = features.getArray();\n  features.sort ( function(a,b) { return self.sortFeatures(a,b); } );\n  this.element.innerHTML = \"\";\n  var elt = this.element;\n  var search = document.createElement(\"input\");\n  search.setAttribute('type', 'search');\n  search.setAttribute('placeholder', this.get('filterLabel') || 'filter');\n  var searchKeyupFunction = function() {\n    var v = this.value.replace(/^\\*/,'');\n    // console.log(v)\n    var r = new RegExp (v, 'i');\n    ul.querySelectorAll('li').forEach(function(li) {\n      if (li.classList.contains('ol-title')) {\n        li.style.display = '';\n      } else {\n        if (r.test(li.querySelector('.ol-name').textContent)) li.style.display = '';\n        else li.style.display = 'none';\n      }\n    });\n    ul.querySelectorAll(\"li.ol-title\").forEach(function(li) {\n      var nextAll = false;\n      nextAll = [].filter.call(li.parentNode.children, function (htmlElement) {\n        return (htmlElement.previousElementSibling === li) ? nextAll = true : nextAll;\n      });\n      console.log(nextAll);\n      var nextVisible = nextAll[0];\n      if (nextVisible.length && !nextVisible.classList.contains('ol-title')) li.style.display = '';\n      else li.style.display = 'none';\n    });\n  };\n  search.addEventListener('search', searchKeyupFunction);\n  search.addEventListener('keyup', searchKeyupFunction);\n  elt.appendChild(search);\n  var ul = document.createElement(\"ul\");\n  elt.appendChild(ul);\n  var r, title;\n  for (var i=0, f; f=features[i]; i++) {\n    (function(feat) {\n      r = self.getReference(feat.getGeometry().getFirstCoordinate());\n      if (r) {\n        var name = self.getFeatureName(feat);\n        var c = self.indexTitle(feat);\n        if (c != title) {\n          var li_title = document.createElement(\"li\");\n          li_title.classList.add('ol-title');\n          li_title.textContent = c;\n          ul.appendChild(li_title);\n        }\n        title = c;\n        var li_ref_name = document.createElement(\"li\");\n        var span_name = document.createElement(\"span\");\n            span_name.classList.add(\"ol-name\");\n            span_name.textContent = name;\n        li_ref_name.appendChild(span_name);\n        var span_ref = document.createElement(\"span\");\n            span_ref.classList.add(\"ol-ref\");\n            span_ref.textContent = r;\n        li_ref_name.appendChild(span_ref);\n        var feature = feat;\n        li_ref_name.addEventListener(\"click\", function() {\n          self.dispatchEvent({ type:\"select\", feature: feature });\n        });\n        ul.appendChild(li_ref_name);\n      }\n    })(f);\n  }\n};\n/** Get reference for a coord\n*\t@param {ol.coordinate} coords\n*\t@return {string} the reference\n*/\nol.control.GridReference.prototype.getReference = function (coords) {\n  if (!this.getMap()) return;\n  var extent = this.get('extent');\n  var size = this.get('size');\n  var dx = Math.floor ( (coords[0] - extent[0]) / (extent[2]- extent[0]) * size[0] );\n  if (dx<0 || dx>=size[0]) return \"\";\n  var dy = Math.floor ( (extent[3] - coords[1]) / (extent[3]- extent[1]) * size[1] );\n  if (dy<0 || dy>=size[1]) return \"\";\n  return String.fromCharCode(65+dx)+dy;\n};\n/** Draw the grid\n* @param {ol.event} e postcompose event\n* @private\n*/\nol.control.GridReference.prototype._draw = function (e) {\n  if (this.get('maxResolution')<e.frameState.viewState.resolution) return;\n  var ctx = this.getContext(e);\n  var canvas = ctx.canvas;\n  var ratio = e.frameState.pixelRatio;\n  var w = canvas.width/ratio;\n  var h = canvas.height/ratio;\n  var extent = this.get('extent');\n  var size = this.get('size');\n  var map = this.getMap();\n  var ex = ol.extent.boundingExtent([map.getPixelFromCoordinate([extent[0],extent[1]]), map.getPixelFromCoordinate([extent[2],extent[3]])]);\n  var p0 = [ex[0],ex[1]];\n  var p1 = [ex[2],ex[3]];\n  var dx = (p1[0]-p0[0])/size[0];\n  var dy = (p1[1]-p0[1])/size[1];\n  ctx.save();\n    var margin = this.get('margin');\n    ctx.scale(ratio,ratio);\n    ctx.strokeStyle = this.getStroke().getColor();\n    ctx.lineWidth = this.getStroke().getWidth();\n    // Draw grid\n    ctx.beginPath();\n    var i;\n    for (i=0; i<=size[0]; i++) {\n      ctx.moveTo(p0[0]+i*dx, p0[1]);\n      ctx.lineTo(p0[0]+i*dx, p1[1]);\n    }\n    for (i=0; i<=size[1]; i++) {\n      ctx.moveTo(p0[0], p0[1]+i*dy);\n      ctx.lineTo(p1[0], p0[1]+i*dy);\n    }\n    ctx.stroke();\n    // Draw text\n    ctx.font = this.getTextFont();\n    ctx.fillStyle = this.getTextFill().getColor();\n    ctx.strokeStyle = this.getTextStroke().getColor();\n    var lw = ctx.lineWidth = this.getTextStroke().getWidth();\n    var spacing = margin +lw;\n    ctx.textAlign = 'center';\n    var letter, x, y;\n    for (i=0; i<size[0]; i++) {\n      letter = String.fromCharCode(65+i);\n      x = p0[0]+i*dx+dx/2;\n      y = p0[1]-spacing;\n      if (y<0) {\n        y = spacing;\n        ctx.textBaseline = 'hanging';\n      }\n      else ctx.textBaseline = 'alphabetic';\n      ctx.strokeText(letter, x, y);\n      ctx.fillText(letter, x, y);\n      y = p1[1]+spacing;\n      if (y>h) {\n        y = h-spacing;\n        ctx.textBaseline = 'alphabetic';\n      }\n      else ctx.textBaseline = 'hanging';\n      ctx.strokeText(letter, x, y);\n      ctx.fillText(letter, x, y);\n    }\n    ctx.textBaseline = 'middle';\n    for (i=0; i<size[1]; i++) {\n      y = p0[1]+i*dy+dy/2;\n      ctx.textAlign = 'right';\n      x = p0[0] - spacing;\n      if (x<0) {\n        x = spacing;\n        ctx.textAlign = 'left';\n      }\n      else ctx.textAlign = 'right';\n      ctx.strokeText(i, x, y);\n      ctx.fillText(i, x, y);\n      x = p1[0] + spacing;\n      if (x>w) {\n        x = w-spacing;\n        ctx.textAlign = 'right';\n      }\n      else ctx.textAlign = 'left';\n      ctx.strokeText(i, x, y);\n      ctx.fillText(i, x, y);\n    }\n  ctx.restore();\n};\n\n/** Image line control\n *\n * @constructor\n * @extends {ol.control.Control}\n * @fires select\n * @fires collapse\n * @param {Object=} options Control options.\n *\t@param {String} options.className class of the control\n *\t@param {ol.source.Vector} options.source a vector source that contains the images\n *\t@param {function} options.getImage a function that gets a feature and return the image url, default return the img propertie\n *\t@param {function} options.getTitle a function that gets a feature and return the title, default return an empty string\n *\t@param {boolean} options.collapsed the line is collapse, default false\n *\t@param {boolean} options.collapsible the line is collapsible, default false\n *\t@param {number} options.maxFeatures the maximum image element in the line, default 100\n *\t@param {boolean} options.hover select image on hover, default false\n *\t@param {string|boolean} options.linkColor link color or false if no link, default false\n */\nol.control.Imageline = function(options) {\n  var element = ol.ext.element.create('DIV', {\n    className: (options.className || '') + ' ol-imageline'\n      + (options.target ? '': ' ol-unselectable ol-control')\n      + (options.collapsed && options.collapsible ? 'ol-collapsed' : '')\n      + ('ontouchstart' in window ? ' ol-touch' : '')\n  });\n  if (!options.target && options.collapsible) {\n    ol.ext.element.create('BUTTON', {\n      type: 'button',\n      click: function() {\n        this.toggle();\n      }.bind(this),\n      parent: element\n    });\n  }\n  // Source \n  this._source = options.source;\n  // Initialize\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  // Scroll imageline\n  this._setScrolling();\n  this._scrolldiv.addEventListener(\"scroll\", function() {\n    if (this.getMap()) this.getMap().render();\n  }.bind(this));\n  // Parameters\n  if (typeof(options.getImage)==='function') this._getImage =  options.getImage;\n  if (typeof(options.getTitle)==='function') this._getTitle =  options.getTitle;\n  this.set('maxFeatures', options.maxFeatures || 100);\n  this.set('linkColor', options.linkColor || false);\n  this.set('hover', options.hover || false);\n  this.set('useExtent', options.useExtent || false);\n  this.refresh();\n};\nol.ext.inherits(ol.control.Imageline, ol.control.Control);\n/**\n * Remove the control from its current map and attach it to the new map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.control.Imageline.prototype.setMap = function (map) {\n\tif (this._listener) {\n    this._listener.forEach(function(l) {\n      ol.Observable.unByKey(l);\n    }.bind(this));\n  }\n\tthis._listener = null;\n\tol.control.Control.prototype.setMap.call(this, map);\n\tif (map) {\t\n    this._listener = [\n      map.on('postcompose', this._drawLink.bind(this)),\n      map.on('moveend', function() { \n        if (this.get('useExtent')) this.refresh();\n      }.bind(this))\n    ]\n\t}\n};\n/** Set useExtent param and refresh the line\n * @param {boolean} b\n */\nol.control.Imageline.prototype.useExtent = function(b) {\n  this.set('useExtent', b);\n  this.refresh();\n};\n/** Is the line collapsed\n * @return {boolean}\n */\nol.control.Imageline.prototype.isCollapsed = function() {\n  return this.element.classList.contains('ol-collapsed');\n};\n/** Collapse the line\n * @param {boolean} b\n */\nol.control.Imageline.prototype.collapse = function(b) {\n  if (b) this.element.classList.add('ol-collapsed');\n  else this.element.classList.remove('ol-collapsed');\n  if (this.getMap()) {\n    setTimeout ( function() {\n      this.getMap().render();\n    }.bind(this), this.isCollapsed() ? 0 : 250);\n  }\n  this.dispatchEvent({ type: 'collapse', collapsed: this.isCollapsed() });\n};\n/** Collapse the line\n */\nol.control.Imageline.prototype.toggle = function() {\n  this.element.classList.toggle('ol-collapsed');\n  if (this.getMap()) {\n    setTimeout ( function() {\n      this.getMap().render();\n    }.bind(this), this.isCollapsed() ? 0 : 250);\n  }\n  this.dispatchEvent({ type: 'collapse', collapsed: this.isCollapsed() });\n};\n/** Default function to get an image of a feature\n * @param {ol.Feature} f\n * @private\n */\nol.control.Imageline.prototype._getImage = function(f) {\n  return f.get('img');\n};\n/** Default function to get an image title\n * @param {ol.Feature} f\n * @private\n */\nol.control.Imageline.prototype._getTitle = function(/* f */) {\n  return '';\n};\n/**\n * Get features\n * @return {Array<ol.Feature>}\n */\nol.control.Imageline.prototype.getFeatures = function() {\n  var map = this.getMap();\n  if (!this.get('useExtent') || !map) {\n    return this._source.getFeatures();\n  } else {\n    var extent = map.getView().calculateExtent(map.getSize());\n    return this._source.getFeaturesInExtent(extent);\n  }\n};\n/** Set element scrolling with a acceleration effect on desktop\n * (on mobile it uses the scroll of the browser)\n * @private\n */\nol.control.Imageline.prototype._setScrolling = function() {\n  var elt = this._scrolldiv = ol.ext.element.create('DIV', {\n    parent: this.element\n  });\n  ol.ext.element.scrollDiv(elt, {\n    // Prevent selection when moving\n    onmove: function(b) {\n      this._moving=b; \n    }.bind(this)\n  });\n};\n/**\n * Refresh the imageline with new data\n */\nol.control.Imageline.prototype.refresh = function() {\n  this._scrolldiv.innerHTML = '';\n  var features = this.getFeatures();\n  var current = this._select ? this._select.feature : null;\n  if (this._select) this._select.elt = null;\n  this._iline = [];\n  if (this.getMap()) this.getMap().render();\n  // Add a new image\n  var addImage = function(f) {\n    if (this._getImage(f)) {\n      var img = ol.ext.element.create('DIV', {\n        className: 'ol-image',\n        parent: this._scrolldiv\n      });\n      ol.ext.element.create('IMG', {\n        src: this._getImage(f),\n        parent: img\n      }).addEventListener('load', function(){\n        this.classList.add('ol-loaded');\n      });\n      ol.ext.element.create('SPAN', {\n        html: this._getTitle(f),\n        parent: img\n      });\n      // Current image\n      var sel = { elt: img, feature: f };\n      // On click > dispatch event\n      img.addEventListener('click', function(){\n        if (!this._moving) {\n          this.dispatchEvent({type: 'select', feature: f });\n          this._scrolldiv.scrollLeft = img.offsetLeft \n            + ol.ext.element.getStyle(img, 'width')/2\n            - ol.ext.element.getStyle(this.element, 'width')/2;\n            if (this._select) this._select.elt.classList.remove('select');\n            this._select = sel;\n            this._select.elt.classList.add('select');\n          }\n      }.bind(this));\n      // Show link\n      img.addEventListener('mouseover', function(e) {\n        if (this.get('hover')) {\n          if (this._select) this._select.elt.classList.remove('select');\n          this._select = sel;\n          this._select.elt.classList.add('select');\n          this.getMap().render();\n          e.stopPropagation();\n        }\n      }.bind(this));\n      // Remove link\n      img.addEventListener('mouseout', function(e) {\n        if (this.get('hover')) {\n          if (this._select) this._select.elt.classList.remove('select');\n          this._select = false;\n          this.getMap().render();\n          e.stopPropagation();\n        }\n      }.bind(this));\n      // Prevent image dragging\n      img.ondragstart = function(){ return false; };\n      // Add image\n      this._iline.push(sel);\n      if (current===f) {\n        this._select = sel;\n        sel.elt.classList.add('select');\n      }\n    }\n  }.bind(this);\n  // Add images \n  var nb = this.get('maxFeatures');\n  for (var i=0, f; f=features[i]; i++) {\n    if (nb--<0) break;\n    addImage(f);\n  }\n  // Add the selected one\n  if (this._select && this._select.feature && !this._select.elt) {\n    addImage(this._select.feature);\n  }\n};\n/** Center image line on a feature\n * @param {ol.feature} feature\n * @param {boolean} scroll scroll the line to center on the image, default true\n * @api\n */\nol.control.Imageline.prototype.select = function(feature, scroll) {\n  this._select = false;\n  // Find the image\n  this._iline.forEach(function (f) {\n    if (f.feature === feature) {\n      f.elt.classList.add('select');\n      this._select = f;\n      if (scroll!==false) {\n        this._scrolldiv.scrollLeft = f.elt.offsetLeft \n          + ol.ext.element.getStyle(f.elt, 'width')/2\n          - ol.ext.element.getStyle(this.element, 'width')/2;\n      }\n    } else {\n      f.elt.classList.remove('select');\n    }\n  }.bind(this));\n};\n/** Draw link on the map\n * @private\n */\nol.control.Imageline.prototype._drawLink = function(e) {\n  if (!this.get('linkColor') | this.isCollapsed()) return;\n  var map = this.getMap();\n  if (map && this._select && this._select.elt) {\n    var ctx = e.context || ol.ext.getMapCanvas(this.getMap()).getContext('2d');\n    var ratio = e.frameState.pixelRatio;\n    var pt = [ \n      this._select.elt.offsetLeft \n      - this._scrolldiv.scrollLeft\n      + ol.ext.element.getStyle(this._select.elt, 'width')/2, \n      parseFloat(ol.ext.element.getStyle(this.element, 'top')) || this.getMap().getSize()[1]\n    ];\n    var geom = this._select.feature.getGeometry().getFirstCoordinate();\n    geom = this.getMap().getPixelFromCoordinate(geom);\n    ctx.save();\n    ctx.fillStyle = this.get('linkColor');\n    ctx.beginPath();\n      if (geom[0]>pt[0]) {\n        ctx.moveTo((pt[0]-5)*ratio, pt[1]*ratio);\n        ctx.lineTo((pt[0]+5)*ratio, (pt[1]+5)*ratio);\n      } else {\n        ctx.moveTo((pt[0]-5)*ratio, (pt[1]+5)*ratio);\n        ctx.lineTo((pt[0]+5)*ratio, pt[1]*ratio);\n      }\n      ctx.lineTo(geom[0]*ratio, geom[1]*ratio);\n    ctx.fill();\n    ctx.restore();\n  }\n};\n\n/*\tCopyright (c) 2018 Jean-Marc VIGLINO,\n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Geoportail isochrone Control.\n * @see https://geoservices.ign.fr/documentation/geoservices/isochrones.html\n * @constructor\n * @extends {ol.control.Control}\n * @fires isochrone\n * @fires error\n * @param {Object=} options\n *\t@param {string} options.className control class name\n *\t@param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *\t@param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *\t@param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *\t@param {string | undefined} options.inputLabel label for the input, default none\n *\t@param {string | undefined} options.noCollapse prevent collapsing on input blur, default false\n *\t@param {number | undefined} options.typing a delay on each typing to start searching (ms) use -1 to prevent autocompletion, default 300.\n *\t@param {integer | undefined} options.minLength minimum length to start searching, default 1\n *\t@param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *\t@param {integer | undefined} options.maxHistory maximum number of items to display in history. Set -1 if you don't want history, default maxItems\n *\t@param {function} options.getTitle a function that takes a feature and return the name to display in the index.\n *\t@param {function} options.autocomplete a function that take a search string and callback function to send an array\n *\n *  @param {string} options.exclusions Exclusion list separate with a comma 'Toll,Tunnel,Bridge'\n */\nol.control.IsochroneGeoportail = function(options) {\n  var self = this;\n\tif (!options) options = {};\n\tif (options.typing == undefined) options.typing = 300;\n\tvar classNames = (options.className ? options.className : '')+ ' ol-isochrone ol-routing';\n\tif (!options.target) classNames += ' ol-unselectable ol-control';\n\tvar element = ol.ext.element.create('DIV', { className: classNames })\n\tif (!options.target) {\n    var bt = ol.ext.element.create('BUTTON', { parent: element })\n    bt.addEventListener('click', function(){\n      element.classList.toggle('ol-collapsed');\n    });\n  }\n  // Inherits\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.set('iter', 1);\n  var content = ol.ext.element.create('DIV', { className: 'content', parent: element } )\n  // Search control\n  this._addSearchCtrl(content, options);\n  // Method buttons\n  ol.ext.element.create('BUTTON', { className: 'ol-button ol-method-time selected', title:'isochrone', parent: content })\n    .addEventListener('click', function(){\n      this.setMethod('time');\n    }.bind(this));\n  ol.ext.element.create('I', { className: 'ol-button ol-method-distance', title:'isodistance', parent: content })\n    .addEventListener('click', function(){\n      this.setMethod('distance');\n    }.bind(this));\n  // Mode buttons\n  ol.ext.element.create('I', { className: 'ol-button ol-car selected', title:'by car', parent: content })\n    .addEventListener('click', function(){\n      this.setMode('car');\n    }.bind(this));\n  ol.ext.element.create('I', { className: 'ol-button ol-pedestrian', title:'by foot', parent: content })\n    .addEventListener('click', function(){\n      this.setMode('pedestrian');\n    }.bind(this));\n  // Direction buttons\n  ol.ext.element.create('I', { className: 'ol-button ol-direction-direct selected', title:'direct', parent: content })\n    .addEventListener('click', function(){\n      this.setDirection('direct');\n    }.bind(this));\n  ol.ext.element.create('I', { className: 'ol-button ol-direction-reverse', title:'reverse', parent: content })\n    .addEventListener('click', function(){\n      this.setDirection('reverse');\n    }.bind(this));\n  // Input \n  var div = ol.ext.element.create('DIV', { className: 'ol-time', parent: content })\n  ol.ext.element.create('DIV', { html:'isochrone:', parent: div });\n  ol.ext.element.create('INPUT', { type: 'number', parent: div, min: 0 })\n    .addEventListener('change', function(){\n      self.set('hour', Number(this.value));\n    });\n  ol.ext.element.create('TEXT', { parent: div, html: 'h' });\n  ol.ext.element.create('INPUT', { type: 'number', parent: div, min: 0 })\n    .addEventListener('change', function(){\n      self.set('minute', Number(this.value));\n    });\n  ol.ext.element.create('TEXT', { parent: div, html: 'mn' });\n  div = ol.ext.element.create('DIV', { className: 'ol-distance', parent: content });\n  ol.ext.element.create('DIV', { html:'isodistance:', parent: div });\n  ol.ext.element.create('INPUT', { type: 'number', step: 'any', parent: div, min: 0 })\n    .addEventListener('change', function(){\n      self.set('distance', Number(this.value));\n    });\n  ol.ext.element.create('TEXT', { parent: div, html: 'km' });\n  div = ol.ext.element.create('DIV', { className: 'ol-iter', parent: content })\n  ol.ext.element.create('DIV', { html:'Iteration:', parent: div });\n  ol.ext.element.create('INPUT', { type: 'number', parent: div, value: 1, min: 1 })\n    .addEventListener('change', function(){\n      self.set('iter', Number(this.value));\n    });\n  // OK button\n  ol.ext.element.create('I', { className:'ol-ok', html:'ok', parent: content })\n    .addEventListener('click', function() {\n      var val = 0;\n      switch (this.get('method')) {\n        case 'distance':  {\n          val = this.get('distance')*1000;\n          break;\n        }\n        default: {\n          val = (this.get('hour')||0)*3600 + (this.get('minute')||0)*60;\n          break;\n        }\n      }\n      if (val && this.get('coordinate')) {\n        this.search(this.get('coordinate'), val);\n      }\n    }.bind(this));\n  this.set('url', 'https://wxs.ign.fr/'+options.apiKey+'/isochrone/isochrone.json');\n  this._ajax = new ol.ext.Ajax({ \n    dataType: 'JSON',\n    auth: options.auth\n  });\n  this._ajax.on('success', this._success.bind(this));\n  this._ajax.on('error', this._error.bind(this));\n  // searching\n  this._ajax.on('loadstart', function() {\n    this.element.classList.add('ol-searching');\n  }.bind(this));\n  this._ajax.on('loadend', function() {\n    this.element.classList.remove('ol-searching');\n  }.bind(this));\n  this.setMethod(options.method);\n};\nol.ext.inherits(ol.control.IsochroneGeoportail, ol.control.Control);\n/**\n * Set the map instance the control is associated with\n * and add its controls associated to this map.\n * @param {_ol_Map_} map The map instance.\n */\nol.control.IsochroneGeoportail.prototype.setMap = function (map) {\n\tol.control.Control.prototype.setMap.call(this, map);\n\tthis._search.setMap(map);\n};\n/** Add a new search input\n * @private\n */\nol.control.IsochroneGeoportail.prototype._addSearchCtrl = function (element, options) {\n\tvar div = ol.ext.element.create(\"DIV\", { parent: element });\n  var search = this._search = new ol.control.SearchGeoportail({\n    className: 'IGNF ol-collapsed',\n\t\tapiKey: options.apiKey,\n\t\ttarget: div\n\t});\n\tsearch.on('select', function(e){\n    search.setInput(e.search.fulltext);\n    this.set('coordinate', e.coordinate);\n  }.bind(this));\n  search.on('change:input', function(){\n    this.set('coordinate', false);\n  }.bind(this));\n};\n/** Set the travel method\n * @param [string] method The method (time or distance)\n */\nol.control.IsochroneGeoportail.prototype.setMethod = function(method) {7\n  method = (/distance/.test(method) ? 'distance' : 'time');\n  this.element.querySelector(\".ol-method-time\").classList.remove(\"selected\");\n  this.element.querySelector(\".ol-method-distance\").classList.remove(\"selected\");\n  this.element.querySelector(\".ol-method-\"+method).classList.add(\"selected\");\n  this.element.querySelector(\"div.ol-time\").classList.remove(\"selected\");\n  this.element.querySelector(\"div.ol-distance\").classList.remove(\"selected\");\n  this.element.querySelector(\"div.ol-\"+method).classList.add(\"selected\");\n  this.set('method', method);\n};\n/** Set mode\n * @param {string} mode The mode: 'car' or 'pedestrian', default 'car'\n */\nol.control.IsochroneGeoportail.prototype.setMode = function (mode) {\n  this.set('mode', mode);\n  this.element.querySelector(\".ol-car\").classList.remove(\"selected\");\n  this.element.querySelector(\".ol-pedestrian\").classList.remove(\"selected\");\n  this.element.querySelector(\".ol-\"+mode).classList.add(\"selected\");\n};\n/** Set direction\n * @param {string} direction The direction: 'direct' or 'reverse', default direct\n */\nol.control.IsochroneGeoportail.prototype.setDirection = function (direction) {\n  this.set('direction', direction);\n  this.element.querySelector(\".ol-direction-direct\").classList.remove(\"selected\");\n  this.element.querySelector(\".ol-direction-reverse\").classList.remove(\"selected\");\n  this.element.querySelector(\".ol-direction-\"+direction).classList.add(\"selected\");\n};\n/** Calculate an isochrone\n * @param {ol.coordinate} coord\n * @param {number|string} option A number as time (in second) or distance (in meter), depend on method propertie\n * or a string with a unit (s, mn, h for time or km, m)\n */\nol.control.IsochroneGeoportail.prototype.search = function(coord, option, iter) {\n  var proj = this.getMap() ? this.getMap().getView().getProjection() : 'EPSG:3857';\n  var method = /distance/.test(this.get('method')) ? 'distance' : 'time';\n  if (typeof(option)==='string') {\n    var unit = option.replace(/([0-9|.]*)([a-z]*)$/,'$2');\n    method = 'time';\n    option = parseFloat(option);\n    // convert unit\n    switch (unit) {\n      case 'mn': {\n        option = option*60;\n        break;\n      }\n      case 'h': {\n        option = option*3600;\n        break;\n      }\n      case 'm': {\n        method = 'distance';\n        break;\n      }\n      case 'km': {\n        method = 'distance';\n        option = option*1000;\n        break;\n      }\n    }\n  }\n  var dt = Math.round(option * (this.get('iter')-(iter||0)) / this.get('iter'));\n  if (typeof option === 'number') {\n    // Send data\n    var data = {\n      'gp-access-lib': '2.1.0',\n      location: ol.proj.toLonLat(coord, proj),\n      graphName: (this.get('mode')==='pedestrian' ?  'Pieton' : 'Voiture'),\n      exclusions: this.get('exclusions') || undefined,\n      method: method,\n      time: method==='time' ? dt : undefined,\n      distance: method==='distance' ? dt : undefined,\n      reverse: (this.get('direction') === 'reverse'),\n      smoothing: this.get('smoothing') || true,\n      holes: this.get('holes') || false\n    };\n    this._ajax.send(this.get('url'), data, { \n      coord: coord, \n      option: option,\n      data: data,\n      iteration: (iter||0)+1 \n    });\n  }\n};\n/** Trigger result\n * @private\n */\nol.control.IsochroneGeoportail.prototype._success = function(e) {\n  var proj = this.getMap() ? this.getMap().getView().getProjection() : 'EPSG:3857';\n  // Convert to features\n  var format = new ol.format.WKT();\n  var evt = e.response;\n\tevt.feature = format.readFeature(evt.wktGeometry, {\n    dataProjection: 'EPSG:4326',\n    featureProjection: proj\n  });\n  evt.feature.set('iteration', e.options.iteration);\n  evt.feature.set('method', e.options.data.method);\n  evt.feature.set(e.options.data.method, e.options.data[e.options.data.method]);\n  delete evt.wktGeometry;\n  evt.type = 'isochrone';\n  evt.iteration = e.options.iteration-1;\n  this.dispatchEvent (evt);\n  if (e.options.iteration < this.get('iter')) {\n    this.search(e.options.coord, e.options.option, e.options.iteration);\n  }\n};\n/** Trigger error\n * @private\n */\nol.control.IsochroneGeoportail.prototype._error = function() {\n  this.dispatchEvent ({ type:'error' });\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * OpenLayers Layer Switcher Control.\n *\n * @constructor\n * @extends {ol.control.LayerSwitcher}\n * @param {Object=} options Control options.\n */\nol.control.LayerPopup = function(options) {\n  options = options || {};\n\toptions.switcherClass=\"ol-layerswitcher-popup\";\n\tif (options.mouseover!==false) options.mouseover=true;\n\tol.control.LayerSwitcher.call(this, options);\n};\nol.ext.inherits(ol.control.LayerPopup, ol.control.LayerSwitcher);\n/** Disable overflow\n*/\nol.control.LayerPopup.prototype.overflow = function(){};\n/** Render a list of layer\n * @param {elt} element to render\n * @layers {Array{ol.layer}} list of layer to show\n * @api stable\n */\nol.control.LayerPopup.prototype.drawList = function(ul, layers) {\t\n  var self=this;\n\tvar setVisibility = function(e) {\n    e.preventDefault(); \n\t\tvar l = self._getLayerForLI(this);\n\t\tself.switchLayerVisibility(l,layers);\n\t\tif (e.type==\"touchstart\") self.element.classList.add(\"ol-collapsed\");\n\t};\n\tlayers.forEach(function(layer) {\n    if (self.displayInLayerSwitcher(layer)) {\n      var d = ol.ext.element.create('LI', {\n        html: layer.get(\"title\") || layer.get(\"name\"),\n        on: { 'click touchstart': setVisibility },\n        parent: ul\n      });\n      self._setLayerForLI(d, layer);\n\t\t\tif (self.testLayerVisibility(layer)) d.classList.add(\"ol-layer-hidden\");\n\t\t\tif (layer.getVisible()) d.classList.add('ol-visible');\n\t\t}\n\t});\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc OpenLayers Layer Switcher Control.\n * @require layer.getPreview\n *\n * @constructor\n * @extends {ol.control.LayerSwitcher}\n * @param {Object=} options Control options.\n */\nol.control.LayerSwitcherImage = function(options) {\n  options = options || {};\n\toptions.switcherClass = \"ol-layerswitcher-image\";\n\tif (options.mouseover!==false) options.mouseover=true;\n\tol.control.LayerSwitcher.call(this, options);\n};\nol.ext.inherits(ol.control.LayerSwitcherImage, ol.control.LayerSwitcher);\n/** Render a list of layer\n * @param {elt} element to render\n * @layers {Array{ol.layer}} list of layer to show\n * @api stable\n */\nol.control.LayerSwitcherImage.prototype.drawList = function(ul, layers) {\n  var self = this;\n\tvar setVisibility = function(e) {\n    e.preventDefault(); \n\t\tvar l = self._getLayerForLI(this);\n\t\tself.switchLayerVisibility(l,layers);\n\t\tif (e.type==\"touchstart\") self.element.classList.add(\"ol-collapsed\");\n\t};\n\tol.ext.element.setStyle(ul, { height: 'auto' });\n\tlayers.forEach(function(layer) {\n    if (self.displayInLayerSwitcher(layer)) {\n      var preview = layer.getPreview ? layer.getPreview() : [\"none\"];\n      var d = ol.ext.element.create('LI', {\n        className: 'ol-imgcontainer' + (layer.getVisible() ? ' ol-visible':''),\n        on: { 'touchstart click': setVisibility },\n        parent: ul\n      });\n      self._setLayerForLI(d, layer);\n      preview.forEach(function(img){\n        ol.ext.element.create('IMG', {\n          src: img,\n          parent: d\n        })\n      });\n\t\t\tol.ext.element.create('p', {\n        html: layer.get(\"title\") || layer.get(\"name\"),\n        parent: d\n      });\n\t\t\tif (self.testLayerVisibility(layer)) d.classList.add('ol-layer-hidden');\n\t\t}\n\t});\n};\n/** Disable overflow\n*/\nol.control.LayerSwitcherImage.prototype.overflow = function(){};\n\n/** Create a legend for styles\n * @constructor\n * @fires select\n * @param {*} options\n *  @param {String} options.className class of the control\n *  @param {String} options.title Legend title\n *  @param {ol.size | undefined} options.size Size of the symboles in the legend, default [40, 25]\n *  @param {int | undefined} options.margin Size of the symbole's margin, default 10\n *  @param {boolean | undefined} options.collapsed Specify if attributions should be collapsed at startup. Default is true.\n *  @param {boolean | undefined} options.collapsible Specify if attributions can be collapsed, default true.\n *  @param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param { ol.style.Style | Array<ol.style.Style> | ol.StyleFunction | undefined\t} options.style a style or a style function to use with features\n * @extends {ol.control.Control}\n */\nol.control.Legend = function(options) {\n  options = options || {};\n  var element = document.createElement('div');\n  if (options.target) {\n    element.className = options.className || \"ol-legend\";\n  } else {\n    element.className = (options.className || \"ol-legend\")\n      +\" ol-unselectable ol-control ol-collapsed\"\n      +(options.collapsible===false ? ' ol-uncollapsible': '');\n    // Show on click\n    var button = document.createElement('button');\n    button.setAttribute('type', 'button');\n    button.addEventListener('click', function() {\n      this.toggle();\n    }.bind(this));\n    element.appendChild(button);\n    // Hide on click\n    button = document.createElement('button');\n    button.setAttribute('type', 'button');\n    button.className = 'ol-closebox';\n    button.addEventListener('click', function() {\n      this.toggle();\n    }.bind(this));\n    element.appendChild(button);\n  }\n  // The legend\n  this._imgElement = document.createElement('div');\n  this._imgElement.className = 'ol-legendImg';\n  element.appendChild(this._imgElement);\n  this._tableElement = document.createElement('ul');\n  element.appendChild(this._tableElement);\n\tol.control.Control.call(this, {\n    element: element,\n\t\ttarget: options.target\n\t});\n  this._rows = [];\n  this.set('size', options.size || [40, 25]);\n  this.set('margin', options.margin===0 ? 0 : options.margin || 10);\n  this.set('title', options.title || '');\n  // Set the style\n  this._style = options.style;\n  if (options.collapsed===false) this.show();\n  this.refresh();\n};\nol.ext.inherits(ol.control.Legend, ol.control.Control);\n/** Set the style\n * @param { ol.style.Style | Array<ol.style.Style> | ol.StyleFunction | undefined\t} style a style or a style function to use with features\n */\nol.control.Legend.prototype.setStyle = function(style) {\n  this._style = style;\n  this.refresh();\n};\n/** Add a new row to the legend\n *  * You can provide in options:\n * - a feature width a style \n * - or a feature that will use the legend style function\n * - or properties ans a geometry type that will use the legend style function\n * - or a style and a geometry type\n * @param {*} options a list of parameters \n *  @param {ol.Feature} options.feature a feature to draw\n *  @param {string} options.className class name for the row\n *  @param {ol.style.Style} options.style the style to use if no feature is provided\n *  @param {*} options.properties properties to use with a style function\n *  @param {string} options.typeGeom type geom to draw with the style or the properties\n */\nol.control.Legend.prototype.addRow = function(row) {\n  this._rows.push(row||{});\n  this.refresh();\n};\n/** Remove a row from the legend\n *  @param {int} index\n */\nol.control.Legend.prototype.removeRow = function(index) {\n  this._rows.splice(index,1);\n  this.refresh();\n};\n/** Get a legend row\n * @param {int} index\n * @return {*}\n */\nol.control.Legend.prototype.getRow = function(index) {\n  return this._rows[index];\n};\n/** Get a legend row\n * @return {int}\n */\nol.control.Legend.prototype.getLength = function() {\n  return this._rows.length;\n};\n/** Refresh the legend\n */\nol.control.Legend.prototype.refresh = function() {\n  var self = this;\n  var table = this._tableElement\n  table.innerHTML = '';\n  var width = this.get('size')[0] + 2*this.get('margin');\n  var height = this.get('size')[1] + 2*this.get('margin');\n  // Add a new row\n  function addRow(str, classname, r, i){\n    var row = document.createElement('li');\n    row.style.height = height + 'px';\n    row.addEventListener('click', function() {\n      self.dispatchEvent({ type:'select', title: str, row: r, index: i });\n    });\n    var col = document.createElement('div');\n    row.appendChild(col);\n    col.style.height = height + 'px';\n    col = document.createElement('div');\n    if (classname) {\n      row.className = classname;\n    } else {\n      col.style.paddingLeft = width + 'px';\n    }\n    col.innerHTML = str || '';\n    row.appendChild(col);\n    table.appendChild(row);\n  }\n  if (this.get('title')) {\n    addRow(this.get('title'), 'ol-title', {}, -1);\n  }\n  var canvas = document.createElement('canvas');\n  canvas.width = 5*width;\n  canvas.height = (this._rows.length+1) * height * ol.has.DEVICE_PIXEL_RATIO;\n  this._imgElement.innerHTML = '';\n  this._imgElement.appendChild(canvas);\n  this._imgElement.style.height = (this._rows.length+1)*height + 'px';\n  for (var i=0, r; r = this._rows[i]; i++) {\n    addRow(r.title, r.className, r, i);\n    canvas = this.getStyleImage(r, canvas, i+(this.get('title')?1:0));\n  }\n};\n/** Show control\n */\nol.control.Legend.prototype.show = function() {\n  if (this.element.classList.contains('ol-collapsed')) {\n    this.element.classList.remove('ol-collapsed');\n    this.dispatchEvent({ type:'change:collapse', collapsed: false });\n  }\n};\n/** Hide control\n */\nol.control.Legend.prototype.hide = function() {\n  if (!this.element.classList.contains('ol-collapsed')) {\n    this.element.classList.add('ol-collapsed');\n    this.dispatchEvent({ type:'change:collapse', collapsed: true });\n  }\n};\n/** Toggle control\n */\nol.control.Legend.prototype.toggle = function() {\n  this.element.classList.toggle('ol-collapsed');\n  this.dispatchEvent({ type:'change:collapse', collapsed: this.element.classList.contains('ol-collapsed') });\n};\n/** Get the image for a style \n * You can provide in options:\n * - a feature width a style \n * - or a feature that will use the legend style function\n * - or properties and a geometry type that will use the legend style function\n * - or a style and a geometry type\n * @param {*} options\n *  @param {ol.Feature} options.feature a feature to draw\n *  @param {ol.style.Style} options.style the style to use if no feature is provided\n *  @param {*} options.properties properties to use with a style function\n *  @param {string} options.typeGeom type geom to draw with the style or the properties\n * @param {Canvas|undefined} canvas a canvas to draw in\n * @param {int|undefined} row row number to draw in canvas\n * @return {CanvasElement}\n */\nol.control.Legend.prototype.getStyleImage = function(options, theCanvas, row) {\n  options = options || {};\n  var size = this.get('size');\n  var width = size[0] + 2*this.get('margin');\n  var height = size[1] + 2*this.get('margin');\n  var canvas = theCanvas;\n  var ratio = ol.has.DEVICE_PIXEL_RATIO;\n  if (!canvas) {\n    canvas = document.createElement('canvas');\n    canvas.width = width * ratio;\n    canvas.height = height * ratio;\n  }\n  var ctx = canvas.getContext('2d');\n  ctx.save();\n  var vectorContext = ol.render.toContext(ctx);\n  var typeGeom = options.typeGeom;\n  var style;\n  var feature = options.feature;\n  if (!feature && options.properties && typeGeom) {\n    if (/Point/.test(typeGeom)) feature = new ol.Feature(new ol.geom.Point([0,0]));\n    else if (/LineString/.test(typeGeom)) feature = new ol.Feature(new ol.geom.LineString([0,0]));\n    else feature = new ol.Feature(new ol.geom.Polygon([[0,0]]));\n    feature.setProperties(options.properties);\n  }\n  if (feature) {\n    style = feature.getStyle();\n    if (typeof(style)==='function') style = style(feature);\n    if (!style) {\n      style = typeof(this._style) === 'function' ? this._style(feature) : this._style || [];\n    }\n    typeGeom = feature.getGeometry().getType();\n  } else {\n    style = options.style;\n  }\n  if (!(style instanceof Array)) style = [style];\n  var cx = width/2;\n  var cy = height/2;\n  var sx = size[0]/2;\n  var sy = size[1]/2;\n  var i, s;\n  // Get point offset\n  if (typeGeom === 'Point') {\n    var extent = null;\n    for (i=0; s= style[i]; i++) {\n      var img = s.getImage();\n      if (img && img.getAnchor) {\n        var anchor = img.getAnchor();\n        var si = img.getSize();\n        var dx = anchor[0] - si[0];\n        var dy = anchor[1] - si[1];\n        if (!extent) {\n          extent = [dx, dy, dx+si[0], dy+si[1]];\n        } else {\n          ol.extent.extend(extent, [dx, dy, dx+si[0], dy+si[1]]);\n        }\n      }\n    }\n    if (extent) {\n      cx = cx + (extent[2] + extent[0])/2;\n      cy = cy + (extent[3] + extent[1])/2;\n    }\n  }\n  // Draw image\n  cy += (theCanvas ? row*height : 0);\n  for (i=0; s= style[i]; i++) {\n    vectorContext.setStyle(s);\n    switch (typeGeom) {\n      case ol.geom.Point:\n      case 'Point':\n      case 'MultiPoint':\n        vectorContext.drawGeometry(new ol.geom.Point([cx, cy]));\n        break;\n      case ol.geom.LineString:\n      case 'LineString':\n      case 'MultiLineString': \n        ctx.save();\n          ctx.rect(this.get('margin') * ratio, 0, size[0] *  ratio, canvas.height);\n          ctx.clip();\n          vectorContext.drawGeometry(new ol.geom.LineString([[cx-sx, cy], [cx+sx, cy]]));\n        ctx.restore();\n        break;\n      case ol.geom.Polygon:\n      case 'Polygon':\n      case 'MultiPolygon': \n        vectorContext.drawGeometry(new ol.geom.Polygon([[[cx-sx, cy-sy], [cx+sx, cy-sy], [cx+sx, cy+sy], [cx-sx, cy+sy], [cx-sx, cy-sy]]]));\n        break;\n    }\n  }\n  ctx.restore();\n  return canvas;\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n//\n/** A control to jump from one zone to another.\n *\n * @constructor\n * @fires select\n * @extends {ol.control.Control}\n * @param {Object=} options Control options.\n *\t@param {string} options.className class name\n *\t@param {ol.layer.Layer} options.layer layer to display in the control\n *\t@param {ol.ProjectionLike} options.projection projection of the control, Default is EPSG:3857 (Spherical Mercator).\n *  @param {Array<any>} options.zone an array of zone: { name, extent (in EPSG:4326) }\n *  @param {bolean} options.centerOnClick center on click when click on zones, default true\n */\nol.control.MapZone = function(options) {\n  if (!options) options={};\n  var element = document.createElement(\"div\");\n  if (options.target) {\n    element = ol.ext.element.create('DIV', {\n      className: options.className || \"ol-mapzone\"\n    });\n  } else {\n    element = ol.ext.element.create('DIV', {\n      className: (options.className || \"ol-mapzone\") +' ol-unselectable ol-control ol-collapsed'\n    });\n    var bt = ol.ext.element.create('BUTTON', {\n      type: 'button',\n      on: {\n        'click': function() {\n          element.classList.toggle(\"ol-collapsed\");\n          maps.forEach(function (m) {\n            m.updateSize();\n          });\n        }.bind(this)\n      },\n      parent: element\n    });\n    ol.ext.element.create('I', {\n      parent: bt\n    });\n  }\n  // Parent control\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  // Create maps\n  var maps = this._maps = [];\n  options.zones.forEach(function(z) {\n    var view = new ol.View({ zoom: 6, center: [0,0], projection: options.projection });\n    var extent = ol.proj.transformExtent(z.extent, 'EPSG:4326', view.getProjection());\n    console.log(extent, z.extent)\n    var div = ol.ext.element.create('DIV', {\n      className: 'ol-mapzonezone',\n      parent: element,\n      click : function() {\n        this.dispatchEvent({\n          type: 'select',\n          coordinate: ol.extent.getCenter(extent),\n          extent: extent\n        });\n        if (options.centerOnClick !== false) {\n          this.getMap().getView().fit(extent);\n        }\n        this.setVisible(false);\n      }.bind(this)\n    });\n    var layer = new options.layer.constructor({\n      source: options.layer.getSource()\n    });\n    var map = new ol.Map({\n      target: div,\n      view: view,\n      controls: [],\n      interactions:[],\n      layers: [layer]\n    });\n    maps.push(map);\n    view.fit(extent);\n    // Nmae\n    ol.ext.element.create('P', {\n      html: z.title,\n      parent: div\n    });\n  }.bind(this));\n  // Refresh the maps\n  setTimeout(function() {\n    maps.forEach(function (m) {\n      m.updateSize();\n    });\n  });\n};\nol.ext.inherits(ol.control.MapZone, ol.control.Control);\n/** Set the control visibility\n* @param {boolean} b\n*/\nol.control.MapZone.prototype.setVisible = function (b) {\n  if (b) {\n    this.element.classList.remove('ol-collapsed');\n    // Force map rendering\n    this.getMaps().forEach(function (m) {\n      m.updateSize();\n    });\n  } else {\n    this.element.classList.add('ol-collapsed');\n  }\n};\n/** Get associated maps\n * @return {ol.Map}\n */\nol.control.MapZone.prototype.getMaps = function () {\n  return this._maps\n};\n/** Pre-defined zones */\nol.control.MapZone.zones = {};\n/** French overseas departments  */\nol.control.MapZone.zones.DOM = [{\n  \"title\": \"Guadeloupe\",\n  \"extent\": [ -61.898594315312444, 15.75623038647845, -60.957887532935324, 16.575317670979473 ]\n},{\n  \"title\": \"Guyane\",\n  \"extent\": [ -54.72525931072715, 2.1603763430019, -51.528236062921344, 5.7984307809552575 ]\n},{\n  \"title\": \"Martinique\",\n  \"extent\": [ -61.257556528564756, 14.387506317407514, -60.76934912110432, 14.895067461729951 ]\n},{\n  \"title\": \"Mayotte\",\n  \"extent\": [ 44.959844536967815, -13.01674138212816, 45.35328866510648, -12.65521942207829 ]\n},{\n  \"title\": \"La réunion\",\n  \"extent\": [ 55.17059012967656, -21.407680069231688, 55.88195702001797, -20.85560221637526 ]\n}];\n/** French overseas territories */\nol.control.MapZone.zones.TOM = [{\n  \"title\": \"Polynésie Française\",\n  \"extent\": [ 206.23664226630862, -22.189040615809787, 221.85920743981987, -10.835039595040698 ]\n},{\n  \"title\": \"Nouvelle Calédonie\",\n  \"extent\": [ 163.76420580160925, -22.581641092751838, 167.66984709498706, -19.816411635668445 ]\n},{\n  \"title\": \"St-Pierre et Miquelon\",\n  \"extent\": [ -56.453698765748676, 46.74449858188555, -56.0980198121544, 47.14669874229787 ]\n},{\n  \"title\": \"Wallis et Futuna\",\n  \"extent\": [ 181.7588623143665, -14.7341169873267, 183.95612353301715, -13.134720799175085 ]\n},{\n  \"title\": \"St-Martin St-Barthélemy\",\n  \"extent\": [ -63.1726389501678, 17.806097291313506, -62.7606535945649, 18.13267688837938 ]\n}];\n/** French overseas departments and territories */\nol.control.MapZone.zones.DOMTOM = [{\n  title: 'Métropole',\n  extent: [ -5.318421740712579, 41.16082274292913, 9.73284186155716, 51.21957336557702 ]\n}].concat(ol.control.MapZone.zones.DOM,ol.control.MapZone.zones.TOM);\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Control overlay for OL3\n * The overlay control is a control that display an overlay over the map\n *\n * @constructor\n * @extends {ol.control.Control}\n * @fire change:visible\n * @param {Object=} options Control options.\n *  @param {string} className class of the control\n *  @param {boolean} hideOnClick hide the control on click, default false\n *  @param {boolean} closeBox add a closeBox to the control, default false\n */\nol.control.Notification = function(options) {\n  options = options || {};\n\tvar element = document.createElement(\"DIV\");\n  this.contentElement = document.createElement(\"DIV\");\n  element.appendChild(this.contentElement);\n  var classNames = (options.className||\"\")+ \" ol-notification\";\n\tif (!options.target) {\n    classNames += \" ol-unselectable ol-control ol-collapsed\";\n  }\n\telement.setAttribute('class', classNames);\n\tol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n};\nol.ext.inherits(ol.control.Notification, ol.control.Control);\n/**\n * Display a notification on the map\n * @param {string|node|undefined} what the notification to show, default get the last one\n * @param {number} [duration=3000] duration in ms, if -1 never hide\n */\nol.control.Notification.prototype.show = function(what, duration) {\n  var self = this;\n  var elt = this.element;\n  if (what) {\n    if (what instanceof Node) {\n      this.contentElement.innerHTML = '';\n      this.contentElement.appendChild(what);\n    } else {\n      this.contentElement.innerHTML = what;\n    }\n  }\n  if (this._listener) {\n    clearTimeout(this._listener);\n    this._listener = null;\n  }\n  elt.classList.add('ol-collapsed');\n  this._listener = setTimeout(function() {\n    elt.classList.remove('ol-collapsed');\n    if (!duration || duration >= 0) {\n      self._listener = setTimeout(function() {\n        elt.classList.add('ol-collapsed');\n        self._listener = null;\n      }, duration || 3000);\n    } else {\n      self._listener = null;\n    }\n  }, 100);\n};\n/**\n * Remove a notification on the map\n */\nol.control.Notification.prototype.hide = function() {\n  if (this._listener) {\n    clearTimeout(this._listener);\n    this._listener = null;\n  }\n  this.element.classList.add('ol-collapsed');\n};\n/**\n * Toggle a notification on the map\n * @param {number} [duration=3000] duration in ms\n */\nol.control.Notification.prototype.toggle = function(duration) {\n  if (this.element.classList.contains('ol-collapsed')) {\n    this.show(null, duration);\n  } else {\n    this.hide();\n  }\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Control overlay for OL3\n * The overlay control is a control that display an overlay over the map\n *\n * @constructor\n * @extends {ol.control.Control}\n * @fire change:visible\n * @param {Object=} options Control options.\n *\t@param {String} options.className class of the control\n*\t@param {String|Element} options.content\n*\t@param {bool} options.hideOnClick hide the control on click, default false\n*\t@param {bool} options.closeBox add a closeBox to the control, default false\n*/\nol.control.Overlay = function(options) {\n  if (!options) options={};\n/*\n  var element = document.createElement(\"div\");\n  element.classList.add('ol-unselectable', 'ol-overlay');\n  //if (options.className) element.classList.add(options.className);\n*/\n  var element = ol.ext.element.create('DIV', {\n    className: 'ol-unselectable ol-overlay '+(options.className||''),\n    html: options.content\n  });\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  var self = this;\n  if (options.hideOnClick) element.addEventListener(\"click\", function(){self.hide();});\n  this.set(\"closeBox\", options.closeBox);\n  this._timeout = false;\n  this.setContent (options.content);\n};\nol.ext.inherits(ol.control.Overlay, ol.control.Control);\n/** Set the content of the overlay\n* @param {string|Element} html the html to display in the control\n*/\nol.control.Overlay.prototype.setContent = function (html) {\n  var self = this;\n  if (html) {\n    var elt = this.element;\n    if (html instanceof Element) {\n      elt.innerHTML='';\n      elt.appendChild(html)\n    }\n    else if (html!==undefined) elt.innerHTML = html;\n    if (this.get(\"closeBox\")) {\n      var cb = document.createElement(\"div\");\n      cb.classList.add(\"ol-closebox\");\n      cb.addEventListener(\"click\", function(){self.hide();});\n      elt.insertBefore(cb, elt.firstChild);\n    }\n  }\n};\n/** Set the control visibility\n* @param {string|Element} html the html to display in the control\n* @param {ol.coordinate} coord coordinate of the top left corner of the control to start from\n*/\nol.control.Overlay.prototype.show = function (html, coord) {\n  var self = this;\n  var elt = this.element;\n  elt.style.display = 'block';\n  if (coord) {\n    this.center_ = this.getMap().getPixelFromCoordinate(coord);\n    elt.style.top = this.center_[1]+'px';\n    elt.style.left = this.center_[0]+'px';\n  } else {\n    //TODO: Do fix from  hkollmann pull request\n    this.center_ = false;\n    elt.style.top = \"\";\n    elt.style.left = \"\";\n  }\n  if (html) this.setContent(html);\n  if (this._timeout) clearTimeout(this._timeout);\n  this._timeout = setTimeout(function() {\n    elt.classList.add(\"ol-visible\")\n    elt.style.top = \"\";\n    elt.style.left = \"\";\n    self.dispatchEvent({ type:'change:visible', visible:true, element: self.element });\n  }, 10);\n};\n/** Show an image\n * @param {string} src image url\n * @param {*} options\n *  @param {string} options.title\n *  @param {ol.coordinate} coordinate\n */\nol.control.Overlay.prototype.showImage = function (src, options) {\n  options = options || {};\n  var content = ol.ext.element.create('DIV', {\n    className: 'ol-fullscreen-image'\n  });\n  ol.ext.element.create('IMG', {\n    src: src,\n    parent: content\n  });\n  if (options.title) {\n    content.classList.add('ol-has-title');\n    ol.ext.element.create('P', { \n      html: options.title,\n      parent: content\n    });\n  }\n  this.show(content, options.coordinate);\n};\n/** Set the control visibility hidden\n*/\nol.control.Overlay.prototype.hide = function () {\n  var elt = this.element;\n  this.element.classList.remove(\"ol-visible\");\n  if (this.center_) {\n    elt.style.top = this.center_[1]+'px';\n    elt.style.left = this.center_[0]+'px';\n    this.center_ = false;\n  }\n  if (this._timeout) clearTimeout(this._timeout);\n  this._timeout = setTimeout(function(){ elt.style.display = 'none'; }, 500);\n  this.dispatchEvent({ type:'change:visible', visible:false, element: this.element });\n};\n/** Toggle control visibility\n*/\nol.control.Overlay.prototype.toggle = function () {\t\n  if (this.getVisible()) this.hide();\n  else this.show();\n}\n/** Get the control visibility\n* @return {boolean} b\n*/\nol.control.Overlay.prototype.getVisible = function () {\n  return ol.ext.element.getStyle(this.element, 'display') !== 'none';\n};\n/** Change class name\n* @param {String} className a class name or a list of class names separated by a space\n*/\nol.control.Overlay.prototype.setClass = function (className) {\n  var vis = this.element.classList.contains('ol-visible');\n  this.element.className = ('ol-unselectable ol-overlay '+(vis ? 'ol-visible ' : '')+className).trim();\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * OpenLayers 3 Layer Overview Control.\n * The overview can rotate with map. \n * Zoom levels are configurable.\n * Click on the overview will center the map.\n * Change width/height of the overview trough css.\n *\n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} options Control options.\n *  @param {ol.ProjectionLike} options.projection The projection. Default is EPSG:3857 (Spherical Mercator).\n *  @param {Number} options.minZoom default 0\n *  @param {Number} options.maxZoom default 18\n *  @param {boolean} options.rotation enable rotation, default false\n *  @param {top|bottom-left|right} options.align position\n *  @param {Array<ol.layer>} options.layers list of layers\n *  @param {ol.style.Style | Array.<ol.style.Style> | undefined} options.style style to draw the map extent on the overveiw\n *  @param {bool|elastic} options.panAnimation use animation to center map on click, default true\n */\nol.control.Overview = function(options)\n{\toptions = options || {};\n  var self = this;\n  // API\n  this.minZoom = options.minZoom || 0;\n  this.maxZoom = options.maxZoom || 18;\n  this.rotation = options.rotation;\n  var element;\n  if (options.target) {\n    element = document.createElement(\"div\");\n    this.panel_ = options.target;\n  } else {\n    element = document.createElement(\"div\");\n    element.classList.add('ol-overview', 'ol-unselectable', 'ol-control', 'ol-collapsed');\n    if (/top/.test(options.align)) element.classList.add('ol-control-top');\n    if (/right/.test(options.align)) element.classList.add('ol-control-right');\n    var button = document.createElement(\"button\");\n        button.setAttribute('type','button');\n        button.addEventListener(\"touchstart\", function(e){ self.toggleMap(); e.preventDefault(); });\n        button.addEventListener(\"click\", function(){self.toggleMap()});\n        element.appendChild(button);\n    this.panel_ = document.createElement(\"div\");\n    this.panel_.classList.add(\"panel\");\n    element.appendChild(this.panel_);\n  }\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  // Create a overview map\n  this.ovmap_ = new ol.Map({\n    controls: new ol.Collection(),\n    interactions: new ol.Collection(),\n    target: this.panel_,\n    view: new ol.View ({\n      zoom: 2,\n      center: [0,0],\n      projection: options.projection\n    }),\n    layers: options.layers\n  });\n  this.oview_ = this.ovmap_.getView();\n  // Cache extent\n  this.extentLayer = new ol.layer.Vector({\n    name: 'Cache extent',\n    source: new ol.source.Vector(),\n    style: options.style || [new ol.style.Style({\n      image: new ol.style.Circle({\n        fill: new ol.style.Fill({\n          color: 'rgba(255,0,0, 1)'\n        }),\n        stroke: new ol.style.Stroke({\n          width: 7,\n            color: 'rgba(255,0,0, 0.8)'\n          }),\n          radius: 5\n        }),\n        stroke: new ol.style.Stroke({\n          width: 5,\n          color: \"rgba(255,0,0,0.8)\"\n        })\n      }\n    )]\n  })\n  this.ovmap_.addLayer(this.extentLayer);\n  /** Elastic bounce\n  *\t@param {Int} bounce number of bounce\n  *\t@param {Number} amplitude amplitude of the bounce [0,1] \n  *\t@return {Number}\n  * /\n  var bounceFn = function (bounce, amplitude){\n    var a = (2*bounce+1) * Math.PI/2;\n    var b = amplitude>0 ? -1/amplitude : -100;\n    var c = - Math.cos(a) * Math.pow(2, b);\n    return function(t) {\n      t = 1-Math.cos(t*Math.PI/2);\n      return 1 + Math.abs( Math.cos(a*t) ) * Math.pow(2, b*t) + c*t;\n    }\n  }\n  /** Elastic bounce\n  *\t@param {Int} bounce number of bounce\n  *\t@param {Number} amplitude amplitude of the bounce [0,1] \n  *\t@return {Number}\n  */\n  var elasticFn = function (bounce, amplitude) {\n    var a = 3*bounce * Math.PI/2;\n    var b = amplitude>0 ? -1/amplitude : -100;\n    var c = Math.cos(a) * Math.pow(2, b);\n    return function(t){\n      t = 1-Math.cos(t*Math.PI/2);\n      return 1 - Math.cos(a*t) * Math.pow(2, b*t) + c*t;\n    }\n  }\n  // Click on the preview center the map\n  this.ovmap_.addInteraction (new ol.interaction.Pointer({\n    handleDownEvent: function(evt) {\n      if (options.panAnimation !==false) {\n        if (options.panAnimation==\"elastic\" || options.elasticPan) {\n          self.getMap().getView().animate({\n            center: evt.coordinate,\n            easing: elasticFn(2,0.3),\n            duration: 1000\n          });\n        } else {\n          self.getMap().getView().animate({\n            center: evt.coordinate,\n            duration: 300\n          });\n        }\n      }\n      else self.getMap().getView().setCenter(evt.coordinate);\n      return false;\n    }\n  }));\n};\nol.ext.inherits(ol.control.Overview, ol.control.Control);\n/** Get overview map\n*\t@return {ol.Map}\n*/\nol.control.Overview.prototype.getOverviewMap = function(){\n  return this.ovmap_;\n};\n/** Toggle overview map\n*/\nol.control.Overview.prototype.toggleMap = function(){\n  this.element.classList.toggle(\"ol-collapsed\");\n  this.ovmap_.updateSize();\n  this.setView();\n};\n/** Set overview map position\n*\t@param {top|bottom-left|right}\n*/\nol.control.Overview.prototype.setPosition = function(align){\n  if (/top/.test(align)) this.element.classList.add(\"ol-control-top\");\n  else this.element.classList.remove(\"ol-control-top\");\n  if (/right/.test(align)) this.element.classList.add(\"ol-control-right\");\n  else this.element.classList.remove(\"ol-control-right\");\n};\n/**\n * Set the map instance the control associated with.\n * @param {ol.Map} map The map instance.\n */\nol.control.Overview.prototype.setMap = function(map) {\n  if (this._listener) ol.Observable.unByKey(this._listener);\n  this._listener = null;\n  ol.control.Control.prototype.setMap.call(this, map);\n  if (map) {\n    this._listener = map.getView().on('propertychange', this.setView.bind(this));\n    this.setView();\n  }\n};\n/** Calculate the extent of the map and draw it on the overview\n*/\nol.control.Overview.prototype.calcExtent_ = function(extent){\n  var map = this.getMap();\n  if (!map) return;\n  var source = this.extentLayer.getSource();\n  source.clear();\n  var f = new ol.Feature();\n  var size = map.getSize();\n  var resolution = map.getView().getResolution();\n  var rotation = map.getView().getRotation();\n  var center = map.getView().getCenter();\n  if (!resolution) return;\n  var dx = resolution * size[0] / 2;\n  var dy = resolution * size[1] / 2;\n  var res2 = this.oview_.getResolution();\n  if (dx/res2>5 || dy/res2>5) {\n    var cos = Math.cos(rotation);\n    var sin = Math.sin(rotation);\n    var i, x, y;\n    extent=[[-dx,-dy],[-dx,dy],[dx,dy],[dx,-dy]];\n    for (i = 0; i < 4; ++i) {\n      x = extent[i][0];\n      y = extent[i][1];\n      extent[i][0] = center[0] + x * cos - y * sin;\n      extent[i][1] = center[1] + x * sin + y * cos;\n    }\n    f.setGeometry (new ol.geom.Polygon( [ extent ]));\n  } else {\n    f.setGeometry (new ol.geom.Point( center ));\n  }\n  source.addFeature(f);\n};\n/**\n*\t@private\n*/\nol.control.Overview.prototype.setView = function(e){\n  if (!e) {\n    // refresh all\n    this.setView({key:'rotation'});\n    this.setView({key:'resolution'});\n    this.setView({key:'center'});\n    return;\n  }\n  // Set the view params\n  switch (e.key){\n    case 'rotation': {\n      if (this.rotation) this.oview_.setRotation(this.getMap().getView().getRotation());\n      else if (this.oview_.getRotation()) this.oview_.setRotation(0);\n      break;\n    }\n    case 'center': {\n      var mapExtent = this.getMap().getView().calculateExtent(this.getMap().getSize());\n      var extent = this.oview_.calculateExtent(this.ovmap_.getSize());\n      if (mapExtent[0]<extent[0] || mapExtent[1]<extent[1] \n      || mapExtent[2]>extent[2] || mapExtent[3]>extent[3]){\n        this.oview_.setCenter(this.getMap().getView().getCenter()); \n      }\n      break;\n    }\t\n    case 'resolution': {\n      //var z = Math.round(this.getMap().getView().getZoom()/2)*2-4;\n      var z = Math.round(this.oview_.getZoomForResolution(this.getMap().getView().getResolution())/2)*2-4;\n      z = Math.min ( this.maxZoom, Math.max(this.minZoom, z) );\n      this.oview_.setZoom(z);\n      break;\n    }\n    default: break;\n  }\n  this.calcExtent_();\n};\n\n/*\tCopyright (c) 2015-2018 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Set an hyperlink that will return the user to the current map view.\n * Just add a `permalink`property to layers to be handled by the control (and added in the url). \n * The layer's permalink property is used to name the layer in the url.\n * The control must be added after all layer are inserted in the map to take them into acount.\n *\n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} options\n *  @param {boolean} options.urlReplace replace url or not, default true\n *  @param {boolean} options.localStorage save current map view in localStorage, default false\n *  @param {boolean} options.geohash use geohash instead of lonlat, default false\n *  @param {integer} options.fixed number of digit in coords, default 6\n *  @param {boolean} options.anchor use \"#\" instead of \"?\" in href\n *  @param {boolean} options.visible hide the button on the map, default true\n *  @param {boolean} options.hidden hide the button on the map, default false DEPRECATED: use visible instead\n *  @param {function} options.onclick a function called when control is clicked\n*/\nol.control.Permalink = function(opt_options) {\n  var options = opt_options || {};\n  var self = this;\n  var button = document.createElement('button');\n  this.replaceState_ = (options.urlReplace!==false);\n  this.fixed_ = options.fixed || 6;\n  this.hash_ = options.anchor ? \"#\" : \"?\";\n  this._localStorage = options.localStorage;\n  if (!this._localStorage) localStorage.removeItem('ol@parmalink');\n  function linkto() {\n    if (typeof(options.onclick) == 'function') options.onclick(self.getLink());\n    else self.setUrlReplace(!self.replaceState_);\n  }\n  button.addEventListener('click', linkto, false);\n  button.addEventListener('touchstart', linkto, false);\n  var element = document.createElement('div');\n  element.className = (options.className || \"ol-permalink\") + \" ol-unselectable ol-control\";\n  element.appendChild(button);\n  if (options.hidden || options.visible===false) ol.ext.element.hide(element);\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.set('geohash', options.geohash);\n  this.on ('change', this.viewChange_.bind(this));\n  // Save search params\n  this.search_ = {};\n  var hash = this.replaceState_ ? document.location.hash || document.location.search : '';\n//  console.log('hash', hash)\n  if (!hash && this._localStorage) {\n    hash = localStorage['ol@parmalink'];\n  }\n  if (hash) {\n    hash = hash.replace(/(^#|^\\?)/,\"\").split(\"&\");\n    for (var i=0; i<hash.length;  i++) {\n      var t = hash[i].split(\"=\");\n      switch(t[0]) {\n        case 'lon':\n        case 'lat':\n        case 'gh':\n        case 'z':\n        case 'r':\n        case 'l': break;\n        default: this.search_[t[0]] = t[1];\n      }\n    }\n  }\n  // Decode permalink\n  this.setPosition();\n};\nol.ext.inherits(ol.control.Permalink, ol.control.Control);\n/**\n * Set the map instance the control associated with.\n * @param {ol.Map} map The map instance.\n */\nol.control.Permalink.prototype.setMap = function(map) {\n  if (this._listener) {\n    ol.Observable.unByKey(this._listener.change);\n    ol.Observable.unByKey(this._listener.moveend);\n  }\n  this._listener = null;\n  ol.control.Control.prototype.setMap.call(this, map);\n  // Get change \n  if (map) {\n    this._listener = {\n      change: map.getLayerGroup().on('change', this.layerChange_.bind(this)),\n      moveend: map.on('moveend', this.viewChange_.bind(this))\n    };\n    this.setPosition();\n  }\n};\n/** Get layer given a permalink name (permalink propertie in the layer)\n*\t@param {string} the permalink to search for\n*\t@param {Array<ol.layer>|undefined} an array of layer to search in\n*\t@return {ol.layer|false}\n*/\nol.control.Permalink.prototype.getLayerByLink =  function (id, layers) {\n  if (!layers && this.getMap()) layers = this.getMap().getLayers().getArray();\n  for (var i=0; i<layers.length; i++) {\n    if (layers[i].get('permalink') == id) return layers[i];\n    // Layer Group\n    if (layers[i].getLayers) {\n      var li = this.getLayerByLink ( id, layers[i].getLayers().getArray() );\n      if (li) return li;\n    }\n  }\n  return false;\n};\n/** Set coordinates as geohash\n * @param {boolean}\n */\nol.control.Permalink.prototype.setGeohash = function(b) {\n  this.set('geohash', b);\n  this.setUrlParam();\n};\n/** Set map position according to the current link \n */\nol.control.Permalink.prototype.setPosition = function() {\n  var map = this.getMap();\n  if (!map) return;\n  var hash = this.replaceState_ ? document.location.hash || document.location.search : '';\n  if (!hash && this._localStorage) {\n    hash = localStorage['ol@parmalink'];\n  }\n  if (!hash) return;\n  var i, t, param = {};\n  hash = hash.replace(/(^#|^\\?)/,\"\").split(\"&\");\n  for (i=0; i<hash.length;  i++) {\n    t = hash[i].split(\"=\");\n    param[t[0]] = t[1];\n  }\n  if (param.gh) {\n    var ghash = param.gh.split('-');\n    var lonlat = ol.geohash.toLonLat(ghash[0] );\n    param.lon = lonlat[0];\n    param.lat = lonlat[1];\n    param.z = ghash[1];\n  }\n  var c = ol.proj.transform([Number(param.lon),Number(param.lat)], 'EPSG:4326', map.getView().getProjection());\n  if (c[0] && c[1]) map.getView().setCenter(c);\n  if (param.z) map.getView().setZoom(Number(param.z));\n  if (param.r) map.getView().setRotation(Number(param.r));\n  // Reset layers visibility\n  function resetLayers(layers) {\n    if (!layers) layers = map.getLayers().getArray();\n    for (var i=0; i<layers.length; i++){\n      if (layers[i].get('permalink')) {\n        layers[i].setVisible(false);\n        // console.log(\"hide \"+layers[i].get('permalink'));\n      }\n      if (layers[i].getLayers) {\n        resetLayers (layers[i].getLayers().getArray());\n      }\n    }\n  }\n  if (param.l) {\n    resetLayers();\n    var l = param.l.split(\"|\");\n    for (i=0; i<l.length; i++) {\n      t = l[i].split(\":\");\n      var li = this.getLayerByLink(t[0]);\n      var op = Number(t[1]);\n      if (li) {\n        li.setOpacity(op);\n        li.setVisible(true);\n      }\n    }\n  }\n};\n/**\n * Get the parameters added to the url. The object can be changed to add new values.\n * @return {Object} a key value object added to the url as &key=value\n * @api stable\n */\nol.control.Permalink.prototype.getUrlParams = function() {\n  return this.search_;\n};\n/**\n * Set a parameter to the url.\n * @param {string} key the key parameter\n * @param {string|undefined} value the parameter's value, if undefined or empty string remove the parameter\n * @api stable\n */\nol.control.Permalink.prototype.setUrlParam = function(key, value) {\n  if (key) {\n    if (value===undefined || value==='') delete (this.search_[encodeURIComponent(key)])\n    else this.search_[encodeURIComponent(key)] = encodeURIComponent(value);\n  }\n  this.viewChange_();\n};\n/**\n * Get a parameter url.\n * @param {string} key the key parameter\n * @return {string} the parameter's value or empty string if not set\n * @api stable\n */\nol.control.Permalink.prototype.getUrlParam = function(key) {\n  return decodeURIComponent (this.search_[encodeURIComponent(key)] || '');\n};\n/**\n * Has a parameter url.\n * @param {string} key the key parameter\n * @return {boolean} \n * @api stable\n */\nol.control.Permalink.prototype.hasUrlParam = function(key) {\n  return this.search_.hasOwnProperty(encodeURIComponent(key));\n};\n/**\n * Get the permalink\n * @return {permalink}\n */\nol.control.Permalink.prototype.getLink = function(param) {\n  var map = this.getMap();\n  var c = ol.proj.transform(map.getView().getCenter(), map.getView().getProjection(), 'EPSG:4326');\n  var z = Math.round(map.getView().getZoom()*10)/10;\n  var r = map.getView().getRotation();\n  var l = this.layerStr_;\n  // Change anchor\n  var anchor = (r?\"&r=\"+(Math.round(r*10000)/10000):\"\")+(l?\"&l=\"+l:\"\");\n  if (this.get('geohash')) {\n    var ghash = ol.geohash.fromLonLat(c,8);\n    anchor = \"gh=\" + ghash + '-' + z + anchor;\n  } else {\n    anchor = \"lon=\"+c[0].toFixed(this.fixed_)+\"&lat=\"+c[1].toFixed(this.fixed_)+\"&z=\"+z + anchor;\n  }\n  for (var i in this.search_) anchor += \"&\"+i+\"=\"+this.search_[i];\n  if (param) return anchor;\n  //return document.location.origin+document.location.pathname+this.hash_+anchor;\n  return document.location.protocol+\"//\"+document.location.host+document.location.pathname+this.hash_+anchor;\n};\n/**\n * Enable / disable url replacement (replaceSate)\n *\t@param {bool}\n*/\nol.control.Permalink.prototype.setUrlReplace = function(replace) {\n  try {\n    this.replaceState_ = replace;\n    if (!replace) {\n      var s = \"\";\n      for (var i in this.search_) {\n        s += (s==\"\"?\"?\":\"&\") + i+\"=\"+this.search_[i];\n      }\n      window.history.replaceState (null,null, document.location.origin+document.location.pathname+s);\n    }\n    else window.history.replaceState (null,null, this.getLink());\n  } catch(e) {/* ok */}\n  /*\n  if (this._localStorage) {\n    localStorage['ol@parmalink'] = this.getLink(true);\n  }\n  */\n};\n/**\n * On view change refresh link\n * @param {ol.event} The map instance.\n * @private\n */\nol.control.Permalink.prototype.viewChange_ = function() {\n  try {\n    if (this.replaceState_) window.history.replaceState (null,null, this.getLink());\n  } catch(e) {/* ok */}\n  if (this._localStorage) {\n    localStorage['ol@parmalink'] = this.getLink(true);\n  }\n};\n/**\n * Layer change refresh link\n * @private\n */\nol.control.Permalink.prototype.layerChange_ = function() {\n  // Prevent multiple change at the same time\n  if (this._tout) {\n    clearTimeout(this._tout);\n    this._tout = null;\n  } else {\n    this._tout = setTimeout(function() {\n      this._tout = null;\n      // Get layers\n      var l = \"\";\n      function getLayers(layers) {\n        for (var i=0; i<layers.length; i++) {\n          if (layers[i].getVisible() && layers[i].get(\"permalink\")) {\n            if (l) l += \"|\";\n            l += layers[i].get(\"permalink\")+\":\"+layers[i].get(\"opacity\");\n          }\n          // Layer Group\n          if (layers[i].getLayers) getLayers(layers[i].getLayers().getArray());\n        }\n      }\n      getLayers(this.getMap().getLayers().getArray());\n      this.layerStr_ = l;\n      this.viewChange_();\n    }.bind(this), 200);\n  }\n};\n\n/*\n  Copyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Print control to get an image of the map\n *\n * @constructor\n * @fire print\n * @fire error\n * @fire printing\n * @extends {ol.control.Control}\n * @param {Object=} options Control options.\n *\t@param {String} options.className class of the control\n *\t@param {string} options.imageType A string indicating the image format, default image/jpeg\n *\t@param {number} options.quality Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp\n *\t@param {string} options.orientation Page orientation (landscape/portrait), default guest the best one\n *\t@param {boolean} options.immediate force print even if render is not complete,  default false\n */\nol.control.Print = function(options) {\n  if (!options) options = {};\n  var element = ol.ext.element.create('DIV', {\n    className: (options.className || 'ol-print')\n  });\n  if (!options.target) {\n    element.classList.add('ol-unselectable', 'ol-control');\n    ol.ext.element.create('BUTTON', {\n      type: 'button',\n      click: function() { this.print(); }.bind(this),\n      parent: element\n    });\n  }\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.set('immediate', options.immediate);\n  this.set('imageType', options.imageType || 'image/jpeg');\n  this.set('quality', options.quality || .8);\n  this.set('orientation', options.orientation);\n};\nol.ext.inherits(ol.control.Print, ol.control.Control);\n/** Helper function to copy result to clipboard\n * @param {Event} e print event\n * @return {boolean}\n */\nol.control.Print.prototype.toClipboard = function(e, callback) {\n  try {\n    e.canvas.toBlob(function(blob) {\n      try {\n        navigator.clipboard.write([\n          new window.ClipboardItem(\n            Object.defineProperty({}, blob.type, {\n              value: blob,\n              enumerable: true\n            })\n          )\n        ])\n        if (typeof(callback) === 'function') callback(true);\n      } catch (err) {\n        if (typeof(callback) === 'function') callback(false);\n      }\n    });\n  } catch(err) {\n    if (typeof(callback) === 'function') callback(false);\n  }\n};\n/** Helper function to copy result to clipboard\n * @param {any} options print options\n * @param {function} callback a callback function that takes a boolean if copy\n */\nol.control.Print.prototype.copyMap = function(options, callback) {\n  this.once('print', function(e) {\n    this.toClipboard(e, callback);\n  }.bind(this));\n  this.print(options);\n};\n/** Print the map\n * @param {function} cback a callback function that take a string containing the requested data URI.\n * @param {Object} options\n *\t@param {string} options.imageType A string indicating the image format, default the control one\n *\t@param {number} options.quality Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp\n *  @param {boolean} options.immediate true to prevent delay for printing\n *  @param {*} options.any any options passed to the print event when fired\n * @api\n */\nol.control.Print.prototype.print = function(options) {\n  options = options || {};\n  var imageType = options.imageType || this.get('imageType');\n  var quality = options.quality || this.get('quality');\n  if (this.getMap()) {\n    if (options.immediate !== 'silent') {\n      this.dispatchEvent(Object.assign({ \n        type: 'printing',\n      }, options));\n    }\n    // Start printing after delay to var user show info in the DOM\n    if (!options.immediate) {\n      setTimeout (function () {\n        options = Object.assign({}, options);\n        options.immediate = 'silent';\n        this.print(options);\n      }.bind(this), 200);\n      return;\n    }\n    // Run printing\n    this.getMap().once(this.get('immediate') ? 'postcompose' : 'rendercomplete', function(event) {\n      var canvas, ctx;\n      // ol <= 5 : get the canvas\n      if (event.context) {\n        canvas = event.context.canvas;\n      } else {\n        // ol6+ : create canvas using layer canvas\n        this.getMap().getViewport().querySelectorAll('.ol-layer canvas, canvas.ol-fixedoverlay').forEach(function(c) {\n          if (c.width) {\n            // Create a canvas if none\n            if (!canvas) {\n              canvas = document.createElement('canvas');\n              var size = this.getMap().getSize();\n              canvas.width = size[0];\n              canvas.height = size[1];\n              ctx = canvas.getContext('2d');\n              if (/jp.*g$/.test(imageType)) {\n                ctx.fillStyle = this.get('bgColor') || 'white';\n                ctx.fillRect(0,0,canvas.width,canvas.height);\t\t\n              }\n            }\n            ctx.save();\n            // opacity\n            if (c.parentNode.style.opacity==='0') return;\n            ctx.globalAlpha = parseFloat(c.parentNode.style.opacity) || 1;\n            // transform\n            var tr = ol.ext.element.getStyle(c,'transform') || ol.ext.element.getStyle(c,'-webkit-transform');\n            if (/^matrix/.test(tr)) {\n              tr = tr.replace(/^matrix\\(|\\)$/g,'').split(',');\n              tr.forEach(function(t,i) { tr[i] = parseFloat(t); });\n              ctx.transform(tr[0],tr[1],tr[2],tr[3],tr[4],tr[5]);\n              ctx.drawImage(c, 0, 0);\n            } else {\n              ctx.drawImage(c, 0, 0, ol.ext.element.getStyle(c,'width'), ol.ext.element.getStyle(c,'height'));\n            }\n            ctx.restore();\n          }\n        }.bind(this));\n      }\n      // Calculate print format\n      var size = [210,297], format = 'a4';\n      var w, h, position;\n      var orient = options.orient || this.get('orientation');\n      var margin = options.margin || 10;\n      if (canvas) {\n        // Calculate size\n        if (orient!=='landscape' && orient!=='portrait') {\n          orient = (canvas.width > canvas.height) ? 'landscape' : 'portrait';\n        }\n        if (orient === 'landscape') size = [size[1],size[0]];\n        var sc = Math.min ((size[0]-2*margin)/canvas.width,(size[1]-2*margin)/canvas.height);\n        w = sc * canvas.width;\n        h = sc * canvas.height;\n        // Image position\n        position = [(size[0] - w)/2, (size[1] - h)/2];\n      }\n      // get the canvas image\n      var image;\n      try { \n        image = canvas ? canvas.toDataURL(imageType, quality) : null;\n      } catch(e) {\n        // Fire error event\n        this.dispatchEvent({\n          type: 'error',\n          canvas: canvas\n        });\n        return;\n      }\n      // Fire print event\n      var e = Object.assign({ \n        type: 'print',\n        print: {\n          format: format,\n          orientation: orient,\n          unit: 'mm',\n          size: size,\n          position: position,\n          imageWidth: w,\n          imageHeight: h\n        },\n        image: image,\n        imageType: imageType,\n        canvas: canvas\n      }, options);\n      this.dispatchEvent(e);\n    }.bind(this));\n    this.getMap().render();\n  }\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/*eslint no-constant-condition: [\"error\", { \"checkLoops\": false }]*/\n/**\n * @classdesc OpenLayers 3 Profil Control.\n * Draw a profile of a feature (with a 3D geometry)\n *\n * @constructor\n * @extends {ol.control.Control}\n * @fires over\n * @fires out\n * @fires show\n * @fires dragstart\n * @fires dragging\n * @fires dragend\n * @fires dragcancel\n * @param {Object=} options\n *  @param {string} options.className\n *  @param {ol.style.Style} options.style style to draw the profil\n *  @param {*} options.info keys/values for i19n\n *  @param {number} options.width\n *  @param {number} options.height\n *  @param {ol.Feature} options.feature the feature to draw profil\n *  @param {boolean} options.selectable enable selection on the profil, default false\n *  @param {boolean} options.zoomable can zoom in the profil\n */\nol.control.Profil = function(options) {\n  options = options || {};\n  this.info = options.info || ol.control.Profil.prototype.info;\n  var self = this;\n  var element;\n  if (options.target) {\n    element = document.createElement(\"div\");\n    element.classList.add(options.className || \"ol-profil\");\n  } else {\n    element = document.createElement(\"div\");\n    element.className = ((options.className || 'ol-profil') +' ol-unselectable ol-control ol-collapsed').trim();\n    this.button = document.createElement(\"button\");\n    this.button.setAttribute('type','button');\n    var click_touchstart_function = function(e) {\n      self.toggle();\n      e.preventDefault();\n    };\n    this.button.addEventListener(\"click\", click_touchstart_function);\n    this.button.addEventListener(\"touchstart\", click_touchstart_function);\n    element.appendChild(this.button);\n  }\n  // Drawing style\n  if (options.style instanceof ol.style.Style) {\n    this._style = options.style;\n  } else {\n    this._style = new ol.style.Style({\n      text: new ol.style.Text(),\n      stroke: new ol.style.Stroke({\n        width: 1.5,\n        color: '#369'\n      })\n    });\n  }\n  if (!this._style.getText()) this._style.setText(new ol.style.Text());\n  // Selection style\n  if (options.selectStyle instanceof ol.style.Style) {\n    this._selectStyle = options.selectStyle;\n  } else {\n    this._selectStyle = new ol.style.Style({\n      fill: new ol.style.Fill({ color: '#369' })\n    });\n  }\n  var div_inner = document.createElement(\"div\");\n      div_inner.classList.add(\"ol-inner\");\n      element.appendChild(div_inner);\n  var div = document.createElement(\"div\");\n      div.style.position = \"relative\";\n      div_inner.appendChild(div);\n  var ratio = this.ratio = 2;\n  this.canvas_ = document.createElement('canvas');\n  this.canvas_.width = (options.width || 300)*ratio;\n  this.canvas_.height = (options.height || 150)*ratio;\n  var styles = {\n    \"msTransform\":\"scale(0.5,0.5)\", \"msTransformOrigin\":\"0 0\",\n    \"webkitTransform\":\"scale(0.5,0.5)\", \"webkitTransformOrigin\":\"0 0\",\n    \"mozTransform\":\"scale(0.5,0.5)\", \"mozTransformOrigin\":\"0 0\",\n    \"transform\":\"scale(0.5,0.5)\", \"transformOrigin\":\"0 0\"\n  };\n  Object.keys(styles).forEach(function(style) {\n    if (style in self.canvas_.style) {\n      self.canvas_.style[style] = styles[style];\n    }\n  });\n  var div_to_canvas = document.createElement(\"div\");\n  div.appendChild(div_to_canvas);\n  div_to_canvas.style.width = this.canvas_.width/ratio + \"px\";\n  div_to_canvas.style.height = this.canvas_.height/ratio + \"px\";\n  div_to_canvas.appendChild(this.canvas_);\n  div_to_canvas.addEventListener('pointerdown', this.onMove.bind(this));\n  document.addEventListener('pointerup', this.onMove.bind(this));\n  div_to_canvas.addEventListener('mousemove', this.onMove.bind(this));\n  div_to_canvas.addEventListener('touchmove', this.onMove.bind(this));\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.set('selectable', options.selectable);\n  // Offset in px\n  this.margin_ = { top:10*ratio, left:40*ratio, bottom:30*ratio, right:10*ratio };\n  if (!this.info.ytitle) this.margin_.left -= 20*ratio;\n  if (!this.info.xtitle) this.margin_.bottom -= 20*ratio;\n  // Cursor\n  this.bar_ = document.createElement(\"div\");\n  this.bar_.classList.add(\"ol-profilbar\");\n  this.bar_.style.top = (this.margin_.top/ratio)+\"px\";\n  this.bar_.style.height = (this.canvas_.height-this.margin_.top-this.margin_.bottom)/ratio+\"px\";\n  div.appendChild(this.bar_);\n  this.cursor_ = document.createElement(\"div\");\n  this.cursor_.classList.add(\"ol-profilcursor\");\n  div.appendChild(this.cursor_);\n  this.popup_ = document.createElement(\"div\");\n  this.popup_.classList.add(\"ol-profilpopup\");\n  this.cursor_.appendChild(this.popup_);\n  // Track information\n  var t = document.createElement(\"table\");\n      t.cellPadding = '0';\n      t.cellSpacing = '0';\n      t.style.clientWidth = this.canvas_.width/ratio + \"px\";\n    div.appendChild(t);\n  var firstTr = document.createElement(\"tr\");\n      firstTr.classList.add(\"track-info\");\n      t.appendChild(firstTr);\n  var div_zmin = document.createElement(\"td\");\n  div_zmin.innerHTML = (this.info.zmin||\"Zmin\")+': <span class=\"zmin\">';\n  firstTr.appendChild(div_zmin);\n  var div_zmax = document.createElement(\"td\");\n  div_zmax.innerHTML = (this.info.zmax||\"Zmax\")+': <span class=\"zmax\">';\n  firstTr.appendChild(div_zmax);\n  var div_distance = document.createElement(\"td\");\n  div_distance.innerHTML = (this.info.distance||\"Distance\")+': <span class=\"dist\">';\n  firstTr.appendChild(div_distance);\n  var div_time = document.createElement(\"td\");\n  div_time.innerHTML = (this.info.time||\"Time\")+': <span class=\"time\">';\n  firstTr.appendChild(div_time);\n  var secondTr = document.createElement(\"tr\");\n      secondTr.classList.add(\"point-info\")\n      t.appendChild(secondTr);\n  var div_altitude = document.createElement(\"td\");\n  div_altitude.innerHTML = (this.info.altitude||\"Altitude\")+': <span class=\"z\">';\n  secondTr.appendChild(div_altitude);\n  var div_distance2 = document.createElement(\"td\");\n  div_distance2.innerHTML = (this.info.distance||\"Distance\")+': <span class=\"dist\">';\n  secondTr.appendChild(div_distance2);\n  var div_time2 = document.createElement(\"td\");\n  div_time2.innerHTML = (this.info.time||\"Time\")+': <span class=\"time\">';\n  secondTr.appendChild(div_time2);\n  // Array of data\n  this.tab_ = [];\n  // Show feature\n  if (options.feature) {\n    this.setGeometry (options.feature);\n  }\n  // Zoom on profile\n  if (options.zoomable) {\n    this.set('selectable', true);\n    var start, geom;\n    this.on('change:geometry', function() {\n      geom = null;\n    });\n    this.on('dragstart', function(e) {\n      start = e.index;\n    })\n    this.on('dragend', function(e) {\n      if (Math.abs(start - e.index) > 10) {\n        if (!geom) {\n          var bt = ol.ext.element.create('BUTTON', {\n            parent: element,\n            className: 'ol-zoom-out',\n            click: function(e) {\n              e.stopPropagation();\n              e.preventDefault();\n              if (geom) {\n                this.dispatchEvent({ type:'zoom' });\n                this.setGeometry(geom, this._geometry[1]);\n              }\n              element.removeChild(bt);\n            }.bind(this)\n          })\n        }\n        var saved = geom || this._geometry[0];\n        var g = new ol.geom.LineString(this.getSelection(start, e.index));\n        this.setGeometry(g, this._geometry[1]);\n        geom = saved;\n        this.dispatchEvent({ type:'zoom', geometry: g, start: start, end: e.index });\n      }\n    }.bind(this));\n  }\n};\nol.ext.inherits(ol.control.Profil, ol.control.Control);\n/** Custom infos list\n* @api stable\n*/\nol.control.Profil.prototype.info = {\n  \"zmin\": \"Zmin\",\n  \"zmax\": \"Zmax\",\n  \"ytitle\": \"Altitude (m)\",\n  \"xtitle\": \"Distance (km)\",\n  \"time\": \"Time\",\n  \"altitude\": \"Altitude\",\n  \"distance\": \"Distance\",\n  \"altitudeUnits\": \"m\",\n  \"distanceUnitsM\": \"m\",\n  \"distanceUnitsKM\": \"km\",\n};\n/** Show popup info\n* @param {string} info to display as a popup\n* @api stable\n*/\nol.control.Profil.prototype.popup = function(info) {\n  this.popup_.innerHTML = info;\n};\n/** Show point on profil\n * @param {*} p \n * @param {number} dx \n * @private\n */\nol.control.Profil.prototype._drawAt = function(p, dx) {\n  if (p) {\n    this.cursor_.style.left = dx+\"px\";\n    this.cursor_.style.top = (this.canvas_.height-this.margin_.bottom+p[1]*this.scale_[1]+this.dy_)/this.ratio+\"px\";\n    this.cursor_.style.display = \"block\";\n    this.bar_.parentElement.classList.add(\"over\");\n    this.bar_.style.left = dx+\"px\";\n    this.bar_.style.display = \"block\";\n    this.element.querySelector(\".point-info .z\").textContent = p[1]+this.info.altitudeUnits;\n    this.element.querySelector(\".point-info .dist\").textContent = (p[0]/1000).toFixed(1)+this.info.distanceUnitsKM;\n    this.element.querySelector(\".point-info .time\").textContent = p[2];\n    if (dx>this.canvas_.width/this.ratio/2) this.popup_.classList.add('ol-left');\n    else this.popup_.classList.remove('ol-left');\n  } else {\n    this.cursor_.style.display = \"none\";\n    this.bar_.style.display = 'none';\n    this.cursor_.style.display = 'none';  \n    this.bar_.parentElement.classList.remove(\"over\");\n  }\n};\n/** Show point at coordinate or a distance on the profil\n * @param { ol.coordinates|number } where a coordinate or a distance from begining, if none it will hide the point\n * @return { ol.coordinates } current point\n */\nol.control.Profil.prototype.showAt = function(where) {\n  var i, p, p0, d0 = Infinity;\n  if (typeof(where) === 'undefined') {\n    if (this.bar_.parentElement.classList.contains(\"over\")) {\n      // Remove it\n      this._drawAt();\n    }\n  } else if (where.length) {\n    // Look for closest the point\n    for (i=1; p=this.tab_[i]; i++) {\n      var d = ol.coordinate.dist2d(p[3], where);\n      if (d<d0) {\n        p0 = p;\n        d0 = d;\n      } \n    }\n  } else {\n    for (i=0; p=this.tab_[i]; i++) {\n      p0 = p;\n      if (p[0] >= where) {\n        break;\n      } \n    }\n  }\n  if (p0) {\n    var dx = (p0[0] * this.scale_[0] + this.margin_.left) / this.ratio;\n    this._drawAt(p0, dx);\n    return p0[3];\n  }\n  return null;\n};\n/** Show point at a time on the profil\n * @param { Date|number } time a Date or a DateTime (in s) to show the profile on, if none it will hide the point\n * @param { booelan } delta true if time is a delta from the start, default false\n * @return { ol.coordinates } current point\n */\nol.control.Profil.prototype.showAtTime = function(time, delta) {\n  var i, p, p0;\n  if (time instanceof Date) {\n    time = time.getTime()/1000;\n  } else if (delta) {\n    time += this.tab_[0][3][3];\n  }\n  if (typeof(time) === 'undefined') {\n    if (this.bar_.parentElement.classList.contains(\"over\")) {\n      // Remove it\n      this._drawAt();\n    }\n  } else {\n    for (i=0; p=this.tab_[i]; i++) {\n      p0 = p;\n      if (p[3][3] >= time) {\n        break;\n      } \n    }\n  }\n  if (p0) {\n    var dx = (p0[0] * this.scale_[0] + this.margin_.left) / this.ratio;\n    this._drawAt(p0, dx);\n    return p0[3];\n  }\n  return null;\n};\n/** Get the point at a given time on the profil\n * @param { number } time time at which to show the point\n * @return { ol.coordinates } current point\n */\nol.control.Profil.prototype.pointAtTime = function(time) {\n  var i, p;\n  // Look for closest the point\n  for (i=1; p=this.tab_[i]; i++) {\n    var t = p[3][3];\n    if (t >= time) {\n      // Previous one ?\n      var pt = this.tab_[i-1][3];\n      if ((pt[3]+t)/2 < time) return pt;\n      else return p;\n    }\n  }\n  return this.tab_[this.tab_.length-1][3];\n};\n/** Mouse move over canvas\n */\nol.control.Profil.prototype.onMove = function(e) {\n  if (!this.tab_.length) return;\n  var box_canvas = this.canvas_.getBoundingClientRect();\n  var pos = {\n    top: box_canvas.top + window.pageYOffset - document.documentElement.clientTop,\n    left: box_canvas.left + window.pageXOffset - document.documentElement.clientLeft\n  };\n  var pageX = e.pageX \n    || (e.touches && e.touches.length && e.touches[0].pageX) \n    || (e.changedTouches && e.changedTouches.length && e.changedTouches[0].pageX);\n  var pageY = e.pageY \n    || (e.touches && e.touches.length && e.touches[0].pageY) \n    || (e.changedTouches && e.changedTouches.length && e.changedTouches[0].pageY);\n  var dx = pageX -pos.left;\n  var dy = pageY -pos.top;\n  var ratio = this.ratio;\n  if (dx>this.margin_.left/ratio && dx<(this.canvas_.width-this.margin_.right)/ratio\n    && dy>this.margin_.top/ratio && dy<(this.canvas_.height-this.margin_.bottom)/ratio) {\n    var d = (dx*ratio-this.margin_.left)/this.scale_[0];\n    var p0 = this.tab_[0];\n    var index, p;\n    for (index=1; p=this.tab_[index]; index++) {\n      if (p[0]>=d) {\n        if (d < (p[0]+p0[0])/2) {\n          index = 0;\n          p = p0;\n        }\n        break;\n      }\n    }\n    this._drawAt(p, dx);\n    this.dispatchEvent({ type:'over', click:e.type==='click', index: index, coord: p[3], time: p[2], distance: p[0] });\n    // Handle drag / click\n    switch (e.type) {\n      case 'pointerdown': {\n        this._dragging = {\n          event: { type:'dragstart', index: index, coord: p[3], time: p[2], distance: p[0] },\n          pageX: pageX,\n          pageY: pageY\n        }\n        break;\n      }\n      case 'pointerup': {\n        if (this._dragging && this._dragging.pageX) {\n          if (Math.abs(this._dragging.pageX - pageX)<3 && Math.abs(this._dragging.pageY - pageY) < 3) {\n            this.dispatchEvent({ type:'click', index: index, coord: p[3], time: p[2], distance: p[0] });\n            this.refresh();\n          }\n        } else {\n          this.dispatchEvent({ type:'dragend', index: index, coord: p[3], time: p[2], distance: p[0] });\n        }\n        this._dragging = false;\n        break;\n      }\n      default: {\n        if (this._dragging) {\n          if (this._dragging.pageX) {\n            if (Math.abs(this._dragging.pageX - pageX)>3 || Math.abs(this._dragging.pageY - pageY) > 3) {\n              this._dragging.pageX = this._dragging.pageY = false;\n              this.dispatchEvent(this._dragging.event);\n            }\n          } else {\n            this.dispatchEvent({ type:'dragging', index: index, coord: p[3], time: p[2], distance: p[0] });\n            var min = Math.min(this._dragging.event.index, index);\n            var max = Math.max(this._dragging.event.index, index);\n            this.refresh();\n            if (this.get('selectable')) this._drawGraph(this.tab_.slice(min, max), this._selectStyle);\n          }\n        }\n        break;\n      }\n    }\n  } else {\n    if (this.bar_.parentElement.classList.contains('over')) {\n      this._drawAt();\n      this.dispatchEvent({ type:'out' });\n    }\n    if (e.type === 'pointerup' && this._dragging) {\n      this.dispatchEvent({ type:'dragcancel' });\n      this._dragging = false;\n    }\n  }\n};\n/** Show panel\n* @api stable\n*/\nol.control.Profil.prototype.show = function() {\n  this.element.classList.remove(\"ol-collapsed\");\n  this.dispatchEvent({ type:'show', show: true });\n};\n/** Hide panel\n* @api stable\n*/\nol.control.Profil.prototype.hide = function() {\n  this.element.classList.add(\"ol-collapsed\");\n  this.dispatchEvent({ type:'show', show: false });\n};\n/** Toggle panel\n* @api stable\n*/\nol.control.Profil.prototype.toggle = function() {\n  this.element.classList.toggle(\"ol-collapsed\");\n  var b = this.element.classList.contains(\"ol-collapsed\");\n  this.dispatchEvent({ type:'show', show: !b });\n}\n/** Is panel visible\n*/\nol.control.Profil.prototype.isShown = function() {\n  return (!this.element.classList.contains(\"ol-collapsed\"));\n};\n/** Get selection\n * @param {number} starting point\n * @param {number} ending point\n * @return {Array<ol.coordinate>}\n */\nol.control.Profil.prototype.getSelection = function(start, end) {\n  var sel = [];\n  var min = Math.max(Math.min(start, end), 0);\n  var max = Math.min(Math.max(start, end), this.tab_.length-1);\n  for (var i=min; i <= max; i++) {\n    sel.push(this.tab_[i][3])\n  }\n  return sel;\n};\n/** Draw the graph\n * @private\n */\nol.control.Profil.prototype._drawGraph = function(t, style) {\n  if (!t.length) return;\n  var ctx = this.canvas_.getContext('2d');\n  var scx = this.scale_[0];\n  var scy = this.scale_[1];\n  var dy = this.dy_;\n  var ratio = this.ratio;\n  var i, p;\n  // Draw Path\n  ctx.beginPath();\n  for (i=0; p=t[i]; i++) {\n    if (i==0) ctx.moveTo(p[0]*scx,p[1]*scy+dy);\n    else ctx.lineTo(p[0]*scx,p[1]*scy+dy);\n  }\n  if (style.getStroke()) {\n    ctx.strokeStyle = style.getStroke().getColor() || '#000';\n    ctx.lineWidth = style.getStroke().getWidth() * ratio;\n    ctx.setLineDash([]);\n    ctx.stroke();\n  }\n  // Fill path\n  if (style.getFill()) {\n    ctx.fillStyle = style.getFill().getColor() || '#000';\n    ctx.Style = style.getFill().getColor() || '#000';\n    ctx.lineTo(t[t.length-1][0]*scx, 0);\n    ctx.lineTo(t[0][0]*scx, 0);\n    ctx.fill();\n  }\n};\n/**\n * Set the geometry to draw the profil.\n * @param {ol.Feature|ol.geom.Geometry} f the feature.\n * @param {Object=} options\n *  @param {ol.ProjectionLike} options.projection feature projection, default projection of the map\n *  @param {string} options.zunit 'm' or 'km', default m\n *  @param {string} options.unit 'm' or 'km', default km\n *  @param {Number|undefined} options.zmin default 0\n *  @param {Number|undefined} options.zmax default max Z of the feature\n *  @param {Number|undefined} options.graduation z graduation default 100\n *  @param {integer|undefined} options.amplitude amplitude of the altitude, default zmax-zmin\n * @api stable\n */\nol.control.Profil.prototype.setGeometry = function(g, options) {\n  if (!options) options = {};\n  if (g instanceof ol.Feature) g = g.getGeometry();\n  this._geometry = [g, options];\n  // No Z\n  if (!/Z/.test(g.getLayout())) return;\n  // No time\n  if(/M/.test(g.getLayout())) this.element.querySelector(\".time\").parentElement.style.display = 'block';\n  else this.element.querySelector(\".time\").parentElement.style.display = 'none';\n  // Coords\n  var c = g.getCoordinates();\n  switch (g.getType()) {\n    case \"LineString\": break;\n    case \"MultiLineString\": c = c[0]; break;\n    default: return;\n  }\n  // Distance beetween 2 coords\n  var proj = options.projection || this.getMap().getView().getProjection();\n  function dist2d(p1,p2) {\n    return ol.sphere.getDistance(\n      ol.proj.transform(p1, proj, 'EPSG:4326'),\n      ol.proj.transform(p2, proj, 'EPSG:4326')\n    );\n  }\n  function getTime(t0, t1) {\n    if (!t0 || !t1) return \"-\"\n    var dt = (t1-t0) / 60; // mn\n    var ti = Math.trunc(dt/60);\n    var mn = Math.trunc(dt-ti*60);\n    return ti+\"h\"+(mn<10?\"0\":\"\")+mn+\"mn\";\n  }\n  // Calculate [distance, altitude, time, point] for each points\n  var zmin=Infinity, zmax=-Infinity;\n  var i, p, d, z, ti, t = this.tab_ = [];\n  for (i=0, p; p=c[i]; i++) {\n    z = p[2];\n    if (z<zmin) zmin=z;\n    if (z>zmax) zmax=z;\n    if (i==0) d = 0;\n    else d += dist2d(c[i-1], p);\n    ti = getTime(c[0][3],p[3]);\n    t.push ([d, z, ti, p]);\n  }\n  this._z = [zmin,zmax];\n  this.set('graduation', options.graduation || 100);\n  this.set('zmin', options.zmin);\n  this.set('zmax', options.zmax);\n  this.set('amplitude', options.amplitude);\n  this.set('unit', options.unit);\n  this.set('zunit', options.zunit);\n  this.dispatchEvent({ type: 'change:geometry', geometry: g })\n  this.refresh();\n};\n/** Refresh the profil\n */\nol.control.Profil.prototype.refresh = function() {\n  var canvas = this.canvas_;\n  var ctx = canvas.getContext('2d');\n  var w = canvas.width;\n  var h = canvas.height;\n  ctx.setTransform(1, 0, 0, 1, 0, 0);\n  ctx.clearRect(0,0, w, h);\n  var zmin = this._z[0];\n  var zmax = this._z[1];\n  var t = this.tab_;\n  var d = t[t.length-1][0];\n  var ti = t[t.length-1][2];\n  var i;\n  if (!d) {\n    console.error('[ol/control/Profil] no data...', t);\n    return;\n  }\n  // Margin\n  ctx.setTransform(1, 0, 0, 1, this.margin_.left, h-this.margin_.bottom);\n  var ratio = this.ratio;\n  w -= this.margin_.right + this.margin_.left;\n  h -= this.margin_.top + this.margin_.bottom;\n  // Draw axes\n  ctx.strokeStyle = this._style.getText().getFill().getColor() || '#000';\n  ctx.lineWidth = 0.5*ratio;\n  ctx.beginPath();\n  ctx.moveTo(0,0); ctx.lineTo(0,-h);\n  ctx.moveTo(0,0); ctx.lineTo(w, 0);\n  ctx.stroke();\n  // Info\n  this.element.querySelector(\".track-info .zmin\").textContent = zmin.toFixed(2)+this.info.altitudeUnits;\n  this.element.querySelector(\".track-info .zmax\").textContent = zmax.toFixed(2)+this.info.altitudeUnits;\n  if (d>1000) {\n    this.element.querySelector(\".track-info .dist\").textContent = (d/1000).toFixed(1)+this.info.distanceUnitsKM;\n  } else {\n    this.element.querySelector(\".track-info .dist\").textContent= (d).toFixed(1)+this.info.distanceUnitsM;\n  }\n  this.element.querySelector(\".track-info .time\").textContent = ti;\n  // Set graduation\n  var grad = this.get('graduation');\n  while (true) {\n    zmax = Math.ceil(zmax/grad)*grad;\n    zmin = Math.floor(zmin/grad)*grad;\n    var nbgrad = (zmax-zmin)/grad;\n    if (h/nbgrad < 15*ratio) {\n      grad *= 2;\n    }\n    else break;\n  }\n  // Set amplitude\n  if (typeof(this.get('zmin'))=='number' && zmin > this.get('zmin')) zmin = this.get('zmin');\n  if (typeof(this.get('zmax'))=='number' && zmax < this.get('zmax')) zmax = this.get('zmax');\n  var amplitude = this.get('amplitude');\n  if (amplitude) {\n    zmax = Math.max (zmin + amplitude, zmax);\n  }\n  // Scales lines\n  var scx = w/d;\n  var scy = -h/(zmax-zmin);\n  var dy = this.dy_ = -zmin*scy;\n  this.scale_ = [scx,scy];\n  this._drawGraph(t, this._style);\n  // Draw\n  ctx.font = (10*ratio)+'px arial';\n  ctx.textAlign = 'right';\n  ctx.textBaseline = 'middle';\n  ctx.fillStyle = this._style.getText().getFill().getColor() || '#000';\n  // Scale Z\n  ctx.beginPath();\n  for (i=zmin; i<=zmax; i+=grad) {\n    if (this.get('zunit')!=\"km\") ctx.fillText(i, -4*ratio, i*scy+dy);\n    else ctx.fillText((i/1000).toFixed(1), -4*ratio, i*scy+dy);\n    ctx.moveTo (-2*ratio, i*scy+dy);\n    if (i!=0) ctx.lineTo (d*scx, i*scy+dy);\n    else ctx.lineTo (0, i*scy+dy);\n  }\n  // Scale X\n  ctx.textAlign = \"center\";\n  ctx.textBaseline = \"top\";\n  ctx.setLineDash([ratio,3*ratio]);\n  var unit = this.get('unit') ||\"km\";\n  var step;\n  if (d>1000) {\n    step = Math.round(d/1000)*100;\n    if (step > 1000) step = Math.ceil(step/1000)*1000;\n  } else {\n    unit = \"m\";\n    if (d>100) step = Math.round(d/100)*10;\n    else if (d>10) step = Math.round(d/10);\n    else if (d>1) step = Math.round(d)/10;\n    else step = d;\n  }\n  for (i=0; i<=d; i+=step) {\n    var txt = (unit==\"m\") ? i : (i/1000);\n    //if (i+step>d) txt += \" \"+ (options.zunits || \"km\");\n    ctx.fillText(Math.round(txt*10)/10, i*scx, 4*ratio);\n    ctx.moveTo (i*scx, 2*ratio); ctx.lineTo (i*scx, 0);\n  }\n  ctx.font = (12*ratio)+\"px arial\";\n  ctx.fillText(this.info.xtitle.replace(\"(km)\",\"(\"+unit+\")\"), w/2, 18*ratio);\n  ctx.save();\n  ctx.rotate(-Math.PI/2);\n  ctx.fillText(this.info.ytitle, h/2, -this.margin_.left);\n  ctx.restore();\n  ctx.stroke();\n};\n/** Get profil image\n* @param {string|undefined} type image format or 'canvas' to get the canvas image, default image/png.\n* @param {Number|undefined} encoderOptions between 0 and 1 indicating image quality image/jpeg or image/webp, default 0.92.\n* @return {string} requested data uri\n* @api stable\n*/\nol.control.Profil.prototype.getImage = function(type, encoderOptions) {\n  if (type===\"canvas\") return this.canvas_;\n  return this.canvas_.toDataURL(type, encoderOptions);\n};\n\n/*\tCopyright (c) 2018 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Geoportail routing Control.\n * @constructor\n * @extends {ol.control.Control}\n * @fires select\n * @fires change:input\n * @param {Object=} options\n *\t@param {string} options.className control class name\n *\t@param {string | undefined} options.apiKey the service api key.\n *\t@param {string | undefined} options.authentication: basic authentication for the service API as btoa(\"login:pwd\")\n *\t@param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *\t@param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *\t@param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *\t@param {string | undefined} options.inputLabel label for the input, default none\n *\t@param {string | undefined} options.noCollapse prevent collapsing on input blur, default false\n *\t@param {number | undefined} options.typing a delay on each typing to start searching (ms) use -1 to prevent autocompletion, default 300.\n *\t@param {integer | undefined} options.minLength minimum length to start searching, default 1\n *\t@param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *\t@param {integer | undefined} options.maxHistory maximum number of items to display in history. Set -1 if you don't want history, default maxItems\n *\t@param {function} options.getTitle a function that takes a feature and return the name to display in the index.\n *\t@param {function} options.autocomplete a function that take a search string and callback function to send an array\n *\t@param {number} options.timeout default 10s\n */\nol.control.RoutingGeoportail = function(options) {\n  var self = this;\n  if (!options) options = {};\n  if (options.typing == undefined) options.typing = 300;\n  // Class name for history\n  this._classname = options.className || 'search';\n  this._source = new ol.source.Vector();\n  // Authentication\n  this._auth = options.authentication;\n  var element = document.createElement(\"DIV\");\n  var classNames = (options.className||\"\")+ \" ol-routing\";\n  if (!options.target) {\n    classNames += \" ol-unselectable ol-control\";\n  }\n  element.setAttribute('class', classNames);\n\tif (!options.target) {\n    var bt = ol.ext.element.create('BUTTON', { parent: element })\n    bt.addEventListener('click', function(){\n      element.classList.toggle('ol-collapsed');\n    });\n  }\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.set('url', 'https://wxs.ign.fr/'+options.apiKey+'/itineraire/rest/route.json');\n  var content = ol.ext.element.create('DIV', { className: 'content', parent: element } )\n  var listElt = ol.ext.element.create('DIV', { className: 'search-input', parent: content });\n  this._search = [];\n  this.addSearch(listElt, options);\n  this.addSearch(listElt, options);\n  ol.ext.element.create('I', { className: 'ol-car', title: options.carlabel||'by car', parent: content })\n    .addEventListener(\"click\", function() {\n      self.setMode('car');\n    });\n  ol.ext.element.create('I', { className: 'ol-pedestrian', title: options.pedlabel||'pedestrian', parent: content })\n    .addEventListener(\"click\", function() {\n      self.setMode('pedestrian');\n    });\n  ol.ext.element.create('I', { className: 'ol-ok', title: options.runlabel||'search', html:'OK', parent: content })\n    .addEventListener(\"click\", function() {\n      self.calculate();\n    });\n  ol.ext.element.create('I', { className: 'ol-cancel', html:'cancel', parent: content })\n    .addEventListener(\"click\", function() {\n      this.resultElement.innerHTML = '';\n    }.bind(this));\n  this.resultElement = document.createElement(\"DIV\");\n  this.resultElement.setAttribute('class', 'ol-result');\n  element.appendChild(this.resultElement);\n  this.setMode(options.mode || 'car');\n  this.set('timeout', options.timeout || 10000);\n};\nol.ext.inherits(ol.control.RoutingGeoportail, ol.control.Control);\nol.control.RoutingGeoportail.prototype.setMode = function (mode, silent) {\n  this.set('mode', mode);\n  this.element.querySelector(\".ol-car\").classList.remove(\"selected\");\n  this.element.querySelector(\".ol-pedestrian\").classList.remove(\"selected\");\n  this.element.querySelector(\".ol-\"+mode).classList.add(\"selected\");\n  if (!silent) this.calculate();\n};\nol.control.RoutingGeoportail.prototype.setMethod = function (method, silent) {\n  this.set('method', method);\n  if (!silent) this.calculate();\n};\nol.control.RoutingGeoportail.prototype.addButton = function (className, title, info) {\n  var bt = document.createElement(\"I\");\n  bt.setAttribute(\"class\", className);\n  bt.setAttribute(\"type\", \"button\");\n  bt.setAttribute(\"title\", title);\n  bt.innerHTML = info||'';\n  this.element.appendChild(bt);\n  return bt;\n};\n/** Get point source\n * @return {ol.source.Vector }\n */\nol.control.RoutingGeoportail.prototype.getSource = function () {\n  return this._source;\n};\nol.control.RoutingGeoportail.prototype._resetArray = function (element) {\n  this._search = [];\n  var q = element.parentNode.querySelectorAll('.search-input > div')\n  q.forEach(function(d) {\n    if (d.olsearch) {\n      if (d.olsearch.get('feature')) {\n        d.olsearch.get('feature').set('step', this._search.length);\n        if (this._search.length===0) d.olsearch.get('feature').set('pos', 'start');\n        else if (this._search.length === q.length-1) d.olsearch.get('feature').set('pos', 'end');\n        else d.olsearch.get('feature').set('pos', '');\n      }\n      this._search.push(d.olsearch);\n    }\n  }.bind(this));\n};\n/** Remove a new search input\n * @private\n */\nol.control.RoutingGeoportail.prototype.removeSearch = function (element, options, after) {\n  element.removeChild(after);\n  if (after.olsearch.get('feature')) this._source.removeFeature(after.olsearch.get('feature'));\n  if (this.getMap()) this.getMap().removeControl(after.olsearch);\n  this._resetArray(element);\n};\n/** Add a new search input\n * @private\n */\nol.control.RoutingGeoportail.prototype.addSearch = function (element, options, after) {\n  var self = this;\n  var div = ol.ext.element.create('DIV');\n  if (after) element.insertBefore(div, after.nextSibling);\n  else element.appendChild(div);\n  ol.ext.element.create ('BUTTON', { title: options.startlabel||\"add/remove\", parent: div})\n    .addEventListener('click', function(e) {\n      if (e.ctrlKey) {\n        if (this._search.length>2) this.removeSearch(element, options, div);\n      } else if (e.shiftKey) {\n        this.addSearch(element, options, div);\n      }\n    }.bind(this));\n  var search = div.olsearch = new ol.control.SearchGeoportail({\n    className: 'IGNF ol-collapsed',\n    apiKey: options.apiKey,\n    authentication: options.authentication,\n    target: div,\n    reverse: true\n  });\n  search._changeCounter = 0;\n  this._resetArray(element);\n  search.on('select', function(e){\n    search.setInput(e.search.fulltext);\n    var f = search.get('feature');\n    if (!f) {\n      f = new ol.Feature(new ol.geom.Point(e.coordinate));\n      search.set('feature', f);\n      this._source.addFeature(f);\n      // Check geometry change\n      search.checkgeom = true;\n      f.getGeometry().on('change', function() {\n        if (search.checkgeom) this.onGeometryChange(search, f);\n      }.bind(this));\n    } else {\n      search.checkgeom = false;\n      if (!e.silent) f.getGeometry().setCoordinates(e.coordinate);\n      search.checkgeom = true;\n    }\n    f.set('name', search.getTitle(e.search));\n    f.set('step', this._search.indexOf(search));\n    if (f.get('step') === 0) f.set('pos','start');\n    else if (f.get('step') === this._search.length-1) f.set('pos','end');\n    search.set('selection', e.search);\n  }.bind(this));\n  search.element.querySelector('input').addEventListener('change', function(){\n    search.set('selection', null);\n    self.resultElement.innerHTML = '';\n  });\n  if (this.getMap()) this.getMap().addControl(search);\n};\n/** Geometry has changed\n * @private\n */\nol.control.RoutingGeoportail.prototype.onGeometryChange = function (search, f, delay) {\n  // Set current geom \n  var lonlat = ol.proj.transform(f.getGeometry().getCoordinates(), this.getMap().getView().getProjection(), 'EPSG:4326');\n  search._handleSelect({ \n    x: lonlat[0], \n    y: lonlat[1], \n    fulltext: lonlat[0].toFixed(6) + ',' + lonlat[1].toFixed(6) \n  }, true, { silent: true });\n  // Try to revers geocode\n  if (delay) {\n    search._changeCounter--;\n    if (!search._changeCounter) {\n      search.reverseGeocode(f.getGeometry().getCoordinates(), { silent: true });\n      return;\n    }\n  } else {\n    search._changeCounter++;\n    setTimeout(function() {\n      this.onGeometryChange(search, f, true);\n    }.bind(this), 1000);\n  }\n}\n/**\n * Set the map instance the control is associated with\n * and add its controls associated to this map.\n * @param {_ol_Map_} map The map instance.\n */\nol.control.RoutingGeoportail.prototype.setMap = function (map) {\n  ol.control.Control.prototype.setMap.call(this, map);\n  for (var i=0; i<this._search.length; i++) {\n    var c = this._search[i];\n    c.setMap(map);\n  }\n};\n/** Get request data\n * @private\n */\nol.control.RoutingGeoportail.prototype.requestData = function (steps) {\n  var start = steps[0];\n  var end = steps[steps.length-1];\n  var waypoints = '';\n  for (var i=1; i<steps.length-1; i++) {\n    waypoints += (waypoints ? ';':'') + steps[i].x+','+steps[i].y;\n  }\n  return {\n    'gp-access-lib': '1.1.0',\n    origin: start.x+','+start.y,\n    destination: end.x+','+end.y,\n    method: this.get('method') || 'time', // 'distance'\n    graphName: this.get('mode')==='pedestrian' ? 'Pieton' : 'Voiture',\n    waypoints: waypoints,\n    format: 'STANDARDEXT'\n  };\n};\n/** Gets time as string\n * @param {*} routing routing response\n * @return {string}\n * @api\n */\nol.control.RoutingGeoportail.prototype.getTimeString = function (t) {\n  t /= 60;\n  return (t<1) ? '' : (t<60) ? t.toFixed(0)+' min' : (t/60).toFixed(0)+' h '+(t%60).toFixed(0)+' min';\n};\n/** Gets distance as string\n * @param {number} d distance\n * @return {string}\n * @api\n */\nol.control.RoutingGeoportail.prototype.getDistanceString = function (d) {\n  return (d<1000) ? d.toFixed(0)+' m' : (d/1000).toFixed(2)+' km';\n};\n/** Show routing as a list\n * @private\n */\nol.control.RoutingGeoportail.prototype.listRouting = function (routing) {\n  this.resultElement.innerHTML = '';\n  var t = this.getTimeString(routing.duration);\n  t += ' ('+this.getDistanceString(routing.distance)+')';\n  var iElement = document.createElement('i');\n  iElement.textContent = t;\n  this.resultElement.appendChild(iElement)\n  var ul = document.createElement('ul');\n  this.resultElement.appendChild(ul);\n  var info = {\n    'none': 'Prendre sur ',\n    'R': 'Tourner à droite sur ',\n    'FR': 'Tourner légèrement à droite sur ',\n    'L': 'Tourner à gauche sur ',\n    'FL': 'Tourner légèrement à gauche sur ',\n    'F': 'Continuer tout droit sur ',\n  }\n  for (var i=0, f; f=routing.features[i]; i++) {\n    var d = this.getDistanceString(f.get('distance'));\n    t = this.getTimeString(f.get('durationT'));\n    var li = document.createElement('li');\n        li.classList.add(f.get('instruction'));\n        li.innerHTML = (info[f.get('instruction')||'none']||'#')\n      + ' ' + f.get('name')\n      + '<i>' + d + (t ? ' - ' + t : '') +'</i>'\n    ul.appendChild(li);\n  }\n};\n/** Handle routing response\n * @private\n */\nol.control.RoutingGeoportail.prototype.handleResponse = function (data, start, end) {\n  if (data.status === 'ERROR') {\n    this.dispatchEvent({\n      type: 'errror',\n      status: '200',\n      statusText: data.message\n    })\n    return;\n  }\n  var routing = { type:'routing' };\n  routing.features = [];\n  var distance = 0;\n  var duration = 0;\n  var f, route = [];\n  for (var i=0, l; l=data.legs[i]; i++) {\n    for (var j=0, s; s=l.steps[j]; j++) {\n      var geom = [];\n      for (var k=0, p; p=s.points[k]; k++){\n        p = p.split(',');\n        geom.push([parseFloat(p[0]),parseFloat(p[1])]);\n        if (i===0 || k!==0) route.push(geom[k]);\n      }\n      geom = new ol.geom.LineString(geom);\n      var options = {\n        geometry: geom.transform('EPSG:4326',this.getMap().getView().getProjection()),\n        name: s.name,\n        instruction: s.navInstruction,\n        distance: parseFloat(s.distanceMeters),\n        duration: parseFloat(s.durationSeconds)\n      }\n      //console.log(duration, options.duration, s)\n      distance += options.distance;\n      duration += options.duration;\n      options.distanceT = distance;\n      options.durationT = duration;\n      f = new ol.Feature(options);\n      routing.features.push(f);\n    }\n  }\n  routing.distance = parseFloat(data.distanceMeters);\n  routing.duration = parseFloat(data.durationSeconds);\n  // Full route\n  route = new ol.geom.LineString(route);\n  routing.feature = new ol.Feature ({\n    geometry: route.transform('EPSG:4326',this.getMap().getView().getProjection()),\n    start: this._search[0].getTitle(start),\n    end: this._search[0].getTitle(end), \n    distance: routing.distance,\n    duration: routing.duration\n  });\n  // console.log(data, routing);\n  this.dispatchEvent(routing);\n  this.path = routing;\n  return routing;\n};\n/** Calculate route\n * @param {Array<ol.coordinate>|undefined} steps an array of steps in EPSG:4326, default use control input values\n * @return {boolean} true is a new request is send (more than 2 points to calculate)\n */\nol.control.RoutingGeoportail.prototype.calculate = function (steps) {\n  this.resultElement.innerHTML = '';\n  if (steps) {\n    var convert = [];\n    steps.forEach(function(s) {\n      convert.push({ x: s[0], y: s[1] });\n    });\n    steps = convert;\n  } else {\n    steps = []\n    for (var i=0; i<this._search.length; i++) {\n      if (this._search[i].get('selection')) steps.push(this._search[i].get('selection'));\n    }\n  }\n  if (steps.length<2) return false;\n  var start = steps[0];\n  var end = steps[steps.length-1];\n  var data = this.requestData(steps);\n  var url = encodeURI(this.get('url'));\n  var parameters = '';\n  for (var index in data) {\n    parameters += (parameters) ? '&' : '?';\n    if (data.hasOwnProperty(index)) parameters += index + '=' + data[index];\n  }\n  var self = this;\n  this.ajax(url + parameters, \n    function (resp) {\n      if (resp.status >= 200 && resp.status < 400) {\n        self.listRouting(self.handleResponse (JSON.parse(resp.response), start, end));\n      } else {\n        //console.log(url + parameters, arguments);\n        this.dispatchEvent({ type: 'error', status: resp.status, statusText: resp.statusText});\n      }\n    }.bind(this), \n    function(resp){\n      console.log('ERROR', resp)\n      this.dispatchEvent({ type: 'error', status: resp.status, statusText: resp.statusText});\n    }.bind(this)\n  );\n  return true;\n};\t\n/** Send an ajax request (GET)\n * @param {string} url\n * @param {function} onsuccess callback\n * @param {function} onerror callback\n */\nol.control.RoutingGeoportail.prototype.ajax = function (url, onsuccess, onerror){\n  var self = this;\n  // Abort previous request\n  if (this._request) {\n    this._request.abort();\n  }\n  // New request\n  var ajax = this._request = new XMLHttpRequest();\n  ajax.open('GET', url, true);\n  ajax.timeout = this.get('timeout') || 10000;\n  if (this._auth) {\n    ajax.setRequestHeader(\"Authorization\", \"Basic \" + this._auth);\n  }\n  this.element.classList.add('ol-searching');\n  // Load complete\n  ajax.onload = function() {\n    self._request = null;\n    self.element.classList.remove('ol-searching');\n    onsuccess.call(self, this);\n  };\n  // Timeout\n  ajax.ontimeout = function () {\n    self._request = null;\n    self.element.classList.remove('ol-searching');\n    if (onerror) onerror.call(self, this);\n  };\n  // Oops, TODO do something ?\n  ajax.onerror = function() {\n    self._request = null;\n    self.element.classList.remove('ol-searching');\n    if (onerror) onerror.call(self, this);\n  };\n  // GO!\n  ajax.send();\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Scale Control.\n * A control to display the scale of the center on the map\n *\n * @constructor\n * @extends {ol.control.Control}\n * @fires select\n * @fires change:input\n * @param {Object=} options\n *  @param {string} options.className control class name\n *  @param {string} options.ppi screen ppi, default 96\n * \t@param {string} options.editable make the control editable, default true\n */\nol.control.Scale = function(options) {\n  if (!options) options = {};\n  if (options.typing == undefined) options.typing = 300;\n  var element = document.createElement(\"DIV\");\n  var classNames = (options.className||\"\")+ \" ol-scale\";\n  if (!options.target) {\n  classNames += \" ol-unselectable ol-control\";\n  }\n  this._input = document.createElement(\"INPUT\");\n  this._input.value = '-';\n  element.setAttribute('class', classNames);\n  if (options.editable===false) this._input.readOnly = true;\n  element.appendChild(this._input);\n  ol.control.Control.call(this, {\n  element: element,\n  target: options.target\n  });\n  this._input.addEventListener(\"change\", this.setScale.bind(this));\n  this.set('ppi', options.ppi || 96)\n};\nol.ext.inherits(ol.control.Scale, ol.control.Control);\n/**\n * Remove the control from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.control.Scale.prototype.setMap = function (map) {\n  if (this._listener) ol.Observable.unByKey(this._listener);\n  this._listener = null;\n  ol.control.Control.prototype.setMap.call(this, map);\n  // Get change (new layer added or removed)\n  if (map) {\n    this._listener = map.on('moveend', this._showScale.bind(this));\n  }\n};\n/** Display the scale\n */\nol.control.Scale.prototype._showScale = function () {\n  var map = this.getMap();\n  if (map) {\n    var view = map.getView();\n    var proj = view.getProjection();\n    var center = view.getCenter();\n    var px = map.getPixelFromCoordinate(center);\n    px[1] += 1;\n    var coord = map.getCoordinateFromPixel(px);\n    var d = ol.sphere.getDistance(\n      ol.proj.transform(center, proj, 'EPSG:4326'),\n      ol.proj.transform(coord, proj, 'EPSG:4326'));\n    d *= this.get('ppi')/.0254\n    this._input.value = this.formatScale(d);\n  }\n};\n/** Format the scale 1/d\n * @param {Number} d\n * @return {string} formated string\n */\nol.control.Scale.prototype.formatScale = function (d) {\n  if (d>100) d = Math.round(d/100) * 100;\n  else d = Math.round(d);\n  return '1 / '+ d.toLocaleString();\n};\n/** Set the current scale (will change the scale of the map)\n * @param {Number} value the scale factor\n */\nol.control.Scale.prototype.setScale = function (value) {\n  var map = this.getMap();\n  if (map && value) {\n    if (value.target) value = value.target.value;\n    var fac = value;\n    if (typeof(value)==='string') {\n      fac = value.split('/')[1];\n      if (!fac) fac = value;\n      fac = fac.replace(/[^\\d]/g,'');\n      fac = parseInt(fac);\n    }\n    // Calculate new resolution\n    var view = map.getView();\n    var proj = view.getProjection();\n    var center = view.getCenter();\n    var px = map.getPixelFromCoordinate(center);\n    px[1] += 1;\n    var coord = map.getCoordinateFromPixel(px);\n    var d = ol.sphere.getDistance(\n      ol.proj.transform(center, proj, 'EPSG:4326'),\n      ol.proj.transform(coord, proj, 'EPSG:4326'));\n    d *= this.get('ppi')/.0254\n    view.setResolution(view.getResolution()*fac/d);\n  }\n  this._showScale();\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Search places using the French National Base Address (BAN) API.\n *\n * @constructor\n * @extends {ol.control.Search}\n * @fires select\n * @param {Object=} Control options.\n *  @param {string} options.className control class name\n *  @param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *  @param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *  @param {number | undefined} options.typing a delay on each typing to start searching (ms), default 500.\n *  @param {integer | undefined} options.minLength minimum length to start searching, default 3\n *  @param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *\n *  @param {string|undefined} options.url Url to BAN api, default \"https://api-adresse.data.gouv.fr/search/\"\n *  @param {boolean} options.position Search, with priority to geo position, default false\n *  @param {function} options.getTitle a function that takes a feature and return the text to display in the menu, default return label attribute\n * @see {@link https://adresse.data.gouv.fr/api/}\n */\nol.control.SearchBAN = function(options) {\n  options = options || {};\n  options.typing = options.typing || 500;\n  options.url = options.url || 'https://api-adresse.data.gouv.fr/search/';\n  options.className = options.className || 'BAN';\n  options.copy = '<a href=\"https://adresse.data.gouv.fr/\" target=\"new\">&copy; BAN-data.gouv.fr</a>';\n  ol.control.SearchPhoton.call(this, options);\n};\nol.ext.inherits(ol.control.SearchBAN, ol.control.SearchPhoton);\n/** Returns the text to be displayed in the menu\n * @param {ol.Feature} f the feature\n * @return {string} the text to be displayed in the index\n * @api\n */\nol.control.SearchBAN.prototype.getTitle = function (f) {\n  var p = f.properties;\n  return (p.label);\n};\n/** A ligne has been clicked in the menu > dispatch event\n * @param {any} f the feature, as passed in the autocomplete\n * @api\n */\nol.control.SearchBAN.prototype.select = function (f){\n  var c = f.geometry.coordinates;\n  // Add coordinate to the event\n  try {\n    c = ol.proj.transform (f.geometry.coordinates, 'EPSG:4326', this.getMap().getView().getProjection());\n  } catch(e) { /* ok */ }\n  this.dispatchEvent({ type:\"select\", search:f, coordinate: c });\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Search on DFCI grid.\n *\n * @constructor\n * @extends {ol.control.Search}\n * @fires select\n * @param {Object=} Control options. \n *\t@param {string} options.className control class name\n *\t@param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *\t@param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *\t@param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *\t@param {number | undefined} options.typing a delay on each typing to start searching (ms), default 300.\n *\t@param {integer | undefined} options.minLength minimum length to start searching, default 1\n *\t@param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *\n *\t@param {string | undefined} options.property a property to display in the index, default 'name'.\n *\t@param {function} options.getTitle a function that takes a feature and return the name to display in the index, default return the property \n *\t@param {function | undefined} options.getSearchString a function that take a feature and return a text to be used as search string, default geTitle() is used as search string\n */\nol.control.SearchDFCI = function(options) {\n  if (!options) options = {};\n  options.className = options.className || 'dfci';\n  options.placeholder = options.placeholder || 'Code DFCI';\n  ol.control.Search.call(this, options);\n};\nol.ext.inherits(ol.control.SearchDFCI, ol.control.Search);\n/** Autocomplete function\n* @param {string} s search string\n* @return {Array<any>|false} an array of search solutions or false if the array is send with the cback argument (asnchronous)\n* @api\n*/\nol.control.SearchDFCI.prototype.autocomplete = function (s) {\n  s = s.toUpperCase();\n  s = s.replace(/[^0-9,^A-H,^K-N]/g,'');\n  if (s.length<2) {\n    this.setInput(s);\n    return [];\n  }\n  var i;\n  var proj = this.getMap().getView().getProjection();\n  var result = [];\n  var c = ol.coordinate.fromDFCI(s, proj);\n  var level = Math.floor(s.length/2)-1;\n  var dfci = ol.coordinate.toDFCI(c, level, proj);\n  dfci = dfci.replace(/[^0-9,^A-H,^K-N]/g,'');\n  // Valid DFCI ?\n  if (!/NaN/.test(dfci) && dfci) {\n    console.log('ok', dfci)\n    this.setInput(dfci + s.substring(dfci.length, s.length));\n    result.push({ coordinate: ol.coordinate.fromDFCI(dfci, proj), name: dfci });\n    if (s.length===5) {\n      c = ol.coordinate.fromDFCI(s+0, proj);\n      dfci = (ol.coordinate.toDFCI(c, level+1, proj)).substring(0,5);\n      for (i=0; i<10; i++) {\n        result.push({ coordinate: ol.coordinate.fromDFCI(dfci+i, proj), name: dfci+i });\n      }\n    }\n    if (level === 2) {\n      for (i=0; i<6; i++) {\n        result.push({ coordinate: ol.coordinate.fromDFCI(dfci+'.'+i, proj), name: dfci+'.'+i });\n      }\n    }\n  }\n  return result;\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Search features.\n *\n * @constructor\n * @extends {ol.control.Search}\n * @fires select\n * @param {Object=} Control options. \n *\t@param {string} options.className control class name\n *\t@param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *\t@param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *\t@param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *\t@param {number | undefined} options.typing a delay on each typing to start searching (ms), default 300.\n *\t@param {integer | undefined} options.minLength minimum length to start searching, default 1\n *\t@param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *\n *\t@param {string | undefined} options.property a property to display in the index, default 'name'.\n *\t@param {function} options.getTitle a function that takes a feature and return the name to display in the index, default return the property \n *\t@param {function | undefined} options.getSearchString a function that take a feature and return a text to be used as search string, default geTitle() is used as search string\n */\nol.control.SearchFeature = function(options) {\n  if (!options) options = {};\n  options.className = options.className || 'feature';\n  ol.control.Search.call(this, options);\n  if (typeof(options.getSearchString)==\"function\") this.getSearchString = options.getSearchString;\n  this.set('property', options.property || 'name');\n  this.source_ = options.source;\n};\nol.ext.inherits(ol.control.SearchFeature, ol.control.Search);\n/** No history avaliable on features\n */\nol.control.SearchFeature.prototype.restoreHistory = function () {\n  this.set('history', []);\n};\n/** No history avaliable on features\n */\nol.control.SearchFeature.prototype.saveHistory = function () {\n  localStorage.removeItem(\"ol@search-\"+this._classname);\n}\n/** Returns the text to be displayed in the menu\n*\t@param {ol.Feature} f the feature\n*\t@return {string} the text to be displayed in the index\n*\t@api\n*/\nol.control.SearchFeature.prototype.getTitle = function (f) {\n  return f.get(this.get('property')||'name');\n};\n/** Return the string to search in\n*\t@param {ol.Feature} f the feature\n*\t@return {string} the text to be used as search string\n*\t@api\n*/\nol.control.SearchFeature.prototype.getSearchString = function (f) {\n  return this.getTitle(f);\n};\n/** Get the source\n*\t@return {ol.source.Vector}\n*\t@api\n*/\nol.control.SearchFeature.prototype.getSource = function () {\n  return this.source_;\n}\n/** Get the source\n*\t@param {ol.source.Vector} source\n*\t@api\n*/\nol.control.SearchFeature.prototype.setSource = function (source) {\n  this.source_ =  source;\n};\n/** Autocomplete function\n* @param {string} s search string\n* @param {int} max max \n* @param {function} cback a callback function that takes an array to display in the autocomplete field (for asynchronous search)\n* @return {Array<any>|false} an array of search solutions or false if the array is send with the cback argument (asnchronous)\n* @api\n*/\nol.control.SearchFeature.prototype.autocomplete = function (s) {\n  var result = [];\n  if (this.source_) {\n    // regexp\n    s = s.replace(/^\\*/,'');\n    var rex = new RegExp(s, 'i');\n    // The source\n    var features = this.source_.getFeatures();\n    var max = this.get('maxItems')\n    for (var i=0, f; f=features[i]; i++) {\n      var att = this.getSearchString(f);\n      if (att !== undefined && rex.test(att)) {\n        result.push(f);\n        if ((--max)<=0) break;\n      }\n    }\n  }\n  return result;\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Search on GPS coordinate.\n *\n * @constructor\n * @extends {ol.control.Search}\n * @fires select\n * @param {Object=} Control options. \n *  @param {string} options.className control class name\n *  @param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *  @param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *  @param {number | undefined} options.typing a delay on each typing to start searching (ms), default 300.\n *  @param {integer | undefined} options.minLength minimum length to start searching, default 1\n *  @param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n */\nol.control.SearchGPS = function(options) {\n  if (!options) options = {};\n  options.className = (options.className || '') + ' ol-searchgps';\n  options.placeholder = options.placeholder || 'lon,lat';\n  ol.control.Search.call(this, options);\n  // Geolocation\n  this.geolocation = new ol.Geolocation({\n    projection: \"EPSG:4326\",\n    trackingOptions: {\n      maximumAge: 10000,\n      enableHighAccuracy: true,\n      timeout: 600000\n    }\n  });\n  ol.ext.element.create ('BUTTON', {\n    className: 'ol-geoloc',\n    title: 'Locate with GPS',\n    parent: this.element,\n    click: function(){\n      this.geolocation.setTracking(true);\n    }.bind(this)\n  })\n  // DMS switcher\n  var dms = ol.ext.element.create('LABEL', {\n    className: 'ol-switch',\n    parent: this.element\n  });\n  ol.ext.element.create('TEXT', {\n    html: 'decimal',\n    parent: dms\n  });\n  ol.ext.element.create('INPUT', {\n    type: 'checkbox',\n    parent: dms,\n    on: {\n      'change': function(e) {\n        if (e.target.checked) this.element.classList.add('ol-dms');\n        else this.element.classList.remove('ol-dms');\n      }.bind(this)\n    }\n  });\n  ol.ext.element.create ('SPAN', {\n    parent: dms\n  });\n  ol.ext.element.create('TEXT', {\n    html: 'DMS',\n    parent: dms\n  });\n  this._createForm();\n  // Move list to the end\n  var ul = this.element.querySelector(\"ul.autocomplete\");\n  this.element.appendChild(ul);\n};\nol.ext.inherits(ol.control.SearchGPS, ol.control.Search);\n/** Create input form\n * @private\n */\nol.control.SearchGPS.prototype._createForm = function () {\n  // Value has change\n  var onchange = function(e) {\n    if (e.target.classList.contains('ol-dms')) {\n      lon.value = (lond.value<0 ? -1:1) * Number(lond.value) + Number(lonm.value)/60 + Number(lons.value)/3600;\n      lon.value = (lond.value<0 ? -1:1) * Math.round(lon.value*10000000)/10000000;\n      lat.value = (latd.value<0 ? -1:1) * Number(latd.value) + Number(latm.value)/60 + Number(lats.value)/3600;\n      lat.value = (latd.value<0 ? -1:1) * Math.round(lat.value*10000000)/10000000;\n    }\n    if (lon.value||lat.value) {\n      this._input.value = lon.value+','+lat.value;\n    } else {\n      this._input.value = '';\n    }\n    if (!e.target.classList.contains('ol-dms')) {\n      var s = ol.coordinate.toStringHDMS([Number(lon.value), Number(lat.value)]);\n      var c = s.replace(/(N|S|E|W)/g,'').split('″');\n      c[1] = c[1].trim().split(' ');\n      lond.value = (/W/.test(s) ? -1 : 1) * parseInt(c[1][0]);\n      lonm.value = parseInt(c[1][1]);\n      lons.value = parseInt(c[1][2]);\n      c[0] = c[0].trim().split(' ');\n      latd.value = (/W/.test(s) ? -1 : 1) * parseInt(c[0][0]);\n      latm.value = parseInt(c[0][1]);\n      lats.value = parseInt(c[0][2]);\n    }\n    this.search();\n  }.bind(this);\n  function createInput(className, unit) {\n    var input = ol.ext.element.create('INPUT', {\n      className: className,\n      type:'number',\n      step:'any',\n      lang: 'en',\n      parent: div,\n      on: {\n        'change keyup': onchange\n      }\n    });\n    if (unit) {\n      ol.ext.element.create('SPAN', {\n        className: 'ol-dms',\n        html: unit,\n        parent: div,\n      });\n    }\n    return input;\n  }\n  // Longitude\n  var div = ol.ext.element.create('DIV', {\n    className: 'ol-longitude',\n    parent: this.element\n  });\n  ol.ext.element.create('LABEL', {\n    html: 'Longitude',\n    parent: div\n  });\n  var lon = createInput('ol-decimal');\n  var lond = createInput('ol-dms','°');\n  var lonm = createInput('ol-dms','\\'');\n  var lons = createInput('ol-dms','\"');\n  // Latitude\n  div = ol.ext.element.create('DIV', {\n    className: 'ol-latitude',\n    parent: this.element\n  })\n  ol.ext.element.create('LABEL', {\n    html: 'Latitude',\n    parent: div\n  });\n  var lat = createInput('ol-decimal');\n  var latd = createInput('ol-dms','°');\n  var latm = createInput('ol-dms','\\'');\n  var lats = createInput('ol-dms','\"');\n  // Focus\n  this.button.addEventListener(\"click\", function() {\n    lon.focus();\n  });\n  // Change value on click\n  this.on('select', function(e){\n    lon.value = e.search.gps[0];\n    lat.value = e.search.gps[1];\n  }.bind(this));\n  // Change value on geolocation\n  this.geolocation.on('change', function(){\n    this.geolocation.setTracking(false);\n    var coord = this.geolocation.getPosition();\n    lon.value = coord[0];\n    lat.value = coord[1];\n    this._triggerCustomEvent('keyup', lon);\n  }.bind(this));\n};\n/** Autocomplete function\n* @param {string} s search string\n* @return {Array<any>|false} an array of search solutions\n* @api\n*/\nol.control.SearchGPS.prototype.autocomplete = function (s) {\n  var result = [];\n  var c = s.split(',');\n  c[0] = Number(c[0]);\n  c[1] = Number(c[1]);\n  // Name\n  s = ol.coordinate.toStringHDMS(c)\n  if (s) s= s.replace(/(°|′|″) /g,'$1');\n  // \n  var coord = ol.proj.transform ([c[0], c[1]], 'EPSG:4326', this.getMap().getView().getProjection());\n  result.push({ gps: c, coordinate: coord, name: s });\n  return result;\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Search places using the French National Base Address (BAN) API.\n *\n * @constructor\n * @extends {ol.control.SearchJSON}\n * @fires select\n * @param {any} options extend ol.control.SearchJSON options\n *\t@param {string} options.className control class name\n *\t@param {boolean | undefined} options.apiKey the service api key.\n *\t@param {string | undefined} options.authentication: basic authentication for the service API as btoa(\"login:pwd\")\n *\t@param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *\t@param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *\t@param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *\t@param {number | undefined} options.typing a delay on each typing to start searching (ms), default 500.\n *\t@param {integer | undefined} options.minLength minimum length to start searching, default 3\n *\t@param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *\n *\t@param {Number} options.pageSize item per page for parcelle list paging, use -1 for no paging, default 5\n * @see {@link https://geoservices.ign.fr/documentation/geoservices/geocodage.html}\n */\nol.control.SearchGeoportailParcelle = function(options) {\n  var self = this;\n  options.type = \"Commune\";\n  options.className = (options.className ? options.className:\"\")+\" IGNF-parcelle ol-collapsed-list ol-collapsed-num\";\n  options.inputLabel = \"Commune\";\n  options.noCollapse = true;\n  options.placeholder = options.placeholder || \"Choisissez une commune...\";\n  ol.control.SearchGeoportail.call(this, options);\n  this.set('copy', null);\n  var element = this.element;\n  // Add parcel form\n  var div = document.createElement(\"DIV\");\n  element.appendChild(div);\n  var label = document.createElement(\"LABEL\");\n  label.innerText = 'Préfixe'\n  div.appendChild(label);\n  label = document.createElement(\"LABEL\");\n  label.innerText = 'Section'\n  div.appendChild(label);\n  label = document.createElement(\"LABEL\");\n  label.innerText = 'Numéro'\n  div.appendChild(label);\n  div.appendChild(document.createElement(\"BR\"));\n  // Input\n  this._inputParcelle = {\n    prefix: document.createElement(\"INPUT\"),\n    section: document.createElement(\"INPUT\"),\n    numero: document.createElement(\"INPUT\")\n  };\n  this._inputParcelle.prefix.setAttribute('maxlength',3);\n  this._inputParcelle.section.setAttribute('maxlength',2);\n  this._inputParcelle.numero.setAttribute('maxlength',4);\n  // Delay search\n  var tout;\n  var doSearch = function() {\n    if (tout) clearTimeout(tout);\n    tout = setTimeout(function() {\n        self.autocompleteParcelle();\n    }, options.typing || 0);\n  }\n  // Add inputs\n  for (var i in this._inputParcelle) {\n    div.appendChild(this._inputParcelle[i]);\n    this._inputParcelle[i].addEventListener(\"keyup\", doSearch);\n    this._inputParcelle[i].addEventListener('blur', function() {\n      tout = setTimeout(function(){ element.classList.add('ol-collapsed-num'); }, 200);\n    });\n    this._inputParcelle[i].addEventListener('focus', function() {\n      clearTimeout(tout);\n      element.classList.remove('ol-collapsed-num');\n    });\n  }\n  this.activateParcelle(false);\n  // Autocomplete list\n  var auto = document.createElement('DIV');\n  auto.className = 'autocomplete-parcelle';\n  element.appendChild(auto);\n  var ul = document.createElement('UL');\n  ul.classList.add('autocomplete-parcelle');\n  auto.appendChild(ul);\n  ul = document.createElement('UL');\n  ul.classList.add('autocomplete-page');\n  auto.appendChild(ul);\n  // Show/hide list on fcus/blur\t\n  this._input.addEventListener('blur', function() {\n    setTimeout(function(){ element.classList.add('ol-collapsed-list') }, 200);\n  });\n  this._input.addEventListener('focus', function() {\n    element.classList.remove('ol-collapsed-list');\n    self._listParcelle([]);\n    if (self._commune) {\n      self._commune = null;\n      self._input.value = '';\n      self.drawList_();\n    }\n    self.activateParcelle(false);\n  });\n  this.on('select', this.selectCommune.bind(this));\n  this.set('pageSize', options.pageSize || 5);\n};\nol.ext.inherits(ol.control.SearchGeoportailParcelle, ol.control.SearchGeoportail);\n/** Select a commune => start searching parcelle  \n * @param {any} e \n * @private\n */\nol.control.SearchGeoportailParcelle.prototype.selectCommune = function(e) {\n  this._commune = e.search.insee;\n  this._input.value = e.search.insee + ' - ' + e.search.fulltext;\n  this.activateParcelle(true);\n  this._inputParcelle.numero.focus();\n  this.autocompleteParcelle();\n};\n/** Set the input parcelle\n * @param {*} p parcel\n * \t@param {string} p.Commune\n * \t@param {string} p.CommuneAbsorbee\n * \t@param {string} p.Section\n * \t@param {string} p.Numero\n * @param {boolean} search start a search\n */\nol.control.SearchGeoportailParcelle.prototype.setParcelle = function(p, search) {\n  this._inputParcelle.prefix.value = (p.Commune||'') + (p.CommuneAbsorbee||'');\n  this._inputParcelle.section.value = p.Section||'';\n  this._inputParcelle.numero.value = p.Numero||'';\n  if (search) this._triggerCustomEvent(\"keyup\", this._inputParcelle.prefix);\n};\n/** Activate parcelle inputs\n * @param {bolean} b\n */\nol.control.SearchGeoportailParcelle.prototype.activateParcelle = function(b) {\n  for (var i in this._inputParcelle) {\n    this._inputParcelle[i].readOnly = !b;\n  }\n  if (b) {\n    this._inputParcelle.section.parentElement.classList.add('ol-active');\n  } else {\n    this._inputParcelle.section.parentElement.classList.remove('ol-active');\t\t\n  }\n};\n/** Send search request for the parcelle  \n * @private\n */\nol.control.SearchGeoportailParcelle.prototype.autocompleteParcelle = function() {\n  // Add 0 to fit the format\n  function complete (s, n, c) {\n    if (!s) return s;\n    c = c || \"0\";\n    while (s.length < n) s = c+s;\n    return s.replace(/\\*/g,'_');\n  }\n  // The selected commune\n  var commune = this._commune;\n  var prefix = complete (this._inputParcelle.prefix.value, 3);\n  if (prefix === '000') {\n    prefix = '___';\n  }\n  // Get parcelle number\n  var section = complete (this._inputParcelle.section.value, 2);\n  var numero = complete (this._inputParcelle.numero.value, 4, \"0\");\n  var search = commune + (prefix||'___') + (section||\"__\") + (numero ?  numero : section ? \"____\":\"0001\");\n  this.searchParcelle(search, \n    function(jsonResp) {\n      this._listParcelle(jsonResp);\n    }.bind(this),\n    function() {\n      console.log('oops')\n    })\n};\n/** Send search request for a parcelle number\n * @param {string} search search parcelle number\n * @param {function} success callback function called on success\n * @param {function} error callback function called on error\n */\nol.control.SearchGeoportailParcelle.prototype.searchParcelle = function(search, success /*, error */) {\n  // Request\n  var request = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n  +'<XLS xmlns:xls=\"http://www.opengis.net/xls\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns=\"http://www.opengis.net/xls\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"1.2\" xsi:schemaLocation=\"http://www.opengis.net/xls http://schemas.opengis.net/ols/1.2/olsAll.xsd\">'\n    +'<RequestHeader/>'\n    +'<Request requestID=\"1\" version=\"1.2\" methodName=\"LocationUtilityService\">'\n      +'<GeocodeRequest returnFreeForm=\"false\">'\n        +'<Address countryCode=\"CadastralParcel\">'\n        +'<freeFormAddress>'+search+'+</freeFormAddress>'\n        +'</Address>'\n      +'</GeocodeRequest>'\n    +'</Request>'\n  +'</XLS>'\n  // Geocode\n  this.ajax(\n    this.get('url').replace('ols/apis/completion','geoportail/ols'), \n    { xls: request },\n    function(xml) {\n      // XML to JSON\n      var parser = new DOMParser();\n      var xmlDoc = parser.parseFromString(xml,\"text/xml\");\n      var parcelles = xmlDoc.getElementsByTagName('GeocodedAddress');\n      var jsonResp = []\n      for (var i=0, parc; parc= parcelles[i]; i++) {\n        var node = parc.getElementsByTagName('gml:pos')[0] || parc.getElementsByTagName('pos')[0];\n        var p = node.childNodes[0].nodeValue.split(' ');\n        var att = parc.getElementsByTagName('Place');\n        var json = { \n          lon: Number(p[1]), \n          lat: Number(p[0])\n        };\n        for (var k=0, a; a=att[k]; k++) {\n          json[a.attributes.type.value] = a.childNodes[0].nodeValue;\n        }\n        jsonResp.push(json);\n      }\n      success(jsonResp);\n    }, \n    { dataType: 'XML' }\n  );\n};\n/**\n * Draw the autocomplete list\n * @param {*} resp \n * @private\n */\nol.control.SearchGeoportailParcelle.prototype._listParcelle = function(resp) {\n  var self = this;\n  var ul = this.element.querySelector(\"ul.autocomplete-parcelle\");\n  ul.innerHTML='';\n  var page = this.element.querySelector(\"ul.autocomplete-page\");\n  page.innerHTML='';\n  this._listParc = [];\n  // Show page i\n  function showPage(i) {\n    var l = ul.children;\n    var visible = \"ol-list-\"+i;\n    var k;\n    for (k=0; k<l.length; k++) {\n      l[k].style.display = (l[k].className===visible) ? '' : 'none';\n    }\n    l = page.children;\n    for (k=0; k<l.length; k++) {\n      l[k].className = (l[k].innerText==i) ? 'selected' : '';\n    }\n    page.style.display = l.length>1 ? '' : 'none';\n  }\n  // Sort table\n  resp.sort(function(a,b) {\n    var na = a.INSEE+a.CommuneAbsorbee+a.Section+a.Numero;\n    var nb = b.INSEE+b.CommuneAbsorbee+b.Section+b.Numero;\n    return na===nb ? 0 : na<nb ? -1 : 1;\n  });\n  // Show list\n  var n = this.get('pageSize');\n  for (var i=0, r; r = resp[i]; i++) {\n    var li = document.createElement(\"LI\");\n    li.setAttribute(\"data-search\", i);\n    if (n>0) li.classList.add(\"ol-list-\"+Math.floor(i/n));\n    this._listParc.push(r);\n    li.addEventListener(\"click\", function(e) {\n      self._handleParcelle(self._listParc[e.currentTarget.getAttribute(\"data-search\")]);\n    });\n    li.innerHTML = r.INSEE+r.CommuneAbsorbee+r.Section+r.Numero;\n    ul.appendChild(li);\n    //\n    if (n>0 && !(i%n)) {\n      li = document.createElement(\"LI\");\n      li.innerText = Math.floor(i/n);\n      li.addEventListener(\"click\", function(e) {\n        showPage(e.currentTarget.innerText);\n      });\n      page.appendChild(li);\n    }\n  }\n  if (n>0) showPage(0);\n};\n/**\n * Handle parcelle section\n * @param {*} parc \n * @private\n */\nol.control.SearchGeoportailParcelle.prototype._handleParcelle = function(parc) {\n  this.dispatchEvent({ \n    type:\"parcelle\", \n    search: parc, \n    coordinate: ol.proj.fromLonLat([parc.lon, parc.lat], this.getMap().getView().getProjection())\n  });\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Search places using the Nominatim geocoder from the OpenStreetmap project.\n *\n * @constructor\n * @extends {ol.control.Search}\n * @fires select\n * @param {Object=} Control options.\n *  @param {string} options.className control class name\n *  @param {boolean | undefined} options.polygon To get output geometry of results (in geojson format), default false.\n *  @param {Array<Number> | undefined} options.viewbox The preferred area to find search results. Any two corner points of the box are accepted in any order as long as they span a real box, default none.\n *  @param {boolean | undefined} options.bounded Restrict the results to only items contained with the bounding box. Restricting the results to the bounding box also enables searching by amenity only. default false\n *  @param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *  @param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *  @param {number | undefined} options.typing a delay on each typing to start searching (ms), default 500.\n *  @param {integer | undefined} options.minLength minimum length to start searching, default 3\n *  @param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *\n *  @param {string|undefined} options.url URL to Nominatim API, default \"https://nominatim.openstreetmap.org/search\"\n * @see {@link https://wiki.openstreetmap.org/wiki/Nominatim}\n */\nol.control.SearchNominatim = function(options) {\n  options = options || {};\n  options.className = options.className || 'nominatim';\n  options.typing = options.typing || 500;\n  options.url = options.url || 'https://nominatim.openstreetmap.org/search';\n  options.copy = '<a href=\"http://www.openstreetmap.org/copyright\" target=\"new\">&copy; OpenStreetMap contributors</a>';\n  ol.control.SearchJSON.call(this, options);\n  this.set('polygon', options.polygon);\n  this.set('viewbox', options.viewbox);\n  this.set('bounded', options.bounded);\n};\nol.ext.inherits(ol.control.SearchNominatim, ol.control.SearchJSON);\n/** Returns the text to be displayed in the menu\n *\t@param {ol.Feature} f the feature\n*\t@return {string} the text to be displayed in the index\n*\t@api\n*/\nol.control.SearchNominatim.prototype.getTitle = function (f) {\n  var info = [];\n  if (f.class) info.push(f.class);\n  if (f.type) info.push(f.type);\n  var title = f.display_name+(info.length ? \"<i>\"+info.join(' - ')+\"</i>\" : '');\n  if (f.icon) title = \"<img src='\"+f.icon+\"' />\" + title;\n  return (title);\n};\n/** \n * @param {string} s the search string\n * @return {Object} request data (as key:value)\n * @api\n */\nol.control.SearchNominatim.prototype.requestData = function (s) {\n  var data = { \n    format: \"json\", \n    addressdetails: 1, \n    q: s, \n    polygon_geojson: this.get('polygon') ? 1:0,\n    bounded: this.get('bounded') ? 1:0,\n    limit: this.get('maxItems')\n  };\n  if (this.get('viewbox')) data.viewbox = this.get('viewbox');\n  return data;\n};\n/** A ligne has been clicked in the menu > dispatch event\n *\t@param {any} f the feature, as passed in the autocomplete\n*\t@api\n*/\nol.control.SearchNominatim.prototype.select = function (f){\n  var c = [Number(f.lon), Number(f.lat)];\n  // Add coordinate to the event\n  try {\n    c = ol.proj.transform (c, 'EPSG:4326', this.getMap().getView().getProjection());\n  } catch(e) { /* ok */}\n  this.dispatchEvent({ type:\"select\", search:f, coordinate: c });\n};\n/**\n * Handle server response to pass the features array to the display list\n * @param {any} response server response\n * @return {Array<any>} an array of feature\n * @api\n */\nol.control.SearchJSON.prototype.handleResponse = function (response) {\n  return response.results || response;\n};\n/** Reverse geocode\n * @param {ol.coordinate} coord\n * @api\n */\nol.control.SearchNominatim.prototype.reverseGeocode = function (coord, cback) {\n  var lonlat = ol.proj.transform (coord, this.getMap().getView().getProjection(), 'EPSG:4326');\n  this.ajax(\n    this.get('url').replace('search', 'reverse'),\n    { lon: lonlat[0], lat: lonlat[1], format: 'json' },\n    function(resp) {\n      if (cback) {\n        cback.call(this, [resp]);\n      } else {\n        this._handleSelect(resp, true);\n        //this.setInput('', true);\n      }\n    }.bind(this)\n  );\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Search places using the MediaWiki API.\n * @see https://www.mediawiki.org/wiki/API:Main_page\n *\n * @constructor\n * @extends {ol.control.SearchJSON}\n * @fires select\n * @param {Object=} Control options.\n *  @param {string} options.className control class name\n *  @param {Element | string | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {string | undefined} options.label Text label to use for the search button, default \"search\"\n *  @param {string | undefined} options.placeholder placeholder, default \"Search...\"\n *  @param {number | undefined} options.typing a delay on each typing to start searching (ms), default 1000.\n *  @param {integer | undefined} options.minLength minimum length to start searching, default 3\n *  @param {integer | undefined} options.maxItems maximum number of items to display in the autocomplete list, default 10\n *  @param {function | undefined} options.handleResponse Handle server response to pass the features array to the list\n * \n *  @param {string|undefined} options.lang API language, default none\n */\nol.control.SearchWikipedia = function(options){\n  options = options || {};\n  options.lang = options.lang||'en';\n  options.className = options.className || 'ol-search-wikipedia';\n  options.url = 'https://'+options.lang+'.wikipedia.org/w/api.php';\n  options.placeholder = options.placeholder || 'search string, File:filename';\n  options.copy = '<a href=\"https://'+options.lang+'.wikipedia.org/\" target=\"new\">Wikipedia&reg; - CC-By-SA</a>';\n  ol.control.SearchJSON.call(this, options);\n  this.set('lang', options.lang);\n};\nol.ext.inherits(ol.control.SearchWikipedia, ol.control.SearchJSON);\n/** Returns the text to be displayed in the menu\n*\t@param {ol.Feature} f the feature\n*\t@return {string} the text to be displayed in the index\n*\t@api\n*/\nol.control.SearchWikipedia.prototype.getTitle = function (f){\n  return ol.ext.element.create('DIV', {\n    html: f.title,\n    title: f.desc\n  });\n  //return f.desc;\n};\n/** Set the current language\n * @param {string} lang the current language as ISO string (en, fr, de, es, it, ja, ...)\n */\nol.control.SearchWikipedia.prototype.setLang = function (lang){\n  this.set('lang', lang)\n  this.set('url', 'https://'+lang+'.wikipedia.org/w/api.php');\n};\n/** \n * @param {string} s the search string\n * @return {Object} request data (as key:value)\n * @api\n */\nol.control.SearchWikipedia.prototype.requestData = function (s) {\n  var data = {\n    action: 'opensearch',\n    search: s,\n    lang: this.get('lang'),\n    format: 'json',\n    origin: '*',\n    limit: this.get('maxItems')\n  }\n  return data;\n};\n/**\n * Handle server response to pass the features array to the list\n * @param {any} response server response\n * @return {Array<any>} an array of feature\n */\nol.control.SearchWikipedia.prototype.handleResponse = function (response) {\n  var features = [];\n  for (var i=0; i<response[1].length; i++) {\n    features.push({\n      title: response[1][i],\n      desc: response[2][i],\n      uri: response[3][i]\n    })\n  }\n  return features;\n};\n/** A ligne has been clicked in the menu query for more info and disatch event\n*\t@param {any} f the feature, as passed in the autocomplete\n*\t@api\n*/\nol.control.SearchWikipedia.prototype.select = function (f){\n  var title = decodeURIComponent(f.uri.split('/').pop()).replace(/'/,'%27');\n  // Search for coords\n  ol.ext.Ajax.get({\n    url: f.uri.split('wiki/')[0]+'w/api.php',\n    data: {\n      action: 'query',\n      prop: 'pageimages|coordinates|extracts',\n      exintro: 1,\n      explaintext: 1,\n      piprop: 'original',\n      origin: '*',\n      format: 'json',\n      redirects: 1,\n      titles: title\n    },\n    options: {\n      encode: false\n    },\n    success: function (e) {\n      var page = e.query.pages[Object.keys(e.query.pages).pop()];\n      console.log(page);\n      var feature = {\n        title: f.title,\n        desc: page.extract || f.desc,\n        url: f.uri,\n        img: page.original ? page.original.source : undefined,\n        pageid: page.pageid\n      }\n      var c;\n      if (page.coordinates) {\n        feature.lon = page.coordinates[0].lon;\n        feature.lat = page.coordinates[0].lat;\n        c = [feature.lon, feature.lat];\n        c = ol.proj.transform (c, 'EPSG:4326', this.getMap().getView().getProjection());\n      }\n      this.dispatchEvent({ type:\"select\", search:feature, coordinate: c });\n    }.bind(this)\n  })\n};\n/** */\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Select Control.\n * A control to select features by attributes\n *\n * @constructor\n * @extends {ol.control.SelectBase}\n * @fires select\n * @param {Object=} options\n *  @param {string} options.className control class name\n *  @param {Element | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {ol.source.Vector | Array<ol.source.Vector>} options.source the source to search in\n *  @param {string} [options.selectLabel=select] select button label\n *  @param {string} [options.addLabel=add] add button label\n *  @param {string} [options.caseLabel=case sensitive] case checkbox label\n *  @param {string} [options.allLabel=match all] match all checkbox label\n *  @param {string} [options.attrPlaceHolder=attribute]\n *  @param {string} [options.valuePlaceHolder=value]\n */\nol.control.Select = function(options) {\n  var self = this;\n  if (!options) options = {};\n  // Container\n  var div = options.content = document.createElement(\"div\");\n  // Autocompletion list\n  this._ul = ol.ext.element.create('UL', {\n    parent: div\n  });\n  // All conditions\n  this._all = ol.ext.element.create('INPUT', {\n    type: 'checkbox',\n    checked: true\n  });\n  var label_match_all = ol.ext.element.create('LABEL',{\n    html: this._all,\n    parent: div\n  });\n  ol.ext.element.appendText(label_match_all, options.allLabel || 'match all');\n  // Use case\n  this._useCase = ol.ext.element.create('INPUT', {\n    type: 'checkbox'\n  });\n  var label_case_sensitive = ol.ext.element.create('LABEL',{\n    html: this._useCase,\n    parent: div\n  });\n  ol.ext.element.appendText(label_case_sensitive, options.caseLabel || 'case sensitive');\n  ol.control.SelectBase.call(this, options);\n  // Add button\n  ol.ext.element.create('BUTTON', {\n    className: 'ol-append',\n    html: options.addLabel\t|| 'add rule',\n    click: function(){\n      self.addCondition();\n    },\n    parent: div\n  });\n  this._conditions = [];\n  this.set('attrPlaceHolder', options.attrPlaceHolder || 'attribute');\n  this.set('valuePlaceHolder', options.valuePlaceHolder || 'value');\n  this.addCondition();\n};\nol.ext.inherits(ol.control.Select, ol.control.SelectBase);\n/** Add a new condition\n * @param {*} options\n * \t@param {string} options.attr attribute name\n * \t@param {string} options.op\toperator\n * \t@param {string} options.val attribute value\n */\nol.control.Select.prototype.addCondition = function (options) {\n  options = options || {};\n  this._conditions.push({\n    attr: options.attr || '',\n    op: options.op || '=',\n    val: options.val || ''\n  });\n  this._drawlist();\n};\n/** Get the condition list\n */\nol.control.Select.prototype.getConditions = function () {\n  return {\n    usecase: this._useCase.checked,\n    all: this._all.checked,\n    conditions: this._conditions\n  }\n};\n/** Set the condition list\n */\nol.control.Select.prototype.setConditions = function (cond) {\n  this._useCase.checked = cond.usecase;\n  this._all.checked = cond.all;\n  this._conditions = cond.conditions;\n  this._drawlist();\n};\n/** Get the conditions as string\n */\nol.control.Select.prototype.getConditionsString = function (cond) {\n  var st = '';\n  for (var i=0,c; c=cond.conditions[i]; i++) {\n    if (c.attr) {\n      st += (st ? (cond.all ? ' AND ' : ' OR ') : '')\n        + c.attr\n        + this.operationsList[c.op]\n        + c.val;\n    }\n  }\n  return st\n};\n/** Draw the liste\n * @private\n */\nol.control.Select.prototype._drawlist = function () {\n  this._ul.innerHTML = '';\n  for (var i=0; i < this._conditions.length; i++) {\n    this._ul.appendChild(this._getLiCondition(i));\n  }\n};\n/** Get a line\n * @return {*}\n * @private\n */\nol.control.Select.prototype._autocomplete = function (val, ul) {\n  ul.classList.remove('ol-hidden');\n  ul.innerHTML = '';\n  var attributes = {};\n  var sources = this.get('source');\n  for (var i=0, s; s=sources[i]; i++) {\n    var features = s.getFeatures();\n    for (var j=0, f; f=features[j]; j++) {\n      Object.assign(attributes, f.getProperties());\n      if (j>100) break;\n    }\n  }\n  var rex = new RegExp(val, 'i');\n  for (var a in attributes) {\n    if (a==='geometry') continue;\n    if (rex.test(a)) {\n      var li = document.createElement('li');\n      li.textContent = a;\n      li.addEventListener(\"click\", function() {\n        ul.previousElementSibling.value = this.textContent;\n        var event = document.createEvent('HTMLEvents');\n        event.initEvent('change', true, false);\n        ul.previousElementSibling.dispatchEvent(event);\n        ul.classList.add('ol-hidden');\n      });\n      ul.appendChild(li);\n    }\n  }\n};\n/** Get a line\n * @return {*}\n * @private\n */\nol.control.Select.prototype._getLiCondition = function (i) {\n  var self = this;\n  var li = document.createElement('li');\n  // Attribut\n  var autocomplete = document.createElement('div');\n      autocomplete.classList.add('ol-autocomplete');\n      autocomplete.addEventListener(\"mouseleave\", function() {\n        this.querySelector('ul'). classList.add('ol-hidden');\n      });\n      li.appendChild(autocomplete);\n  var input_attr = document.createElement('input');\n      input_attr.classList.add('ol-attr');\n      input_attr.setAttribute('type', 'search');\n      input_attr.setAttribute('placeholder', this.get('attrPlaceHolder'));\n      input_attr.addEventListener('keyup', function () {\n        self._autocomplete( this.value, this.nextElementSibling );\n      })\n      input_attr.addEventListener('focusout', function() {\n        setTimeout(function() {\n          autocomplete.querySelector('ul'). classList.add('ol-hidden');\n        }, 300);\n      });\n      input_attr.addEventListener('click', function(){\n        setTimeout(function() {\n          self._autocomplete( this.value, this.nextElementSibling );\n          this.nextElementSibling.classList.remove('ol-hidden');\n        }.bind(this));\n      })\n      input_attr.addEventListener('change', function() {\n        self._conditions[i].attr = this.value;\n      })\n      input_attr.value = self._conditions[i].attr;\n      autocomplete.appendChild(input_attr);\n  // Autocomplete list\n  var ul_autocomplete = document.createElement('ul');\n      ul_autocomplete.classList.add('ol-hidden')\n      autocomplete.appendChild(ul_autocomplete);\n  // Operation\n  var select = document.createElement('select');\n  li.appendChild(select);\n  for (var k in this.operationsList) {\n    var option = document.createElement('option');\n        option.value = k;\n        option.textContent = this.operationsList[k];\n        select.appendChild(option);\n  }\n  select.value = self._conditions[i].op;\n  select.addEventListener('change', function() {\n    self._conditions[i].op = this.value;\n  });\n  // Value\n  var input_value = document.createElement('input');\n  input_value.setAttribute('type', 'text');\n      input_value.setAttribute('placeholder', this.get('valuePlaceHolder'));\n    input_value.addEventListener('change', function() {\n      self._conditions[i].val = this.value;\n    })\n    input_value.value = self._conditions[i].val;\n    li.appendChild(input_value);\n  if (this._conditions.length > 1) {\n    var div_delete = document.createElement('div');\n    div_delete.classList.add('ol-delete');\n      div_delete.addEventListener(\"click\", function(){ self.removeCondition(i); })\n      li.appendChild(div_delete);\n  }\n  //\n  return li;\n};\n/** Remove the ith condition\n * @param {int} i condition index\n */\nol.control.Select.prototype.removeCondition = function (i) {\n  this._conditions.splice(i,1);\n  this._drawlist();\n};\n/** Select features by attributes\n * @param {*} options\n *  @param {Array<ol.source.Vector>|undefined} options.sources source to apply rules, default the select sources\n *  @param {bool} options.useCase case sensitive, default checkbox state\n *  @param {bool} options.matchAll match all conditions, , default checkbox state\n *  @param {Array<conditions>} options.conditions array of conditions\n * @fires select\n */\nol.control.Select.prototype.doSelect = function (options) {\n  options = options || {};\n  options.useCase = options.useCase || this._useCase.checked;\n  options.matchAll = options.matchAll || this._all.checked;\n  options.conditions = options.conditions || this._conditions\n  return ol.control.SelectBase.prototype.doSelect.call(this, options);\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Select features by property using a popup \n *\n * @constructor\n * @extends {ol.control.SelectBase}\n * @fires select\n * @param {Object=} options\n *  @param {string} options.className control class name\n *  @param {Element | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {ol/source/Vector | Array<ol/source/Vector>} options.source the source to search in\n *  @param {string} options.property property to select on\n *  @param {string} options.label control label\n *  @param {number} options.max max feature to test to get the values, default 10000\n *  @param {number} options.selectAll select all features if no option selected\n *  @param {string} options.type check type: checkbox or radio, default checkbox\n *  @param {number} options.defaultLabel label for the default radio button\n *  @param {function|undefined} options.onchoice function triggered when an option is clicked, default doSelect\n */\nol.control.SelectCheck = function(options) {\n  if (!options) options = {};\n  // Container\n  var div = options.content = ol.ext.element.create('DIV');\n  if (options.label) {\n    ol.ext.element.create('LABEL', {\n      html: options.label,\n      parent: div\n    });\n  }\n  // Input div\n  this._input = ol.ext.element.create('DIV', {\n    parent: div\n  });\n  options.className = options.className || 'ol-select-check';\n  ol.control.SelectBase.call(this, options);\n  this.set('property', options.property || 'name');\n  this.set('max', options.max || 10000);\n  this.set('defaultLabel', options.defaultLabel);\n  this.set('type', options.type);\n  this._selectAll = options.selectAll;\n  this._onchoice = options.onchoice;\n  // Set select options\n  this.setValues();\n};\nol.ext.inherits(ol.control.SelectCheck, ol.control.SelectBase);\n/**\n* Set the map instance the control associated with.\n* @param {o.Map} map The map instance.\n*/\nol.control.SelectCheck.prototype.setMap = function(map) {\n  ol.control.SelectBase.prototype.setMap.call(this, map);\n  this.setValues();\n};\n/** Select features by attributes\n */\nol.control.SelectCheck.prototype.doSelect = function(options) {\n  options = options || {};\n  var conditions = [];\n  this._checks.forEach(function(c) {\n    if (c.checked) {\n      if (c.value) {\n        conditions.push({\n          attr: this.get('property'),\n          op: '=',\n          val: c.value\n        });\n      }\n    }\n  }.bind(this));\n  if (!conditions.length) {\n    return ol.control.SelectBase.prototype.doSelect.call(this, { \n      features: options.features, \n      matchAll: this._selectAll \n    });\n  } else {\n    return ol.control.SelectBase.prototype.doSelect.call(this, {\n      features: options.features, \n      conditions: conditions\n    })\n  }\n};\n/** Set the popup values\n * @param {Object} options\n *  @param {Object} options.values a key/value list with key = property value, value = title shown in the popup, default search values in the sources\n *  @param {boolean} options.sort sort values\n */\nol.control.SelectCheck.prototype.setValues = function(options) {\n  options = options || {};\n  console.log(options)\n  var values, vals;\n  if (options.values) {\n    if (options.values instanceof Array) {\n      vals = {};\n      options.values.forEach(function(v) { vals[v] = v; });\n    } else {\n      vals = options.values;\n    }\n  } else {\n    vals = {};\n    var prop = this.get('property');\n    this.getSources().forEach(function(s){\n      var features = s.getFeatures();\n      var max = Math.min(features.length, this.get('max'))\n      for (var i=0; i<max; i++) {\n        var p = features[i].get(prop);\n        if (p) vals[p] = p;\n      }\n    }.bind(this));\n  }\n  if (!Object.keys(vals).length) return;\n  if (options.sort) {\n    values = {};\n    Object.keys(vals).sort().forEach(function(key) {\n      values[key] = vals[key];\n    });\n  } else {\n    values = vals;\n  }\n  ol.ext.element.setHTML(this._input, '');\n  this._checks = [];\n  var id = 'radio_'+(new Date().getTime());\n  var addCheck = function(val, info) {\n    var label = ol.ext.element.create('LABEL', {\n      className: (this.get('type')==='radio' ? 'ol-radio' : 'ol-checkbox'),\n      parent: this._input\n    });\n    this._checks.push( ol.ext.element.create('INPUT', {\n      name: id,\n      type: (this.get('type')==='radio' ? 'radio' : 'checkbox'),\n      value: val,\n      change: function () { \n        if (this._onchoice) this._onchoice()\n        else this.doSelect();\n      }.bind(this),\n      parent: label\n    }));\n    ol.ext.element.create('DIV', {\n      html: info,\n      parent: label\n    });\n  }.bind(this);\n  if (this.get('defaultLabel') && this.get('type')==='radio') addCheck('', this.get('defaultLabel'));\n  for (var k in values) addCheck(k, values[k]);\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Select features by property using a condition \n *\n * @constructor\n * @extends {ol.control.SelectBase}\n * @fires select\n * @param {Object=} options\n *  @param {string} options.className control class name\n *  @param {Element | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {ol/source/Vector | Array<ol/source/Vector>} options.source the source to search in\n *  @param {string} options.label control label, default 'condition'\n *  @param {number} options.selectAll select all features if no option selected\n *  @param {condition|Array<condition>} options.condition conditions \n *  @param {function|undefined} options.onchoice function triggered when an option is clicked, default doSelect\n */\nol.control.SelectCondition = function(options) {\n  if (!options) options = {};\n  // Container\n  var div = options.content = ol.ext.element.create('DIV');\n  var label = ol.ext.element.create('LABEL', {\n    parent: div\n  });\n  this._check = ol.ext.element.create('INPUT', {\n    type: 'checkbox',\n    change: function () { \n      if (this._onchoice) this._onchoice()\n      else this.doSelect();\n    }.bind(this),\n    parent: label\n  });\n  ol.ext.element.create('DIV', {\n    html: options.label || 'condition',\n    parent: label\n  });\n  // Input div\n  this._input = ol.ext.element.create('DIV', {\n    parent: div\n  });\n  options.className = options.className || 'ol-select-condition';\n  ol.control.SelectBase.call(this, options);\n  this.setCondition(options.condition);\n  this._selectAll = options.selectAll;\n  this._onchoice = options.onchoice;\n};\nol.ext.inherits(ol.control.SelectCondition, ol.control.SelectBase);\n/** Set condition to select on\n * @param {condition | Array<condition>} condition\n *  @param {string} attr property to select on\n *  @param {string} op operator (=, !=, <; <=, >, >=, contain, !contain, regecp)\n *  @param {*} val value to select on\n */\nol.control.SelectCondition.prototype.setCondition = function(condition) {\n  if (!condition) this._conditions = [];\n  else this._conditions = (condition instanceof Array ?  condition : [condition]);\n};\n/** Add a condition to select on\n * @param {condition} condition\n *  @param {string} attr property to select on\n *  @param {string} op operator (=, !=, <; <=, >, >=, contain, !contain, regecp)\n *  @param {*} val value to select on\n */\nol.control.SelectCondition.prototype.addCondition = function(condition) {\n  this._conditions.push(condition);\n};\n/** Select features by condition\n */\nol.control.SelectCondition.prototype.doSelect = function(options) {\n  options = options || {};\n  var conditions = this._conditions;\n  if (!this._check.checked) {\n    return ol.control.SelectBase.prototype.doSelect.call(this, { features: options.features, matchAll: this._selectAll });\n  } else {\n    return ol.control.SelectBase.prototype.doSelect.call(this, {\n      features: options.features,\n      conditions: conditions\n    })\n  }\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Select features by property using a simple text input\n *\n * @constructor\n * @extends {ol.control.SelectBase}\n * @fires select\n * @param {Object=} options\n *  @param {string} options.className control class name\n *  @param {Element | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {ol/source/Vector | Array<ol/source/Vector>} options.source the source to search in\n *  @param {string} options.property property to select on\n *  @param {function|undefined} options.onchoice function triggered the text change, default nothing\n */\nol.control.SelectFulltext = function(options) {\n  if (!options) options = {};\n  // Container\n  var div = options.content =ol.ext.element.create('DIV');\n  if (options.label) {\n    ol.ext.element.create('LABEL', {\n      html: options.label,\n      parent: div\n    });\n  }\n  this._input = ol.ext.element.create('INPUT', {\n    placeHolder: options.placeHolder || 'search...',\n    change: function() {\n      if (this._onchoice) this._onchoice();\n    }.bind(this),\n    parent: div\n  });\n  ol.control.SelectBase.call(this, options);\n  this._onchoice = options.onchoice;\n  this.set('property', options.property || 'name');\n};\nol.ext.inherits(ol.control.SelectFulltext, ol.control.SelectBase);\n/** Select features by condition\n */\nol.control.SelectFulltext.prototype.doSelect= function(options) {\n  options = options || {};\n  return ol.control.SelectBase.prototype.doSelect.call(this, {\n    features: options.features,\n    useCase: false,\n    conditions: [{\n      attr: this.get('property'),\n      op: 'contain',\n      val: this._input.value\n    }]\n  });\n}\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * A multiselect control. \n * A container that manage other control Select \n *\n * @constructor\n * @extends {ol.control.SelectBase}\n * @fires select\n * @param {Object=} options\n *  @param {string} options.className control class name\n *  @param {Element | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {ol/source/Vector | Array<ol/source/Vector>} options.source the source to search in\n *  @param {Array<ol.control.SelectBase>} options.controls an array of controls\n */\nol.control.SelectMulti = function(options) {\n  if (!options) options = {};\n  // Container\n  options.content = ol.ext.element.create('DIV');\n  this._container = ol.ext.element.create('UL', {\n    parent: options.content\n  });\n  options.className = options.className || 'ol-select-multi';\n  ol.control.SelectBase.call(this, options);\n  this._controls = [];\n  options.controls.forEach(this.addControl.bind(this));\n};\nol.ext.inherits(ol.control.SelectMulti, ol.control.SelectBase);\n/**\n* Set the map instance the control associated with.\n* @param {o.Map} map The map instance.\n*/\nol.control.SelectMulti.prototype.setMap = function(map) {\n  if (this.getMap()) {\n    this._controls.forEach(function(c) {\n      this.getMap().remveControl(c);\n    }.bind(this));\n  }\n  ol.control.SelectBase.prototype.setMap.call(this, map);\n  if (this.getMap()) {\n    this._controls.forEach(function(c) {\n      this.getMap().addControl(c);\n    }.bind(this));\n  }\n};\n/** Add a new control\n * @param {ol.control.SelectBase} c\n */\nol.control.SelectMulti.prototype.addControl = function(c) {\n  if (c instanceof ol.control.SelectBase) {\n    this._controls.push(c);\n    c.setTarget(ol.ext.element.create('LI', {\n      parent: this._container\n    }));\n    c._selectAll = true;\n    c._onchoice = this.doSelect.bind(this);\n    if (this.getMap()) {\n      this.getMap().addControl(c);\n    }\n  }\n};\n/** Get select controls\n * @return {Aray<ol.control.SelectBase>}\n */\nol.control.SelectMulti.prototype.getControls = function() {\n  return this._controls;\n};\n/** Select features by condition\n */\nol.control.SelectMulti.prototype.doSelect = function() {\n  var features = [];\n  this.getSources().forEach(function(s) {\n    features = features.concat(s.getFeatures());\n  });\n  this._controls.forEach(function(c) {\n    features = c.doSelect({ features: features });\n  });\n  this.dispatchEvent({ type:\"select\", features: features });\n  return features;\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Select features by property using a popup \n *\n * @constructor\n * @extends {ol.control.SelectBase}\n * @fires select\n * @param {Object=} options\n *  @param {string} options.className control class name\n *  @param {Element | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport.\n *  @param {ol/source/Vector | Array<ol/source/Vector>} options.source the source to search in\n *  @param {string} options.property property to select on\n *  @param {number} options.max max feature to test to get the values, default 10000\n *  @param {number} options.selectAll select all features if no option selected\n *  @param {string} options.defaultLabel label for the default selection\n *  @param {function|undefined} options.onchoice function triggered when an option is clicked, default doSelect\n */\nol.control.SelectPopup = function(options) {\n  if (!options) options = {};\n  // Container\n  var div = options.content = ol.ext.element.create('DIV');\n  if (options.label) {\n    ol.ext.element.create('LABEL', {\n      html: options.label,\n      parent: div\n    });\n  }\n  this._input = ol.ext.element.create('SELECT', {\n    on: { change: function () { \n      if (this._onchoice) this._onchoice();\n      else this.doSelect();\n    }.bind(this) },\n    parent: div\n  });\n  options.className = options.className || 'ol-select-popup';\n  ol.control.SelectBase.call(this, options);\n  this.set('property', options.property || 'name');\n  this.set('max', options.max || 10000);\n  this.set('defaultLabel', options.defaultLabel);\n  this._selectAll = options.selectAll;\n  this._onchoice = options.onchoice;\n  // Set select options\n  this.setValues();\n};\nol.ext.inherits(ol.control.SelectPopup, ol.control.SelectBase);\n/**\n* Set the map instance the control associated with.\n* @param {o.Map} map The map instance.\n*/\nol.control.SelectPopup.prototype.setMap = function(map) {\n  ol.control.SelectBase.prototype.setMap.call(this, map);\n  this.setValues();\n};\n/** Select features by attributes\n */\nol.control.SelectPopup.prototype.doSelect = function(options) {\n  options = options || {};\n  if (!this._input.value) {\n    return ol.control.SelectBase.prototype.doSelect.call(this, { features: options.features, matchAll: this._selectAll });\n  } else {\n    return ol.control.SelectBase.prototype.doSelect.call(this, {\n      features: options.features, \n      conditions: [{\n        attr: this.get('property'),\n        op: '=',\n        val: this._input.value\n      }]\n    })\n  }\n};\n/** Set the popup values\n * @param {Object} values a key/value list with key = property value, value = title shown in the popup, default search values in the sources\n */\nol.control.SelectPopup.prototype.setValues = function(options) {\n  options = options || {};\n  var values, vals;\n  if (options.values) {\n    if (options.values instanceof Array) {\n      vals = {};\n      options.values.forEach(function(v) { vals[v] = v; });\n    } else {\n      vals = options.values;\n    }\n  } else {\n    vals = {};\n    var prop = this.get('property');\n    this.getSources().forEach(function(s){\n      var features = s.getFeatures();\n      var max = Math.min(features.length, this.get('max'))\n      for (var i=0; i<max; i++) {\n        var p = features[i].get(prop);\n        if (p) vals[p] = p;\n      }\n    }.bind(this));\n  }\n  if (options.sort) {\n    values = {};\n    Object.keys(vals).sort().forEach(function(key) {\n      values[key] = vals[key];\n    });\n  } else {\n    values = vals;\n  }\n  ol.ext.element.setHTML(this._input, '');\n  ol.ext.element.create('OPTION', {\n    className: 'ol-default',\n    html: this.get('defaultLabel') || '',\n    value: '',\n    parent: this._input\n  });\n  for (var k in values) {\n    ol.ext.element.create('OPTION', {\n      html: values[k],\n      value: k,\n      parent: this._input\n    });\n  }\n};\n\n/** A control with scroll-driven navigation to create narrative maps\n *\n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} options Control options.\n *\t@param {String} options.className class of the control\n *  @param {string} options.status status, default none\n *  @param {string} options.position position of the status 'top', 'left', 'bottom' or 'right', default top\n *  @param {boolean} options.visible default true\n */\nol.control.Status = function(options) {\n  options = options || {};\n  // New element\n  var element = ol.ext.element.create('DIV', {\n    className: (options.className || '') + ' ol-status'\n      + (options.target ? '': ' ol-unselectable ol-control')\n  });\n  // Initialize\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  this.setVisible(options.visible!==false);\n  if (options.position) this.setPosition(options.position);\n  this.status(options.status || '');\n};\nol.ext.inherits(ol.control.Status, ol.control.Control);\n/** Set visiblitity \n * @param {boolean} visible\n */\nol.control.Status.prototype.setVisible = function(visible) {\n  if (visible) this.element.classList.add ('ol-visible');\n  else this.element.classList.remove('ol-visible');\n};\n/** Show status on the map\n * @param {string|Element} html status text or DOM element\n */\nol.control.Status.prototype.status = function(html) {\n  var s = html || '';\n  if (s) {\n    ol.ext.element.show(this.element);\n    if (typeof(s)==='object' && !(s instanceof String)) {\n      s = '';\n      for (var i in html) {\n        s += '<label>'+i+':</label> '+html[i]+'<br/>';\n      }\n    }\n    ol.ext.element.setHTML(this.element, s);\n  } else {\n    ol.ext.element.hide(this.element);\n  }\n};\n/** Set status position\n * @param {string} position position of the status 'top', 'left', 'bottom' or 'right', default top\n */\nol.control.Status.prototype.setPosition = function(position) {\n  this.element.classList.remove('ol-left');\n  this.element.classList.remove('ol-right');\n  this.element.classList.remove('ol-bottom');\n  this.element.classList.remove('ol-center');\n  if (/^left$|^right$|^bottom$|^center$/.test(position)) {\n    this.element.classList.add('ol-'+position);\n  }\n};\n/** Show the status\n * @param {boolean} show show or hide the control, default true\n */\nol.control.Status.prototype.show = function(show) {\n  if (show===false) ol.ext.element.hide(this.element);\n  else ol.ext.element.show(this.element);\n};\n/** Hide the status\n */\nol.control.Status.prototype.hide = function() {\n  ol.ext.element.hide(this.element);\n};\n/** Toggle the status\n */\nol.control.Status.prototype.toggle = function() {\n  ol.ext.element.toggle(this.element);\n};\n/** Is status visible\n */\nol.control.Status.prototype.isShown = function() {\n  return this.element.style.display==='none';\n};\n\n/** A control with scroll-driven navigation to create narrative maps\n *\n * @constructor\n * @extends {ol.control.Control}\n * @fires scrollto\n * @fires clickimage\n * @param {Object=} options Control options.\n *\t@param {String} options.className class of the control\n *\t@param {Element | string | undefined} options.html The storymap content\n *\t@param {Element | string | undefined} options.target The target element to place the story. If no html is provided the content of the target will be used.\n */\nol.control.Storymap = function(options) {\n  // Remove or get target content \n  if (options.target) {\n    if (!options.html) {\n      options.html = options.target.innerHTML;\n    } else if (options.html instanceof Element) {\n      options.html = options.html.innerHTML;\n    }\n    options.target.innerHTML = '';\n  }\n  // New element\n  var element = ol.ext.element.create('DIV', {\n    className: (options.className || '') + ' ol-storymap'\n      + (options.target ? '': ' ol-unselectable ol-control')\n      + ('ontouchstart' in window ? ' ol-touch' : ''),\n    html: options.html\n  });\n  element.querySelectorAll('.chapter').forEach(function(c) {\n    c.addEventListener('click', function(e) {\n      // Not moving\n      if (!this.element.classList.contains('ol-move')) {\n        if (!c.classList.contains('ol-select')) {\n          this.element.scrollTop = c.offsetTop - 30;\n          e.preventDefault();\n        } else {\n          if (e.target.tagName==='IMG' && e.target.dataset.title) {\n            this.dispatchEvent({ \n              coordinate: this.getMap() ? this.getMap().getCoordinateFromPixel([e.layerX,e.layerY]) : null,\n              type: 'clickimage', \n              img: e.target, \n              title: e.target.dataset.title, \n              element: c, \n              name: c.getAttribute('name'),\n              originalEvent: e\n            });\n          }\n        }\n      }\n    }.bind(this));\n  }.bind(this));\n  // Initialize\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  // Make a scroll div\n  ol.ext.element.scrollDiv (this.element, {\n    vertical: true,\n    mousewheel: true\n  });\n  // Scroll to the next chapter\n  var sc = this.element.querySelectorAll('.ol-scroll-next');\n  sc.forEach(function(s) {\n    s.addEventListener('click', function(e) { \n      if (s.parentElement.classList.contains('ol-select')) {\n        var chapter = this.element.querySelectorAll('.chapter');\n        var scrollto = s.offsetTop;\n        for (var i=0, c; c=chapter[i]; i++) {\n          if (c.offsetTop > scrollto) {\n            scrollto = c.offsetTop;\n            break;\n          }\n        }\n        this.element.scrollTop = scrollto - 30;\n        e.stopPropagation();\n        e.preventDefault();\n      }\n    }.bind(this));\n  }.bind(this));\n  // Scroll top \n  sc = this.element.querySelectorAll('.ol-scroll-top');\n  sc.forEach(function(i) {\n    i.addEventListener('click', function(e){ \n      this.element.scrollTop = 0;\n      e.stopPropagation();\n      e.preventDefault();\n    }.bind(this));\n  }.bind(this));\n  var getEvent = function(currentDiv) {\n    var lonlat = [ parseFloat(currentDiv.getAttribute('data-lon')),\n      parseFloat(currentDiv.getAttribute('data-lat'))];\n    var coord = ol.proj.fromLonLat(lonlat, this.getMap().getView().getProjection());\n    var zoom = parseFloat(currentDiv.getAttribute('data-zoom'));\n    return { \n      type: 'scrollto', \n      element: currentDiv, \n      name: currentDiv.getAttribute('name'),\n      coordinate: coord,\n      lon: lonlat,\n      zoom: zoom\n    };\n  }.bind(this);\n  // Handle scrolling\n  var currentDiv = this.element.querySelectorAll('.chapter')[0];\n  setTimeout (function (){\n    currentDiv.classList.add('ol-select');\n    this.dispatchEvent(getEvent(currentDiv));\n  }.bind(this));\n  // Trigger change event on scroll\n  this.element.addEventListener('scroll', function() {\n    var current, chapter = this.element.querySelectorAll('.chapter');\n    var height = ol.ext.element.getStyle(this.element, 'height');\n    if (!this.element.scrollTop) {\n      current = chapter[0];\n    } else {\n      for (var i=0, s; s=chapter[i]; i++) {\n        var p = s.offsetTop - this.element.scrollTop;\n        if (p > height/3) break;\n        current = s;\n      }\n    }\n    if (current && current!==currentDiv) {\n      if (currentDiv) currentDiv.classList.remove('ol-select');\n      currentDiv = current;\n      currentDiv.classList.add('ol-select');\n      var e = getEvent(currentDiv);\n      var view = this.getMap().getView();\n      view.cancelAnimations();\n      switch (currentDiv.getAttribute('data-animation')) {\n        case 'flyto': {\n          // Fly to destination\n          var duration = 2000;\n          view.animate ({\n            center: e.coordinate,\n            duration: duration\n          });\n          view.animate ({\n            zoom: Math.min(view.getZoom(), e.zoom)-1,\n            duration: duration/2\n          },{\n            zoom: e.zoom,\n            duration: duration/2\n          });\n          break;\n        }\n        default: break;\n      }\n      this.dispatchEvent(e);\n    }\n  }.bind(this));\n};\nol.ext.inherits(ol.control.Storymap, ol.control.Control);\n/** Scroll to a chapter\n * @param {string} name Name of the chapter to scroll to\n */\nol.control.Storymap.prototype.setChapter = function (name) {\n  var chapter = this.element.querySelectorAll('.chapter');\n  for (var i=0, s; s=chapter[i]; i++) {\n    if (s.getAttribute('name')===name) {\n      this.element.scrollTop = s.offsetTop - 30;\n    }\n  }\n};\n\n/*\n  Copyright (c) 2015 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc Swipe Control.\n *\n * @constructor\n * @extends {ol.control.Control}\n * @param {Object=} Control options.\n *  @param {ol.layer} options.layers layer to swipe\n *  @param {ol.layer} options.rightLayer layer to swipe on right side\n *  @param {string} options.className control class name\n *  @param {number} options.position position propertie of the swipe [0,1], default 0.5\n *  @param {string} options.orientation orientation propertie (vertical|horizontal), default vertical\n */\nol.control.Swipe = function(options) {\n  options = options || {};\n  var button = document.createElement('button');\n  var element = document.createElement('div');\n  element.className = (options.className || \"ol-swipe\") + \" ol-unselectable ol-control\";\n  element.appendChild(button);\n  element.addEventListener(\"mousedown\", this.move.bind(this));\n  element.addEventListener(\"touchstart\", this.move.bind(this));\n  ol.control.Control.call(this, {\n    element: element\n  });\n  // An array of listener on layer postcompose\n  this.precomposeRight_ = this.precomposeRight.bind(this);\n  this.precomposeLeft_ = this.precomposeLeft.bind(this);\n  this.postcompose_ = this.postcompose.bind(this);\n  this.layers = [];\n  if (options.layers) this.addLayer(options.layers, false);\n  if (options.rightLayers) this.addLayer(options.rightLayers, true);\n  this.on('propertychange', function() {\n    if (this.getMap()) this.getMap().renderSync();\n    if (this.get('orientation') === \"horizontal\") {\n      this.element.style.top = this.get('position')*100+\"%\";\n      this.element.style.left = \"\";\n    } else {\n      if (this.get('orientation') !== \"vertical\") this.set('orientation', \"vertical\");\n      this.element.style.left = this.get('position')*100+\"%\";\n      this.element.style.top = \"\";\n    }\n    this.element.classList.remove(\"horizontal\", \"vertical\");\n    this.element.classList.add(this.get('orientation'));\n  }.bind(this));\n  this.set('position', options.position || 0.5);\n  this.set('orientation', options.orientation || 'vertical');\n};\nol.ext.inherits(ol.control.Swipe, ol.control.Control);\n/**\n * Set the map instance the control associated with.\n * @param {_ol_Map_} map The map instance.\n */\nol.control.Swipe.prototype.setMap = function(map) {\n  var i;\n  var l;\n  if (this.getMap()) {\n    for (i=0; i<this.layers.length; i++) {\n      l = this.layers[i];\n      if (l.right) l.layer.un(['precompose','prerender'], this.precomposeRight_);\n      else l.layer.un(['precompose','prerender'], this.precomposeLeft_);\n      l.layer.un(['postcompose','postrender'], this.postcompose_);\n    }\n    this.getMap().renderSync();\n  }\n  ol.control.Control.prototype.setMap.call(this, map);\n  if (map) {\n    this._listener = [];\n    for (i=0; i<this.layers.length; i++) {\n      l = this.layers[i];\n      if (l.right) l.layer.on(['precompose','prerender'], this.precomposeRight_);\n      else l.layer.on(['precompose','prerender'], this.precomposeLeft_);\n      l.layer.on(['postcompose','postrender'], this.postcompose_);\n    }\n    map.renderSync();\n  }\n};\n/** @private\n*/\nol.control.Swipe.prototype.isLayer_ = function(layer){\n  for (var k=0; k<this.layers.length; k++) {\n    if (this.layers[k].layer === layer) return k;\n  }\n  return -1;\n};\n/** Add a layer to clip\n *\t@param {ol.layer|Array<ol.layer>} layer to clip\n*\t@param {bool} add layer in the right part of the map, default left.\n*/\nol.control.Swipe.prototype.addLayer = function(layers, right) {\n  if (!(layers instanceof Array)) layers = [layers];\n  for (var i=0; i<layers.length; i++) {\n    var l = layers[i];\n    if (this.isLayer_(l) < 0) {\n      this.layers.push({ layer:l, right:right });\n      if (this.getMap()) {\n        if (right) l.on(['precompose','prerender'], this.precomposeRight_);\n        else l.on(['precompose','prerender'], this.precomposeLeft_);\n        l.on(['postcompose','postrender'], this.postcompose_);\n        this.getMap().renderSync();\n      }\n    }\n  }\n};\n/** Remove a layer to clip\n *\t@param {ol.layer|Array<ol.layer>} layer to clip\n*/\nol.control.Swipe.prototype.removeLayer = function(layers) {\n  if (!(layers instanceof Array)) layers = [layers];\n  for (var i=0; i<layers.length; i++) {\n    var k = this.isLayer_(layers[i]);\n    if (k >=0 && this.getMap()) {\n      if (this.layers[k].right) layers[i].un(['precompose','prerender'], this.precomposeRight_);\n      else layers[i].un(['precompose','prerender'], this.precomposeLeft_);\n      layers[i].un(['postcompose','postrender'], this.postcompose_);\n      this.layers.splice(k,1);\n      this.getMap().renderSync();\n    }\n  }\n};\n/** @private\n*/\nol.control.Swipe.prototype.move = function(e) {\n  var self = this;\n  var l;\n  switch (e.type) {\n    case 'touchcancel':\n    case 'touchend':\n    case 'mouseup': {\n      self.isMoving = false;\n      [\"mouseup\", \"mousemove\", \"touchend\", \"touchcancel\", \"touchmove\"]\n        .forEach(function(eventName) {\n          document.removeEventListener(eventName, self.move);\n        });\n      break;\n    }\n    case 'mousedown':\n    case 'touchstart': {\n      self.isMoving = true;\n      [\"mouseup\", \"mousemove\", \"touchend\", \"touchcancel\", \"touchmove\"]\n        .forEach(function(eventName) {\n          document.addEventListener(eventName, self.move.bind(self));\n        });\n    }\n    // fallthrough\n    case 'mousemove':\n    case 'touchmove': {\n      if (self.isMoving) {\n        if (self.get('orientation') === \"vertical\") {\n          var pageX = e.pageX\n            || (e.touches && e.touches.length && e.touches[0].pageX)\n            || (e.changedTouches && e.changedTouches.length && e.changedTouches[0].pageX);\n          if (!pageX) break;\n          pageX -= self.getMap().getTargetElement().getBoundingClientRect().left +\n            window.pageXOffset - document.documentElement.clientLeft;\n          l = self.getMap().getSize()[0];\n          l = Math.min(Math.max(0, 1-(l-pageX)/l), 1);\n          self.set('position', l);\n        } else {\n          var pageY = e.pageY\n            || (e.touches && e.touches.length && e.touches[0].pageY)\n            || (e.changedTouches && e.changedTouches.length && e.changedTouches[0].pageY);\n          if (!pageY) break;\n          pageY -= self.getMap().getTargetElement().getBoundingClientRect().top +\n            window.pageYOffset - document.documentElement.clientTop;\n          l = self.getMap().getSize()[1];\n          l = Math.min(Math.max(0, 1-(l-pageY)/l), 1);\n          self.set('position', l);\n        }\n      }\n      break;\n    }\n    default: break;\n  }\n};\nol.control.Swipe.prototype._drawRect = function(e, pts) {\n  var tr = e.inversePixelTransform;\n  if (tr) {\n    var r = [\n      [pts[0][0], pts[0][1]],\n      [pts[0][0], pts[1][1]],\n      [pts[1][0], pts[1][1]],\n      [pts[1][0], pts[0][1]],\n      [pts[0][0], pts[0][1]]\n    ];\n    r.forEach(function (pt, i) {\n      pt = [\n        (pt[0]*tr[0] - pt[1]*tr[1] + tr[4]),\n        (-pt[0]*tr[2] + pt[1]*tr[3] + tr[5])\n      ];\n      if (!i) {\n        e.context.moveTo(pt[0], pt[1]);\n      } else {\n        e.context.lineTo(pt[0], pt[1]);\n      }\n    });\n  } else {\n    var ratio = e.frameState.pixelRatio;\n    e.context.rect(pts[0][0]*ratio,pts[0][1]*ratio,pts[1][0]*ratio,pts[1][1]*ratio);\n  }\n};\n/** @private\n*/\nol.control.Swipe.prototype.precomposeLeft = function(e) {\n  var ctx = e.context;\n  var size = e.frameState.size;\n  ctx.save();\n  ctx.beginPath();\n  var pts = [[0,0],[size[0],size[1]]];\n  if (this.get('orientation') === \"vertical\") {\n    pts[1] = [\n      size[0]*this.get('position'), \n      size[1]\n    ];\n  } else {\n    pts[1] = [\n      size[0],\n      size[1]*this.get('position')\n    ];\n  }\n  this._drawRect(e, pts);\n  ctx.clip();\n};\n/** @private\n*/\nol.control.Swipe.prototype.precomposeRight = function(e) {\n  var ctx = e.context;\n  var size = e.frameState.size;\n  ctx.save();\n  ctx.beginPath();\n  var pts = [[0,0],[size[0],size[1]]];\n  if (this.get('orientation') === \"vertical\") {\n    pts[0] = [\n      size[0]*this.get('position'), \n      0\n    ];\n  } else {\n    pts[0] = [\n      0,\n      size[1]*this.get('position')\n    ]\n  }\n  this._drawRect(e, pts);\n  ctx.clip();\n};\n/** @private\n*/\nol.control.Swipe.prototype.postcompose = function(e) {\n  // restore context when decluttering is done\n  // https://github.com/openlayers/openlayers/issues/10096\n  if (e.target.getClassName()!=='ol-layer' && e.target.get('declutter')) {\n    setTimeout(function () {\n      e.context.restore();\n    }, 0);\n  } else {\n    e.context.restore();\n  }\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** ol.control.Target draw a target at the center of the map.\n * @constructor\n * @extends {ol.control.CanvasBase}\n * @param {Object} options\n *  @param {ol.style.Style|Array<ol.style.Style>} options.style\n *  @param {string} options.composite composite operation = difference|multiply|xor|screen|overlay|darken|lighter|lighten|...\n */\nol.control.Target = function(options) {\n  options = options || {};\n\tthis.style = options.style || [\n    new ol.style.Style({ image: new ol.style.RegularShape ({ points: 4, radius: 11, radius1: 0, radius2: 0, snapToPixel:true, stroke: new ol.style.Stroke({ color: \"#fff\", width:3 }) }) }),\n    new ol.style.Style({ image: new ol.style.RegularShape ({ points: 4, radius: 11, radius1: 0, radius2: 0, snapToPixel:true, stroke: new ol.style.Stroke({ color: \"#000\", width:1 }) }) })\n  ];\n\tif (!(this.style instanceof Array)) this.style = [this.style];\n\tthis.composite = options.composite || '';\n\tvar div = document.createElement('div');\n\tdiv.className = \"ol-target ol-unselectable ol-control\";\n\tol.control.CanvasBase.call(this, {\n    element: div,\n\t\ttarget: options.target\n\t});\n\tthis.setVisible(options.visible!==false);\n};\nol.ext.inherits(ol.control.Target, ol.control.CanvasBase);\n/** Set the control visibility\n * @paraam {boolean} b \n */\nol.control.Target.prototype.setVisible = function (b) {\n  this.set(\"visible\",b);\n\tif (this.getMap()) this.getMap().renderSync();\n};\n/** Get the control visibility\n * @return {boolean} b \n */\nol.control.Target.prototype.getVisible = function () {\n  return this.get(\"visible\");\n};\n/** Draw the target\n * @private\n */\nol.control.Target.prototype._draw = function (e) {\n  var ctx = this.getContext(e);\n  if (!ctx || !this.getMap() || !this.getVisible()) return;\n\tvar ratio = e.frameState.pixelRatio;\n\tctx.save();\n\t\tctx.scale(ratio,ratio);\n\t\tvar cx = ctx.canvas.width/(2*ratio);\n\t\tvar cy = ctx.canvas.height/(2*ratio);\n\t\tvar geom = new ol.geom.Point (this.getMap().getCoordinateFromPixel([cx,cy]));\n\t\tif (this.composite) ctx.globalCompositeOperation = this.composite;\n    for (var i=0; i<this.style.length; i++) {\n      var style = this.style[i];\n      if (style instanceof ol.style.Style) {\n        var vectorContext = e.vectorContext;\n        if (!vectorContext) {\n          var event = {\n            inversePixelTransform: [ratio,0,0,ratio,0,0],\n            context: ctx,\n            frameState: {\n              pixelRatio: ratio,\n              extent: e.frameState.extent,\n              coordinateToPixelTransform: e.frameState.coordinateToPixelTransform,\n              viewState: e.frameState.viewState\n            }\n          }\n          vectorContext = ol.render.getVectorContext(event);\n        } \n        vectorContext.setStyle(style);\n        vectorContext.drawGeometry(geom);\n      }\n    }\n\tctx.restore();\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO,\n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A simple push button control drawn as text\n * @constructor\n * @extends {ol.control.Button}\n * @param {Object=} options Control options.\n *\t@param {String} options.className class of the control\n *\t@param {String} options.title title of the control\n *\t@param {String} options.html html to insert in the control\n *\t@param {function} options.handleClick callback when control is clicked (or use change:active event)\n */\nol.control.TextButton = function(options)\n{\toptions = options || {};\n    options.className = (options.className||\"\") + \" ol-text-button\";\n    ol.control.Button.call(this, options);\n};\nol.ext.inherits(ol.control.TextButton, ol.control.Button);\n\n/*eslint no-constant-condition: [\"error\", { \"checkLoops\": false }]*/\n/** Timeline control\n *\n * @constructor\n * @extends {ol.control.Control}\n * @fires select\n * @fires scroll\n * @fires collapse\n * @param {Object=} options Control options.\n *\t@param {String} options.className class of the control\n *\t@param {Array<ol.Feature>} options.features Features to show in the timeline\n *\t@param {ol.SourceImageOptions.vector} options.source class of the control\n *\t@param {Number} options.interval time interval length in ms or a text with a format d, h, mn, s (31 days = '31d'), default none\n *\t@param {String} options.maxWidth width of the time line in px, default 2000px\n *\t@param {String} options.minDate minimum date \n *\t@param {String} options.maxDate maximum date \n *\t@param {Number} options.minZoom Minimum zoom for the line, default .2\n *\t@param {Number} options.maxZoom Maximum zoom for the line, default 4\n *\t@param {boolean} options.zoomButton Are zoom buttons avaliable, default false\n *\t@param {function} options.getHTML a function that takes a feature and returns the html to display\n *\t@param {function} options.getFeatureDate a function that takes a feature and returns its date, default the date propertie\n *\t@param {function} options.endFeatureDate a function that takes a feature and returns its end date, default no end date\n *\t@param {String} options.graduation day|month to show month or day graduation, default show only years\n *\t@param {String} options.scrollTimeout Time in milliseconds to get a scroll event, default 15ms\n */\nol.control.Timeline = function(options) {\n  var element = ol.ext.element.create('DIV', {\n    className: (options.className || '') + ' ol-timeline'\n      + (options.target ? '': ' ol-unselectable ol-control')\n      + (options.zoomButton ? ' ol-hasbutton':'')\n      + ('ontouchstart' in window ? ' ol-touch' : '')\n  });\n  // Initialize\n  ol.control.Control.call(this, {\n    element: element,\n    target: options.target\n  });\n  // Scroll div\n  this._scrollDiv = ol.ext.element.create('DIV', {\n    className: 'ol-scroll',\n    parent: this.element\n  });\n  // Add a button bar\n  this._buttons = ol.ext.element.create('DIV', {\n    className: 'ol-buttons',\n    parent: this.element\n  });\n  // Zoom buttons\n  if (options.zoomButton) {\n    // Zoom in\n    this.addButton({\n      className: 'ol-zoom-in',\n      handleClick: function(){\n        var zoom = this.get('zoom');\n        if (zoom>=1) {\n          zoom++;\n        } else {\n          zoom = Math.min(1, zoom + 0.1);\n        }\n        zoom = Math.round(zoom*100)/100;\n        this.refresh(zoom);\n      }.bind(this)\n    });\n    // Zoom out\n    this.addButton({\n      className: 'ol-zoom-out',\n      handleClick: function(){\n        var zoom = this.get('zoom');\n        if (zoom>1) {\n          zoom--;\n        } else {\n          zoom -= 0.1;\n        }\n        zoom = Math.round(zoom*100)/100;\n        this.refresh(zoom);\n      }.bind(this)\n    });\n  }\n  // Draw center date\n  this._intervalDiv = ol.ext.element.create('DIV', {\n    className: 'ol-center-date',\n    parent: this.element\n  });\n  // Remove selection\n  this.element.addEventListener('mouseover', function(){\n    if (this._select) this._select.elt.classList.remove('ol-select');\n  }.bind(this));\n  // Trigger scroll event\n  var scrollListener = null;\n  this._scrollDiv.addEventListener('scroll', function() {\n    this._setScrollLeft();\n    if (scrollListener) {\n      clearTimeout(scrollListener);\n      scrollListener = null;\n    }\n    scrollListener = setTimeout(function() {\n      this.dispatchEvent({ \n        type: 'scroll', \n        date: this.getDate(), \n        dateStart: this.getDate('start'), \n        dateEnd: this.getDate('end')\n      });\n    }.bind(this), options.scrollTimeout || 15);\n  }.bind(this));\n  // Magic to give \"live\" scroll events on touch devices\n  this._scrollDiv.addEventListener('gesturechange', function() {});\n  // Scroll timeline\n  ol.ext.element.scrollDiv(this._scrollDiv, {\n    onmove: function(b) {\n      // Prevent selection on moving\n      this._moving = b; \n    }.bind(this)\n  });\n  this._tline = [];\n  // Parameters\n  this._scrollLeft = 0;\n  this.set('maxWidth', options.maxWidth || 2000);\n  this.set('minDate', options.minDate || Infinity);\n  this.set('maxDate', options.maxDate || -Infinity);\n  this.set('graduation', options.graduation);\n  this.set('minZoom', options.minZoom || .2);\n  this.set('maxZoom', options.maxZoom || 4);\n  this.setInterval(options.interval);\n  if (options.getHTML) this._getHTML =  options.getHTML;\n  if (options.getFeatureDate) this._getFeatureDate =  options.getFeatureDate;\n  if (options.endFeatureDate) this._endFeatureDate =  options.endFeatureDate;\n  // Feature source \n  this.setFeatures(options.features || options.source, options.zoom);\n};\nol.ext.inherits(ol.control.Timeline, ol.control.Control);\n/**\n * Set the map instance the control is associated with\n * and add interaction attached to it to this map.\n * @param {_ol_Map_} map The map instance.\n */\nol.control.Timeline.prototype.setMap = function(map) {\n  ol.control.Control.prototype.setMap.call(this, map);\n  this.refresh(this.get('zoom')||1, true);\n};\n/** Add a button on the timeline\n * @param {*} button\n *  @param {string} button.className\n *  @param {title} button.className\n *  @param {Element|string} button.html Content of the element\n *  @param {function} button.click a function called when the button is clicked\n */\nol.control.Timeline.prototype.addButton = function(button) {\n  this.element.classList.add('ol-hasbutton');\n  ol.ext.element.create('BUTTON', {\n    className: button.className || undefined,\n    title: button.title,\n    html : button.html,\n    click: button.handleClick,\n    parent: this._buttons\n  })\n};\n/** Set an interval\n * @param {number|string} length the interval length in ms or a farmatted text ie. end with y, 1d, h, mn, s (31 days = '31d'), default none\n */\nol.control.Timeline.prototype.setInterval = function(length) {\n  if (typeof(length)==='string') {\n    if (/s$/.test(length)) {\n      length = parseFloat(length) * 1000;\n    } else if (/mn$/.test(length)) {\n      length = parseFloat(length) * 1000 * 60;\n    } else if (/h$/.test(length)) {\n      length = parseFloat(length) * 1000 * 3600;\n    } else if (/d$/.test(length)) {\n      length = parseFloat(length) * 1000 * 3600 * 24;\n    } else if (/y$/.test(length)) {\n      length = parseFloat(length) * 1000 * 3600 * 24 * 365;\n    } else {\n      length = 0;\n    }\n  }\n  this.set('interval', length || 0);\n  if (length) this.element.classList.add('ol-interval');\n  else this.element.classList.remove('ol-interval');\n  this.refresh(this.get('zoom'));\n}\n/** Default html to show in the line\n * @param {ol.Feature} feature\n * @return {DOMElement|string}\n * @private\n */\nol.control.Timeline.prototype._getHTML = function(feature) {\n  return feature.get('name') || '';\n};\n/** Default function to get the date of a feature, returns the date attribute\n * @param {ol.Feature} feature\n * @return {Data|string}\n * @private\n */\nol.control.Timeline.prototype._getFeatureDate = function(feature) {\n  return (feature && feature.get) ? feature.get('date') : null;\n};\n/** Default function to get the end date of a feature, return undefined\n * @param {ol.Feature} feature\n * @return {Data|string}\n * @private\n */\nol.control.Timeline.prototype._endFeatureDate = function(/* feature */) {\n  return undefined;\n};\n/** Is the line collapsed\n * @return {boolean}\n */\nol.control.Timeline.prototype.isCollapsed = function() {\n  return this.element.classList.contains('ol-collapsed');\n};\n/** Collapse the line\n * @param {boolean} b\n */\nol.control.Timeline.prototype.collapse = function(b) {\n  if (b) this.element.classList.add('ol-collapsed');\n  else this.element.classList.remove('ol-collapsed');\n  this.dispatchEvent({ type: 'collapse', collapsed: this.isCollapsed() });\n};\n/** Collapse the line\n */\nol.control.Timeline.prototype.toggle = function() {\n  this.element.classList.toggle('ol-collapsed');\n  this.dispatchEvent({ type: 'collapse', collapsed: this.isCollapsed() });\n};\n/** Set the features to display in the timeline\n * @param {Array<ol.Features>|ol.source.Vector} features An array of features or a vector source\n * @param {number} zoom zoom to draw the line default 1\n */\nol.control.Timeline.prototype.setFeatures = function(features, zoom) {\n  this._features = this._source = null;\n  if (features instanceof ol.source.Vector) this._source = features;\n  else if (features instanceof Array) this._features = features;\n  else this._features = [];\n  this.refresh(zoom);\n};\n/**\n * Get features\n * @return {Array<ol.Feature>}\n */\nol.control.Timeline.prototype.getFeatures = function() {\n  return this._features || this._source.getFeatures();\n}\n/**\n * Refresh the timeline with new data\n * @param {Number} zoom Zoom factor from 0.25 to 10, default 1\n */\nol.control.Timeline.prototype.refresh = function(zoom, first) {\n  if (!this.getMap()) return;\n  if (!zoom) zoom = this.get('zoom');\n  zoom = Math.min(this.get('maxZoom'), Math.max(this.get('minZoom'), zoom || 1));\n  this.set('zoom', zoom);\n  this._scrollDiv.innerHTML = '';\n  var features = this.getFeatures();\n  var d, d2;\n  // Get features sorted by date\n  var tline = this._tline = [];\n  features.forEach(function(f) {\n    if (d = this._getFeatureDate(f)) {\n      if (!(d instanceof Date)) {\n        d = new Date(d)\n      }\n      if (this._endFeatureDate) {\n        d2 = this._endFeatureDate(f);\n        if (!(d2 instanceof Date)) {\n          d2 = new Date(d2)\n        }\n      }\n      if (!isNaN(d)) {\n        tline.push({\n          date: d,\n          end: isNaN(d2) ? null : d2,\n          feature: f\n        });\n      }\n    }\n  }.bind(this));\n  tline.sort(function(a,b) { \n    return (a.date < b.date ? -1 : (a.date===b.date ? 0: 1))\n  });\n  // Draw\n  var div = ol.ext.element.create('DIV', {\n    parent: this._scrollDiv\n  });\n  // Calculate width\n  var min = this._minDate = Math.min(this.get('minDate'), tline.length ? tline[0].date : Infinity);\n  var max = this._maxDate = Math.max(this.get('maxDate'), tline.length ? tline[tline.length-1].date : -Infinity);\n  if (!isFinite(min)) this._minDate = min = new Date();\n  if (!isFinite(max)) this._maxDate = max = new Date();\n  var delta = (max-min);\n  var maxWidth = this.get('maxWidth');\n  var scale = this._scale = (delta > maxWidth ? maxWidth/delta : 1) * zoom;\n  // Leave 10px on right\n  min = this._minDate = this._minDate - 10/scale;\n  delta = (max-min) * scale;\n  ol.ext.element.setStyle(div, {\n    width: delta,\n    maxWidth: 'unset'\n  });\n  // Draw time's bar\n  this._drawTime(div, min, max, scale);\n  // Set interval\n  if (this.get('interval')) {\n    ol.ext.element.setStyle (this._intervalDiv, { width: this.get('interval') * scale });\n  } else {\n    ol.ext.element.setStyle (this._intervalDiv, { width: '' });\n  }\n  // Draw features\n  var line = [];\n  var lineHeight = ol.ext.element.getStyle(this._scrollDiv, 'lineHeight');\n  // Wrapper\n  var fdiv = ol.ext.element.create('DIV', {\n      className: 'ol-features',\n      parent: div\n  });\n  // Add features on the line\n  tline.forEach(function(f) {\n    var d = f.date;\n    var t = f.elt = ol.ext.element.create('DIV', {\n      className: 'ol-feature',\n      style: {\n        left: Math.round((d-min)*scale),\n      },\n      html: this._getHTML(f.feature),\n      parent: fdiv\n    });\n    // Prevent image dragging\n    var img = t.querySelectorAll('img');\n    for (var i=0; i<img.length; i++) {\n      img[i].ondragstart = function(){ return false; };\n    }\n    // Calculate image width\n    if (f.end) {\n      ol.ext.element.setStyle(t, { \n        minWidth: (f.end-d) * scale, \n        width: (f.end-d) * scale, \n        maxWidth: 'unset'\n      });\n    }\n    var left = ol.ext.element.getStyle(t, 'left');\n    // Select on click\n    t.addEventListener('click', function(){\n      if (!this._moving) {\n        this.dispatchEvent({type: 'select', feature: f.feature });\n      }\n    }.bind(this));\n    // Find first free Y position\n    var pos, l;\n    for (pos=0; l=line[pos]; pos++) {\n      if (left > l) {\n        break;\n      }\n    }\n    line[pos] = left + ol.ext.element.getStyle(t, 'width');\n    ol.ext.element.setStyle(t, { top: pos*lineHeight });\n  }.bind(this));\n  this._nbline = line.length;\n  if (first) this.setDate(this._minDate, { anim: false, position: 'start' });\n  // Dispatch scroll event\n  this.dispatchEvent({ \n    type: 'scroll', \n    date: this.getDate(), \n    dateStart: this.getDate('start'), \n    dateEnd: this.getDate('end')\n  });\n};\n/** Get offset given a date\n * @param {Date} date\n * @return {number}\n * @private\n */\nol.control.Timeline.prototype._getOffsetFromDate = function(date) {\n  return (date - this._minDate) * this._scale;\n};\n/** Get date given an offset\n * @param {Date} date\n * @return {number}\n * @private\n */\nol.control.Timeline.prototype._getDateFromOffset = function(offset) {\n  return offset / this._scale + this._minDate;\n};\n/** Set the current position \n * @param {number} scrollLeft current position (undefined when scrolling)\n * @returns {number}\n * @private\n */\nol.control.Timeline.prototype._setScrollLeft = function(scrollLeft) {\n  this._scrollLeft = scrollLeft;\n  if (scrollLeft !== undefined) {\n    this._scrollDiv.scrollLeft = scrollLeft;\n  }\n};\n/** Get the current position \n * @returns {number}\n * @private\n */\nol.control.Timeline.prototype._getScrollLeft = function() {\n  // Unset when scrolling\n  if (this._scrollLeft === undefined) {\n    return this._scrollDiv.scrollLeft;\n  } else {\n    // St by user\n    return this._scrollLeft;\n  }\n};\n/**\n * Draw dates on line\n * @private\n */\nol.control.Timeline.prototype._drawTime = function(div, min, max, scale) {\n  // Times div\n  var tdiv = ol.ext.element.create('DIV', {\n    className: 'ol-times',\n    parent: div\n  });\n  var d, dt, month, dmonth;\n  var dx = ol.ext.element.getStyle(tdiv, 'left');\n  var heigth = ol.ext.element.getStyle(tdiv, 'height');\n  // Year\n  var year = (new Date(this._minDate)).getFullYear();\n  dt = ((new Date(0)).setFullYear(String(year)) - new Date(0).setFullYear(String(year-1))) * scale;\n  var dyear = Math.round(2*heigth/dt)+1;\n  while(true) {\n    d = new Date(0).setFullYear(year);\n    if (d > this._maxDate) break;\n    ol.ext.element.create('DIV', {\n      className: 'ol-time ol-year',\n      style: {\n        left: this._getOffsetFromDate(d) - dx\n      },\n      html: year,\n      parent: tdiv\n    });\n    year += dyear;\n  }\n  // Month\n  if (/day|month/.test(this.get('graduation'))) {\n    dt = ((new Date(0,0,1)).setFullYear(String(year)) - new Date(0,0,1).setFullYear(String(year-1))) * scale;\n    dmonth = Math.max(1, Math.round(12 / Math.round(dt/heigth/2)));\n    if (dmonth < 12) {\n      year = (new Date(this._minDate)).getFullYear();\n      month = dmonth+1;\n      while(true) {\n        d = new Date(0,0,1);\n        d.setFullYear(year);\n        d.setMonth(month-1);\n        if (d > this._maxDate) break;\n        ol.ext.element.create('DIV', {\n          className: 'ol-time ol-month',\n          style: {\n            left: this._getOffsetFromDate(d) - dx\n          },\n          html: d.toLocaleDateString(undefined, { month: 'short'}),\n          parent: tdiv\n        });\n        month += dmonth;\n        if (month > 12) {\n          year++;\n          month = dmonth+1;\n        }\n      }\n    }\n  }\n  // Day\n  if (this.get('graduation')==='day') {\n    dt = (new Date(0,1,1) - new Date(0,0,1)) * scale;\n    var dday = Math.max(1, Math.round(31 / Math.round(dt/heigth/2)));\n    if (dday < 31) {\n      year = (new Date(this._minDate)).getFullYear();\n      month = 0;\n      var day = dday;\n      while(true) {\n        d = new Date(0,0,1);\n        d.setFullYear(year);\n        d.setMonth(month);\n        d.setDate(day);\n        if (isNaN(d)) {\n          month++;\n          if (month>12) {\n            month = 1;\n            year++;\n          }\n          day = dday;\n        } else {\n          if (d > this._maxDate) break;\n          ol.ext.element.create('DIV', {\n            className: 'ol-time ol-day',\n            style: {\n              left: this._getOffsetFromDate(d) - dx\n            },\n            html: day,\n            parent: tdiv\n          });\n          year = d.getFullYear();\n          month = d.getMonth();\n          day = d.getDate() + dday;\n          if (day+dday/2>31) {\n            month++;\n            day = dday;\n          }\n        }\n      }\n    }\n  }\n};\n/** Center timeline on a date\n * @param {Date|String|ol.feature} feature a date or a feature with a date\n * @param {Object} options\n *  @param {boolean} options.anim animate scroll\n *  @param {string} options.position start, end or middle, default middle\n */\nol.control.Timeline.prototype.setDate = function(feature, options) {\n  var date;\n  options = options || {};\n  // It's a date\n  if (feature instanceof Date) {\n    date = feature;\n  } else {\n    // Get date from Feature\n    if (this.getFeatures().indexOf(feature) >= 0) {\n      date = this._getFeatureDate(feature);\n    }\n    if (date && !(date instanceof Date)) {\n      date = new Date(date);\n    }\n    if (!date || isNaN(date)) {\n      date = new Date(String(feature));\n    }\n  }\n  if (!isNaN(date)) {\n    if (options.anim === false) this._scrollDiv.classList.add('ol-move');\n    var scrollLeft = this._getOffsetFromDate(date);\n    if (options.position==='start') {\n      scrollLeft += ol.ext.element.outerWidth(this._scrollDiv)/2 - ol.ext.element.getStyle(this._scrollDiv, 'marginLeft')/2;\n    } else if (options.position==='end') {\n      scrollLeft -= ol.ext.element.outerWidth(this._scrollDiv)/2 - ol.ext.element.getStyle(this._scrollDiv, 'marginLeft')/2;\n    }\n    this._setScrollLeft(scrollLeft);\n    if (options.anim === false) this._scrollDiv.classList.remove('ol-move');\n    if (feature) {\n      for (var i=0, f; f = this._tline[i]; i++) {\n        if (f.feature === feature) {\n          f.elt.classList.add('ol-select');\n          this._select = f;\n        } else {\n          f.elt.classList.remove('ol-select');\n        }\n      }\n    }\n  }\n};\n/** Get round date (sticked to mn, hour day or month)\n * @param {Date} d\n * @param {string} stick sticking option to stick date to: 'mn', 'hour', 'day', 'month', default no stick\n * @return {Date}\n */\nol.control.Timeline.prototype.roundDate = function(d, stick) {\n  switch (stick) {\n    case 'mn': {\n      return new Date(this._roundTo(d, 60*1000));\n    }\n    case 'hour': {\n      return new Date(this._roundTo(d, 60*60*1000));\n    }\n    case 'day': {\n      return new Date(this._roundTo(d, 24*60*60*1000));\n    }\n    case 'month': {\n      d = new Date(this._roundTo(d, 24*60*60*1000));\n      if (d.getDate() > 15) {\n        d = new Date(d.setMonth(d.getMonth() + 1));\n      }\n      d = d.setDate(1);\n      return new Date(d);\n    }\n    default: return new Date(d);\n  }\n};\n/** Get the date of the center\n * @param {string} position position to get 'start', 'end' or 'middle', default middle\n * @param {string} stick sticking option to stick date to: 'mn', 'hour', 'day', 'month', default no stick\n * @return {Date}\n */\nol.control.Timeline.prototype.getDate = function(position, stick) {\n  var pos;\n  if (!stick) stick = position;\n  switch (position) {\n    case 'start': {\n      if (this.get('interval')) {\n        pos = - ol.ext.element.getStyle(this._intervalDiv, 'width')/2 + ol.ext.element.getStyle(this._scrollDiv, 'marginLeft')/2;\n      } else {\n        pos = - ol.ext.element.outerWidth(this._scrollDiv)/2 + ol.ext.element.getStyle(this._scrollDiv, 'marginLeft')/2;\n      }\n      break;\n    }\n    case 'end': {\n      if (this.get('interval')) {\n        pos = ol.ext.element.getStyle(this._intervalDiv, 'width')/2 - ol.ext.element.getStyle(this._scrollDiv, 'marginLeft')/2;\n      } else {\n        pos = ol.ext.element.outerWidth(this._scrollDiv)/2 - ol.ext.element.getStyle(this._scrollDiv, 'marginLeft')/2;\n      }\n      break;\n    }\n    default: {\n      pos = 0;\n      break;\n    }\n  }\n  var d = this._getDateFromOffset(this._getScrollLeft() + pos);\n  d = this.roundDate(d, stick);\n  return new Date(d);\n};\n/** Round number to \n * @param {number} d\n * @param {number} r\n * @return {number}\n * @private\n */\nol.control.Timeline.prototype._roundTo = function(d, r) {\n  return Math.round(d/r) * r;\n};\n/** Get the start date of the control\n * @return {Date}\n */\nol.control.Timeline.prototype.getStartDate = function() {\n  return new Date(this.get('minDate'));\n}\n/** Get the end date of the control\n * @return {Date}\n */\nol.control.Timeline.prototype.getEndDate = function() {\n  return new Date(this.get('maxDate'));\n}\n\n/* \n  WMS Layer with EPSG:4326 projection.\n  The tiles will be reprojected to map pojection (EPSG:3857).\n  NB: reduce tileSize to minimize deformations on small scales.\n*/\n/** WMSCapabilities\n * @constructor\n * @param {*} options\n *  @param {string|Element} options.target the target to set the dialog, use document.body to have fullwindow dialog\n *  @param {string} options.proxy proxy to use when requesting Getcapabilites, default none (suppose the service use CORS)\n *  @param {string} options.placeholder input placeholder, default 'service url...'\n *  @param {string} options.title dialog title, default 'WMS'\n *  @param {string} options.searchLabel Label for search button, default 'search'\n *  @param {string} options.loadLabel Label for load button, default 'load'\n *  @param {boolean} options.popupLayer Use a popup for the layers, default false\n *  @param {*} options.services a key/url object of services for quick access in a menu\n *  @param {Array<string>} options.srs an array of supported srs, default map projection code or 'EPSG:3857'\n *  @param {number} options.timeout Timeout for getCapabilities request, default 1000\n *  @param {boolean} options.cors Use CORS, default false\n *  @param {boolean} options.trace Log layer info, default false\n */\nol.control.WMSCapabilities = function (options) {\n  options = options || {};\n  var buttonOptions = Object.assign({}, options || {});\n  this._proxy = options.proxy;\n  if (buttonOptions.target===document.body) delete buttonOptions.target;\n  if (buttonOptions.target) {\n    buttonOptions.className = ((buttonOptions.className||'') + ' ol-wmscapabilities ol-hidden').trim();\n    delete buttonOptions.target;\n  } else {\n    buttonOptions.className = ((buttonOptions.className||'') + ' ol-wmscapabilities').trim();\n    buttonOptions.handleClick = function () {\n      this.showDialog();\n    }.bind(this)\n  }\n  ol.control.Button.call(this, buttonOptions);\n  // WMS options\n  this.set('srs', options.srs || []);\n  this.set('cors', options.cors);\n  this.set('trace', options.trace);\n  this.set('title', options.title);\n  this.set('loadLabel', options.loadLabel);\n  // Dialog\n  this.createDialog(options);\n  // Ajax request\n  var parser = new ol.format.WMSCapabilities();\n  this._ajax = new ol.ext.Ajax({ dataType:'text', auth: options.authentication });\n  this._ajax.on('success', function (e) {\n    try {\n      var caps = parser.read(e.response);\n      this.showCapabilitis(caps)\n    } catch (e) {\n      this.showError({ type: 'load', error: e });\n    }\n  }.bind(this));\n  this._ajax.on('error', function(e) {\n    this.showError({ type: 'load', error: e });\n  }.bind(this));\n  // Handle waiting\n  this._ajax.on('loadstart', function() {\n    this._elements.element.classList.add('ol-searching');\n  }.bind(this));\n  this._ajax.on('loadend', function() {\n    this._elements.element.classList.remove('ol-searching');\n  }.bind(this));\n};\nol.ext.inherits(ol.control.WMSCapabilities, ol.control.Button);\n/** Error list: a key/value list of error to display in the dialog \n * Overwrite it to handle internationalization\n */\nol.control.WMSCapabilities.prototype.error = {\n  load: 'Can\\'t retrieve service capabilities, try to add it manually...',\n  badUrl: 'The input value is not a valid url...',\n  srs: 'The service projection looks different from that of your map, it may not display correctly...'\n};\n/** Form labels: a key/value list of form labels to display in the dialog\n * Overwrite it to handle internationalization\n */\nol.control.WMSCapabilities.prototype.labels = {\n  formTitle: 'Title:',\n  formLayer: 'Layers:',\n  formMap: 'Map:',\n  formFormat: 'Format:',\n  formMinZoom: 'Min zoom level:',\n  formMaxZoom: 'Max zoom level:',\n  formExtent: 'Extent:',\n  formProjection: 'Projection:',\n  formCrossOrigin: 'CrossOrigin:',\n  formVersion: 'Version:'\n};\n/** Create dialog\n * @private\n */\nol.control.WMSCapabilities.prototype.createDialog = function (options) {\n  var target = options.target;\n  if (!target || target===document.body) {\n    this._dialog = new ol.control.Dialog({\n      className: 'ol-wmscapabilities',\n      closeBox: true,\n      closeOnSubmit: false,\n      target: options.target\n    });\n    this._dialog.on('button', function(e) {\n      if (e.button==='submit') {\n        this.getCapabilities(e.inputs.url.value);\n      }\n    }.bind(this));\n    target = null;\n  }\n  var element = ol.ext.element.create('DIV', {\n    className: ('ol-wmscapabilities '+(options.className||'')).trim(),\n    parent: target\n  });\n  this._elements = {\n    element: target || element\n  };\n  var inputdiv = ol.ext.element.create('DIV', {\n    className: 'ol-url',\n    parent: element\n  });\n  var input = this._elements.input = ol.ext.element.create('INPUT', {\n    className: 'url',\n    placeholder: options.placeholder || 'service url...',\n    autocorrect: 'off',\n    autocapitalize: 'off',\n    parent: inputdiv\n  });\n  input.addEventListener('keyup', function(e) {\n    if (e.keyCode===13) {\n      this.getCapabilities(input.value, options);\n    }\n  }.bind(this));\n  if (options.services) {\n    var qaccess = ol.ext.element.create('SELECT', {\n      className: 'url',\n      on: {\n        change: function(e) {\n          var url = e.target.options[e.target.selectedIndex].value;\n          this.getCapabilities(url, options);\n          e.target.selectedIndex = 0;\n        }.bind(this)\n      },\n      parent: inputdiv\n    });\n    ol.ext.element.create('OPTION', {\n      html: ' ',\n      parent: qaccess\n    });\n    for (var k in options.services) {\n      ol.ext.element.create('OPTION', {\n        html: k,\n        value: options.services[k],\n        parent: qaccess\n      });\n    }\n  }\n  ol.ext.element.create('BUTTON', {\n    click: function() {\n      this.getCapabilities(input.value, options);\n    }.bind(this),\n    html: options.searchLabel || 'search',\n    parent: inputdiv\n  });\n  // Errors\n  this._elements.error = ol.ext.element.create('DIV', {\n    className: 'ol-error',\n    parent: inputdiv\n  });\n  // Result div\n  var rdiv = this._elements.result = ol.ext.element.create('DIV', {\n    className: 'ol-result',\n    parent: element\n  });\n  // Preview\n  var preview = ol.ext.element.create('DIV', {\n    className: 'ol-preview',\n    html: options.previewLabel || 'preview',\n    parent: rdiv\n  });\n  this._elements.preview = ol.ext.element.create('IMG', {\n    parent: preview\n  });\n  // Check tainted canvas\n  this._img = new Image;\n  this._img.crossOrigin = 'Anonymous';\n  this._img.addEventListener('error', function() {\n    preview.className = 'ol-preview tainted';\n  }.bind(this));\n  this._img.addEventListener('load', function() {\n    preview.className = 'ol-preview ok';\n  }.bind(this));\n  // Select list\n  var select = this._elements.select = ol.ext.element.create('SELECT', {\n    className: 'ol-select-list',\n    size: options.popupLayer ? 0 : 10,\n    on: {\n      change: function () {\n        select.options[select.selectedIndex].click();\n      }.bind(this)\n    },\n    parent: rdiv\n  });\n  // Info data\n  this._elements.data = ol.ext.element.create('DIV', {\n    className: 'ol-data',\n    parent: rdiv\n  });\n  this._elements.buttons = ol.ext.element.create('DIV', {\n    className: 'ol-buttons',\n    parent: rdiv\n  });\n  this._elements.legend = ol.ext.element.create('IMG', {\n    className: 'ol-legend',\n    parent: rdiv\n  });\n  // WMS form\n  var form = this._elements.form = ol.ext.element.create('UL', {\n    className: 'ol-wmsform',\n    parent: element\n  });\n  var addLine = function(label, val, pholder) {\n    var li = ol.ext.element.create('li', {\n      parent: form\n    });\n    ol.ext.element.create('LABEL', {\n      html: this.labels[label],\n      parent: li\n    });\n    if (typeof(val) === 'boolean') {\n      this._elements[label] = ol.ext.element.create('INPUT', {\n        type: 'checkbox',\n        checked: val,\n        parent: li\n      });\n    } else if (val instanceof Array) {\n      var sel = this._elements[label] = ol.ext.element.create('SELECT', {\n        parent: li\n      });\n      val.forEach(function(v) {\n        ol.ext.element.create('OPTION', {\n          html: v,\n          value: v,\n          parent: sel\n        });\n      }.bind(this));\n    } else {\n      this._elements[label] = ol.ext.element.create('INPUT', {\n        value: (val===undefined ? '' : val),\n        placeholder: pholder || '',\n        type: typeof(val),\n        parent: li\n      });\n    }\n  }.bind(this);\n  addLine('formTitle');\n  addLine('formLayer', '', 'layer1,layer2,...');\n  addLine('formMap');\n  addLine('formFormat', ['image/png', 'image/jpeg']);\n  addLine('formMinZoom', 0);\n  addLine('formMaxZoom', 20);\n  addLine('formExtent', '', 'xmin,ymin,xmax,ymax');\n  addLine('formProjection', '');\n  addLine('formCrossOrigin', false);\n  addLine('formVersion', '1.3.0');\n  ol.ext.element.create('BUTTON', {\n    html: this.get('loadLabel') || 'Load',\n    click: function() {\n      var minZoom = parseInt(this._elements.formMinZoom.value);\n      var maxZoom = parseInt(this._elements.formMaxZoom.value);\n      var view = new ol.View({\n        projection: this.getMap().getView().getProjection()\n      })\n      view.setZoom(minZoom);\n      var maxResolution = view.getResolution();\n      view.setZoom(maxZoom);\n      var minResolution = view.getResolution();\n      var ext = [];\n      if (this._elements.formExtent.value) {\n        this._elements.formExtent.value.split(',').forEach(function(b) {\n          ext.push(parseFloat(b));\n        })\n      }\n      if (ext.length !== 4) ext = undefined;\n      var options = {\n        layer: {\n          title: this._elements.formTitle.value,\n          extent: ext,\n          maxResolution: maxResolution,\n          minResolution: minResolution\n        },\n        source: {\n          url: this._elements.input.value,\n          crossOrigin: this._elements.formCrossOrigin.checked ? 'anonymous' : null,\n          projection: this._elements.formProjection.value,\n          params: {\n            FORMAT: this._elements.formFormat.options[this._elements.formFormat.selectedIndex].value,\n            LAYERS: this._elements.formLayer.value,\n            VERSION: this._elements.formVersion.value\n          }\n        },\n        data: {\n          title: this._elements.formTitle.value\n        }\n      }\n      if (this._elements.formMap.value) options.source.param.MAP = this._elements.formMap.value;\n      var layer = this.getLayerFromOptions(options);\n      this.dispatchEvent({ type: 'load', layer: layer, options: options });\n      this._dialog.hide();\n    }.bind(this),\n    parent: form\n  });\n  return element;\n};\n/** Create a new layer using options received by getOptionsFromCap method\n * @param {*} options\n */\nol.control.WMSCapabilities.prototype.getLayerFromOptions = function (options) {\n  options.layer.source = new ol.source.TileWMS(options.source);\n  var layer = new ol.layer.Tile(options.layer);\n  delete options.layer.source;\n  return layer;\n};\n/**\n * Set the map instance the control is associated with\n * and add its controls associated to this map.\n * @param {_ol_Map_} map The map instance.\n */\nol.control.WMSCapabilities.prototype.setMap = function (map) {\n  ol.control.Button.prototype.setMap.call(this, map);\n  if (this._dialog) this._dialog.setMap(map);\n};\n/** Show dialog for url */\nol.control.WMSCapabilities.prototype.showDialog = function(url, options) {\n  if (url) this.showError();\n  if (!this._elements.formProjection.value) {\n    this._elements.formProjection.value = this.getMap().getView().getProjection().getCode();\n  }\n  this._dialog.show({\n    title: this.get('title')===undefined ? 'WMS' : this.get('title'),\n    content: this._elements.element\n  });\n  this.getCapabilities(url, options);\n};\n/** Get WMS capabilities for a server\n * @fire load\n * @param {string} url service url\n * @param {*} options \n *  @param {string} options.version WMS version, default 1.3.0\n *  @param {Number} options.timeout\n *  @param {string} options.map WMS map or get map in url?map=xxx\n *  @param {string} options.version WMS version (yet only 1.3.0 is implemented), default 1.3.0\n *  @param {number} options.timeout timout to get the capabilities\n */\nol.control.WMSCapabilities.prototype.getCapabilities = function(url, options) {\n  if (!url) return;\n  if (!/(https?:\\/\\/)([\\da-z.-]+)\\.([a-z]{2,6})([/\\w.-]*)*\\/?/g.test(url)) {\n    this.showError({\n      type: 'badUrl'\n    })\n    return;\n  }\n  options = options || {};\n  // Extract map attributes\n  url = url.split('?');\n  var search = url[1];\n  url = url[0];\n  // reset\n  this._elements.formMap.value = '';\n  this._elements.formLayer.value = '';\n  this._elements.formTitle.value = '';\n  this._elements.formProjection.value = this.getMap().getView().getProjection().getCode();\n  this._elements.formFormat.selectedIndex = 0;\n  var map = options.map || '';\n  if (search) {\n    search = search.replace(/^\\?/,'').split('&');\n    search.forEach(function(s) {\n      s = s.split('=');\n      s[1] = decodeURIComponent(s[1] || '');\n      if (/^map$/i.test(s[0])) {\n        map = s[1];\n        this._elements.formMap.value = map;\n      }\n      if (/^layers$/i.test(s[0])) {\n        this._elements.formLayer.value = s[1];\n        this._elements.formTitle.value = s[1].split(',')[0];\n      }\n      if (/^crs$/i.test(s[0])) {\n        this._elements.formProjection.value = s[1];\n      }\n      if (/^format$/i.test(s[0])) {\n        for (var o,i=0; o=this._elements.formFormat.options[i]; i++) {\n          if (o.value===s[1]) {\n            this._elements.formFormat.selectedIndex = i;\n            break;\n          }\n        }\n      }\n    }.bind(this))\n  }\n  // Fill form\n  this._elements.input.value = (url || '') + (map ? '?map='+map : '');\n  this.clearForm();\n  var request = {\n    SERVICE: 'WMS',\n    REQUEST: 'GetCapabilities',\n    VERSION: options.version || '1.3.0'\n  }\n  if (map) request.MAP = map;\n  if (this._proxy) {\n    var q = '';\n    for (var r in request) q += (q?'&':'')+r+'='+request[r];\n    this._ajax.send(this._proxy, {\n      url: q\n    }, {\n      timeout: options.timeout || 10000\n    });\n  } else {\n    this._ajax.send(url, request, {\n      timeout: options.timeout || 10000\n    });\n  }\n};\n/** Display error\n * @param {*} error event\n */\nol.control.WMSCapabilities.prototype.showError = function(e) {\n  if (!e) this._elements.error.innerHTML = '';\n  else this._elements.error.innerHTML = this.error[e.type] || ('ERROR ('+e.type+')');\n  if (e && e.type === 'load') {\n    this._elements.form.classList.add('visible');\n  } else {\n    this._elements.form.classList.remove('visible');\n  }\n};\n/** Clear form\n */\nol.control.WMSCapabilities.prototype.clearForm = function() {\n  this._elements.result.classList.remove('ol-visible')\n  this.showError();\n  this._elements.select.innerHTML = '';\n  this._elements.data.innerHTML = '';\n  this._elements.preview.src = '';\n  this._elements.legend.src = '';\n  this._elements.legend.classList.remove('visible');\n};\n/** Display capabilities in the dialog\n * @param {*} caps JSON capabilities\n */\nol.control.WMSCapabilities.prototype.showCapabilitis = function(caps) {\n  this._elements.result.classList.add('ol-visible')\n//  console.log(caps)\n  var list = [];\n  var addLayers = function(parent, level) {\n    level = level || 0;\n    parent.Layer.forEach(function(l) {\n      if (!l.Attribution) l.Attribution = parent.Attribution;\n      if (!l.EX_GeographicBoundingBox) l.EX_GeographicBoundingBox = parent.EX_GeographicBoundingBox;\n      var li = ol.ext.element.create('OPTION', {\n        className: (l.Layer ? 'ol-title ' : '') + 'level-'+level,\n        html: l.Name || l.Title,\n        click: function(e) {\n          if (e.isTrusted) return;\n          // Load layer\n          var options = this.getOptionsFromCap(l, caps);\n          var layer = this.getLayerFromOptions(options);\n          //\n          list.forEach(function(i) {\n            i.classList.remove('selected');\n          })\n          li.classList.add('selected');\n          this._elements.buttons.innerHTML = '';\n          ol.ext.element.create('BUTTON', {\n            html: this.get('loadLabel') || 'Load',\n            click: function() {\n              this.dispatchEvent({type: 'load', layer: layer, options: options });\n              if (this._dialog) this._dialog.hide();\n            }.bind(this),\n            parent: this._elements.buttons\n          });\n          ol.ext.element.create('BUTTON', {\n            html: '+',\n            className: 'ol-wmsform',\n            click: function() {\n              this._elements.form.classList.toggle('visible');\n              this._elements.legend.classList.toggle('visible');\n            }.bind(this),\n            parent: this._elements.buttons\n          });\n          // Show preview\n          var reso = this.getMap().getView().getResolution();\n          var center = this.getMap().getView().getCenter();\n          this._elements.preview.src = layer.getPreview(center, reso, this.getMap().getView().getProjection());\n          this._img.src = this._elements.preview.src;\n          // ShowInfo\n          this._elements.data.innerHTML = '';\n          ol.ext.element.create('p', {\n            className: 'ol-title',\n            html: options.data.title,\n            parent: this._elements.data\n          });\n          ol.ext.element.create('p', {\n            html: options.data.abstract,\n            parent: this._elements.data\n          });\n          if (options.data.legend.length) {\n            this._elements.legend.src = options.data.legend[0];\n            this._elements.legend.classList.add('visible');\n          } else {\n            this._elements.legend.src = '';\n            this._elements.legend.classList.remove('visible');\n          }\n        }.bind(this),\n        parent: this._elements.select\n      });\n      list.push(li);\n      if (l.Layer) {\n        addLayers(l, level+1);\n      }\n    }.bind(this));\n  }.bind(this);\n  this._elements.select.innerHTML = '';\n  ol.ext.element.create('OPTION', {\n    html: 'layer...',\n    className: 'ol-info',\n    parent: this._elements.select,\n    click: () => {\n      this._elements.buttons.innerHTML = '';\n      this._elements.data.innerHTML = '';\n      this._elements.legend.src = '';\n      this._elements.legend.classList.remove('visible');\n      this._elements.preview.src = '';\n    }\n  });\n  addLayers(caps.Capability.Layer);\n};\n/** Get resolution for a layer\n * @param {string} 'min' or 'max'\n * @param {*} layer\n * @param {number} val\n * @return {number}\n * @private\n */\nol.control.WMSCapabilities.prototype.getLayerResolution = function(m, layer, val) {\n  var att = m==='min' ? 'MinScaleDenominator' : 'MaxScaleDenominator';\n  if (layer[att] !== undefined) return layer[att]/(72/2.54*100);\n  if (!layer.Layer) return (m==='min' ? 0 : 156543.03392804097);\n  // Get min / max of contained layers\n  val = (m==='min' ? 156543.03392804097 : 0);\n  for (var i=0; i<layer.Layer.length; i++) {\n    var res = this.getLayerResolution(m, layer.Layer[i], val);\n    if (res !== undefined) val = Math[m](val, res);\n  }\n  return val;\n};\n/** Return a WMS ol.layer.Tile for the given capabilities\n * @param {*} caps layer capabilities (read from the capabilities)\n * @param {*} parent capabilities\n * @return {*} options\n */\nol.control.WMSCapabilities.prototype.getOptionsFromCap = function(caps, parent) {\n  var formats = parent.Capability.Request.GetMap.Format;\n  var format, i;\n  // Look for prefered format first\n  var pref = [/png/,/jpeg/,/gif/];\n  for (i=0; i<3; i++) {\n    for (var f=0; f<formats.length; f++) {\n      if (pref[i].test(formats[f])) {\n        format = formats[f];\n        break;\n      }\n    }\n    if (format) break;\n  }\n  if (!format) format = formats[0];  \n  // Check srs\n  var srs = this.getMap().getView().getProjection().getCode();\n  this.showError();\n  var crs = false;\n  if (!caps.CRS) {\n    crs = false;\n  } else if (caps.CRS.indexOf(srs)>=0) {\n    crs = true;\n  } else if (caps.CRS.indexOf('EPSG:4326')>=0) {\n    // try to set EPSG:4326 instead\n    srs = 'EPSG:4326';\n    crs = true;\n  } else {\n    this.get('srs').forEach(function(s) {\n      if (caps.CRS.indexOf(s)>=0) {\n        srs = s;\n        crs = true;\n      }\n    })\n  }\n  if (!crs) {\n    this.showError({ type:'srs' });\n    if (this.get('trace')) console.log('BAD srs: ', caps.CRS);\n  }\n  var bbox = caps.EX_GeographicBoundingBox;\n  //bbox = ol.proj.transformExtent(bbox, 'EPSG:4326', srs);\n  if (bbox) bbox = ol.proj.transformExtent(bbox, 'EPSG:4326', this.getMap().getView().getProjection());\n  var attributions = [];\n  if (caps.Attribution) {\n    attributions.push('<a href=\"'+encodeURI(caps.Attribution.OnlineResource)+'\">&copy; '+caps.Attribution.Title.replace(/</g,'&lt;')+'</a>');\n  }\n  var layer_opt = {\n    title: caps.Title,\n    extent: bbox,\n    queryable: caps.queryable,\n    abstract: caps.Abstract,\n    minResolution: this.getLayerResolution('min', caps),\n    maxResolution: this.getLayerResolution('max', caps) || 156543.03392804097\n  };\n  var source_opt = {\n    url: parent.Capability.Request.GetMap.DCPType[0].HTTP.Get.OnlineResource, //parent.Service.OnlineResource,\n    projection: srs,\n    attributions: attributions,\n    crossOrigin: this.get('cors') ? 'anonymous' : null,\n    params: {\n      'LAYERS': caps.Name,\n      'FORMAT': format,\n      'VERSION': parent.version || '1.3.0'\n    }\n  }\n  // Fill form\n  this._elements.formTitle.value = layer_opt.title;\n  this._elements.formLayer.value = source_opt.params.LAYERS;\n  var o;\n  for (i=0; o=this._elements.formFormat.options[i]; i++) {\n    if (o.value===source_opt.params.FORMAT) {\n      this._elements.formFormat.selectedIndex = i;\n      break;\n    }\n  }\n  var view = new ol.View({\n    projection: this.getMap().getView().getProjection()\n  })\n  view.setResolution(layer_opt.minResolution);\n  this._elements.formMaxZoom.value = Math.round(view.getZoom());\n  view.setResolution(layer_opt.maxResolution);\n  this._elements.formMinZoom.value = Math.round(view.getZoom());\n  this._elements.formExtent.value = bbox ? bbox.join(',') : '';\n  this._elements.formProjection.value = source_opt.projection;\n  // Trace\n  if (this.get('trace')) {\n    var tso = JSON.stringify([ source_opt ], null, \"\\t\").replace(/\\\\\"/g,'\"');\n    layer_opt.source = \"new ol.source.TileWMS(\"+tso+\")\";\n    var t = \"new ol.layer.Tile (\" +JSON.stringify(layer_opt, null, \"\\t\")+ \")\" \n    t = t.replace(/\\\\\"/g,'\"')\n      .replace(/\"new/g,'new')\n      .replace(/\\)\"/g,')')\n      .replace(/\\\\t/g,\"\\t\").replace(/\\\\n/g,\"\\n\")\n      .replace(\"([\\n\\t\",\"(\")\n      .replace(\"}\\n])\",\"})\");\n    console.log(t);\n    delete layer_opt.source;\n  }\n  // Legend ?\n  var legend = [];\n    if (caps.Style) {\n    caps.Style.forEach(function(s) {\n      if (s.LegendURL) {\n        legend.push(s.LegendURL[0].OnlineResource);\n      }\n    });\n  }\n  return ({ \n    layer: layer_opt, \n    source: source_opt,\n    data: {\n      title: caps.Title,\n      abstract: caps.Abstract,\n      logo: caps.Attribution && caps.Attribution.LogoURL ? caps.Attribution.LogoURL.OnlineResource : undefined,\n      keyword: caps.KeywordList,\n      legend: legend,\n      opaque: caps.opaque,\n      queryable: caps.queryable\n    } \n  });\n};\n\n/*\n  Copyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL license (http://www.cecill.info/).\n*/\n/** Feature animation base class\n * Use the {@link _ol_Map_#animateFeature} or {@link _ol_layer_Vector_#animateFeature} to animate a feature\n * on postcompose in a map or a layer\n* @constructor\n* @fires animationstart\n* @fires animating\n* @fires animationend\n* @param {ol.featureAnimationOptions} options\n*\t@param {Number} options.duration duration of the animation in ms, default 1000\n*\t@param {bool} options.revers revers the animation direction\n*\t@param {Number} options.repeat number of time to repeat the animation, default 0\n*\t@param {ol.style.Style} options.hiddenStyle a style to display the feature when playing the animation\n*\t  to be used to make the feature selectable when playing animation \n*\t  (@see {@link ../examples/map.featureanimation.select.html}), default the feature \n*\t  will be hidden when playing (and not selectable)\n*\t@param {ol.easing.Function} options.fade an easing function used to fade in the feature, default none\n*\t@param {ol.easing.Function} options.easing an easing function for the animation, default ol.easing.linear\n*/\nol.featureAnimation = function(options) {\n  options = options || {};\n  this.duration_ = typeof (options.duration)=='number' ? (options.duration>=0 ? options.duration : 0) : 1000;\n  this.fade_ = typeof(options.fade) == 'function' ? options.fade : null;\n  this.repeat_ = Number(options.repeat);\n  var easing = typeof(options.easing) =='function' ? options.easing : ol.easing.linear;\n  if (options.revers) this.easing_ = function(t) { return (1 - easing(t)); };\n  else this.easing_ = easing;\n  this.hiddenStyle = options.hiddenStyle;\n  ol.Object.call(this);\n};\nol.ext.inherits(ol.featureAnimation, ol.Object);\n/** Hidden style: a transparent style\n */\nol.featureAnimation.hiddenStyle = new ol.style.Style({ \n  image: new ol.style.Circle({}), \n  stroke: new ol.style.Stroke({ \n    color: 'transparent' \n  }) \n});\n/** Draw a geometry \n* @param {olx.animateFeatureEvent} e\n* @param {ol.geom} geom geometry for shadow\n* @param {ol.geom} shadow geometry for shadow (ie. style with zIndex = -1)\n* @private\n*/\nol.featureAnimation.prototype.drawGeom_ = function (e, geom, shadow) {\n  if (this.fade_) {\n    e.context.globalAlpha = this.fade_(1-e.elapsed);\n  }\n  var style = e.style;\n  for (var i=0; i<style.length; i++) {\n    // Prevent crach if the style is not ready (image not loaded)\n    try {\n      var vectorContext = e.vectorContext || ol.render.getVectorContext(e);\n      vectorContext.setStyle(style[i]);\n      if (style[i].getZIndex()<0) vectorContext.drawGeometry(shadow||geom);\n      else vectorContext.drawGeometry(geom);\n    } catch(e) { /* ok */ }\n  }\n};\n/** Function to perform manipulations onpostcompose. \n * This function is called with an ol.featureAnimationEvent argument.\n * The function will be overridden by the child implementation.    \n * Return true to keep this function for the next frame, false to remove it.\n * @param {ol.featureAnimationEvent} e\n * @return {bool} true to continue animation.\n * @api \n */\nol.featureAnimation.prototype.animate = function (/* e */) {\n  return false;\n};\n/** An animation controler object an object to control animation with start, stop and isPlaying function.    \n * To be used with {@link olx.Map#animateFeature} or {@link ol.layer.Vector#animateFeature}\n * @typedef {Object} ol.animationControler\n * @property {function} start - start animation.\n * @property {function} stop - stop animation option arguments can be passed in animationend event.\n * @property {function} isPlaying - return true if animation is playing.\n */\n/** Animate feature on a map\n * @function \n * @param {ol.Feature} feature Feature to animate\n * @param {ol.featureAnimation|Array<ol.featureAnimation>} fanim the animation to play\n * @return {olx.animationControler} an object to control animation with start, stop and isPlaying function\n */\nol.Map.prototype.animateFeature = function(feature, fanim) {\n  // Get or create an animation layer associated with the map \n  var layer = this._featureAnimationLayer;\n  if (!layer) {\n    layer = this._featureAnimationLayer = new ol.layer.Vector({ source: new ol.source.Vector() });\n    layer.setMap(this);\n  }\n  // Animate feature on this layer\n  layer.getSource().addFeature(feature);\n  var listener = fanim.on('animationend', function(e) {\n    if (e.feature===feature) {\n      // Remove feature on end\n      layer.getSource().removeFeature(feature);\n      ol.Observable.unByKey(listener);\n    }\n  });\n  layer.animateFeature(feature, fanim);\n};\n/** Animate feature on a vector layer \n * @fires animationstart, animationend\n * @param {ol.Feature} feature Feature to animate\n * @param {ol.featureAnimation|Array<ol.featureAnimation>} fanim the animation to play\n * @param {boolean} useFilter use the filters of the layer\n * @return {olx.animationControler} an object to control animation with start, stop and isPlaying function\n */\nol.layer.Base.prototype.animateFeature = function(feature, fanim, useFilter) {\n  var self = this;\n  var listenerKey;\n  // Save style\n  var style = feature.getStyle();\n  var flashStyle = style || (this.getStyleFunction ? this.getStyleFunction()(feature) : null);\n  if (!flashStyle) flashStyle=[];\n  if (!(flashStyle instanceof Array)) flashStyle = [flashStyle];\n  // Structure pass for animating\n  var event = {\n    // Frame context\n    vectorContext: null,\n    frameState: null,\n    start: 0,\n    time: 0,\n    elapsed: 0,\n    extent: false,\n    // Feature information\n    feature: feature,\n    geom: feature.getGeometry(),\n    typeGeom: feature.getGeometry().getType(),\n    bbox: feature.getGeometry().getExtent(),\n    coord: ol.extent.getCenter(feature.getGeometry().getExtent()),\n    style: flashStyle\n  };\n  if (!(fanim instanceof Array)) fanim = [fanim];\n  // Remove null animations\n  for (var i=fanim.length-1; i>=0; i--) {\n    if (fanim[i].duration_===0) fanim.splice(i,1);\n  }\n  var nb=0, step = 0;\n  // Filter availiable on the layer\n  var filters = (useFilter && this.getFilters) ? this.getFilters() : [];\n  function animate(e) {\n    event.type = e.type;\n    try {\n      event.vectorContext = e.vectorContext || ol.render.getVectorContext(e);\n    } catch(e) { /* nothing todo */ }\n    event.frameState = e.frameState;\n    event.inversePixelTransform = e.inversePixelTransform;\n    if (!event.extent) {\n      event.extent = e.frameState.extent;\n      event.start = e.frameState.time;\n      event.context = e.context;\n    }\n    event.time = e.frameState.time - event.start;\n    event.elapsed = event.time / fanim[step].duration_;\n    if (event.elapsed > 1) event.elapsed = 1;\n    // Filter\n    e.context.save();\n    filters.forEach(function(f) {\n      if (f.get('active')) f.precompose(e);\n    });\n    if (this.getOpacity) {\n      e.context.globalAlpha = this.getOpacity();\n    }\n    // Stop animation?\n    if (!fanim[step].animate(event)) {\n      nb++;\n      // Repeat animation\n      if (nb < fanim[step].repeat_) {\n        event.extent = false;\n      } else if (step < fanim.length-1) {\n        // newt step\n        fanim[step].dispatchEvent({ type:'animationend', feature: feature });\n        step++;\n        nb=0;\n        event.extent = false;\n      } else {\n        // the end\n        stop();\n      }\n    } else {\n      var animEvent = { \n        type: 'animating', \n        step: step,\n        start: event.start,\n        time: event.time,\n        elapsed: event.elapsed,\n        rotation: event.rotation||0,\n        geom: event.geom,\n        coordinate: event.coord,\n        feature: feature \n      };\n      fanim[step].dispatchEvent(animEvent);\n      self.dispatchEvent(animEvent);\n    }\n    filters.forEach(function(f) {\n      if (f.get('active')) f.postcompose(e);\n    });\n    e.context.restore();\n    // tell OL3 to continue postcompose animation\n    e.frameState.animate = true;\n  }\n  // Stop animation\n  function stop(options) {\n    ol.Observable.unByKey(listenerKey);\n    listenerKey = null;\n    feature.setStyle(style);\n    // Send event\n    var event = { type:'animationend', feature: feature };\n    if (options) {\n      for (var i in options) if (options.hasOwnProperty(i)) {\n        event[i] = options[i]; \n      }\n    }\n    fanim[step].dispatchEvent(event);\n    self.dispatchEvent(event);\n  }\n  // Launch animation\n  function start(options) {\n    if (fanim.length && !listenerKey) {\n      listenerKey = self.on(['postcompose','postrender'], animate.bind(self));\n      // map or layer?\n      if (self.renderSync) self.renderSync();\n      else self.changed();\n      // Hide feature while animating\n      feature.setStyle(fanim[step].hiddenStyle || ol.featureAnimation.hiddenStyle);\n      // Send event\n      var event = { type:'animationstart', feature: feature };\n      if (options) {\n        for (var i in options) if (options.hasOwnProperty(i)) {\n          event[i] = options[i]; \n        }\n      }\n      fanim[step].dispatchEvent(event);\n      self.dispatchEvent(event);\n    }\n  }\n  start();\n  // Return animation controler\n  return {\n    start: start,\n    stop: stop,\n    isPlaying: function() { return (!!listenerKey); }\n  };\n};\n\n/*\n  Copyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL license (http://www.cecill.info/).\n*/\n/** Blink a feature\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationOptions} options\n *  @param {Number} options.nb number of blink, default 10\n */\nol.featureAnimation.Blink = function(options) {\n  ol.featureAnimation.call(this, options);\n  this.set('nb', options.nb || 10)\n}\nol.ext.inherits(ol.featureAnimation.Blink, ol.featureAnimation);\n/** Animate: Show or hide feature depending on the laptimes\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Blink.prototype.animate = function (e) {\t\n  if (!(Math.round(this.easing_(e.elapsed)*this.get('nb'))%2)) {\n    this.drawGeom_(e, e.geom);\n  }\n  return (e.time <= this.duration_);\n}\n\n/*\n\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL license (http://www.cecill.info/).\n*/\n/** Bounce animation: \n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationBounceOptions} options\n *\t@param {Integer} options.bounce number of bounce, default 3\n *\t@param {Integer} options.amplitude bounce amplitude,default 40\n *\t@param {ol.easing} options.easing easing used for decaying amplitude, use function(){return 0} for no decay, default ol.easing.linear\n *\t@param {Integer} options.duration duration in ms, default 1000\n */\nol.featureAnimation.Bounce = function(options)\n{\toptions = options || {};\n\tol.featureAnimation.call(this, options);\n\tthis.amplitude_ = options.amplitude || 40;\n\tthis.bounce_ = -Math.PI*(options.bounce || 3);\n}\nol.ext.inherits(ol.featureAnimation.Bounce, ol.featureAnimation);\n/** Animate\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Bounce.prototype.animate = function (e)\n{\t// Animate\n\tvar flashGeom = e.geom.clone();\n\t/*\n\tvar t = this.easing_(e.elapsed)\n\tt = Math.abs(Math.sin(this.bounce_*t)) * this.amplitude_ * (1-t) * e.frameState.viewState.resolution;\n\t*/\n\tvar t = Math.abs(Math.sin(this.bounce_*e.elapsed)) * this.amplitude_ * (1-this.easing_(e.elapsed)) * e.frameState.viewState.resolution;\n\tflashGeom.translate(0, t);\n\tthis.drawGeom_(e, flashGeom, e.geom);\n\treturn (e.time <= this.duration_);\n}\n\n/*\n\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL license (http://www.cecill.info/).\n*/\n/** Drop animation: drop a feature on the map\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationDropOptions} options\n *  @param {Number} options.speed speed of the feature if 0 the duration parameter will be used instead, default 0\n *  @param {Number} options.side top or bottom, default top\n */\nol.featureAnimation.Drop = function(options)\n{\toptions = options || {};\n\tthis.speed_ = options.speed || 0;\n\tol.featureAnimation.call(this, options);\n\tthis.side_ = options.side || 'top';\n}\nol.ext.inherits(ol.featureAnimation.Drop, ol.featureAnimation);\n/** Animate\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Drop.prototype.animate = function (e)\n{\t// First time > calculate duration / speed\n\tif (!e.time) \n\t{\tvar angle = e.frameState.viewState.rotation;\n\t\tvar s = e.frameState.size[1] * e.frameState.viewState.resolution;\n\t\tif (this.side_!='top') s *= -1;\n\t\tthis.dx = -Math.sin(angle)*s;\n\t\tthis.dy = Math.cos(angle)*s;\n\t\tif (this.speed_) \n\t\t{\tthis.duration_ = s/this.speed_/e.frameState.viewState.resolution;\n\t\t}\n\t}\n\t// Animate\n\tvar flashGeom = e.geom.clone();\n\tflashGeom.translate(\n\t\tthis.dx*(1-this.easing_(e.elapsed)),  \n\t\tthis.dy*(1-this.easing_(e.elapsed))\n\t);\n\tthis.drawGeom_(e, flashGeom, e.geom);\n\treturn (e.time <= this.duration_);\n}\n\n/*\n\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL license (http://www.cecill.info/).\n*/\n/** Fade animation: feature fade in\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationOptions} options\n */\nol.featureAnimation.Fade = function(options)\n{\toptions = options || {};\n\tthis.speed_ = options.speed || 0;\n\tol.featureAnimation.call(this, options);\n}\nol.ext.inherits(ol.featureAnimation.Fade, ol.featureAnimation);\n/** Animate\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Fade.prototype.animate = function (e)\n{\te.context.globalAlpha = this.easing_(e.elapsed);\n\tthis.drawGeom_(e, e.geom);\n\treturn (e.time <= this.duration_);\n}\n\n/*\n\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL license (http://www.cecill.info/).\n*/\n/** Do nothing for a given duration\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationShowOptions} options\n * \n */\nol.featureAnimation.None = function(options)\n{\tol.featureAnimation.call(this, options);\n};\nol.ext.inherits(ol.featureAnimation.None, ol.featureAnimation);\n/** Animate: do nothing during the laps time\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.None.prototype.animate = function (e)\n{\t\n\treturn (e.time <= this.duration_);\n};\n\n/*\n  Copyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL license (http://www.cecill.info/).\n*/\n/** Do nothing \n * @constructor\n * @extends {ol.featureAnimation}\n */\nol.featureAnimation.Null = function() {\n  ol.featureAnimation.call(this, { duration:0 });\n};\nol.ext.inherits(ol.featureAnimation.Null, ol.featureAnimation);\n\n/*\n  Copyright (c) 2016-2018 Jean-Marc VIGLINO, \n  released under the CeCILL license (http://www.cecill.info/).\n*/\n/** Path animation: feature follow a path\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationPathOptions} options extend ol.featureAnimation options\n *  @param {Number} options.speed speed of the feature, if 0 the duration parameter will be used instead, default 0\n *  @param {Number|boolean} options.rotate rotate the symbol when following the path, true or the initial rotation, default false\n *  @param {ol.geom.LineString|ol.Feature} options.path the path to follow\n */\nol.featureAnimation.Path = function(options){\n  options = options || {};\n  ol.featureAnimation.call(this, options);\n  this.speed_ = options.speed || 0;\n  this.path_ = options.path;\n  switch (options.rotate) {\n    case true: \n    case 0:\n      this.rotate_ = 0;\n      break;\n    default:\n      this.rotate_ = options.rotate || false;\n      break;\n  }\n  if (this.path_ && this.path_.getGeometry) this.path_ = this.path_.getGeometry();\n  if (this.path_ && this.path_.getLineString) this.path_ = this.path_.getLineString();\n  if (this.path_.getLength) {\n    this.dist_ = this.path_.getLength()\n    if (this.path_ && this.path_.getCoordinates) this.path_ = this.path_.getCoordinates();\n  } else {\n    this.dist_ = 0;\n  }\n  if (this.speed_>0) this.duration_ = this.dist_/this.speed_;\n}\nol.ext.inherits(ol.featureAnimation.Path, ol.featureAnimation);\n/** Animate\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Path.prototype.animate = function (e) {\n  // First time \n  if (!e.time) {\n    if (!this.dist_) return false;\n  }\n  var dmax = this.dist_*this.easing_(e.elapsed);\n  var p0, p, s, dx,dy, dl, d = 0;\n  p = this.path_[0];\n  // Linear interpol\n  for (var i = 1; i<this.path_.length; i++) {\n    p0 = p;\n    p = this.path_[i];\n    dx = p[0]-p0[0];\n    dy = p[1]-p0[1];\n    dl = Math.sqrt(dx*dx+dy*dy);\n    if (dl && d+dl>=dmax) {\n      s = (dmax-d)/dl;\n      p = [ p0[0] + (p[0]-p0[0])*s, p0[1] + (p[1]-p0[1])*s];\n      break;\n    }\n    d += dl;\n  }\n  // Rotate symbols\n  var style = e.style;\n  e.rotation = Math.PI/2 + Math.atan2(p0[1] - p[1], p0[0] - p[0]);\n  if (this.rotate_!==false) {\n    var st = []\n    var angle = this.rotate_ - e.rotation + e.frameState.viewState.rotation;\n    e.rotation = Math.PI/2 + Math.atan2(p0[1] - p[1], p0[0] - p[0]);\n    for (var k=0; s=e.style[k]; k++) {\n      if (s.getImage()) {\n        //s = s.clone();\n        s.getImage().setRotation(angle);\n      }\n      st.push(s);\n    }\n    // Rotated style\n    e.style = st;\n  }\n  e.geom.setCoordinates(p);\n  // Animate\n  this.drawGeom_(e, e.geom);\n  // restore style (if modify by rotation)\n  e.style = style;\n  return (e.time <= this.duration_);\n}\n\n/*\n\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL license (http://www.cecill.info/).\n*/\n/** Shakee animation: \n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationShakeOptions} options\n *\t@param {Integer} options.bounce number o bounds, default 6\n *\t@param {Integer} options.amplitude amplitude of the animation, default 40\n *\t@param {bool} options.horizontal shake horizontally default false (vertical)\n */\nol.featureAnimation.Shake = function(options)\n{\toptions = options || {};\n\tol.featureAnimation.call(this, options);\n//\tthis.easing_ = options.easing_ || function(t){return (0.5+t)*t -0.5*t ;};\n\tthis.amplitude_ = options.amplitude || 40;\n\tthis.bounce_ = -Math.PI*(options.bounce || 6);\n\tthis.horizontal_ = options.horizontal;\n}\nol.ext.inherits(ol.featureAnimation.Shake, ol.featureAnimation);\n/** Animate\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Shake.prototype.animate = function (e)\n{\t// Animate\n\tvar flashGeom = e.geom.clone();\n\tvar shadow = e.geom.clone();\n\tvar t = this.easing_(e.elapsed)\n\tt = Math.sin(this.bounce_*t) * this.amplitude_ * (1-t) * e.frameState.viewState.resolution;\n\tif (this.horizontal_) \n\t{\tflashGeom.translate(t, 0);\n\t\tshadow.translate(t, 0);\n\t}\n\telse flashGeom.translate(0, t);\n\tthis.drawGeom_(e, flashGeom, shadow);\n\treturn (e.time <= this.duration_);\n}\n\n/*\n  Copyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL license (http://www.cecill.info/).\n*/\n/** Show an object for a given duration\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationOptions} options\n */\nol.featureAnimation.Show = function(options) {\n  ol.featureAnimation.call(this, options);\n}\nol.ext.inherits(ol.featureAnimation.Show, ol.featureAnimation);\n/** Animate: just show the object during the laps time\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Show.prototype.animate = function (e) {\t\n  this.drawGeom_(e, e.geom);\n  return (e.time <= this.duration_);\n}\n\n/*\n\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL license (http://www.cecill.info/).\n*/\n/** Slice animation: feature enter from left\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationSlideOptions} options\n *  @param {Number} options.speed speed of the animation, if 0 the duration parameter will be used instead, default 0\n */\nol.featureAnimation.Slide = function(options)\n{\toptions = options || {};\n\tthis.speed_ = options.speed || 0;\n\tol.featureAnimation.call(this, options);\n\tthis.side_ = options.side || 'left';\n}\nol.ext.inherits(ol.featureAnimation.Slide, ol.featureAnimation);\n/** Animate\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Slide.prototype.animate = function (e)\n{\t// First time > calculate duration / speed\n\tif (!e.time) \n\t{\tif (this.side_=='left') this.dx = (e.extent[0]-e.bbox[2])\n\t\telse this.dx = (e.extent[2]-e.bbox[0])\n\t\tif (this.speed_) this.duration_ = Math.abs(this.dx)/this.speed_/e.frameState.viewState.resolution;\n\t}\n\t// Animate\n\tvar flashGeom = e.geom.clone();\n\tflashGeom.translate(this.dx*(1-this.easing_(e.elapsed)), 0);\n\tthis.drawGeom_(e, flashGeom);\n\treturn (e.time <= this.duration_);\n}\n\n/*\n\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL license (http://www.cecill.info/).\n*/\n/** Teleport a feature at a given place\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationOptions} options\n */\nol.featureAnimation.Teleport = function(options)\n{\tol.featureAnimation.call(this, options);\n}\nol.ext.inherits(ol.featureAnimation.Teleport, ol.featureAnimation);\n/** Animate\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Teleport.prototype.animate = function (e)\n{\tvar sc = this.easing_(e.elapsed);\n\tif (sc)\n\t{\te.context.save()\n\t\t\tvar ratio = e.frameState.pixelRatio;\n\t\t\te.context.globalAlpha = sc;\n\t\t\te.context.scale(sc,1/sc);\n\t\t\tvar m = e.frameState.coordinateToPixelTransform;\n\t\t\tvar dx = (1/sc-1) * ratio * (m[0]*e.coord[0] + m[1]*e.coord[1] +m[4]);\n\t\t\tvar dy = (sc-1) * ratio * (m[2]*e.coord[0] + m[3]*e.coord[1] +m[5]);\n\t\t\te.context.translate(dx,dy);\n\t\t\tthis.drawGeom_(e, e.geom);\n\t\te.context.restore()\n\t}\n\treturn (e.time <= this.duration_);\n}\n\n/*\n\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL license (http://www.cecill.info/).\n*/\n/** Slice animation: feature enter from left\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationThrowOptions} options\n *  @param {left|right} options.side side of the animation, default left\n */\nol.featureAnimation.Throw = function(options)\n{\toptions = options || {};\n\tol.featureAnimation.call(this, options);\n\tthis.speed_ = options.speed || 0;\n\tthis.side_ = options.side || 'left';\n}\nol.ext.inherits(ol.featureAnimation.Throw, ol.featureAnimation);\n/** Animate\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Throw.prototype.animate = function (e)\n{\t// First time > calculate duration / speed\n\tif (!e.time && this.speed_) \n\t{\tvar dx, dy;\n\t\tif (this.side_=='left')\n\t\t{\tdx = this.dx = e.extent[0]-e.bbox[2];\n\t\t\tdy = this.dy = e.extent[3]-e.bbox[1];\n\t\t}\n\t\telse\n\t\t{\tdx = this.dx = e.extent[2]-e.bbox[0];\n\t\t\tdy = this.dy = e.extent[3]-e.bbox[1];\n\t\t}\n\t\tthis.duration_ = Math.sqrt(dx*dx+dy*dy)/this.speed_/e.frameState.viewState.resolution;\n\t}\n\t// Animate\n\tvar flashGeom = e.geom.clone();\n\tvar shadow = e.geom.clone();\n\tflashGeom.translate(this.dx*(1-this.easing_(e.elapsed)), \n\t\tthis.dy*Math.cos(Math.PI/2*this.easing_(e.elapsed)));\n\tshadow.translate(this.dx*(1-this.easing_(e.elapsed)), 0);\n\tthis.drawGeom_(e, flashGeom, shadow);\n\treturn (e.time <= this.duration_);\n}\n\n/*\n  Copyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL license (http://www.cecill.info/).\n*/\n/** Zoom animation: feature zoom in (for points)\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationZoomOptions} options\n *  @param {bool} options.zoomOut to zoom out\n */\nol.featureAnimation.Zoom = function(options){\n  options = options || {};\n  ol.featureAnimation.call(this, options);\n  this.set('zoomout', options.zoomOut);\n}\nol.ext.inherits(ol.featureAnimation.Zoom, ol.featureAnimation);\n/** Zoom animation: feature zoom out (for points)\n * @constructor\n * @extends {ol.featureAnimation}\n * @param {ol.featureAnimationZoomOptions} options\n */\nol.featureAnimation.ZoomOut = function(options) {\n  options = options || {};\n  options.zoomOut = true;\n  ol.featureAnimation.Zoom.call(this, options);\n}\nol.ext.inherits(ol.featureAnimation.ZoomOut, ol.featureAnimation.Zoom);\n/** Animate\n* @param {ol.featureAnimationEvent} e\n*/\nol.featureAnimation.Zoom.prototype.animate = function (e) {\n  var fac = this.easing_(e.elapsed);\n  if (fac) {\n    if (this.get('zoomout')) fac  = 1/fac;\n    var style = e.style;\n    var i, imgs, sc=[]\n    for (i=0; i<style.length; i++) {\n      imgs = style[i].getImage();\n      if (imgs) {\n        sc[i] = imgs.getScale();\n        // ol >= v6\n        if (e.type==='postrender') imgs.setScale(sc[i]*fac/e.frameState.pixelRatio);\n        else imgs.setScale(sc[i]*fac);\n      }\n    }\n    this.drawGeom_(e, e.geom);\n    for (i=0; i<style.length; i++) {\n      imgs = style[i].getImage();\n      if (imgs) imgs.setScale(sc[i]);\n    }\n  }\n/*\n  var sc = this.easing_(e.elapsed);\n  if (sc)\n  {\te.context.save()\n    console.log(e)\n      var ratio = e.frameState.pixelRatio;\n      var m = e.frameState.coordinateToPixelTransform;\n      var dx = (1/(sc)-1)* ratio * (m[0]*e.coord[0] + m[1]*e.coord[1] +m[4]);\n      var dy = (1/(sc)-1)*ratio * (m[2]*e.coord[0] + m[3]*e.coord[1] +m[5]);\n      e.context.scale(sc,sc);\n      e.context.translate(dx,dy);\n      this.drawGeom_(e, e.geom);\n    e.context.restore()\n  }\n*/\n  return (e.time <= this.duration_);\n}\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/* Namespace */\nol.filter = {};\n/**\n * @classdesc \n * Abstract base class; normally only used for creating subclasses and not instantiated in apps.    \n * Used to create filters    \n * Use {@link _ol_Map_#addFilter}, {@link _ol_Map_#removeFilter} or {@link _ol_Map_#getFilters} to handle filters on a map.\n * Use {@link ol.layer.Base#addFilter}, {@link ol.layer.Base#removeFilter} or {@link ol.layer.Base#getFilters}\n * to handle filters on layers.\n *\n * @constructor\n * @extends {ol.Object}\n * @param {Object} options Extend {@link _ol_control_Control_} options.\n *  @param {boolean} [options.active]\n */\nol.filter.Base = function(options) {\n  ol.Object.call(this);\n  // Array of postcompose listener\n  this._listener = [];\n  if (options && options.active===false) this.set('active', false);\n  else this.set('active', true);\n};\nol.ext.inherits(ol.filter.Base, ol.Object);\n/** Activate / deactivate filter\n*\t@param {boolean} b\n*/\nol.filter.Base.prototype.setActive = function (b) {\n  this.set('active', b===true);\n};\n/** Get filter active\n*\t@return {boolean}\n*/\nol.filter.Base.prototype.getActive = function () {\n  return this.get('active');\n};\n(function(){\n/** Internal function\n* @this {ol.filter} this the filter\n* @private\n*/\nfunction precompose_(e) {\n  if (this.get('active') && e.context) this.precompose(e);\n}\n/** Internal function\n* @this {ol.filter} this the filter\n* @private\n*/\nfunction postcompose_(e) {\n  if (this.get('active') && e.context) this.postcompose(e);\n}\n/** Force filter redraw / Internal function\n* @this {ol.Map|ol.layer.Layer} this: the map or layer the filter is added to\n* @private\n*/\nfunction filterRedraw_(/* e */) {\n  if (this.renderSync) this.renderSync();\n  else this.changed(); \n}\n/** Add a filter to an ol object\n* @this {ol.Map|ol.layer.Layer} this: the map or layer the filter is added to\n* @private\n*/\nfunction addFilter_(filter) {\n  if (!this.filters_) this.filters_ = [];\n  this.filters_.push(filter);\n  if (filter.precompose) filter._listener.push ( { listener: this.on(['precompose','prerender'], precompose_.bind(filter)), target: this });\n  if (filter.postcompose) filter._listener.push ( { listener: this.on(['postcompose','postrender'], postcompose_.bind(filter)), target: this });\n  filter._listener.push ( { listener: filter.on('propertychange', filterRedraw_.bind(this)), target: this });\n  filterRedraw_.call (this);\n}\n/** Remove a filter to an ol object\n* @this {ol.Map|ol.layer.Layer} this: the map or layer the filter is added to\n* @private\n*/\nfunction removeFilter_(filter) {\n  var i\n  if (!this.filters_) this.filters_ = [];\n  for (i=this.filters_.length-1; i>=0; i--) {\n    if (this.filters_[i]===filter) this.filters_.splice(i,1);\n  }\n  for (i=filter._listener.length-1; i>=0; i--) {\n    // Remove listener on this object\n    if (filter._listener[i].target === this) {\n      ol.Observable.unByKey(filter._listener[i].listener);\n      filter._listener.splice(i,1);\n    }\n  }\n  filterRedraw_.call (this);\n}\n/** Add a filter to an ol.Map\n*\t@param {ol.filter}\n*/\nol.Map.prototype.addFilter = function (filter) {\n  console.warn('[OL-EXT] addFilter deprecated on map.')\n  addFilter_.call (this, filter);\n};\n/** Remove a filter to an ol.Map\n*\t@param {ol.filter}\n*/\nol.Map.prototype.removeFilter = function (filter) {\n  removeFilter_.call (this, filter);\n};\n/** Get filters associated with an ol.Map\n*\t@return {Array<ol.filter>}\n*/\nol.Map.prototype.getFilters = function () {\n  return this.filters_ || [];\n};\n/** Add a filter to an ol.Layer\n*\t@param {ol.filter}\n*/\nol.layer.Base.prototype.addFilter = function (filter) {\n  addFilter_.call (this, filter);\n};\n/** Remove a filter to an ol.Layer\n*\t@param {ol.filter}\n*/\nol.layer.Base.prototype.removeFilter = function (filter) {\n  removeFilter_.call (this, filter);\n};\n/** Get filters associated with an ol.Map\n*\t@return {Array<ol.filter>}\n*/\nol.layer.Base.prototype.getFilters = function () {\n  return this.filters_ || [];\n};\n})();\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Mask drawing using an ol.Feature\n * @constructor\n * @requires ol.filter\n * @extends {ol.filter.Base}\n * @param {Object} [options]\n *  @param {ol.Feature} [options.feature] feature to mask with\n *  @param {ol.style.Fill} [options.fill] style to fill with\n *  @param {boolean} [options.inner] mask inner, default false\n */\nol.filter.Mask = function(options) {\n  options = options || {};\n  ol.filter.Base.call(this, options);\n  if (options.feature) {\n    switch (options.feature.getGeometry().getType()) {\n      case 'Polygon':\n      case 'MultiPolygon':\n        this.feature_ = options.feature;\n        break;\n      default: break;\n    }\n  }\n  this.set('inner', options.inner);\n  this.fillColor_ = options.fill ? ol.color.asString(options.fill.getColor()) || \"rgba(0,0,0,0.2)\" : \"rgba(0,0,0,0.2)\";\n}\nol.ext.inherits(ol.filter.Mask, ol.filter.Base);\n/** Draw the feature into canvas */\nol.filter.Mask.prototype.drawFeaturePath_ = function(e, out) {\n  var ctx = e.context;\n  var canvas = ctx.canvas;\n  var ratio = e.frameState.pixelRatio;\n  // Transform\n  var tr;\n  if (e.frameState.coordinateToPixelTransform) {\n    var m = e.frameState.coordinateToPixelTransform;\n    // ol > 6\n    if (e.inversePixelTransform) {\n      var ipt = e.inversePixelTransform;\n      tr = function(pt) {\n        pt = [\n          (pt[0]*m[0]+pt[1]*m[1]+m[4]),\n          (pt[0]*m[2]+pt[1]*m[3]+m[5])\n        ];\n        return [\n          (pt[0]*ipt[0] - pt[1]*ipt[1] + ipt[4]),\n          (-pt[0]*ipt[2] + pt[1]*ipt[3] + ipt[5])\n        ]\n      }\n    } else {\n      // ol 5\n      tr = function(pt) {\n        return [\n          (pt[0]*m[0]+pt[1]*m[1]+m[4])*ratio,\n          (pt[0]*m[2]+pt[1]*m[3]+m[5])*ratio\n        ];\n      }\n    }\n  } else {\n    // Older version\n    m = e.frameState.coordinateToPixelMatrix;\n    tr = function(pt) {\n      return [\n        (pt[0]*m[0]+pt[1]*m[1]+m[12])*ratio,\n        (pt[0]*m[4]+pt[1]*m[5]+m[13])*ratio\n      ];\n    }\n  }\n  // Geometry\n  var ll = this.feature_.getGeometry().getCoordinates();\n  if (this.feature_.getGeometry().getType()==\"Polygon\") ll = [ll];\n  ctx.beginPath();\n    if (out) {\n      ctx.moveTo (0,0);\n      ctx.lineTo (canvas.width, 0);\n      ctx.lineTo (canvas.width, canvas.height);\n      ctx.lineTo (0, canvas.height);\n      ctx.lineTo (0, 0);\n    }\n    for (var l=0; l<ll.length; l++) {\n      var c = ll[l];\n      for (var i=0; i<c.length; i++) {\n        var pt = tr(c[i][0]);\n        ctx.moveTo (pt[0], pt[1]);\n        for (var j=1; j<c[i].length; j++) {\n          pt = tr(c[i][j]);\n          ctx.lineTo (pt[0], pt[1]);\n        }\n      }\n    }\n};\nol.filter.Mask.prototype.postcompose = function(e) {\n  if (!this.feature_) return;\n  var ctx = e.context;\n  ctx.save();\n    this.drawFeaturePath_(e, !this.get(\"inner\"));\n    ctx.fillStyle = this.fillColor_;\n    ctx.fill(\"evenodd\");\n  ctx.restore();\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** @typedef {Object} CanvasFilterOptions\n * @property {url} url Takes an IRI pointing to an SVG filter element\n * @property {number} blur Gaussian blur value in px\n * @property {number} brightness linear multiplier to the drawing, under 100: darkens the image, over 100 brightens it\n * @property {number} contrast Adjusts the contrast, under 0: black, 100 no change\n * @property {ol.pixel} shadow Applies a drop shadow effect, pixel offset\n * @property {number} shadowBlur Blur radius\n * @property {number} shadowColor \n * @property {number} grayscale 0: unchanged, 100: completely grayscale\n * @property {number} hueRotate Hue rotation angle in deg\n * @property {number} invert Inverts the drawing, 0: unchanged, 100: invert\n * @property {number} saturate Saturates the drawing, 0: unsaturated, 100: unchanged\n * @property {number} sepia Converts the drawing to sepia, 0: sepia, 100: unchanged\n */\n/** Add a canvas Context2D filter to a layer\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter\n * @constructor\n * @requires ol.filter\n * @extends {ol.filter.Base}\n * @param {CanvasFilterOptions} options\n */\nol.filter.CanvasFilter = function(options) {\n  ol.filter.Base.call(this, options);\n  this._svg = {};\n};\nol.ext.inherits(ol.filter.CanvasFilter, ol.filter.Base);\n/** Add a new svg filter\n * @param {string|ol.ext.SVGFilter} url IRI pointing to an SVG filter element\n */\nol.filter.CanvasFilter.prototype.addSVGFilter = function(url) {\n  if (url.getId) url = '#'+url.getId();\n  this._svg[url] = 1;\n  this.dispatchEvent({ type: 'propertychange', key: 'svg', oldValue: this._svg });\n};\n/** Remove a svg filter\n * @param {string|ol.ext.SVGFilter} url IRI pointing to an SVG filter element\n */\nol.filter.CanvasFilter.prototype.removeSVGFilter = function(url) {\n  if (url.getId) url = '#'+url.getId();\n  delete this._svg[url]\n  this.dispatchEvent({ type: 'propertychange', key: 'svg', oldValue: this._svg });\n};\n/**\n * @private\n */\nol.filter.CanvasFilter.prototype.precompose = function() {\n};\n/**\n * @private\n */\nol.filter.CanvasFilter.prototype.postcompose = function(e) {\n  var filter = []\n  // Set filters\n  if (this.get('url')!==undefined) filter.push('url('+this.get('url')+')'); \n  for (var f in this._svg) {\n    filter.push('url('+f+')'); \n  }\n  if (this.get('blur')!==undefined) filter.push('blur('+this.get('blur')+'px)'); \n  if (this.get('brightness')!==undefined) filter.push('brightness('+this.get('brightness')+'%)'); \n  if (this.get('contrast')!==undefined) filter.push('contrast('+this.get('contrast')+'%)'); \n  if (this.get('shadow')!==undefined) {\n    filter.push('drop-shadow('\n      + this.get('shadow')[0]+'px ' \n      + this.get('shadow')[1]+'px '\n      + (this.get('shadowBlur')||0)+'px ' \n      + this.get('shadowColor')+')'); \n  }\n  if (this.get('grayscale')!==undefined) filter.push('grayscale('+this.get('grayscale')+'%)'); \n  if (this.get('hueRotate')!==undefined) filter.push('hue-rotate('+this.get('hueRotate')+'deg)'); \n  if (this.get('invert')!==undefined) filter.push('invert('+this.get('invert')+'%)'); \n  if (this.get('saturate')!==undefined) filter.push('saturate('+this.get('saturate')+'%)'); \n  if (this.get('sepia')!==undefined) filter.push('sepia('+this.get('sepia')+'%)');\n  filter = filter.join(' ');\n  // Apply filter\n  if (filter) {\n    e.context.save();\n    e.context.filter = filter;\n    e.context.drawImage(e.context.canvas, 0,0);\n    e.context.restore();\n  }\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Clip layer or map\n*  @constructor\n* @requires ol.filter\n* @extends {ol.filter.Base}\n* @param {Object} [options]\n*  @param {Array<ol.Coordinate>} [options.coords]\n*  @param {ol.Extent} [options.extent]\n*  @param {string} [options.units] coords units percent (%) or pixel (px)\n*  @param {boolean} [options.keepAspectRatio] keep aspect ratio\n*  @param {string} [options.color] backgroundcolor\n*/\nol.filter.Clip = function(options) {\n  options = options || {};\n  ol.filter.Base.call(this, options);\n  this.set(\"coords\", options.coords);\n  this.set(\"units\", options.units);\n  this.set(\"keepAspectRatio\", options.keepAspectRatio);\n  this.set(\"extent\", options.extent || [0,0,1,1]);\n  this.set(\"color\", options.color);\n  if (!options.extent && options.units!=\"%\" && options.coords) {\n    var xmin = Infinity;\n    var ymin = Infinity;\n    var xmax = -Infinity;\n    var ymax = -Infinity;\n    for (var i=0, p; p=options.coords[i]; i++) {\n      if (xmin > p[0]) xmin = p[0];\n      if (xmax < p[0]) xmax = p[0];\n      if (ymin > p[1]) ymin = p[1];\n      if (ymax < p[1]) ymax = p[1];\n    }\n    options.extent = [xmin,ymin,xmax,ymax];\n  }\n}\nol.ext.inherits(ol.filter.Clip, ol.filter.Base);\nol.filter.Clip.prototype.clipPath_ = function(e) {\n  var ctx = e.context;\n  var size = e.frameState.size;\n  var coords = this.get(\"coords\");\n  if (!coords) return;\n  var ex = this.get('extent');\n  var scx = 1, scy = 1;\n  if (this.get(\"units\")==\"%\") {\n    scx = size[0]/(ex[2]-ex[0]);\n    scy = size[1]/(ex[3]-ex[1]);\n  }\n  if (this.get(\"keepAspectRatio\")) {\n    scx = scy = Math.min (scx, scy);\n  }\n  var pos = this.get('position');\n  var dx=0, dy=0;\n  if (/left/.test(pos)) {\n    dx = -ex[0]*scx;\n  } else if (/center/.test(pos)) {\n    dx = size[0]/2 - (ex[2]-ex[0])*scx/2;\n  } else if (/right/.test(pos)) {\n    dx = size[0] - (ex[2]-ex[0])*scx;\n  }\n  var fx = function(x) { return x*scx + dx };\n  if (/top/.test(pos)) {\n    dy = -ex[1]*scy;\n  } else if (/middle/.test(pos)) {\n    dy = size[1]/2 - (ex[3]-ex[1])*scy/2;\n  } else if (/bottom/.test(pos)) {\n    dy = size[1] - (ex[3]-ex[1])*scy;\n  }\n  var fy = function(y) { return y*scy + dy; };\n  var pt = [ fx(coords[0][0]), fy(coords[0][1]) ];\n  var tr = e.inversePixelTransform;\n  if (tr) {\n    pt = [\n      (pt[0]*tr[0] - pt[1]*tr[1] + tr[4]),\n      (-pt[0]*tr[2] + pt[1]*tr[3] + tr[5])\n    ];\n  }\n  ctx.moveTo ( pt[0], pt[1] );\n  for (var i=1, p; p=coords[i]; i++) {\n    pt = [ fx(p[0]), fy(p[1]) ];\n    if (tr) {\n      pt = [\n        (pt[0]*tr[0] - pt[1]*tr[1] + tr[4]),\n        (-pt[0]*tr[2] + pt[1]*tr[3] + tr[5])\n      ];\n    }\n    ctx.lineTo ( pt[0], pt[1] );\n  }\n  pt = [ fx(coords[0][0]), fy(coords[0][1]) ];\n  if (tr) {\n    pt = [\n      (pt[0]*tr[0] - pt[1]*tr[1] + tr[4]),\n      (-pt[0]*tr[2] + pt[1]*tr[3] + tr[5])\n    ];\n  }\n  ctx.moveTo ( pt[0], pt[1] );\n};\nol.filter.Clip.prototype.precompose = function(e) {\n  if (!this.get(\"color\")){\n    e.context.save();\n    e.context.beginPath();\n    this.clipPath_(e);\n    e.context.clip();\n  }\n};\nol.filter.Clip.prototype.postcompose = function(e) {\n  if (this.get(\"color\")) {\n    var ctx = e.context;\n    var canvas = e.context.canvas;\n    ctx.save();\n    ctx.beginPath();\n    ctx.moveTo(0,0);\n    ctx.lineTo(0,canvas.height);\n    ctx.lineTo(canvas.width, canvas.height);\n    ctx.lineTo(canvas.width, canvas.height);\n    ctx.lineTo(canvas.width, 0);\n    ctx.lineTo(0, 0);\n    this.clipPath_(e);\n    ctx.fillStyle = this.get(\"color\");\n    ctx.fill(\"evenodd\");\n  }\n  e.context.restore();\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** @typedef {Object} FilterColorizeOptions\n * @property {ol.Color} color style to fill with\n * @property {string} operation 'enhance' or a CanvasRenderingContext2D.globalCompositeOperation\n * @property {number} value a value to modify the effect value [0-1]\n * @property {boolean} inner mask inner, default false\n */\n/** Colorize map or layer\n * @constructor\n * @requires ol.filter\n * @extends {ol.filter.Base}\n * @author Thomas Tilak https://github.com/thhomas\n * @author Jean-Marc Viglino https://github.com/viglino\n * @param {FilterColorizeOptions} options\n */\nol.filter.Colorize = function(options) {\n  ol.filter.Base.call(this, options);\n  this.setFilter(options);\n}\nol.ext.inherits(ol.filter.Colorize, ol.filter.Base);\n/** Set options to the filter\n * @param {FilterColorizeOptions} [options]\n */\nol.filter.Colorize.prototype.setFilter = function(options) {\n  options = options || {};\n  switch (options) {\n    case \"grayscale\": options = { operation:'hue', color: [0,0,0], value:1 }; break;\n    case \"invert\": options = { operation:'difference', color: [255,255,255], value:1 }; break;\n    case \"sepia\": options = { operation:'color', color: [153,102,51], value:0.6 }; break;\n    default: break;\n  }\n  var color = options.color ? ol.color.asArray(options.color) : [ options.red, options.green, options.blue, options.value];\n  this.set('color', ol.color.asString(color))\n  this.set ('value', options.value||1);\n  var v;\n  switch (options.operation){\n    case 'color':\n    case 'hue':\n    case 'difference':\n    case 'color-dodge':\n    case 'enhance': {\n      this.set ('operation', options.operation);\n      break;\n    }\n    case 'saturation': {\n      v = 255*(options.value || 0);\n      this.set('color', ol.color.asString([0,0,v,v||1]));\n      this.set ('operation', options.operation);\n      break;\n    }\n    case 'luminosity': {\n      v = 255*(options.value || 0);\n      this.set('color', ol.color.asString([v,v,v,255]));\n      //this.set ('operation', 'luminosity')\n      this.set ('operation', 'hard-light');\n      break;\n    }\n    case 'contrast': {\n      v = 255*(options.value || 0);\n      this.set('color', ol.color.asString([v,v,v,255]));\n      this.set('operation', 'soft-light');\n      break;\n    }\n    default: {\n      this.set ('operation', 'color');\n      break;\n    }\n  }\n}\n/** Set the filter value\n * @param {ol.Color} options.color style to fill with\n */\nol.filter.Colorize.prototype.setValue = function(v) {\n  this.set ('value', v);\n  var c = ol.color.asArray(this.get(\"color\"));\n  c[3] = v;\n  this.set(\"color\", ol.color.asString(c));\n}\n/** Set the color value\n * @param {number} options.value a [0-1] value to modify the effect value\n */\nol.filter.Colorize.prototype.setColor = function(c) {\n  c = ol.color.asArray(c);\n  if (c) {\n    c[3] = this.get(\"value\");\n    this.set(\"color\", ol.color.asString(c));\n  }\n}\n/** @private \n */\nol.filter.Colorize.prototype.precompose = function(/* e */) {\n}\n/** @private \n */\nol.filter.Colorize.prototype.postcompose = function(e) {\n  // Set back color hue\n  var ctx = e.context;\n  var canvas = ctx.canvas;\n  ctx.save();\n    if (this.get('operation')=='enhance') {\n      var v = this.get('value');\n      if (v) {\n        var w = canvas.width;\n        var h = canvas.height;\n        ctx.globalCompositeOperation = 'color-burn'\n        ctx.globalAlpha = v;\n        ctx.drawImage (canvas, 0, 0, w, h);\n        ctx.drawImage (canvas, 0, 0, w, h);\n        ctx.drawImage (canvas, 0, 0, w, h);\n      }\n    } else {\n      ctx.globalCompositeOperation = this.get('operation');\n      ctx.fillStyle = this.get('color');\n      ctx.fillRect(0,0,canvas.width,canvas.height);  \n    }\n  ctx.restore();\n}\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Add a composite filter on a layer\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n * @constructor\n * @requires ol.filter\n * @extends {ol.filter.Base}\n * @param {Object} options\n *   @param {string} options.operation composite operation\n */\nol.filter.Composite = function(options) {\n  ol.filter.Base.call(this, options);\n  this.set(\"operation\", options.operation || \"source-over\");\n}\nol.ext.inherits(ol.filter.Composite, ol.filter.Base);\n/** Change the current operation\n*\t@param {string} operation composite function\n*/\nol.filter.Composite.prototype.setOperation = function(operation) {\n  this.set('operation', operation || \"source-over\");\n}\nol.filter.Composite.prototype.precompose = function(e) {\n  var ctx = e.context;\n  ctx.save();\n  ctx.globalCompositeOperation = this.get('operation');\n}\nol.filter.Composite.prototype.postcompose = function(e) {\n  e.context.restore();\n}\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Crop drawing using an ol.Feature\n* @constructor\n* @requires ol.filter\n* @requires ol.filter.Mask\n* @extends {ol.filter.Mask}\n* @param {Object} [options]\n*  @param {ol.Feature} [options.feature] feature to crop with\n*  @param {boolean} [options.inner=false] mask inner, default false\n*/\nol.filter.Crop = function(options) {\n  options = options || {};\n  ol.filter.Mask.call(this, options);\n}\nol.ext.inherits(ol.filter.Crop, ol.filter.Mask);\nol.filter.Crop.prototype.precompose = function(e) {\n  if (this.feature_) {\n    var ctx = e.context;\n    ctx.save();\n      this.drawFeaturePath_(e, this.get(\"inner\"));\n      ctx.clip(\"evenodd\");\n  }\n}\nol.filter.Crop.prototype.postcompose = function(e) {\n  if (this.feature_) e.context.restore();\n}\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Fold filer map\n * @constructor\n * @requires ol.filter\n * @extends {ol.filter.Base}\n * @param {Object} [options]\n *  @param {Array<number>} [options.fold] number of fold (horizontal and vertical)\n *  @param {number} [options.margin] margin in px, default 8\n *  @param {number} [options.padding] padding in px, default 8\n *  @param {number|number[]} [options.fsize] fold size in px, default 8,10\n *  @param {boolean} [options.fill] true to fill the background, default false\n *  @param {boolean} [options.shadow] true to display shadow, default true\n */\nol.filter.Fold = function(options) {\n  options = options || {};\n  ol.filter.Base.call(this, options);\n  this.set('fold', options.fold || [8,4]);\n  this.set('margin', options.margin || 8);\n  this.set('padding', options.padding || 8);\n  if (typeof options.fsize == 'number') options.fsize = [options.fsize,options.fsize];\n  this.set('fsize', options.fsize || [8,10]);\n  this.set('fill', options.fill);\n  this.set('shadow', options.shadow!==false);\n};\nol.ext.inherits(ol.filter.Fold, ol.filter.Base);\nol.filter.Fold.prototype.drawLine_ = function(ctx, d, m) {\n  var canvas = ctx.canvas;\n  var fold = this.get(\"fold\");\n  var w = canvas.width;\n  var h = canvas.height;\n  var x, y, i;\n  ctx.beginPath();\n  ctx.moveTo ( m, m );\n  for (i=1; i<=fold[0]; i++) {\n    x = i*w/fold[0] - (i==fold[0] ? m : 0);\n    y =  d[1]*(i%2) +m;\n    ctx.lineTo ( x, y );\n  }\n  for (i=1; i<=fold[1]; i++) {\n    x = w - d[0]*(i%2) - m;\n    y = i*h/fold[1] - (i==fold[1] ? d[0]*(fold[0]%2) + m : 0);\n    ctx.lineTo ( x, y );\n  }\n  for (i=fold[0]; i>0; i--) {\n    x = i*w/fold[0] - (i==fold[0] ? d[0]*(fold[1]%2) + m : 0);\n    y = h - d[1]*(i%2) -m;\n    ctx.lineTo ( x, y );\n  }\n  for (i=fold[1]; i>0; i--) {\n    x = d[0]*(i%2) + m;\n    y = i*h/fold[1] - (i==fold[1] ? m : 0);\n    ctx.lineTo ( x, y );\n  }\n  ctx.closePath();\n};\nol.filter.Fold.prototype.precompose = function(e) {\n  var ctx = e.context;\n  ctx.save();\n    ctx.shadowColor = \"rgba(0,0,0,0.3)\";\n    ctx.shadowBlur = 8;\n    ctx.shadowOffsetX = 2;\n    ctx.shadowOffsetY = 3;\n    this.drawLine_(ctx, this.get(\"fsize\"), this.get(\"margin\"));\n    ctx.fillStyle=\"#fff\";\n    if (this.get('fill')) ctx.fill();\n    ctx.strokeStyle = \"rgba(0,0,0,0.1)\";\n    ctx.stroke();\n  ctx.restore();\n  ctx.save();\n    this.drawLine_(ctx, this.get(\"fsize\"), this.get(\"margin\") + this.get(\"padding\"));\n    ctx.clip();\n};\nol.filter.Fold.prototype.postcompose = function(e) {\n  var ctx = e.context;\n  var canvas = ctx.canvas;\n  ctx.restore();\n  ctx.save();\n    this.drawLine_(ctx, this.get(\"fsize\"), this.get(\"margin\"));\n    ctx.clip();\n    if (this.get('shadow')) {\n      var fold = this.get(\"fold\");\n      var w = canvas.width/fold[0];\n      var h = canvas.height/fold[1];\n      var grd = ctx.createRadialGradient(5*w/8,5*w/8,w/4,w/2,w/2,w);\n      grd.addColorStop(0,\"transparent\");\n      grd.addColorStop(1,\"rgba(0,0,0,0.2)\");\n      ctx.fillStyle = grd;\n      ctx.scale (1,h/w);\n      for (var i=0; i<fold[0]; i++) for (var j=0; j<fold[1]; j++) {\n        ctx.save()\n        ctx.translate(i*w, j*w);\n        ctx.fillRect(0,0,w,w);\n        ctx.restore()\n      }\n    }\n  ctx.restore();\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Make a map or layer look like made of a set of Lego bricks.\n *  @constructor\n * @requires ol.filter\n * @extends {ol.filter.Base}\n * @param {Object} [options]\n *  @param {string} [options.img]\n *  @param {number} [options.brickSize] size of te brick, default 30\n *  @param {null | string | undefined} [options.crossOrigin] crossOrigin attribute for loaded images.\n */\nol.filter.Lego = function(options) {\n  if (!options) options = {};\n  ol.filter.Base.call(this, options);\n  var img = new Image();\n  // Default image\n  img.src = this.img[options.img] || this.img.ol3;\n  img.crossOrigin = options.crossOrigin || null;\n  // and pattern \n  this.pattern = {\n    canvas: document.createElement('canvas')\n  };\n  this.setBrick (options.brickSize, img);\n  this.internal_ = document.createElement('canvas');\n}\nol.ext.inherits(ol.filter.Lego, ol.filter.Base);\n/** Image definition\n*/\nol.filter.Lego.prototype.img = {\n  brick: \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAAAnNCSVQICFXsRgQAAAAJcEhZcwAAD10AAA9dAah0GUAAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAGAElEQVRo3sWZy4tkVx3HP+fcc29Vd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BO+u/pTkLT5c8fPNd9nt5tLmRbsVynbsXR704Bbeq775v0uht3btfyZT7OA5knjdAAAAAElFTkSuQmCC\"\n};\n/** Overwrite to handle brickSize\n* @param {string} key\n* @param {any} val\n*/\nol.filter.Lego.prototype.set = function (key, val) {\n  ol.filter.Base.prototype.set.call(this, key, val);\n  if (key==\"brickSize\" && this.pattern.canvas.width!=val) {\n    this.setBrick(val);\n  }\n}\n/** Set the current brick\n*\t@param {number} width the pattern width, default 30\n*\t@param {'brick'|'ol3'|'lego'|undefined} img the pattern, default ol3\n*\t@param {string} crossOrigin\n*/\nol.filter.Lego.prototype.setBrick = function (width, img, crossOrigin) {\n  width = Number(width) || 30;\n  if (typeof(img) === 'string') {\n    var i = new Image;\n    i.src = this.img[img] || this.img.ol3;\n    i.crossOrigin = crossOrigin || null;\n    img = i;\n  }\n  if (img) this.pattern.img = img;\n  if (!this.pattern.img.width) {\n    var self = this;\n    this.pattern.img.onload = function() {\n      self.setBrick(width,img);\n    }\n    return;\n  }\n  this.pattern.canvas.width = this.pattern.canvas.height = width;\n  this.pattern.ctx = this.pattern.canvas.getContext(\"2d\");\n  this.pattern.ctx.fillStyle = this.pattern.ctx.createPattern (this.pattern.img, 'repeat');\n  this.set(\"brickSize\", width);\n  this.set(\"img\", img.src);\n};\n/** Get translated pattern\n*\t@param {number} offsetX x offset\n*\t@param {number} offsetY y offset\n*/\nol.filter.Lego.prototype.getPattern = function (offsetX, offsetY) {\t\n  if (!this.pattern.ctx) return \"transparent\";\n  //return this.pattern.ctx.fillStyle\n  var c = this.pattern.canvas;\n  var ctx = this.pattern.ctx;\n  var sc = c.width / this.pattern.img.width;\n  ctx.save();\n    ctx.clearRect(0,0,c.width,c.height);\n    ctx.scale(sc,sc);\n    offsetX /= sc;\n    offsetY /= sc;\n    ctx.translate(offsetX, offsetY);\n    ctx.beginPath();\n    ctx.clearRect(-2*c.width, -2*c.height, 4*c.width, 4*c.height);\n    ctx.rect(-offsetX, -offsetY, 2*c.width/sc, 2*c.height/sc);\n    ctx.fill(); \n  ctx.restore();\n  return ctx.createPattern(c, 'repeat');\n};\n/** Postcompose operation\n*/\nol.filter.Lego.prototype.postcompose = function(e) {\n  // Set back color hue\n  var ctx = e.context;\n  var canvas = ctx.canvas;\n  var ratio = e.frameState.pixelRatio;\n  // ol v6+\n  if (e.type==='postrender') {\n    ratio = 1;\n  }\n  ctx.save();\n    // resize \n    var step = this.pattern.canvas.width*ratio;\n    var p = e.frameState.extent;\n    var res = e.frameState.viewState.resolution/ratio;\n    var offset = [ -Math.round((p[0]/res)%step), Math.round((p[1]/res)%step) ];\n    var ctx2 = this.internal_.getContext(\"2d\");\n    var w = this.internal_.width = canvas.width;\n    var h = this.internal_.height = canvas.height;\n    // No smoothing please\n    ctx2.webkitImageSmoothingEnabled =\n    ctx2.mozImageSmoothingEnabled =\n    ctx2.msImageSmoothingEnabled =\n    ctx2.imageSmoothingEnabled = false;\n    var w2 = Math.floor((w-offset[0])/step);\n    var h2 = Math.floor((h-offset[1])/step);\n    ctx2.drawImage (canvas, offset[0], offset[1], w2*step, h2*step, 0, 0, w2, h2);\n    //\n    ctx.webkitImageSmoothingEnabled =\n    ctx.mozImageSmoothingEnabled =\n    ctx.msImageSmoothingEnabled =\n    ctx.imageSmoothingEnabled = false;\n    ctx.clearRect (0, 0, w,h);\n    ctx.drawImage (this.internal_, 0,0, w2,h2, offset[0],offset[1], w2*step, h2*step);\n/*\n    for (var x=offset[0]; x<w; x+=step) for (var y=offset[1]; y<h; y+=step)\n    {\tif (x>=0 && y<h) ctx2.drawImage (canvas, x, y, 1, 1, x, y, step, step);\n    }\n    ctx.clearRect (0, 0, w,h);\n    ctx.drawImage (c, 0, 0);\n*/\n    // Draw brick stud\n    ctx.scale(ratio,ratio);\n    ctx.fillStyle = this.getPattern (offset[0]/ratio, offset[1]/ratio);\n    ctx.rect(0,0, w, h);\n    ctx.fill(); \n  ctx.restore();\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** @typedef {Object} FilterPencilSketchOptions\n * @property {number} blur blur value in pixel, default 8\n * @property {number} value intensity value [0,1], default .8\n */\n/** Colorize map or layer\n * Original idea: https://www.freecodecamp.org/news/sketchify-turn-any-image-into-a-pencil-sketch-with-10-lines-of-code-cf67fa4f68ce/\n * @constructor\n * @requires ol.filter\n * @extends {ol.filter.Base}\n * @param {FilterPencilSketchOptions} options\n */\nol.filter.PencilSketch = function(options) {\n  options = options || {};\n  ol.filter.Base.call(this, options);\n  this.set('blur', options.blur || 8);\n  this.set('intensity', options.intensity || .8);\n};\nol.ext.inherits(ol.filter.PencilSketch, ol.filter.Base);\n/** @private \n */\nol.filter.PencilSketch.prototype.precompose = function(/* e */) {\n};\n/** @private \n */\nol.filter.PencilSketch.prototype.postcompose = function(e) {\n  // Set back color hue\n  var ctx = e.context;\n  var canvas = ctx.canvas;\n  var w = canvas.width;\n  var h = canvas.height;\n  // Grayscale image\n  var bwimg = document.createElement('canvas');\n  bwimg.width = w;\n  bwimg.height = h;\n  var bwctx = bwimg.getContext('2d');\n  bwctx.filter = 'grayscale(1) invert(1) blur('+this.get('blur')+'px)';\n  bwctx.drawImage(canvas, 0,0);\n  ctx.save();\n    if (!this.get('color')) {\n      ctx.filter = 'grayscale(1)';\n      ctx.drawImage(canvas, 0,0);\n    } else {\n      ctx.globalCompositeOperation = 'darken';\n      ctx.globalAlpha = .3;\n      ctx.drawImage(canvas, 0,0);\n    }\n    ctx.globalCompositeOperation = 'color-dodge';\n    ctx.globalAlpha = this.get('intensity');\n    ctx.drawImage(bwimg, 0,0);\n  ctx.restore();\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** @typedef {Object} FilterPointillismOptions\n * @property {number} saturate saturation, default 2\n */\n/** A pointillism filter to turn maps into pointillism paintings\n * @constructor\n * @extends {ol.filter.Base}\n * @param {FilterPointillismOptions} options\n */\nol.filter.Pointillism = function(options) {\n  options = options || {};\n  ol.filter.Base.call(this, options);\n  this.set('saturate', Number(options.saturate) || 2);\n  this.pixels = [];\n};\nol.ext.inherits(ol.filter.Pointillism, ol.filter.Base);\n/** Create points to place on the map\n * @private\n */\nol.filter.Pointillism.prototype._getPixels = function(nb) {\n  if (nb > this.pixels.length) {\n    while (this.pixels.length < nb) {\n      this.pixels.push([Math.random(), Math.random(), Math.random()*4+2]);\n    }\n  }\n  return nb;\n};\n/** @private \n */\nol.filter.Pointillism.prototype.precompose = function(/* e */) {\n};\n/** @private \n */\nol.filter.Pointillism.prototype.postcompose = function(e) {\n  // var ratio = e.frameState.pixelRatio;\n  // Set back color hue\n  var ctx = e.context;\n  var canvas = ctx.canvas;\n  var w = canvas.width;\n  var h = canvas.height;\n  // Grayscale image\n  var img = document.createElement('canvas');\n  img.width = w;\n  img.height = h;\n  var ictx = img.getContext('2d');\n  ictx.filter = 'saturate('+Math.round(2*this.get('saturate')*100)+'%)';\n  ictx.drawImage(canvas, 0,0);\n  ctx.save();\n    // Saturate and blur\n    ctx.filter = 'blur(3px) saturate('+(this.get('saturate')*100)+'%)';\n    ctx.drawImage(canvas, 0,0);\n    // ctx.clearRect(0,0,w,h); // debug\n    // Draw points\n    ctx.filter = 'none';\n    ctx.opacity = .5;\n    var max = this._getPixels(w*h/50);\n    for (var i=0; i<max; i++) {\n      var x = Math.floor(this.pixels[i][0]*w);\n      var y = Math.floor(this.pixels[i][1]*h);\n      ctx.fillStyle = ol.color.asString(ictx.getImageData(x, y, 1, 1).data);\n      ctx.beginPath();\n      ctx.arc(x,y, this.pixels[i][2], 0, 2*Math.PI);\n      ctx.fill();\n    }\n  ctx.restore();\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Add a canvas Context2D SVG filter to a layer\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter\n * @constructor\n * @requires ol.filter\n * @extends {ol.filter.Base}\n * @param {ol.ext.SVGFilter|Array<ol.ext.SVGFilter>} filters\n */\nol.filter.SVGFilter = function(filters) {\n  ol.filter.Base.call(this);\n  this._svg = {};\n  if (filters) {\n    if (!(filters instanceof Array)) filters = [filters];\n    filters.forEach(function(f) {\n      this.addSVGFilter(f);\n    }.bind(this));\n  }\n};\nol.ext.inherits(ol.filter.SVGFilter, ol.filter.Base);\n/** Add a new svg filter\n * @param {ol.ext.SVGFilter} filter\n */\nol.filter.SVGFilter.prototype.addSVGFilter = function(filter) {\n  var url = '#'+filter.getId();\n  this._svg[url] = 1;\n  this.dispatchEvent({ type: 'propertychange', key: 'svg', oldValue: this._svg });\n};\n/** Remove a svg filter\n * @param {ol.ext.SVGFilter} filter\n */\nol.filter.SVGFilter.prototype.removeSVGFilter = function(filter) {\n  var url = '#'+filter.getId();\n  delete this._svg[url]\n  this.dispatchEvent({ type: 'propertychange', key: 'svg', oldValue: this._svg });\n};\n/**\n * @private\n */\nol.filter.SVGFilter.prototype.precompose = function() {\n};\n/**\n * @private\n */\nol.filter.SVGFilter.prototype.postcompose = function(e) {\n  var filter = []\n  // Set filters\n  for (var f in this._svg) {\n    filter.push('url('+f+')'); \n  }\n  filter = filter.join(' ');\n  var canvas = document.createElement('canvas');\n  canvas.width = e.context.canvas.width;\n  canvas.height = e.context.canvas.height;\n  canvas.getContext('2d').drawImage(e.context.canvas,0,0);\n  // Apply filter\n  if (filter) {\n    e.context.save();\n    e.context.clearRect(0,0,canvas.width, canvas.height);\n    e.context.filter = filter;\n    e.context.drawImage(canvas, 0,0);\n    e.context.restore();\n  }\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** @typedef {Object} FilterTextureOptions\n *  @property {Image | undefined} img Image object for the texture\n *  @property {string} src Image source URI\n *  @property {number} scale scale to draw the image. Default 1.\n *  @property {number} [opacity]\n *  @property {boolean} rotate Whether to rotate the texture with the view (may cause animation lags on mobile or slow devices). Default is true.\n *  @property {null | string | undefined} crossOrigin The crossOrigin attribute for loaded images.\n */\n/** Add texture effects on maps or layers\n * @constructor\n * @requires ol.filter\n * @extends {ol.filter.Base}\n * @param {FilterTextureOptions} options\n */\nol.filter.Texture = function(options)\n{\tol.filter.Base.call(this, options);\n\tthis.setFilter(options);\n}\nol.ext.inherits(ol.filter.Texture, ol.filter.Base);\n/** Set texture\n * @param {FilterTextureOptions} [options]\n */\nol.filter.Texture.prototype.setFilter = function(options)\n{\tvar img;\n\toptions = options || {};\n\tif (options.img) img = options.img;\n\telse \n\t{\timg = new Image();\n\t\tif (options.src) {\n\t\t\t// Look for a texture stored in ol.filter.Texture.Image\n\t\t\tif (ol.filter.Texture.Image && ol.filter.Texture.Image[options.src]) {\n\t\t\t\timg.src = ol.filter.Texture.Image[options.src];\n\t\t\t} \n\t\t\t// default source\n\t\t\telse {\n\t\t\t\tif (!img.src) img.src = options.src;\n\t\t\t}\n\t\t}\n\t\timg.crossOrigin = options.crossOrigin || null;\n\t}\n\tthis.set('rotateWithView', options.rotateWithView !== false);\n\tthis.set('opacity', typeof(options.opacity)=='number' ? options.opacity : 1);\n\tthis.set('ready', false);\n\tvar self = this;\n\tfunction setPattern(img)\n\t{\tself.pattern = {};\n\t\tself.pattern.scale = options.scale || 1;\n\t\tself.pattern.canvas = document.createElement('canvas');\n\t\tself.pattern.canvas.width = img.width * self.pattern.scale;\n\t\tself.pattern.canvas.height = img.height * self.pattern.scale;\n\t\tself.pattern.canvas.width = img.width;// * self.pattern.scale;\n\t\tself.pattern.canvas.height = img.height;// * self.pattern.scale;\n\t\tself.pattern.ctx = self.pattern.canvas.getContext(\"2d\");\n\t\tself.pattern.ctx.fillStyle = self.pattern.ctx.createPattern(img, 'repeat');\n\t\t// Force refresh\n\t\tself.set('ready', true);\n\t}\n\tif (img.width) \n\t{\tsetPattern(img);\n\t}\n\telse\n\t{\timg.onload = function()\n\t\t{\tsetPattern(img);\n\t\t}\n\t}\n}\n/** Get translated pattern\n *\t@param {number} offsetX x offset\n *\t@param {number} offsetY y offset\n */\nol.filter.Texture.prototype.getPattern = function (offsetX, offsetY)\n{\tvar c = this.pattern.canvas;\n\tvar ctx = this.pattern.ctx;\n\tctx.save();\n\t/*\n\t\toffsetX /= this.pattern.scale;\n\t\toffsetY /= this.pattern.scale;\n\t\tctx.scale(this.pattern.scale,this.pattern.scale);\n\t*/\n\t\tctx.translate(-offsetX, offsetY);\n\t\tctx.beginPath();\n\t\tctx.rect(offsetX, -offsetY, c.width, c.height);\n\t\tctx.fill();\n\tctx.restore();\n\treturn ctx.createPattern(c, 'repeat');\n}\n/** Draw pattern over the map on postcompose */\nol.filter.Texture.prototype.postcompose = function(e)\n{\t// not ready\n\tif (!this.pattern) return;\n\t// Set back color hue\n\tvar ctx = e.context;\n\tvar canvas = ctx.canvas;\n\tvar m = 1.5 * Math.max(canvas.width, canvas.height);\n\tvar mt = e.frameState.pixelToCoordinateTransform;\n\t// Old version (matrix)\n\tif (!mt)\n\t{\tmt = e.frameState.pixelToCoordinateMatrix,\n\t\tmt[2] = mt[4];\n\t\tmt[3] = mt[5];\n\t\tmt[4] = mt[12];\n\t\tmt[5] = mt[13];\n\t}\n\tvar ratio = e.frameState.pixelRatio;\n\tvar res = e.frameState.viewState.resolution;\n\tvar w = canvas.width/2, \n\t\th = canvas.height/2;\n\tctx.save();\n\t\tctx.globalCompositeOperation = \"multiply\";\n\t\t//ctx.globalCompositeOperation = \"overlay\";\n\t\t//ctx.globalCompositeOperation = \"color\";\n\t\tctx.globalAlpha = this.get('opacity');\n\t\tctx.scale(ratio*this.pattern.scale,ratio*this.pattern.scale);\n\t\tif (this.get('rotateWithView'))\n\t\t{\t// Translate pattern\n\t\t\tres *= this.pattern.scale\n\t\t\tctx.fillStyle = this.getPattern ((w*mt[0] + h*mt[1] + mt[4])/res, (w*mt[2] + h*mt[3] + mt[5])/res);\n\t\t\t// Rotate on canvas center and fill\n\t\t\tctx.translate(w/this.pattern.scale, h/this.pattern.scale);\n\t\t\tctx.rotate(e.frameState.viewState.rotation);\n\t\t\tctx.beginPath();\n\t\t\tctx.rect(-w-m, -h-m, 2*m, 2*m);\n\t\t\tctx.fill(); \n\t\t}\n\t\telse\n\t\t{\n\t\t\t/**/\n\t\t\t\tvar dx = -(w*mt[0] + h*mt[1] + mt[4])/res;\n\t\t\t\tvar dy = (w*mt[2] + h*mt[3] + mt[5])/res;\n\t\t\t\tvar cos = Math.cos(e.frameState.viewState.rotation);\n\t\t\t\tvar sin = Math.sin(e.frameState.viewState.rotation);\n\t\t\t\tvar offsetX = (dx*cos - dy*sin) / this.pattern.scale;\n\t\t\t\tvar offsetY = (dx*sin + dy*cos) / this.pattern.scale;\n\t\t\t\tctx.translate(offsetX, offsetY);\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.fillStyle = this.pattern.ctx.fillStyle;\n\t\t\t\tctx.rect(-offsetX -m , -offsetY -m, 2*m, 2*m);\n\t\t\t\tctx.fill(); \n\t\t\t/*\t//old version without centered rotation\n\t\t\t\tvar offsetX = -(e.frameState.extent[0]/res) % this.pattern.canvas.width;\n\t\t\t\tvar offsetY = (e.frameState.extent[1]/res) % this.pattern.canvas.height;\n\t\t\t\tctx.rotate(e.frameState.viewState.rotation);\n\t\t\t\tctx.translate(offsetX, offsetY);\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.fillStyle = this.pattern.ctx.fillStyle\n\t\t\t\tctx.rect(-offsetX -m , -offsetY -m, 2*m, 2*m);\n\t\t\t\tctx.fill(); \n\t\t\t*/\n\t\t}\n\tctx.restore();\n}\n\n/*eslint no-constant-condition: [\"error\", { \"checkLoops\": false }]*/\n/** Feature format for reading and writing data in the GeoJSONX format.\n * @constructor \n * @extends {ol.format.GeoJSON}\n * @param {*} options options.\n *  @param {number} options.decimals number of decimals to save, default 7 for EPSG:4326, 2 for other projections\n *  @param {boolean|Array<*>} options.deleteNullProperties An array of property values to remove, if false, keep all properties, default [null,undefined,\"\"]\n *  @param {boolean|Array<*>} options.extended Decode/encode extended GeoJSON with foreign members (id, bbox, title, etc.), default false\n *  @param {Array<string>|function} options.whiteList A list of properties to keep on features when encoding or a function that takes a property name and retrun true if the property is whitelisted\n *  @param {Array<string>|function} options.blackList A list of properties to remove from features when encoding or a function that takes a property name and retrun true if the property is blacklisted\n *  @param {ol.ProjectionLike} options.dataProjection Projection of the data we are reading. If not provided `EPSG:4326`\n *  @param {ol.ProjectionLike} options.featureProjection Projection of the feature geometries created by the format reader. If not provided, features will be returned in the dataProjection.\n */\nol.format.GeoJSONX = function(options) {\n  options = options || {};\n  ol.format.GeoJSON.call (this, options);\n  this._hash = {};\n  this._count = 0;\n  this._extended = options.extended;\n  if (typeof(options.whiteList)==='function') {\n    this._whiteList = options.whiteList;\n  } else if (options.whiteList && options.whiteList.indexOf) {\n    this._whiteList = function (k) { return options.whiteList.indexOf(k) > -1 };\n  } else {\n    this._whiteList = function() { return true };\n  } \n  if (typeof(options.blackList)==='function') {\n    this._blackList = options.blackList;\n  } else if (options.blackList && options.blackList.indexOf) {\n    this._blackList = function (k) { return options.blackList.indexOf(k) > -1 };\n  } else {\n    this._blackList = function() { return false };\n  } \n  this._deleteNull = options.deleteNullProperties===false ? false : [null,undefined,\"\"];\n  var decimals = 2;\n  if (!options.dataProjection || options.dataProjection === 'EPSG:4326') decimals = 7;\n  if (!isNaN(parseInt(options.decimals))) decimals = parseInt(options.decimals);\n  this._decimals = decimals;\n};\nol.ext.inherits(ol.format.GeoJSONX, ol.format.GeoJSON);\n/** Radix */\nol.format.GeoJSONX.prototype._radix = \n'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ !#$%&\\'()*-.:<=>?@[]^_`{|}~';\n/** Radix size */\nol.format.GeoJSONX.prototype._size = ol.format.GeoJSONX.prototype._radix.length;\n/** GeoSJON types */\nol.format.GeoJSONX.prototype._type = {\n  \"Point\": 0,\n  \"LineString\": 1,\n  \"Polygon\": 2,\n  \"MultiPoint\": 3,\n  \"MultiLineString\": 4,\n  \"MultiPolygon\": 5,\n  \"GeometryCollection\": null // Not supported\n};\n/** GeoSJONX types */\nol.format.GeoJSONX.prototype._toType = [\n  \"Point\",\n  \"LineString\",\n  \"Polygon\",\n  \"MultiPoint\",\n  \"MultiLineString\",\n  \"MultiPolygon\"\n];\n/** Encode a number\n * @param {number} number Number to encode\n * @param {number} decimals Number of decimals\n * @param {string}\n */\nol.format.GeoJSONX.prototype.encodeNumber = function(number, decimals) {\n  if (isNaN(Number(number)) || number === null || !isFinite(number)) {\n    number = 0;\n  }\n  if (!decimals && decimals!==0) decimals = this._decimals;\n  // Round number\n  number = Math.round(number * Math.pow(10, decimals));\n  // Zigzag encoding (get positive number)\n  if (number<0) number = -2*number - 1;\n  else number = 2*number;\n  // Encode\n  var result = '';\n  var modulo, residual = number;\n  while (true) {\n    modulo = residual % this._size\n    result = this._radix.charAt(modulo) + result;\n    residual = Math.floor(residual / this._size);\n    if (residual == 0) break;\n  }\n  return result;\n};\n/** Decode a number\n * @param {string} s \n * @param {number} decimals Number of decimals\n * @return {number}\n */\nol.format.GeoJSONX.prototype.decodeNumber = function(s, decimals) {\n  if (!decimals && decimals!==0) decimals = this._decimals;\n  var decode = 0;\n  s.split('').forEach(function (c) {\n    decode = (decode * this._size) + this._radix.indexOf(c);\n  }.bind(this));\n  // Zigzag encoding\n  var result = Math.floor(decode/2)\n  if (result !== decode/2) result = -1-result;\n  return result / Math.pow(10, decimals);\n};\n/** Encode coordinates\n * @param {ol.coordinate|Array<ol.coordinate>} v\n * @param {number} decimal\n * @return {string|Array<string>}\n * @api\n */\nol.format.GeoJSONX.prototype.encodeCoordinates = function(v, decimal) {\n  var i;\n  if (typeof(v[0]) === 'number') {\n    return this.encodeNumber(v[0], decimal) +','+ this.encodeNumber(v[1], decimal);\n  } else if (v.length && v[0]) {\n    if (typeof(v[0][0]) === 'number') {\n      var dxy=[0,0];\n      var xy = [];\n      for (i=0; i<v.length; i++) {\n        v[i] = [\n          Math.round( v[i][0] * Math.pow(10, decimal)),\n          Math.round( v[i][1] * Math.pow(10, decimal))\n        ];\n        var dx = v[i][0]-dxy[0];\n        var dy = v[i][1]-dxy[1];\n        if (i==0 || (dx!==0 || dy!==0)) {\n          xy.push(this.encodeNumber(dx, 0) +','+ this.encodeNumber(dy, 0));\n          dxy = v[i];\n        }\n      }\n      // Almost 2 points...\n      if (xy.length<2) xy.push('A,A');\n      return xy.join(';');\n    } else {\n      for (i=0; i<v.length; i++) {\n        v[i] = this.encodeCoordinates(v[i], decimal);\n      }\n      return v;\n    }\n  } else {\n    return this.encodeCoordinates([0,0], decimal);\n  }\n};\n/** Decode coordinates\n * @param {string|Array<string>}\n * @param {number} decimal Number of decimals\n * @return {ol.coordinate|Array<ol.coordinate>} v\n * @api\n */\nol.format.GeoJSONX.prototype.decodeCoordinates = function(v, decimals) {\n  var i;\n  if (typeof(v) === 'string') {\n    v = v.split(';');\n    if (v.length>1) {\n      var dxy=[0,0];\n      v.forEach(function(vi, i) {\n        v[i] = vi.split(',');\n        v[i][0] = this.decodeNumber(v[i][0], decimals) + dxy[0];\n        v[i][1] = this.decodeNumber(v[i][1], decimals) + dxy[1];\n        dxy = v[i];\n      }.bind(this));\n      return v;\n    } else {\n      v = v[0].split(',');\n      return [ this.decodeNumber(v[0], decimals), this.decodeNumber(v[1], decimals) ];\n    }\n  } else if (v.length) {\n    var r = [];\n    for (i=0; i<v.length; i++) {\n      r[i] = this.decodeCoordinates(v[i], decimals);\n    }\n    return r;\n  } else {\n    return [0,0];\n  }\n};\n/** Encode an array of features as a GeoJSONX object.\n * @param {Array<ol.Feature>} features Features.\n * @param {*} options Write options.\n * @return {*} GeoJSONX Object.\n * @override\n * @api\n */\nol.format.GeoJSONX.prototype.writeFeaturesObject = function (features, options) {\n  options = options || {};\n  this._count = 0;\n  this._hash = {};\n  var geojson = ol.format.GeoJSON.prototype.writeFeaturesObject.call(this, features, options);\n  geojson.decimals = this._decimals;\n  geojson.hashProperties = [];\n  Object.keys(this._hash).forEach(function(k) {\n    geojson.hashProperties.push(k);\n  }.bind(this));\n  this._count = 0;\n  this._hash = {};\n  // Push features at the end of the object\n  var temp = geojson.features;\n  delete geojson.features;\n  geojson.features = temp;\n  return geojson;\n};\n/** Encode a set of features as a GeoJSONX object.\n * @param {ol.Feature} feature Feature\n * @param {*} options Write options.\n * @return {*} GeoJSONX Object.\n * @override\n * @api\n */\nol.format.GeoJSONX.prototype.writeFeatureObject = function(source, options) {\n  var f0 = ol.format.GeoJSON.prototype.writeFeatureObject.call(this, source, options);\n  // Only features supported yet\n  if (f0.type !== 'Feature') throw 'GeoJSONX doesn\\'t support '+f0.type+'.';\n  var f = [];\n  // Encode geometry\n  if (f0.geometry.type==='Point') {\n    f.push(this.encodeCoordinates(f0.geometry.coordinates, this._decimals));\n  } else {\n    if (!this._type[f0.geometry.type]) {\n      throw 'GeoJSONX doesn\\'t support '+f0.geometry.type+'.';\n    }\n    f.push ([\n      this._type[f0.geometry.type],\n      this.encodeCoordinates(f0.geometry.coordinates, this._decimals)\n    ]);\n  }\n  // Encode properties\n  var k;\n  var prop = [];\n  for (k in f0.properties) {\n    if (!this._whiteList(k) || this._blackList(k)) continue;\n    if (!this._hash.hasOwnProperty(k)) {\n      this._hash[k] = this._count;\n      this._count++;\n    }\n    if (!this._deleteNull || this._deleteNull.indexOf(f0.properties[k])<0) {\n      prop.push (this._hash[k], f0.properties[k]);\n    }\n  }\n  // Create prop table\n  if (prop.length || this._extended) {\n    f.push(prop);\n  }\n  // Other properties (id, title, bbox, centerline...\n  if (this._extended) {\n    var found = false;\n    prop = {};\n    for (k in f0) {\n      if (!/^type$|^geometry$|^properties$/.test(k)) {\n        prop[k] = f0[k];\n        found = true;\n      }\n    }\n    if (found) f.push(prop);\n  }\n  return f;\n};\n/** Encode a geometry as a GeoJSONX object.\n * @param {ol.geom.Geometry} geometry Geometry.\n * @param {*} options Write options.\n * @return {*} Object.\n * @override\n * @api\n */\nol.format.GeoJSONX.prototype.writeGeometryObject = function(source, options) {\n  var g = ol.format.GeoJSON.prototype.writeGeometryObject.call(this, source, options);\n  // Encode geometry\n  if (g.type==='Point') {\n    return this.encodeCoordinates(g.coordinates, this._decimals)\n  } else {\n    return [\n      this._type[g.type],\n      this.encodeCoordinates(g.coordinates, this._decimals)\n    ];\n  }\n};\n/** Decode a GeoJSONX object.\n * @param {*} object GeoJSONX\n * @param {*} options Read options.\n * @return {Array<ol.Feature>}\n * @override\n * @api\n */\nol.format.GeoJSONX.prototype.readFeaturesFromObject = function (object, options) {\n  this._hashProperties = object.hashProperties || [];\n  options = options || {};\n  options.decimals = parseInt(object.decimals);\n  if (!options.decimals && options.decimals!==0) throw 'Bad file format...';\n  var features = ol.format.GeoJSON.prototype.readFeaturesFromObject.call(this, object, options);\n  return features;\n};\n/** Decode GeoJSONX Feature object.\n * @param {*} object GeoJSONX\n * @param {*} options Read options.\n * @return {ol.Feature}\n */\nol.format.GeoJSONX.prototype.readFeatureFromObject = function (f0, options) {\n  var f = {\n    type: 'Feature'\n  }\n  if (typeof(f0[0]) === 'string') {\n    f.geometry = {\n      type: 'Point',\n      coordinates: this.decodeCoordinates(f0[0], typeof(options.decimals) === 'number' ? options.decimals : this.decimals)\n    }  \n  } else {\n    f.geometry = {\n      type: this._toType[f0[0][0]],\n      coordinates: this.decodeCoordinates(f0[0][1], typeof(options.decimals) === 'number' ? options.decimals : this.decimals)\n    }\n  }\n  if (this._hashProperties && f0[1]) {\n    f.properties = {};\n    var t = f0[1];\n    for (var i=0; i<t.length; i+=2) {\n      f.properties[this._hashProperties[t[i]]] = t[i+1];\n    }\n  } else {\n    f.properties = f0[1];\n  }\n  // Extended properties\n  if (f0[2]) {\n    for (var k in f0[2]) {\n      f[k] = f0[2][k];\n    }\n  }\n  var feature = ol.format.GeoJSON.prototype.readFeatureFromObject.call(this, f, options);\n  return feature;\n};\n\n/** Feature format for reading and writing data in the GeoJSONP format,\n * using Polyline Algorithm to encode geometry.\n * @constructor \n * @extends {ol.format.GeoJSON}\n * @param {*} options options.\n *  @param {number} options.decimals number of decimals to save, default 6\n *  @param {ol.ProjectionLike} options.dataProjection Projection of the data we are reading. If not provided `EPSG:4326`\n *  @param {ol.ProjectionLike} options.featureProjection Projection of the feature geometries created by the format reader. If not provided, features will be returned in the dataProjection.\n */\nol.format.GeoJSONP = function(options) {\n  options = options || {};\n  ol.format.GeoJSONX.call (this, options);\n  this._lineFormat = new ol.format.Polyline({ factor: Math.pow(10, options.decimals || 6) });\n};\nol.ext.inherits(ol.format.GeoJSONP, ol.format.GeoJSONX);\n/** Encode coordinates\n * @param {ol.coordinate|Array<ol.coordinate>} v\n * @return {string|Array<string>}\n * @api\n */\nol.format.GeoJSONP.prototype.encodeCoordinates = function(v) {\n  var g;\n  if (typeof(v[0]) === 'number') {\n    g = new ol.geom.Point(v);\n    return this._lineFormat.writeGeometry(g);\n  } else if (v.length && v[0]) {\n    var tab = (typeof(v[0][0]) === 'number');\n    if (tab) {\n      g = new ol.geom.LineString(v);\n      return this._lineFormat.writeGeometry(g);\n    } else {\n      var r = [];\n      for (var i=0; i<v.length; i++) {\n        r[i] = this.encodeCoordinates(v[i]);\n      }\n      return r;\n    }\n  } else {\n    return this.encodeCoordinates([0,0]);\n  }\n};\n/** Decode coordinates\n * @param {string|Array<string>}\n * @return {ol.coordinate|Array<ol.coordinate>} v\n * @api\n */\nol.format.GeoJSONP.prototype.decodeCoordinates = function(v) {\n  var i, g;\n  if (typeof(v) === 'string') {\n    g = this._lineFormat.readGeometry(v);\n    return g.getCoordinates()[0];\n  } else if (v.length) {\n    var tab = (typeof(v[0]) === 'string');\n    var r = [];\n    if (tab) {\n      for (i=0; i<v.length; i++) {\n        g = this._lineFormat.readGeometry(v[i]);\n        r[i] = g.getCoordinates();\n      }\n    } else {\n      for (i=0; i<v.length; i++) {\n        r[i] = this.decodeCoordinates(v[i]);\n      }\n    }\n    return r;\n  } else {\n    return null;\n  }\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Feature format for reading data in the GeoRSS format.\n * @constructor ol.fromat.GeoRSS\n * @extends {ol.Object}\n * @param {*} options options.\n *  @param {ol.ProjectionLike} options.dataProjection Projection of the data we are reading. If not provided `EPSG:4326`\n *  @param {ol.ProjectionLike} options.featureProjection Projection of the feature geometries created by the format reader. If not provided, features will be returned in the dataProjection.\n */\nol.format.GeoRSS = function(options) {\n  options = options || {};\n  ol.Object.call (this, options);\n};\nol.ext.inherits(ol.format.GeoRSS, ol.Object);\n/**\n * Read a feature.  Only works for a single feature. Use `readFeatures` to\n * read a feature collection.\n *\n * @param {Node|string} source Source.\n * @param {*} options Read options.\n *  @param {ol.ProjectionLike} options.dataProjection Projection of the data we are reading. If not provided `EPSG:4326`\n *  @param {ol.ProjectionLike} options.featureProjection Projection of the feature geometries created by the format reader. If not provided, features will be returned in the dataProjection.\n * @return {ol.Feature} Feature or null if no feature read\n * @api\n */\nol.format.GeoRSS.prototype.readFeature = function(source, options) {\n  options = options || {};\n  var att, atts = source.children;\n  var f = new ol.Feature();\n  // Get attributes\n  for (var j=0; att = atts[j]; j++) {\n    f.set(att.tagName, att.innerHTML);\n  }\n  var temp, g, coord=[];\n  // Get geometry\n  if (f.get('geo:long')) {\n    // LonLat\n    g = new ol.geom.Point([parseFloat(f.get('geo:long')), parseFloat(f.get('geo:lat'))]);\n    f.unset('geo:long');\n    f.unset('geo:lat');\n  } else if (f.get('georss:point')) {\n    // Point\n    coord = f.get('georss:point').trim().split(' ');\n    g = new ol.geom.Point([parseFloat(coord[1]), parseFloat(coord[0])]);\n    f.unset('georss:point');\n  } else if (f.get('georss:polygon')) {\n    // Polygon\n    temp = f.get('georss:polygon').trim().split(' ');\n    for (var i=0; i<temp.length; i += 2) {\n      coord.push([parseFloat(temp[i+1]), parseFloat(temp[i])]) \n    }\n    g = new ol.geom.Polygon([coord]);\n    f.unset('georss:polygon');\n  } else if (f.get('georss:where')) {\n    // GML\n    console.warn('[GeoRSS] GML format not implemented')\n    f.unset('georss:where');\n    return null;\n  } else {\n    console.warn('[GeoRSS] unknown geometry')\n    return null;\n  }\n  if (options.featureProjection || this.get('featureProjection')) {\n    g.transform (options.dataProjection || this.get('dataProjection') || 'EPSG:4326', options.featureProjection || this.get('featureProjection'));\n  }\n  f.setGeometry(g);\n  return f;\n};\n/**\n * Read all features.  Works with both a single feature and a feature\n * collection.\n *\n * @param {Document|Node|string} source Source.\n * @param {*} options Read options.\n *  @param {ol.ProjectionLike} options.dataProjection Projection of the data we are reading. If not provided `EPSG:4326`\n *  @param {ol.ProjectionLike} options.featureProjection Projection of the feature geometries created by the format reader. If not provided, features will be returned in the dataProjection.\n * @return {Array<ol.Feature>} Features.\n * @api\n */\nol.format.GeoRSS.prototype.readFeatures = function(source, options) {\n  var items;\n  if (typeof(source)==='string') {\n    var parser = new DOMParser();\n    var xmlDoc = parser.parseFromString(source,\"text/xml\");\n    items = xmlDoc.getElementsByTagName(this.getDocumentItemsTagName(xmlDoc));\n  } else if (source instanceof Document) {\n    items = source.getElementsByTagName(this.getDocumentItemsTagName(source));\n  } else if (source instanceof Node) {\n    items = source;\n  } else {\n    return [];\n  }\n  var features = []\n  for (var i=0, item; item = items[i]; i++) {\n    var f = this.readFeature(item, options);\n    if (f) features.push(f);\n  }\n  return features;\n};\n/**\n * Get the tag name for the items in the XML Document depending if we are\n * dealing with an atom base document or not.\n * @param {Document} xmlDoc document to extract the tag name for the items\n * @return {string} tag name\n * @private\n */\nol.format.GeoRSS.prototype.getDocumentItemsTagName = function(xmlDoc) {\n  switch (xmlDoc.documentElement.tagName) {\n    case 'feed':\n      return 'entry';\n    default:\n      return 'item';\n  }\n}\n\n/** An interaction to check the current map and add key events listeners.\n * It will fire a 'focus' event on the map when map is focused (use mapCondition option to handle the condition when the map is focused).\n * @constructor\n * @fires focus\n * @param {*} options\n *  @param {function} condition a function that takes a mapBrowserEvent and returns true if the map must be activated, default always true\n *  @param {function} onKeyDown a function that takes a keydown event is fired on the active map\n *  @param {function} onKeyPress a function that takes a keypress event is fired on the active map\n *  @param {function} onKeyUp a function that takes a keyup event is fired on the active map\n * @extends {ol.interaction.Interaction}\n */\nol.interaction.CurrentMap = function(options) {\n  options = options || {};\n  var condition = options.condition || function() {\n    return true;\n  }\n  // Check events on the map\n  ol.interaction.Interaction.call(this, {\n    handleEvent: function(e) {\n      if (condition(e)) {\n        if (!this.isCurrentMap()) {\n          this.setCurrentMap(this.getMap());\n          this.dispatchEvent({ type: 'focus', map: this.getMap() });\n          this.getMap().dispatchEvent({ type: 'focus', map: this.getMap() });\n        }\n      }\n      return true;\n    }.bind(this)\n  });\n  // Add a key listener\n  if (options.onKeyDown) { \n    document.addEventListener('keydown', function(e) {\n      if (this.isCurrentMap() && !/INPUT|TEXTAREA|SELECT/.test(document.activeElement.tagName)) {\n        options.onKeyDown ({ type: e.type, map: this.getMap(), originalEvent: e });\n      }\n    }.bind(this));\n  }\n  if (options.onKeyPress) { \n    document.addEventListener('keydown', function(e) {\n      if (this.isCurrentMap() && !/INPUT|TEXTAREA|SELECT/.test(document.activeElement.tagName)) {\n        options.onKeyPress ({ type: e.type, map: this.getMap(), originalEvent: e });\n      }\n    }.bind(this));\n  }\n  if (options.onKeyUp) { \n    document.addEventListener('keydown', function(e) {\n      if (this.isCurrentMap() && !/INPUT|TEXTAREA|SELECT/.test(document.activeElement.tagName)) {\n        options.onKeyUp ({ type: e.type, map: this.getMap(), originalEvent: e });\n      }\n    }.bind(this));\n  }\n};\nol.ext.inherits(ol.interaction.CurrentMap, ol.interaction.Interaction);\n/** The current map */\nol.interaction.CurrentMap.prototype._currentMap = undefined;\n/** Check if is the current map \n * @return {boolean}\n */\nol.interaction.CurrentMap.prototype.isCurrentMap = function() {\n  return this.getMap() === ol.interaction.CurrentMap.prototype._currentMap;\n};\n/** Get the current map\n * @return {ol.Map}\n */\nol.interaction.CurrentMap.prototype.getCurrentMap = function() {\n  return ol.interaction.CurrentMap.prototype._currentMap;\n};\n/** Set the current map\n * @param {ol.Map} map\n */\nol.interaction.CurrentMap.prototype.setCurrentMap = function(map) {\n  ol.interaction.CurrentMap.prototype._currentMap = map;\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Handles coordinates on the center of the viewport.\n * It can be used as abstract base class used for creating subclasses. \n * The CenterTouch interaction modifies map browser event coordinate and pixel properties to force pointer on the viewport center to any interaction that them.\n * Only pointermove pointerup are concerned with it.\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @param {olx.interaction.InteractionOptions} options Options\n *  @param {ol.style.Style|Array<ol.style.Style>} options.targetStyle a style to draw the target point, default cross style\n *  @param {string} options.composite composite operation for the target : difference|multiply|xor|screen|overlay|darken|lighter|lighten|...\n */\nol.interaction.CenterTouch = function(options) {\n  options = options || {};\n  // LIst of listerner on the object\n  this._listener = {};\n  // Filter event\n  var rex = /^pointermove$|^pointerup$/;\n  // Interaction to defer center on top of the interaction \n  // this is done to enable other coordinates manipulation inserted after the interaction (snapping)\n  this.ctouch = new ol.interaction.Interaction({\n    handleEvent: function(e) {\n      if (rex.test(e.type) && this.getMap()) {\n        e.coordinate = this.getMap().getView().getCenter();\n        e.pixel = this.getMap().getSize();\n        e.pixel = [ e.pixel[0]/2, e.pixel[1]/2 ];\n      }\n      return true; \n    }\n  });\n  // Target on map center\n  this._target = new ol.control.Target({\n    style: options.targetStyle,\n    composite: options.composite\n  });\n  ol.interaction.Interaction.call(this, {\n    handleEvent: function(e) {\n      if (rex.test(e.type)) this.pos_ = e.coordinate;\n      if (options.handleEvent) return options.handleEvent.call (this,e);\n      return true; \n    }\n  });\n};\nol.ext.inherits(ol.interaction.CenterTouch, ol.interaction.Interaction);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {_ol_Map_} map Map.\n * @api stable\n */\nol.interaction.CenterTouch.prototype.setMap = function(map) {\n  if (this.getMap()) {\n    this.getMap().removeInteraction(this.ctouch);\n    this.getMap().removeInteraction(this._target);\n  }\n  ol.interaction.Interaction.prototype.setMap.call (this, map);\n  if (this.getMap()) {\n    if (this.getActive()) {\n      this.getMap().addInteraction(this.ctouch);\n      this.getMap().addControl(this._target);\n    }\n  }\n};\n/**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\nol.interaction.CenterTouch.prototype.setActive = function(b) {\n  ol.interaction.Interaction.prototype.setActive.call (this, b);\n  this.pos_ = null;\n  if (this.getMap()) {\n    if (this.getActive()) {\n      this.getMap().addInteraction(this.ctouch);\n      this.getMap().addControl(this._target);\n    } else {\n      this.getMap().removeInteraction(this.ctouch);\n      this.getMap().removeControl(this._target);\n    }\n  }\n};\n/** Get the position of the target\n * @return {ol.coordinate}\n */\nol.interaction.CenterTouch.prototype.getPosition = function () {\n  if (!this.pos_) {\n    var px =this.getMap().getSize();\n    px = [ px[0]/2, px[1]/2 ];\n    this.pos_ = this.getMap().getCoordinateFromPixel(px);\n  }\n  return this.pos_; \n};\n\n/** Clip interaction to clip layers in a circle\n * @constructor\n * @extends {ol.interaction.Pointer}\n * @param {ol.interaction.Clip.options} options flashlight  param\n *  @param {number} options.radius radius of the clip, default 100\n *\t@param {ol.layer|Array<ol.layer>} options.layers layers to clip\n */\nol.interaction.Clip = function(options) {\n  this.layers_ = [];\n  ol.interaction.Pointer.call(this, {\n    handleDownEvent: this.setPosition,\n    handleMoveEvent: this.setPosition\n  });\n  this.precomposeBind_ = this.precompose_.bind(this);\n  this.postcomposeBind_ = this.postcompose_.bind(this);\n  // Default options\n  options = options || {};\n  this.pos = false;\n  this.radius = (options.radius||100);\n  if (options.layers) this.addLayer(options.layers);\n};\nol.ext.inherits(ol.interaction.Clip, ol.interaction.Pointer);\n/** Set the map > start postcompose\n*/\nol.interaction.Clip.prototype.setMap = function(map) {\n  var i;\n  if (this.getMap()) {\n    for (i=0; i<this.layers_.length; i++) {\n      this.layers_[i].un(['precompose','prerender'], this.precomposeBind_);\n      this.layers_[i].un(['postcompose','postrender'], this.postcomposeBind_);\n    }\n    this.getMap().renderSync();\n  }\n  ol.interaction.Pointer.prototype.setMap.call(this, map);\n  if (map) {\n    for (i=0; i<this.layers_.length; i++) {\n      this.layers_[i].on(['precompose','prerender'], this.precomposeBind_);\n      this.layers_[i].on(['postcompose','postrender'], this.postcomposeBind_);\n    }\n    map.renderSync();\n  }\n}\n/** Set clip radius\n *\t@param {integer} radius\n*/\nol.interaction.Clip.prototype.setRadius = function(radius) {\n  this.radius = radius;\n  if (this.getMap()) this.getMap().renderSync();\n}\n/** Add a layer to clip\n *\t@param {ol.layer|Array<ol.layer>} layer to clip\n*/\nol.interaction.Clip.prototype.addLayer = function(layers)  {\n  if (!(layers instanceof Array)) layers = [layers];\n  for (var i=0; i<layers.length; i++) {\n    if (this.getMap()) {\n      layers[i].on(['precompose','prerender'], this.precomposeBind_);\n      layers[i].on(['postcompose','postrender'], this.postcomposeBind_);\n      this.getMap().renderSync();\n    }\n    this.layers_.push(layers[i]);\n  }\n};\n/** Remove a layer to clip\n *\t@param {ol.layer|Array<ol.layer>} layer to clip\n*/\nol.interaction.Clip.prototype.removeLayer = function(layers) {\n  if (!(layers instanceof Array)) layers = [layers];\n  for (var i=0; i<layers.length; i++) {\n    var k;\n    for (k=0; k<this.layers_.length; k++) {\n      if (this.layers_[k]===layers[i]) {\n        break;\n      }\n    }\n    if (k!=this.layers_.length && this.getMap()) {\n      this.layers_[k].un(['precompose','prerender'], this.precomposeBind_);\n      this.layers_[k].un(['postcompose','postrender'], this.postcomposeBind_);\n      this.layers_.splice(k,1);\n      this.getMap().renderSync();\n    }\n  }\n};\n/** Set position of the clip\n*\t@param {ol.Pixel|ol.MapBrowserEvent}\n*/\nol.interaction.Clip.prototype.setPosition = function(e) {\n  if (e.pixel) this.pos = e.pixel;\n  else {\n    if (e && e instanceof Array) this.pos = e;\n    else e = [-10000000,-10000000];\n  }\n  if (this.getMap()) this.getMap().renderSync();\n};\n/* @private\n*/\nol.interaction.Clip.prototype.precompose_ = function(e) {\n  var ctx = e.context;\n  var ratio = e.frameState.pixelRatio;\n  ctx.save();\n  ctx.beginPath();\n  var pt = [ this.pos[0], this.pos[1] ];\n  var radius = this.radius;\n  var tr = e.inversePixelTransform;\n  if (tr) {\n    pt = [\n      (pt[0]*tr[0] - pt[1]*tr[1] + tr[4]),\n      (-pt[0]*tr[2] + pt[1]*tr[3] + tr[5])\n    ];\n  } else {\n    pt[0] *= ratio;\n    pt[1] *= ratio;\n    radius *= ratio;\n  }\n  ctx.arc (pt[0], pt[1], radius, 0, 2*Math.PI);\n  ctx.clip();\n};\n/* @private\n*/\nol.interaction.Clip.prototype.postcompose_ = function(e) {\n  e.context.restore();\n};\n/**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\nol.interaction.Clip.prototype.setActive = function(b) {\n  if (b===this.getActive()) return;\n  ol.interaction.Pointer.prototype.setActive.call (this, b);\n  var i;\n  if (b) {\n    for(i=0; i<this.layers_.length; i++) {\n      this.layers_[i].on(['precompose','prerender'], this.precomposeBind_);\n      this.layers_[i].on(['postcompose','postrender'], this.postcomposeBind_);\n    }\n  } else {\n    for(i=0; i<this.layers_.length; i++) {\n      this.layers_[i].un(['precompose','prerender'], this.precomposeBind_);\n      this.layers_[i].un(['postcompose','postrender'], this.postcomposeBind_);\n    }\n  }\n  if (this.getMap()) this.getMap().renderSync();\n};\n\n/** An interaction to copy/paste features on a map. \n * It will fire a 'focus' event on the map when map is focused (use mapCondition option to handle the condition when the map is focused).\n * @constructor\n * @fires focus\n * @fires copy\n * @fires paste\n * @extends {ol.interaction.Interaction}\n * @param {Object} options Options\n *  @param {function} options.condition a function that takes a mapBrowserEvent and return the action to perform: 'copy', 'cut' or 'paste', default Ctrl+C / Ctrl+V\n *  @param {function} options.mapCondition a function that takes a mapBrowserEvent and return true if the map is the active map, default always returns true\n *  @param {ol.Collection<ol.Feature>} options.features list of features to copy\n *  @param {ol.source.Vector | Array<ol.source.Vector>} options.sources the source to copy from (used for cut), if not defined, it will use the destination\n *  @param {ol.source.Vector} options.destination the source to copy to\n */\nol.interaction.CopyPaste = function(options) {\n  options = options || {};\n  // Features to copy\n  this.features = [];\n  this._cloneFeature = true;\n  var condition = options.condition;\n  if (typeof (condition) !== 'function') {\n    condition = function (e) {\n      if (e.originalEvent.ctrlKey) {\n        if (/^c$/i.test(e.originalEvent.key)) return 'copy';\n        if (/^x$/i.test(e.originalEvent.key)) return 'cut';\n        if (/^v$/i.test(e.originalEvent.key)) return 'paste';\n      }\n      return false;\n    }\n  }\n  this._featuresSource = options.features || new ol.Collection();\n  this.setSources(options.sources);\n  this.setDestination(options.destination);\n  // Create intreaction\n  ol.interaction.CurrentMap.call(this, {\n    condition: options.mapCondition,\n    onKeyDown: function (e) {\n      switch (condition(e)) {\n        case 'copy': {\n          this.copy({ silent: false });\n          break;\n        }\n        case 'cut': {\n          this.copy({ cut: true, silent: false });\n          break;\n        }\n        case 'paste': {\n          this.paste({ silent: false });\n          break;\n        }\n        default: break;\n      }\n    }.bind(this)\n  });\n};\nol.ext.inherits(ol.interaction.CopyPaste, ol.interaction.CurrentMap);\n/** Sources to cut feature from\n * @param { ol.source.Vector | Array<ol.source.Vector> } sources\n */\nol.interaction.CopyPaste.prototype.setSources = function (sources) {\n  if (sources) {\n    this._source = [];\n    this._source = sources instanceof Array ? sources : [sources];\n  } else {\n    this._source = null;\n  }\n};\n/** Get sources to cut feature from\n * @return { Array<ol.source.Vector> } \n */\nol.interaction.CopyPaste.prototype.getSources = function () {\n  return this._source;\n};\n/** Source to paste features\n * @param { ol.source.Vector } source\n */\nol.interaction.CopyPaste.prototype.setDestination = function (destination) {\n  this._destination = destination;\n};\n/** Get source to paste features\n * @param { ol.source.Vector } \n */\nol.interaction.CopyPaste.prototype.getDestination = function () {\n  return this._destination;\n};\n/** Get current feature to copy\n * @return {Array<ol.Feature>}\n */\nol.interaction.CopyPaste.prototype.getFeatures = function() {\n  return this.features;\n};\n/** Set current feature to copy\n * @param {Object} options\n *  @param {Array<ol.Feature> | ol.Collection<ol.Feature>} options.features feature to copy, default get in the provided collection\n *  @param {boolean} options.cut try to cut feature from the sources, default false\n *  @param {boolean} options.silent true to send an event, default true\n */\nol.interaction.CopyPaste.prototype.copy = function (options) {\n  options = options || {};\n  var features = options.features || this._featuresSource.getArray();\n  // Try to remove feature from sources\n  if (options.cut) {\n    var sources = this._source || [this._destination];\n    // Remove feature from sources\n    features.forEach(function(f) {\n      sources.forEach(function(source) {\n        try {\n          source.removeFeature(f);\n        } catch(e) {/*ok*/}\n      });\n    });\n  }\n  if (this._cloneFeature) {\n    this.features = [];\n    features.forEach(function(f) {\n      this.features.push(f.clone());\n    }.bind(this));\n  } else {\n    this.features = features;\n  }\n  // Send an event\n  if (options.silent===false) this.dispatchEvent({ type: options.cut ? 'cut' : 'copy', time: (new Date).getTime() });\n};\n/** Paste features\n * @param {Object} options\n *  @param {Array<ol.Feature> | ol.Collection<ol.Feature>} features feature to copy, default get current features\n *  @param {ol.source.Vector} options.destination Source to paste to, default the current source\n *  @param {boolean} options.silent true to send an event, default true\n */\nol.interaction.CopyPaste.prototype.paste = function(options) {\n  options = options || {};\n  var features = options.features || this.features;\n  if (features) {\n    var destination = options.destination || this._destination;\n    if (destination) {\n      destination.addFeatures(this.features);\n      if (this._cloneFeature) this.copy({ features: this.features });\n    }\n  }\n  // Send an event\n  if (options.silent===false) this.dispatchEvent({ type:'paste', features: features, time: (new Date).getTime() });\n};\n\n/*\tCopyright (c) 2018 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A Select interaction to delete features on click.\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @fires deletestart\n * @fires deleteend\n * @param {*} options ol.interaction.Select options\n */\nol.interaction.Delete = function(options) {\n  ol.interaction.Select.call(this, options);\n  this.on('select', function(e) {\n    this.getFeatures().clear();\n    this.delete(e.selected);\n  }.bind(this));\n};\nol.ext.inherits(ol.interaction.Delete, ol.interaction.Select);\n/** Get vector source of the map\n * @return {Array<ol.source.Vector>}\n */\nol.interaction.Delete.prototype._getSources = function(layers) {\n  if (!this.getMap()) return [];\n  if (!layers) layers = this.getMap().getLayers();\n  var sources = [];\n  layers.forEach(function (l) {\n    // LayerGroup\n    if (l.getLayers) {\n      sources = sources.concat(this._getSources(l.getLayers()));\n    } else {\n      if (l.getSource && l.getSource() instanceof ol.source.Vector) {\n        sources.push(l.getSource());\n      }\n    }\n  }.bind(this));\n  return sources;\n};\n/** Delete features: remove the features from the map (from all layers in the map)\n * @param {ol.Collection<ol.Feature>|Array<ol.Feature>} features The features to delete\n * @api\n */\nol.interaction.Delete.prototype.delete = function(features) {\n  if (features && (features.length || features.getLength())) {\n    this.dispatchEvent({ type: 'deletestart', features: features });\n    var delFeatures = [];\n    // Get the sources concerned\n    this._getSources().forEach(function (source) {\n      try {\n        // Try to delete features in the source\n        features.forEach(function(f) {\n          source.removeFeature(f);\n          delFeatures.push(f);\n        });\n      } catch(e) { /* ok */ }\n    })\n    this.dispatchEvent({ type: 'deleteend', features: delFeatures });\n  }\n};\n\n/** Drag an overlay on the map\n * @constructor\n * @extends {ol.interaction.Pointer}\n * @fires dragstart\n * @fires dragging\n * @fires dragend\n * @param {any} options\n *  @param {ol.Overlay|Array<ol.Overlay>} options.overlays the overlays to drag\n *  @param {ol.Size} options.offset overlay offset, default [0,0]\n */\nol.interaction.DragOverlay = function(options) {\n  if (!options) options = {};\n  var offset = options.offset || [0,0];\n  // Extend pointer\n  ol.interaction.Pointer.call(this, {\n    // start draging on an overlay\n    handleDownEvent: function(evt) {\n      var res = evt.frameState.viewState.resolution\n      var coordinate = [evt.coordinate[0] + offset[0]*res, evt.coordinate[1] - offset[1]*res];\n      // Click on a button (closeBox) or on a link: don't drag!\n      if (/^(BUTTON|A)$/.test(evt.originalEvent.target.tagName)) {\n        this._dragging = false;\n        return true;\n      }\n      // Start dragging\n      if (this._dragging) {\n        if (options.centerOnClick !== false) {\n          this._dragging.setPosition(coordinate, true);\n        } else {\n          coordinate = this._dragging.getPosition();\n        }\n        this.dispatchEvent({ \n          type: 'dragstart',\n          overlay: this._dragging,\n          originalEvent: evt.originalEvent,\n          frameState: evt.frameState,\n          coordinate: coordinate\n        });\n        return true;\n      }\n      return false;\n    },\n    // Drag\n    handleDragEvent: function(evt) {\n      var res = evt.frameState.viewState.resolution\n      var coordinate = [evt.coordinate[0] + offset[0]*res, evt.coordinate[1] - offset[1]*res];\n      if (this._dragging) {\n        this._dragging.setPosition(coordinate, true);\n        this.dispatchEvent({ \n          type: 'dragging',\n          overlay: this._dragging,\n          originalEvent: evt.originalEvent,\n          frameState: evt.frameState,\n          coordinate: coordinate\n        });\n      }\n    },\n    // Stop dragging\n    handleUpEvent: function(evt) {\n      var res = evt.frameState.viewState.resolution\n      var coordinate = [evt.coordinate[0] + offset[0]*res, evt.coordinate[1] - offset[1]*res];\n      if (this._dragging) {\n        this.dispatchEvent({ \n          type: 'dragend',\n          overlay: this._dragging,\n          originalEvent: evt.originalEvent,\n          frameState: evt.frameState,\n          coordinate: coordinate\n        });\n        this._dragging = false;\n        return true;\n      }\n      return false;\n    }\n  });\n  // List of overlays / listeners\n  this._overlays = [];\n  if (!(options.overlays instanceof Array)) options.overlays = [options.overlays];\n  options.overlays.forEach(this.addOverlay.bind(this));\n};\nol.ext.inherits(ol.interaction.DragOverlay, ol.interaction.Pointer);\n/** Add an overlay to the interacton\n * @param {ol.Overlay} ov\n */\nol.interaction.DragOverlay.prototype.addOverlay = function (ov) {\n  for (var i=0, o; o=this._overlays[i]; i++) {\n    if (o===ov) return;\n  }\n  // Stop event overlay\n  if (ov.element.parentElement && ov.element.parentElement.classList.contains('ol-overlaycontainer-stopevent')) {\n    console.warn('[DragOverlay.addOverlay] overlay must be created with stopEvent set to false!');\n    return;\n  }\n  // Add listener on overlay of the same map\n  var handler = function() {\n    if (this.getMap()===ov.getMap()) this._dragging = ov;\n  }.bind(this);\n  this._overlays.push({\n    overlay: ov,\n    listener: handler\n  });\n  ov.element.addEventListener('pointerdown', handler);\n};\n/** Remove an overlay from the interacton\n * @param {ol.Overlay} ov\n */\nol.interaction.DragOverlay.prototype.removeOverlay = function (ov) {\n  for (var i=0, o; o=this._overlays[i]; i++) {\n    if (o.overlay===ov) {\n      var l = this._overlays.splice(i,1)[0];\n      ov.element.removeEventListener('pointerdown', l.listener);\n      break;\n    }\n  }\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Interaction to draw holes in a polygon.\n * It fires a drawstart, drawend event when drawing the hole\n * and a modifystart, modifyend event before and after inserting the hole in the feature geometry.\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @fires drawstart\n * @fires drawend\n * @fires modifystart\n * @fires modifyend\n * @param {olx.interaction.DrawHoleOptions} options extend olx.interaction.DrawOptions\n * \t@param {Array<ol.layer.Vector> | function | undefined} options.layers A list of layers from which polygons should be selected. Alternatively, a filter function can be provided. default: all visible layers\n * \t@param { ol.style.Style | Array<ol.style.Style> | StyleFunction | undefined }\tStyle for the selected features, default: default edit style\n */\nol.interaction.DrawHole = function(options) {\n  if (!options) options = {};\n  var self = this;\n  // Select interaction for the current feature\n  this._select = new ol.interaction.Select({ style: options.style });\n  this._select.setActive(false);\n  // Geometry function that test points inside the current\n  var geometryFn, geomFn = options.geometryFunction;\n  if (geomFn) {\n    geometryFn = function(c,g) {\n      g = self._geometryFn (c, g);\n      return geomFn (c,g);\n    }\n  } else {\n    geometryFn = function(c,g) { return self._geometryFn (c, g); }\n  }\n  // Create draw interaction\n  options.type = \"Polygon\";\n  options.geometryFunction = geometryFn;\n  ol.interaction.Draw.call(this, options);\n  // Layer filter function\n  if (options.layers) {\n    if (typeof (options.layers) === 'function') {\n      this.layers_ = options.layers;\n    } else if (options.layers.indexOf) {\n      this.layers_ = function(l) {\n        return (options.layers.indexOf(l) >= 0); \n      };\n    }\n  }\n  // Start drawing if inside a feature\n  this.on('drawstart', this._startDrawing.bind(this));\n  // End drawing add the hole to the current Polygon\n  this.on('drawend', this._finishDrawing.bind(this));\n};\nol.ext.inherits(ol.interaction.DrawHole, ol.interaction.Draw);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.DrawHole.prototype.setMap = function(map) {\n  if (this.getMap()) this.getMap().removeInteraction(this._select);\n  if (map) map.addInteraction(this._select);\n  ol.interaction.Draw.prototype.setMap.call (this, map);\n};\n/**\n * Activate/deactivate the interaction\n * @param {boolean}\n * @api stable\n */\nol.interaction.DrawHole.prototype.setActive = function(b) {\n  this._select.getFeatures().clear();\n  ol.interaction.Draw.prototype.setActive.call (this, b);\n};\n/**\n * Remove last point of the feature currently being drawn \n * (test if points to remove before).\n */\nol.interaction.DrawHole.prototype.removeLastPoint = function() {\n  if (this._feature && this._feature.getGeometry().getCoordinates()[0].length>2) {\n    ol.interaction.Draw.prototype.removeLastPoint.call(this);\n  }\n};\n/** \n * Get the current polygon to hole\n * @return {ol.Feature}\n */\nol.interaction.DrawHole.prototype.getPolygon = function() {\n  return this._polygon;\n  // return this._select.getFeatures().item(0).getGeometry();\n};\n/**\n * Get current feature to add a hole and start drawing\n * @param {ol.interaction.Draw.Event} e\n * @private\n */\nol.interaction.DrawHole.prototype._startDrawing = function(e) {\n  var map = this.getMap();\n  var layersFilter = this.layers_;\n  this._feature = e.feature;\n  var coord = e.feature.getGeometry().getCoordinates()[0][0];\n  // Check object under the pointer\n  var features = map.getFeaturesAtPixel(\n    map.getPixelFromCoordinate(coord), {\n      layerFilter: layersFilter\n    }\n  );\n  this._current = null;\n  if (features) {\n    for (var k=0; k<features.length; k++) {\n      var poly = features[k].getGeometry();\n      if (poly.getType() === \"Polygon\"\n        && poly.intersectsCoordinate(coord)) {\n        this._polygonIndex = false;\n        this._polygon = poly;\n        this._current = features[k];\n      }\n      else if (poly.getType() === \"MultiPolygon\"\n        && poly.intersectsCoordinate(coord)) {\n        for (var i=0, p; p=poly.getPolygon(i); i++) {\n          if (p.intersectsCoordinate(coord)) {\n            this._polygonIndex = i;\n            this._polygon = p;\n            this._current = features[k];\n            break;\n          }\n        }\n      }\n      if (this._current) break;\n    }\n  }\n  this._select.getFeatures().clear();\n  if (!this._current) {\n    this.setActive(false);\n    this.setActive(true);\n  } else {\n    this._select.getFeatures().push(this._current);\n  }\n};\n/**\n * Stop drawing and add the sketch feature to the target feature. \n * @param {ol.interaction.Draw.Event} e\n * @private\n */\nol.interaction.DrawHole.prototype._finishDrawing = function(e) {\n  // The feature is the hole\n  e.hole = e.feature;\n  // Get the current feature\n  e.feature = this._select.getFeatures().item(0);\n  this.dispatchEvent({ type: 'modifystart', features: [ this._current ] });\n  // Create the hole\n  var c = e.hole.getGeometry().getCoordinates()[0];\n  if (c.length > 3) {\n    if (this._polygonIndex!==false) {\n      var geom = e.feature.getGeometry();\n      var newGeom = new ol.geom.MultiPolygon([]);\n      for (var i=0, pi; pi=geom.getPolygon(i); i++) {\n        if (i===this._polygonIndex) {\n          pi.appendLinearRing(new ol.geom.LinearRing(c));\n          newGeom.appendPolygon(pi);\n        } else {\n          newGeom.appendPolygon(pi);\n        }\n      }\n      e.feature.setGeometry(newGeom);\n    } else {\n      this.getPolygon().appendLinearRing(new ol.geom.LinearRing(c));\n    }\n  }\n  this.dispatchEvent({ type: 'modifyend', features: [ this._current ] });\n  // reset\n  this._feature = null;\n  this._select.getFeatures().clear();\n};\n/**\n * Function that is called when a geometry's coordinates are updated.\n * @param {Array<ol.coordinate>} coordinates\n * @param {ol.geom.Polygon} geometry\n * @return {ol.geom.Polygon}\n * @private\n */\nol.interaction.DrawHole.prototype._geometryFn = function(coordinates, geometry) {\n  var coord = coordinates[0].pop();\n  if (!this.getPolygon() || this.getPolygon().intersectsCoordinate(coord)) {\n    this.lastOKCoord = [coord[0],coord[1]];\n  }\n  coordinates[0].push([this.lastOKCoord[0],this.lastOKCoord[1]]);\n  if (geometry) {\n    geometry.setCoordinates([coordinates[0].concat([coordinates[0][0]])]);\n  } else {\n    geometry = new ol.geom.Polygon(coordinates);\n  }\n  return geometry;\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Interaction rotate\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @fires drawstart, drawing, drawend, drawcancel\n * @param {olx.interaction.TransformOptions} options\n *  @param {Array<ol.Layer>} source Destination source for the drawn features\n *  @param {ol.Collection<ol.Feature>} features Destination collection for the drawn features \n *  @param {ol.style.Style | Array.<ol.style.Style> | ol.style.StyleFunction | undefined} style style for the sketch\n *  @param {integer} sides number of sides, default 0 = circle\n *  @param { ol.events.ConditionType | undefined } squareCondition A function that takes an ol.MapBrowserEvent and returns a boolean to draw square features.\n *  @param { ol.events.ConditionType | undefined } centerCondition A function that takes an ol.MapBrowserEvent and returns a boolean to draw centered features.\n *  @param { bool } canRotate Allow rotation when centered + square, default: true\n *  @param { number } clickTolerance click tolerance on touch devices, default: 6\n *  @param { number } maxCircleCoordinates Maximum number of point on a circle, default: 100\n */\nol.interaction.DrawRegular = function(options) {\n  if (!options) options={};\n  this.squaredClickTolerance_ = options.clickTolerance ? options.clickTolerance * options.clickTolerance : 36;\n  this.maxCircleCoordinates_ = options.maxCircleCoordinates || 100;\n  // Collection of feature to transform \n  this.features_ = options.features;\n  // List of layers to transform \n  this.source_ = options.source;\n  // Square condition\n  this.squareFn_ = options.squareCondition;\n  // Centered condition\n  this.centeredFn_ = options.centerCondition;\n  // Allow rotation when centered + square\n  this.canRotate_ = (options.canRotate !== false);\n  // Specify custom geometry name\n  this.geometryName_ = options.geometryName\n  // Number of sides (default=0: circle)\n  this.setSides(options.sides);\n  // Style\n  var defaultStyle = ol.style.Style.defaultStyle(true);\n  // Create a new overlay layer for the sketch\n  this.sketch_ = new ol.Collection();\n  this.overlayLayer_ = new ol.layer.Vector({\n    source: new ol.source.Vector({\n      features: this.sketch_,\n      useSpatialIndex: false\n    }),\n    name:'DrawRegular overlay',\n    displayInLayerSwitcher: false,\n    style: options.style || defaultStyle\n  });\n  ol.interaction.Interaction.call(this, {\t\n      /*\n      handleDownEvent: this.handleDownEvent_,\n      handleMoveEvent: this.handleMoveEvent_,\n      handleUpEvent: this.handleUpEvent_,\n      */\n      handleEvent: this.handleEvent_\n    });\n};\nol.ext.inherits(ol.interaction.DrawRegular, ol.interaction.Interaction);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.DrawRegular.prototype.setMap = function(map) {\n  if (this.getMap()) this.getMap().removeLayer(this.overlayLayer_);\n  ol.interaction.Interaction.prototype.setMap.call (this, map);\n  this.overlayLayer_.setMap(map);\n};\n/**\n * Activate/deactivate the interaction\n * @param {boolean}\n * @api stable\n */\nol.interaction.DrawRegular.prototype.setActive = function(b) {\n  this.reset();\n  ol.interaction.Interaction.prototype.setActive.call (this, b);\n}\n/**\n * Reset the interaction\n * @api stable\n */\nol.interaction.DrawRegular.prototype.reset = function() {\n  this.overlayLayer_.getSource().clear();\n  this.started_ = false;\n}\n/**\n * Set the number of sides.\n * @param {int} number of sides.\n * @api stable\n */\nol.interaction.DrawRegular.prototype.setSides = function (nb) {\n  nb = parseInt(nb);\n  this.sides_ = nb>2 ? nb : 0;\n}\n/**\n * Allow rotation when centered + square\n * @param {bool} \n * @api stable\n */\nol.interaction.DrawRegular.prototype.canRotate = function (b) {\n  if (b===true || b===false) this.canRotate_ = b;\n  return this.canRotate_;\n}\n/**\n * Get the number of sides.\n * @return {int} number of sides.\n * @api stable\n */\nol.interaction.DrawRegular.prototype.getSides = function () {\n  return this.sides_;\n}\n/** Default start angle array for each sides\n*/\nol.interaction.DrawRegular.prototype.startAngle = {\n  'default':Math.PI/2,\n  3: -Math.PI/2,\n  4: Math.PI/4\n};\n/** Get geom of the current drawing\n* @return {ol.geom.Polygon | ol.geom.Point}\n*/\nol.interaction.DrawRegular.prototype.getGeom_ = function () {\n  this.overlayLayer_.getSource().clear();\n  if (!this.center_) return false;\n  var g;\n  if (this.coord_) {\n    var center = this.center_;\n    var coord = this.coord_;\n    // Specific case: circle\n    var d, dmax, r, circle, centerPx;\n    if (!this.sides_ && this.square_ && !this.centered_) {\n      center = [(coord[0] + center[0])/2, (coord[1] + center[1])/2];\n      d = [coord[0] - center[0], coord[1] - center[1]];\n      r = Math.sqrt(d[0]*d[0]+d[1]*d[1]);\n      circle = new ol.geom.Circle(center, r, 'XY');\n      // Optimize points on the circle\n      centerPx = this.getMap().getPixelFromCoordinate(center);\n      dmax = Math.max (100, Math.abs(centerPx[0]-this.coordPx_[0]), Math.abs(centerPx[1]-this.coordPx_[1]));\n      dmax = Math.min ( this.maxCircleCoordinates_, Math.round(dmax / 3 ));\n      return ol.geom.Polygon.fromCircle (circle, dmax, 0);\n    } else {\n      var hasrotation = this.canRotate_ && this.centered_ && this.square_;\n      d = [coord[0] - center[0], coord[1] - center[1]];\n      if (this.square_ && !hasrotation) {\n        //var d = [coord[0] - center[0], coord[1] - center[1]];\n        var dm = Math.max (Math.abs(d[0]), Math.abs(d[1])); \n        coord = [ \n          center[0] + (d[0]>0 ? dm:-dm),\n          center[1] + (d[1]>0 ? dm:-dm)\n        ];\n      }\n      r = Math.sqrt(d[0]*d[0]+d[1]*d[1]);\n      if (r>0) {\n        circle = new ol.geom.Circle(center, r, 'XY');\n        var a;\n        if (hasrotation) a = Math.atan2(d[1], d[0]);\n        else a = this.startAngle[this.sides_] || this.startAngle['default'];\n        if (this.sides_) {\n          g = ol.geom.Polygon.fromCircle (circle, this.sides_, a);\n        } else {\n          // Optimize points on the circle\n          centerPx = this.getMap().getPixelFromCoordinate(this.center_);\n          dmax = Math.max (100, Math.abs(centerPx[0]-this.coordPx_[0]), Math.abs(centerPx[1]-this.coordPx_[1]));\n          dmax = Math.min ( this.maxCircleCoordinates_, Math.round(dmax / (this.centered_ ? 3:5) ));\n          g = ol.geom.Polygon.fromCircle (circle, dmax, 0);\n        }\n        if (hasrotation) return g;\n        // Scale polygon to fit extent\n        var ext = g.getExtent();\n        if (!this.centered_) center = this.center_;\n        else center = [ 2*this.center_[0]-this.coord_[0], 2*this.center_[1]-this.coord_[1] ];\n        var scx = (center[0] - coord[0]) / (ext[0] - ext[2]);\n        var scy = (center[1] - coord[1]) / (ext[1] - ext[3]);\n        if (this.square_) {\n          var sc = Math.min(Math.abs(scx),Math.abs(scy));\n          scx = Math.sign(scx)*sc;\n          scy = Math.sign(scy)*sc;\n        }\n        var t = [ center[0] - ext[0]*scx, center[1] - ext[1]*scy ];\n        g.applyTransform(function(g1, g2, dim) {\n          for (var i=0; i<g1.length; i+=dim) {\n            g2[i] = g1[i]*scx + t[0];\n            g2[i+1] = g1[i+1]*scy + t[1];\n          }\n          return g2;\n        });\n        return g;\n      }\n    }\n  }\n  // No geom => return a point\n  return new ol.geom.Point(this.center_);\n};\n/** Draw sketch\n* @return {ol.Feature} The feature being drawn.\n*/\nol.interaction.DrawRegular.prototype.drawSketch_ = function(evt) {\n  this.overlayLayer_.getSource().clear();\n  if (evt) {\n    this.square_ = this.squareFn_ ? this.squareFn_(evt) : evt.originalEvent.shiftKey;\n    this.centered_ = this.centeredFn_ ? this.centeredFn_(evt) : evt.originalEvent.metaKey || evt.originalEvent.ctrlKey;\n    var g = this.getGeom_();\n    if (g) {\n      var f = this.feature_;\n      if (this.geometryName_) f.setGeometryName(this.geometryName_)\n      //f.setGeometry (g);\n      if (g.getType()==='Polygon') f.getGeometry().setCoordinates(g.getCoordinates());\n      this.overlayLayer_.getSource().addFeature(f);\n      if (this.coord_ \n        && this.square_ \n        && ((this.canRotate_ && this.centered_ && this.coord_) || (!this.sides_ && !this.centered_))) {\n        this.overlayLayer_.getSource().addFeature(new ol.Feature(new ol.geom.LineString([this.center_,this.coord_])));\n      }\n      return f;\n    }\n  }\n};\n/** Draw sketch (Point)\n*/\nol.interaction.DrawRegular.prototype.drawPoint_ = function(pt, noclear) {\n  if (!noclear) this.overlayLayer_.getSource().clear();\n  this.overlayLayer_.getSource().addFeature(new ol.Feature(new ol.geom.Point(pt)));\n};\n/**\n * @param {ol.MapBrowserEvent} evt Map browser event.\n */\nol.interaction.DrawRegular.prototype.handleEvent_ = function(evt) {\n  var dx, dy;\n  // Event date time\n  this._eventTime = new Date();\n  switch (evt.type) {\n    case \"pointerdown\": {\n      this.downPx_ = evt.pixel;\n      this.start_(evt);\n      // Test long touch\n      var dt = 500;\n      this._longTouch = false;\n      setTimeout(function() {\n        this._longTouch = (new Date() - this._eventTime > .9*dt);\n        if (this._longTouch) this.handleMoveEvent_(evt);\n      }.bind(this), dt);\n      break;\n    }\n    case \"pointerup\": {\n      // Started and fisrt move\n      if (this.started_ && this.coord_) {\n        dx = this.downPx_[0] - evt.pixel[0];\n        dy = this.downPx_[1] - evt.pixel[1];\n        if (dx*dx + dy*dy <= this.squaredClickTolerance_) {\n          // The pointer has moved\n          if ( this.lastEvent == \"pointermove\" || this.lastEvent == \"keydown\" ) {\n            this.end_(evt);\n          }\n          // On touch device there is no move event : terminate = click on the same point\n          else {\n            dx = this.upPx_[0] - evt.pixel[0];\n            dy = this.upPx_[1] - evt.pixel[1];\n            if ( dx*dx + dy*dy <= this.squaredClickTolerance_) {\n              this.end_(evt);\n            } else  {\n              this.handleMoveEvent_(evt);\n              this.drawPoint_(evt.coordinate,true);\n            }\n          }\n        }\n      }\n      this.upPx_ = evt.pixel;\t\n      break;\n    }\n    case \"pointerdrag\": {\n      if (this.started_) {\n        var centerPx = this.getMap().getPixelFromCoordinate(this.center_);\n        dx = centerPx[0] - evt.pixel[0];\n        dy = centerPx[1] - evt.pixel[1];\n        if (dx*dx + dy*dy <= this.squaredClickTolerance_) {\n          this.reset();\n        }\n      }\n      return !this._longTouch;\n      // break;\n    }\n    case \"pointermove\": {\n      if (this.started_) {\n        dx = this.downPx_[0] - evt.pixel[0];\n        dy = this.downPx_[1] - evt.pixel[1];\n        if (dx*dx + dy*dy > this.squaredClickTolerance_) {\n          this.handleMoveEvent_(evt);\n          this.lastEvent = evt.type;\n        }\n      }\n      break;\n    }\n    default: {\n      this.lastEvent = evt.type;\n      // Prevent zoom in on dblclick\n      if (this.started_ && evt.type==='dblclick') {\n        //evt.stopPropagation();\n        return false;\n      }\n      break;\n    }\n  }\n  return true;\n}\n/** Stop drawing.\n */\nol.interaction.DrawRegular.prototype.finishDrawing = function() {\n  if (this.started_ && this.coord_) {\n    this.end_({ pixel: this.upPx_, coordinate: this.coord_});\n  }\n};\n/**\n * @param {ol.MapBrowserEvent} evt Event.\n */\nol.interaction.DrawRegular.prototype.handleMoveEvent_ = function(evt) {\n  if (this.started_) {\n    this.coord_ = evt.coordinate;\n    this.coordPx_ = evt.pixel;\n    var f = this.drawSketch_(evt);\n    this.dispatchEvent({ \n      type:'drawing', \n      feature: f, \n      pixel: evt.pixel, \n      startCoordinate: this.center_,\n      coordinate: evt.coordinate, \n      square: this.square_, \n      centered: this.centered_ \n    });\n  } else  {\n    this.drawPoint_(evt.coordinate);\n  }\n};\n/** Start an new draw\n * @param {ol.MapBrowserEvent} evt Map browser event.\n * @return {boolean} `false` to stop the drag sequence.\n */\nol.interaction.DrawRegular.prototype.start_ = function(evt) {\n  if (!this.started_) {\n    this.started_ = true;\n    this.center_ = evt.coordinate;\n    this.coord_ = null;\n    var geom = new ol.geom.Polygon([[evt.coordinate,evt.coordinate,evt.coordinate]]);\n    var f = this.feature_ = new ol.Feature(geom);\n    this.drawSketch_(evt);\n    this.dispatchEvent({ type:'drawstart', feature: f, pixel: evt.pixel, coordinate: evt.coordinate });\n  } else {\n    this.coord_ = evt.coordinate;\n  }\n};\n/** End drawing\n * @param {ol.MapBrowserEvent} evt Map browser event.\n * @return {boolean} `false` to stop the drag sequence.\n */\nol.interaction.DrawRegular.prototype.end_ = function(evt) {\n  this.coord_ = evt.coordinate;\n  this.started_ = false;\n  // Add new feature\n  if (this.coord_ && this.center_[0]!=this.coord_[0] && this.center_[1]!=this.coord_[1]) {\n    var f = this.feature_;\n    if (this.geometryName_) f.setGeometryName(this.geometryName_)\n    f.setGeometry(this.getGeom_());\n    if (this.source_) this.source_.addFeature(f);\n    else if (this.features_) this.features_.push(f);\n    this.dispatchEvent({ type:'drawend', feature: f, pixel: evt.pixel, coordinate: evt.coordinate, square: this.square_, centered: this.centered_ });\n  } else {\n    this.dispatchEvent({ type:'drawcancel', feature: null, pixel: evt.pixel, coordinate: evt.coordinate, square: this.square_, centered: this.centered_ });\n  }\n  this.center_ = this.coord_ = null;\n  this.drawSketch_();\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Interaction DrawTouch :\n * @constructor\n * @fires drawstart\n * @fires drawend\n * @fires drawabort\n * @extends {ol.interaction.CenterTouch}\n * @param {olx.interaction.DrawOptions} options\n *  @param {ol.source.Vector | undefined} options.source Destination source for the drawn features.\n *  @param {ol.geom.GeometryType} options.type Drawing type ('Point', 'LineString', 'Polygon') not ('MultiPoint', 'MultiLineString', 'MultiPolygon' or 'Circle'). Required.\n *\t@param {boolean} options.tap enable on tap, default true\n *  @param {ol.style.Style|Array<ol.style.Style>} options.style Drawing style\n *  @param {ol.style.Style|Array<ol.style.Style>} options.sketchStyle Sketch style\n *  @param {ol.style.Style|Array<ol.style.Style>} options.targetStyle a style to draw the target point, default cross style\n *  @param {string} options.composite composite operation : difference|multiply|xor|screen|overlay|darken|lighter|lighten|...\n */\nol.interaction.DrawTouch = function(options) {\n  options = options||{};\n  options.handleEvent = function(e) {\n    if (this.get('tap')) {\n      this.sketch.setPosition(this.getPosition());\n      switch (e.type) {\n        case 'singleclick': {\n          this.addPoint();\n          break;\n        }\n        case 'dblclick': {\n          this.addPoint();\n          this.finishDrawing();\n          return false;\n          //break;\n        }\n        default: break;\n      }\n    }\n    return true;\n  }\n  if (!options.sketchStyle) {\n    options.sketchStyle = ol.style.Style.defaultStyle();\n  }\n  var sketch = this.sketch = new ol.layer.SketchOverlay(options);\n  sketch.on(['drawstart', 'drawabort'], function(e) { this.dispatchEvent(e); }.bind(this));\n  sketch.on(['drawend'], function(e) { \n    if (e.feature && e.valid && options.source) options.source.addFeature(e.feature);\n    this.dispatchEvent(e); \n  }.bind(this));\n  ol.interaction.CenterTouch.call(this, options);\n  this._source = options.source;\n};\nol.ext.inherits(ol.interaction.DrawTouch, ol.interaction.CenterTouch);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.DrawTouch.prototype.setMap = function(map) {\n  if (this._listener) {\n    for(var l in this._listener) ol.Observable.unByKey(l);\n  }\n  this._listener = {};\n  ol.interaction.CenterTouch.prototype.setMap.call (this, map);\n  this.sketch.setMap(map);\n  if (map){\n    this._listener.center = map.on('postcompose', function() {\n      if (!ol.coordinate.equal(this.getPosition(), this.sketch.getPosition() || [])) {\n        this.sketch.setPosition(this.getPosition());\n      }\n    }.bind(this));\n  }\n};\n/** Set geometry type\n * @param {ol.geom.GeometryType} type\n */\nol.interaction.DrawTouch.prototype.setGeometryType = function(type) {\n  return this.sketch.setGeometryType(type);\n};\n/** Get geometry type\n * @return {ol.geom.GeometryType}\n */\nol.interaction.DrawTouch.prototype.getGeometryType = function() {\n  return this.sketch.getGeometryType();\n};\n/** Start drawing and add the sketch feature to the target layer. \n * The ol.interaction.Draw.EventType.DRAWEND event is dispatched before inserting the feature.\n */\nol.interaction.DrawTouch.prototype.finishDrawing = function() {\n  this.sketch.finishDrawing(true);\n};\n/** Add a new Point to the drawing\n */\nol.interaction.DrawTouch.prototype.addPoint = function() {\n  this.sketch.addPoint(this.getPosition());\n};\n/** Remove last point of the feature currently being drawn.\n */\nol.interaction.DrawTouch.prototype.removeLastPoint = function() {\n  this.sketch.removeLastPoint();\n};\n/**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\nol.interaction.DrawTouch.prototype.setActive = function(b) {\n  ol.interaction.CenterTouch.prototype.setActive.call (this, b);\n  this.sketch.abortDrawing();\n  this.sketch.setVisible(b);\n};\n\n/** Extend DragAndDrop choose drop zone + fires loadstart, loadend\n * @constructor\n * @extends {ol.interaction.DragAndDrop}\n * @fires loadstart, loadend, addfeatures\n * @param {*} options\n *  @param {string} options.zone selector for the drop zone, default document\n *  @param{ol.projection} options.projection default projection of the map\n *  @param {Array<function(new:ol.format.Feature)>|undefined} options.formatConstructors Format constructors, default [ ol.format.GPX, ol.format.GeoJSONX, ol.format.GeoJSONP, ol.format.GeoJSON, ol.format.IGC, ol.format.KML, ol.format.TopoJSON ]\n *  @param {Array<string>|undefined} options.accept list of eccepted format, default [\"gpx\",\"json\",\"geojsonx\",\"geojsonp\",\"geojson\",\"igc\",\"kml\",\"topojson\"]\n */\nol.interaction.DropFile = function(options) {\n  options = options||{};\n  ol.interaction.DragAndDrop.call(this, {});\n  var zone = options.zone || document;\n  zone.addEventListener('dragenter', this.onstop );\n  zone.addEventListener('dragover', this.onstop );\n  zone.addEventListener('dragleave', this.onstop );\n  // Options\n  this.formatConstructors_ = options.formatConstructors || [ ol.format.GPX, ol.format.GeoJSONX, ol.format.GeoJSONP, ol.format.GeoJSON, ol.format.IGC, ol.format.KML, ol.format.TopoJSON ];\n  this.projection_ = options.projection;\n  this.accept_ = options.accept || [\"gpx\",\"json\",\"geojsonx\",\"geojsonp\",\"geojson\",\"igc\",\"kml\",\"topojson\"];\n  var self = this;\n  zone.addEventListener('drop', function(e){ return self.ondrop(e);});\n};\nol.ext.inherits(ol.interaction.DropFile, ol.interaction.DragAndDrop);\n/** Set the map\n*/\nol.interaction.DropFile.prototype.setMap = function(map) {\n  ol.interaction.Interaction.prototype.setMap.call(this, map);\n};\n/** Do something when over\n*/\nol.interaction.DropFile.prototype.onstop = function(e) {\n  e.preventDefault();\n  e.stopPropagation();\n  return false;\n}\n/** Do something when over\n*/\nol.interaction.DropFile.prototype.ondrop = function(e) {\n  e.preventDefault();\n  if (e.dataTransfer && e.dataTransfer.files.length) {\n    var self = this;\n    // fetch FileList object\n    var files = e.dataTransfer.files; // e.originalEvent.target.files ?\n    // process all File objects\n    var file;\n    var pat = /\\.([0-9a-z]+)(?=[?#])|(\\.)(?:[\\w]+)$/;\n    for (var i=0; file=files[i]; i++) {\n      var ex = file.name.match(pat)[0];\n      self.dispatchEvent({ type:'loadstart', file: file, filesize: file.size, filetype: file.type, fileextension: ex, projection: projection });\n      // Load file\n      var reader = new FileReader();\n      var projection = this.projection_ || (this.getMap() ? this.getMap().getView().getProjection() : null);\n      var formatConstructors = this.formatConstructors_\n      //if (!projection) return;\n      var tryReadFeatures = function (format, result, options) {\n        try {\n          return format.readFeatures(result, options);\n        } catch (e) { /* ok */ }\n      }\n      var theFile = file;\n      reader.onload = function(e) {\n        var result = e.target.result;\n        var features = [];\n        var i, ii;\n        for (i = 0, ii = formatConstructors.length; i < ii; ++i) {\n          var formatConstructor = formatConstructors[i];\n          var format = new formatConstructor();\n          features = tryReadFeatures(format, result, { featureProjection: projection });\n          if (features && features.length > 0) {\n            self.dispatchEvent({ type:'addfeatures', features: features, file: theFile, projection: projection });\n            self.dispatchEvent({ type:'loadend', features: features, file: theFile, projection: projection });\n            return;\n          }\n        }\n        self.dispatchEvent({ type:'loadend', file: theFile, result: result });\n      };\n      reader.readAsText(file);\n    }\n  }\n  return false;\n};\n\n/** A Select interaction to fill feature's properties on click.\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @fires setattributestart\n * @fires setattributeend\n * @param {*} options extentol.interaction.Select options\n *  @param {boolean} options.active activate the interaction on start, default true\n *  @param {boolean} options.cursor use a paint bucket cursor, default true\n * @param {*} properties The properties as key/value\n */\nol.interaction.FillAttribute = function(options, properties) {\n  options = options || {};\n  if (!options.condition) options.condition = ol.events.condition.click;\n  ol.interaction.Select.call(this, options);\n  this.setActive(options.active!==false)\n  this._attributes = properties;\n  this.on('select', function(e) {\n    this.getFeatures().clear();\n    this.fill(e.selected, this._attributes);\n  }.bind(this));\n  if (options.cursor!==false) {\n    var canvas = document.createElement('CANVAS');\n    canvas.width = canvas.height = 32;\n    var ctx = canvas.getContext(\"2d\");\n    ctx.beginPath();\n      ctx.moveTo(9,3);\n      ctx.lineTo(2,9);\n      ctx.lineTo(10,17);\n      ctx.lineTo(17,11);\n    ctx.closePath();\n    ctx.fillStyle = \"#fff\";\n    ctx.fill();\n    ctx.stroke();\n    ctx.beginPath();\n      ctx.moveTo(6,4);\n      ctx.lineTo(0,8);\n      ctx.lineTo(0,13);\n      ctx.lineTo(3,17);\n      ctx.lineTo(3,8);\n    ctx.closePath();\n    ctx.fillStyle = \"#000\";\n    ctx.fill();\n    ctx.stroke();\n    ctx.moveTo(8,8);\n    ctx.lineTo(10,0);\n    ctx.lineTo(11,0);\n    ctx.lineTo(13,3);\n    ctx.lineTo(13,7);\n    ctx.stroke();\n    this._cursor = 'url('+canvas.toDataURL()+') 0 13, auto';\n  }\n};\nol.ext.inherits(ol.interaction.FillAttribute, ol.interaction.Select);\n/** Activate the interaction\n * @param {boolean} active\n */\nol.interaction.FillAttribute.prototype.setActive = function(active) {\n  if(active === this.getActive()) return;\n  ol.interaction.Select.prototype.setActive.call(this, active);\n  if (this.getMap() && this._cursor) {\n    if (active) {\n      this._previousCursor = this.getMap().getTargetElement().style.cursor;\n      this.getMap().getTargetElement().style.cursor = this._cursor;\n//      console.log('setCursor',this._cursor)\n    } else {\n      this.getMap().getTargetElement().style.cursor = this._previousCursor;\n      this._previousCursor = undefined;\n    }\n  }\n};\n/** Set attributes\n * @param {*} properties The properties as key/value\n */\nol.interaction.FillAttribute.prototype.setAttributes = function(properties) {\n  this._attributes = properties;\n};\n/** Set an attribute\n * @param {string} key \n * @param {*} val \n */\nol.interaction.FillAttribute.prototype.setAttribute = function(key, val) {\n  this._attributes[key] = val;\n};\n/** get attributes\n * @return {*} The properties as key/value\n */\nol.interaction.FillAttribute.prototype.getAttributes = function() {\n  return this._attributes;\n};\n/** Get an attribute\n * @param {string} key \n * @return {*} val \n */\nol.interaction.FillAttribute.prototype.getAttribute = function(key) {\n  return this._attributes[key];\n};\n/** Fill feature attributes\n * @param {Array<ol.Feature>} features The features to modify\n * @param {*} properties The properties as key/value\n */\nol.interaction.FillAttribute.prototype.fill = function(features, properties) {\n  if (features.length && properties) {\n    this.dispatchEvent({ type: 'setattributestart', features: features, properties: properties });\n    features.forEach(function(f) {\n      for (var p in properties) {\n        f.set(p, properties[p]);\n      }\n    });\n    this.dispatchEvent({ type: 'setattributeend', features: features, properties: properties });\n  }\n};\n\n/**\n * @constructor\n * @extends {ol.interaction.Pointer}\n * @param {ol.flashlight.options} flashlight options param\n *\t@param {ol.Color} options.color light color, default transparent\n *  @param {ol.Color} options.fill fill color, default rgba(0,0,0,0.8)\n *  @param {number} options.radius radius of the flash\n */\nol.interaction.Flashlight = function(options) {\n  ol.interaction.Pointer.call(this, {\n    handleDownEvent: this.setPosition,\n    handleMoveEvent: this.setPosition\n  });\n  // Default options\n  options = options||{};\n  this.pos = false;\n  this.radius = (options.radius||100);\n  this.setColor(options);\n};\nol.ext.inherits(ol.interaction.Flashlight, ol.interaction.Pointer);\n/** Set the map > start postcompose\n*/\nol.interaction.Flashlight.prototype.setMap = function(map) {\n  if (this.getMap()) {\n    this.getMap().render();\n  }\n  if (this._listener) ol.Observable.unByKey(this._listener);\n  this._listener = null;\n  ol.interaction.Pointer.prototype.setMap.call(this, map);\n  if (map) {\n    this._listener = map.on('postcompose', this.postcompose_.bind(this));\n  }\n}\n/** Set flashlight radius\n *\t@param {integer} radius\n*/\nol.interaction.Flashlight.prototype.setRadius = function(radius) {\n  this.radius = radius\n  if (this.getMap()) this.getMap().renderSync();\n}\n/** Set flashlight color\n *\t@param {ol.flashlight.options} flashlight options param\n*\t\t- color {ol.Color} light color, default transparent\n*\t\t- fill {ol.Color} fill color, default rgba(0,0,0,0.8)\n*/\nol.interaction.Flashlight.prototype.setColor = function(options) {\n  // Backcolor\n  var color = (options.fill ? options.fill : [0,0,0,0.8]);\n  var c = ol.color.asArray(color);\n  this.startColor = ol.color.asString(c);\n  // Halo color\n  if (options.color) {\n    c = this.endColor = ol.color.asString(ol.color.asArray(options.color)||options.color);\n  } else  {\n    c[3] = 0\n    this.endColor = ol.color.asString(c);\n  }\n  c[3] = 0.1;\n  this.midColor = ol.color.asString(c);\n  if (this.getMap()) this.getMap().renderSync();\n}\n/** Set position of the flashlight\n*\t@param {ol.Pixel|ol.MapBrowserEvent}\n*/\nol.interaction.Flashlight.prototype.setPosition = function(e) {\n  if (e.pixel) this.pos = e.pixel;\n  else this.pos = e;\n  if (this.getMap()) {\n    this.getMap().renderSync();\n  }\n}\n/** Postcompose function\n*/\nol.interaction.Flashlight.prototype.postcompose_ = function(e) {\n  var ctx = ol.ext.getMapCanvas(this.getMap()).getContext('2d');\n  var ratio = e.frameState.pixelRatio;\n  var w = ctx.canvas.width;\n  var h = ctx.canvas.height;\n  ctx.save();\n  ctx.scale(ratio,ratio);\n  if (!this.pos) {\n    ctx.fillStyle = this.startColor;\n    ctx.fillRect( 0,0,w,h );\n  } else {\n    var d = Math.max(w, h);\n    // reveal wherever we drag\n    var radGrd = ctx.createRadialGradient( this.pos[0], this.pos[1], w*this.radius/d, this.pos[0], this.pos[1], h*this.radius/d );\n    radGrd.addColorStop(   0, this.startColor );\n    radGrd.addColorStop( 0.8, this.midColor );\n    radGrd.addColorStop(   1, this.endColor );\n    ctx.fillStyle = radGrd;\n    ctx.fillRect( this.pos[0] - d, this.pos[1] - d, 2*d, 2*d );\n  }\n  ctx.restore();\n};\n\n/** An interaction to focus on the map on click. Usefull when using keyboard event on the map.\n * @constructor\n * @fires focus\n * @extends {ol.interaction.Interaction}\n */\nol.interaction.FocusMap = function() {\n  //\n  ol.interaction.Interaction.call(this, {});\n  // Focus (hidden) button to focus on the map when click on it \n  this.focusBt = ol.ext.element.create('BUTTON', {\n    on: {\n      focus: function() {\n        this.dispatchEvent({ type:'focus' });\n      }.bind(this)\n    },\n    style: {\n      position: 'absolute',\n      zIndex: -1,\n      top: 0,\n      opacity: 0\n    }\n  });\n};\nol.ext.inherits(ol.interaction.FocusMap, ol.interaction.Interaction);\n/** Set the map > add the focus button and focus on the map when pointerdown to enable keyboard events.\n */\nol.interaction.FocusMap.prototype.setMap = function(map) {\n  if (this._listener) ol.Observable.unByKey(this._listener);\n  this._listener = null;\n  if (this.getMap()) { this.getMap().getViewport().removeChild(this.focusBt); }\n  ol.interaction.Interaction.prototype.setMap.call (this, map);\n  if (this.getMap()) {\n    // Force focus on the clicked map\n    this._listener = this.getMap().on('pointerdown', function() {\n      if (this.getActive()) this.focusBt.focus();\n    }.bind(this));\n    this.getMap().getViewport().appendChild(this.focusBt); \n  }\n};\n\n// \n/** Interaction to draw on the current geolocation\n *\tIt combines a draw with a ol.Geolocation\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @fires drawstart, drawend, drawing, tracking, follow\n * @param {any} options\n *  @param { ol.Collection.<ol.Feature> | undefined } option.features Destination collection for the drawn features.\n *  @param { ol.source.Vector | undefined } options.source Destination source for the drawn features.\n *  @param {ol.geom.GeometryType} options.type Drawing type ('Point', 'LineString', 'Polygon'), default LineString.\n *  @param {Number | undefined} options.minAccuracy minimum accuracy underneath a new point will be register (if no condition), default 20\n *  @param {function | undefined} options.condition a function that take a ol.Geolocation object and return a boolean to indicate whether location should be handled or not, default return true if accuraty < minAccuraty\n *  @param {Object} options.attributes a list of attributes to register as Point properties: {accuracy:true,accuracyGeometry:true,heading:true,speed:true}, default none.\n *  @param {Number} options.tolerance tolerance to add a new point (in meter), default 5\n *  @param {Number} options.zoom zoom for tracking, default 16\n *  @param {Number} options.minZoom min zoom for tracking, if zoom is less it will zoom to it, default use zoom option\n *  @param {boolean|auto|position|visible} options.followTrack true if you want the interaction to follow the track on the map, default true\n *  @param { ol.style.Style | Array.<ol.style.Style> | ol.StyleFunction | undefined } options.style Style for sketch features.\n */\nol.interaction.GeolocationDraw = function(options) {\n  if (!options) options={};\n  // Geolocation\n  this.geolocation = new ol.Geolocation(({ \n    projection: \"EPSG:4326\",\n    trackingOptions: {\n      maximumAge: 10000,\n      enableHighAccuracy: true,\n      timeout: 600000\n    }\n  }));\n  this.geolocation.on('change', this.draw_.bind(this));\n  // Current path\n  this.path_ = [];\n  this.lastPosition_ = false;\n  // Default style\n  var white = [255, 255, 255, 1];\n  var blue = [0, 153, 255, 1];\n  var width = 3;\n  var circle = new ol.style.Circle({\n    radius: width * 2,\n    fill: new ol.style.Fill({ color: blue }),\n    stroke: new ol.style.Stroke({ color: white, width: width / 2 })\n  });\n  var style = [\n    new ol.style.Style({\n      stroke: new ol.style.Stroke({ color: white, width: width + 2 })\n    }),\n    new ol.style.Style({\n      stroke: new ol.style.Stroke({ color: blue, width: width }),\n      fill: new ol.style.Fill({\n        color: [255, 255, 255, 0.5]\n      })\n    })\n  ];\n  var triangle = new ol.style.RegularShape({\n    radius: width * 3.5,\n    points: 3,\n    rotation: 0,\n    fill: new ol.style.Fill({ color: blue }),\n    stroke: new ol.style.Stroke({ color: white, width: width / 2 })\n  });\n  // stretch the symbol\n  var c = triangle.getImage();\n  var ctx = c.getContext(\"2d\");\n  var c2 = document.createElement('canvas');\n  c2.width = c2.height = c.width;\n  c2.getContext(\"2d\").drawImage(c, 0,0);\n  ctx.clearRect(0,0,c.width,c.height);\n  ctx.drawImage(c2, 0,0, c.width, c.height, width, 0, c.width-2*width, c.height);\n  var defaultStyle = function(f) {\n    if (f.get('heading')===undefined) {\n      style[1].setImage(circle);\n    } else {\n      style[1].setImage(triangle);\n      triangle.setRotation( f.get('heading') || 0);\n    }\n    return style;\n  }\n  // Style for the accuracy geometry\n  this.locStyle = {\n    error: new ol.style.Style({ fill: new ol.style.Fill({ color: [255, 0, 0, 0.2] }) }),\n    warn: new ol.style.Style({ fill: new ol.style.Fill({ color: [255, 192, 0, 0.2] }) }),\n    ok: new ol.style.Style({ fill: new ol.style.Fill({ color: [0, 255, 0, 0.2] }) }),\n  };\n  // Create a new overlay layer for the sketch\n  this.overlayLayer_ = new ol.layer.Vector({\n    source: new ol.source.Vector(),\n    name:'GeolocationDraw overlay',\n    style: options.style || defaultStyle\n  });\n  this.sketch_ = [new ol.Feature(), new ol.Feature(), new ol.Feature()];\n  this.overlayLayer_.getSource().addFeatures(this.sketch_);\n  this.features_ = options.features;\n  this.source_ = options.source;\n  this.condition_ = options.condition || function(loc) { \n    return loc.getAccuracy() < this.get(\"minAccuracy\") \n  };\n  // Prevent interaction when tracking\n  ol.interaction.Interaction.call(this, {\n    handleEvent: function() {\n      return (!this.get('followTrack') || this.get('followTrack')=='auto');//  || !geoloc.getTracking());\n    }\n  });\n  this.set('type', options.type||\"LineString\");\n  this.set('attributes', options.attributes||{});\n  this.set('minAccuracy', options.minAccuracy||20);\n  this.set('tolerance', options.tolerance||5);\n  this.set('zoom', options.zoom);\n  this.set('minZoom', options.minZoom);\n  this.setFollowTrack (options.followTrack===undefined ? true : options.followTrack);\n  this.setActive(false);\n};\nol.ext.inherits(ol.interaction.GeolocationDraw, ol.interaction.Interaction);\n/** Simplify 3D geometry\n * @param {ol.geom.Geometry} geo\n * @param {number} tolerance\n */\nol.interaction.GeolocationDraw.prototype.simplify3D = function(geo, tolerance) {\n  var geom = geo.getCoordinates();\n  var proj = this.getMap().getView().getProjection();\n  if (this.get(\"type\")==='Polygon') {\n    geom = geom[0];\n  }\n  var simply = [geom[0]];\n  var pi, p = ol.proj.transform(geom[0], proj, 'EPSG:4326')\n  for (var i=1; i<geom.length; i++) {\n    pi = ol.proj.transform(geom[i], proj, 'EPSG:4326')\n    var d = ol.sphere.getDistance(p, pi);\n    if (d > tolerance) {\n      simply.push(geom[i]);\n      p = pi;\n    }\n  }\n  if (simply[simply.length-1] !== geom[geom.length-1]) {\n    simply.push(geom[geom.length-1]);\n  }\n  /*\n  var simply = geo.simplify(tolerance).getCoordinates();\n  if (this.get(\"type\")==='Polygon') {\n    simply = simply[0];\n  }\n  var step=0;\n  simply.forEach(function(p) {\n    for (; step<this.path_.length; step++) {\n      if (ol.coordinate.equal(p, this.path_[step])) {\n        p[2] = this.path_[step][2];\n        p[3] = this.path_[step][3];\n        break;\n      }\n    }\n  }.bind(this));\n  */\n  // Get 3D geom\n  if (this.get(\"type\")==='Polygon') {\n    geo = new ol.geom.Polygon([simply], 'XYZM');\n  } else {\n    geo = new ol.geom.LineString(simply, 'XYZM');\n  }\n  return geo;\n};\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.GeolocationDraw.prototype.setMap = function(map) {\n  if (this.getMap()) this.getMap().removeLayer(this.overlayLayer_);\n  ol.interaction.Pointer.prototype.setMap.call (this, map);\n  this.overlayLayer_.setMap(map);\n  if (map) this.geolocation.setProjection(map.getView().getProjection());\n};\n/** Activate or deactivate the interaction.\n * @param {boolean} active\n */\nol.interaction.GeolocationDraw.prototype.setActive = function(active) {\n  if (active === this.getActive()) return;\n  ol.interaction.Interaction.prototype.setActive.call(this, active);\n  this.overlayLayer_.setVisible(active);\n  if (this.getMap()) {\n    this.geolocation.setTracking(active);\n    this.getMap().renderSync();\n  }\n  this.pause(!active);\n  if (active) {\n    // Start drawing\n    this.reset();\n    this.dispatchEvent({ type:'drawstart', feature: this.sketch_[1]});\n  } else {\n    var f = this.sketch_[1].clone();\n    if (f.getGeometry()) {\n      if (this.features_) this.features_.push(f);\n      if (this.source_) this.source_.addFeature(f);\n      this.dispatchEvent({ type:'drawend', feature: f});\n    }\n  }\n};\n/** Simulate a track and override current geolocation\n * @param {Array<ol.coordinate>|boolean} track a list of point or false to stop\n * @param {*} options\n *  @param {number} delay delay in ms, default 1000 (1s)\n *  @param {number} accuracy gps accuracy, default 10\n *  @param {boolean} repeat repeat track, default true\n */\nol.interaction.GeolocationDraw.prototype.simulate = function(track, options) {\n  if (this._track) {\n    clearTimeout(this._track.timeout);\n  }\n  if (!track) {\n    this._track = false;\n    return;\n  }\n  options = options || {};\n  var delay = options.delay || 1000;\n  function handleTrack() {\n    if (this._track.pos >= this._track.track.length) {\n      this._track = false;\n      return;\n    }\n    var coord = this._track.track[this._track.pos];\n    coord[2] = coord[3] || 0;\n    coord[3] = (new Date()).getTime();\n    this._track.pos++;\n    if (options.repeat !== false) {\n      this._track.pos = this._track.pos % this._track.track.length;\n    } \n    if (this.getActive()) this.draw_(true, coord, options.accuracy);\n    this._track.timeout = setTimeout(handleTrack.bind(this), delay);\n  }\n  this._track = {\n    track: track,\n    pos: 0,\n    timeout: setTimeout(handleTrack.bind(this), 0)\n  }\n};\n/** Is simulation on ?\n * @returns {boolean}\n */\nol.interaction.GeolocationDraw.prototype.simulating = function() {\n  return !!this._track;\n};\n/** Reset drawing\n*/\nol.interaction.GeolocationDraw.prototype.reset = function() {\n  this.sketch_[1].setGeometry();\n  this.path_ = [];\n  this.lastPosition_ = false;\n};\n/** Start tracking = setActive(true)\n */\nol.interaction.GeolocationDraw.prototype.start = function() {\n  this.setActive(true);\n};\n/** Stop tracking = setActive(false)\n */\nol.interaction.GeolocationDraw.prototype.stop = function() {\n  this.setActive(false);\n};\n/** Pause drawing\n * @param {boolean} b \n */\nol.interaction.GeolocationDraw.prototype.pause = function(b) {\n  this.pause_ = (b!==false);\n};\n/** Is paused\n * @return {boolean} b \n */\nol.interaction.GeolocationDraw.prototype.isPaused = function() {\n  return this.pause_;\n};\n/** Enable following the track on the map\n* @param {boolean|auto|position|visible} follow, \n*\tfalse: don't follow, \n*\ttrue: follow (position+zoom), \n*\t'position': follow only position,\n*\t'auto': start following until user move the map,\n*\t'visible': center when position gets out of the visible extent\n*/\nol.interaction.GeolocationDraw.prototype.setFollowTrack = function(follow) {\n  this.set('followTrack', follow);\n  var map = this.getMap();\n  // Center if wanted\n  if (this.getActive() && map) {\n    var zoom;\n    if (follow !== 'position') {\n      if (this.get('minZoom')) {\n        zoom = Math.max(this.get('minZoom'), map.getView().getZoom());\n      } else {\n        zoom = this.get('zoom');\n      }\n    }\n    if (follow !== false && !this.lastPosition_) {\n      var pos = this.path_[this.path_.length-1];\n      if (pos) {\n        map.getView().animate({\n          center: pos,\n          zoom: zoom\n        });\n      }\n    } else if (follow==='auto' && this.lastPosition_) {\n      map.getView().animate({\n        center: this.lastPosition_,\n        zoom: zoom\n      });\n    }\n  }\n  this.lastPosition_ = false;\t\t\t\t\n  this.dispatchEvent({ type:'follow', following: follow!==false });\n};\n/** Add a new point to the current path\n * @private\n */\nol.interaction.GeolocationDraw.prototype.draw_ = function(simulate, coord, accuracy) {\n  var map = this.getMap();\n  if (!map) return;\n  var accu, pos, p, loc, heading;\n  // Simulation mode\n  if (this._track) {\n    if (simulate!==true) return;\n    pos = coord;\n    accu = accuracy || 10;\n    if (this.path_ && this.path_.length) {\n      var pt = this.path_[this.path_.length-1];\n      heading = Math.atan2(coord[0]-pt[0],coord[1]-pt[1])\n    }\n    var circle = new ol.geom.Circle(pos, map.getView().getResolution()*accu);\n    p = ol.geom.Polygon.fromCircle(circle);\n  } else {\n    // Current location\n    loc = this.geolocation;\n    accu = loc.getAccuracy();\n    pos = loc.getPosition();\n    pos.push (Math.round((loc.getAltitude()||0)*100)/100);\n    pos.push (Math.round((new Date()).getTime()/1000));\n    p = loc.getAccuracyGeometry();\n    heading = loc.getHeading();\n  }\n  // Center on point\n  // console.log(this.get('followTrack'))\n  switch (this.get('followTrack')) {\n    // Follow center + zoom\n    case true: {\n      // modify zoom\n      if (this.get('followTrack') == true) {\n        if (this.get('minZoom')) {\n          if (this.get('minZoom') > map.getView().getZoom()) {\n            map.getView().setZoom(this.get('minZoom'));\n          }\n        } else {\n          map.getView().setZoom( this.get('zoom') || 16 );\n        }\n        if (!ol.extent.containsExtent(map.getView().calculateExtent(map.getSize()), p.getExtent())) {\n          map.getView().fit(p.getExtent());\n        }\n      }\n      map.getView().setCenter( pos );\n      break;\n    }\n    // Follow  position \n    case 'position': {\n      // modify center\n      map.getView().setCenter( pos );\n      break;\n    }\n    // Keep on following \n    case 'auto': {\n      if (this.lastPosition_) {\n        var center = map.getView().getCenter();\n        // console.log(center,this.lastPosition_)\n        if (center[0]!=this.lastPosition_[0] || center[1]!=this.lastPosition_[1]) {\n          //this.dispatchEvent({ type:'follow', following: false });\n          this.setFollowTrack (false);\n        } else {\n          map.getView().setCenter( pos );\t\n          this.lastPosition_ = pos;\n        }\n      } else {\n        map.getView().setCenter( pos );\t\n        if (this.get('minZoom')) {\n          if (this.get('minZoom') > map.getView().getZoom()) {\n            map.getView().setZoom(this.get('minZoom'));\n          }\n        } else if (this.get('zoom')) {\n          map.getView().setZoom( this.get('zoom'));\n        }\n        this.lastPosition_ = pos;\n      }\n      break;\n    }\n    // Force to stay on the map\n    case 'visible': {\n      if (!ol.extent.containsCoordinate(map.getView().calculateExtent(map.getSize()), pos)) {\n        map.getView().setCenter (pos);\n      }\n      break;\n    }\n    // Don't follow\n    default: break;\n  }\n  // Draw occuracy\n  var f = this.sketch_[0];\n  f.setGeometry(p);\n  if (accu < this.get(\"minAccuracy\")/2) f.setStyle(this.locStyle.ok);\n  else if (accu < this.get(\"minAccuracy\")) f.setStyle(this.locStyle.warn);\n  else f.setStyle(this.locStyle.error);\n  var geo;\n  if (this.pause_) {\n    this.lastPosition_ = pos;\n  }\n  if (!this.pause_ && (!loc || this.condition_.call(this, loc))) {\n    f = this.sketch_[1];\n    this.path_.push(pos);\n    switch (this.get(\"type\")) {\n      case \"Point\":\n        this.path_ = [pos];\n        f.setGeometry(new ol.geom.Point(pos, 'XYZM'));\n        var attr = this.get('attributes');\n        if (attr.heading) f.set(\"heading\",loc.getHeading());\n        if (attr.accuracy) f.set(\"accuracy\",loc.getAccuracy());\n        if (attr.altitudeAccuracy) f.set(\"altitudeAccuracy\",loc.getAltitudeAccuracy());\n        if (attr.speed) f.set(\"speed\",loc.getSpeed());\n        break;\n      case \"LineString\":\n        if (this.path_.length>1) {\n          geo = new ol.geom.LineString(this.path_, 'XYZM');\n          if (this.get(\"tolerance\")) geo = this.simplify3D (geo, this.get(\"tolerance\"));\n          f.setGeometry(geo);\n        } else {\n          f.setGeometry();\n        }\n        break;\n      case \"Polygon\":\n        if (this.path_.length>2) {\n          geo = new ol.geom.Polygon([this.path_], 'XYZM');\n          if (this.get(\"tolerance\")) geo = this.simplify3D (geo, this.get(\"tolerance\"));\n          f.setGeometry(geo);\n        }\n        else f.setGeometry();\n        break;\n    }\n    this.dispatchEvent({ type:'drawing', feature: this.sketch_[1], geolocation: loc });\n  }\n  this.sketch_[2].setGeometry(new ol.geom.Point(pos));\n  this.sketch_[2].set(\"heading\", heading);\n  // Drawing\n  this.dispatchEvent({ type:'tracking', feature: this.sketch_[1], geolocation: loc });\n};\n\n/** Interaction hover do to something when hovering a feature\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @fires hover, enter, leave\n * @param {olx.interaction.HoverOptions} \n *  @param { string | undefined } options.cursor css cursor propertie or a function that gets a feature, default: none\n *  @param {function | undefined} options.featureFilter filter a function with two arguments, the feature and the layer of the feature. Return true to select the feature \n *  @param {function | undefined} options.layerFilter filter a function with one argument, the layer to test. Return true to test the layer\n *  @param {Array<ol.layer> | undefined} options.layers a set of layers to test\n *  @param {number | undefined} options.hitTolerance Hit-detection tolerance in pixels.\n *  @param { function | undefined } options.handleEvent Method called by the map to notify the interaction that a browser event was dispatched to the map. The function may return false to prevent the propagation of the event to other interactions in the map's interactions chain.\n */\nol.interaction.Hover = function(options) {\n  if (!options) options={};\n  var self = this;\n  ol.interaction.Interaction.call(this, {\n    handleEvent: function(e) {\n      if (e.type==\"pointermove\") { self.handleMove_(e); } \n      if (options.handleEvent) return options.handleEvent(e);\n      return true; \n    }\n  });\n  if (options.layers && options.layers.length) {\n    this.setFeatureFilter(function(f, l) {\n      return (options.layers.indexOf(l) >= 0);\n    })\n  } else {\n    this.setFeatureFilter (options.featureFilter);\n  }\n  this.setLayerFilter (options.layerFilter);\n  this.set('hitTolerance', options.hitTolerance)\n  this.setCursor (options.cursor);\n};\nol.ext.inherits(ol.interaction.Hover, ol.interaction.Interaction);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.Hover.prototype.setMap = function(map) {\n  if (this.previousCursor_!==undefined && this.getMap()) {\n    this.getMap().getTargetElement().style.cursor = this.previousCursor_;\n    this.previousCursor_ = undefined;\n  }\n  ol.interaction.Interaction.prototype.setMap.call (this, map);\n};\n/** Activate / deactivate interaction\n * @param {boolean} b\n */\nol.interaction.Hover.prototype.setActive = function(b) {\n  ol.interaction.Interaction.prototype.setActive.call (this, b);\n  if (this.cursor_ && this.getMap()) {\n    var style = this.getMap().getTargetElement().style;\n    if (this.previousCursor_ !== undefined) {\n      style.cursor = this.previousCursor_;\n      this.previousCursor_ = undefined;\n    }\n  }\n};\n/**\n * Set cursor on hover\n * @param { string } cursor css cursor propertie or a function that gets a feature, default: none\n * @api stable\n */\nol.interaction.Hover.prototype.setCursor = function(cursor) {\n  if (!cursor && this.previousCursor_!==undefined && this.getMap()) {\n    this.getMap().getTargetElement().style.cursor = this.previousCursor_;\n    this.previousCursor_ = undefined;\n  }\n  this.cursor_ = cursor;\n};\n/** Feature filter to get only one feature\n* @param {function} filter a function with two arguments, the feature and the layer of the feature. Return true to select the feature \n*/\nol.interaction.Hover.prototype.setFeatureFilter = function(filter) {\n  if (typeof (filter) == 'function') this.featureFilter_ = filter;\n  else this.featureFilter_ = function(){ return true; };\n};\n/** Feature filter to get only one feature\n* @param {function} filter a function with one argument, the layer to test. Return true to test the layer\n*/\nol.interaction.Hover.prototype.setLayerFilter = function(filter) {\n  if (typeof (filter) == 'function') this.layerFilter_ = filter;\n  else this.layerFilter_ = function(){ return true; };\n};\n/** Get features whenmove\n* @param {ol.event} e \"move\" event\n*/\nol.interaction.Hover.prototype.handleMove_ = function(e) {\n  var map = this.getMap();\n  if (map) {\n    //var b = map.hasFeatureAtPixel(e.pixel);\n    var feature, layer;\n    var self = this;\n    var b = map.forEachFeatureAtPixel(\n      e.pixel, \n      function(f, l) {\n        if (self.layerFilter_.call(null, l) \n        && self.featureFilter_.call(null,f,l)) {\n          feature = f;\n          layer = l;\n          return true;\n        } else {\n          feature = layer = null;\n          return false;\n        }\n      },{ \n        hitTolerance: this.get('hitTolerance') \n      }\n    );\n    if (b) this.dispatchEvent({ \n      type: 'hover', \n      feature: feature, \n      layer: layer, \n      coordinate: e.coordinate, \n      pixel: e.pixel, \n      map: e.map, \n      dragging: e.dragging \n    });\n    if (this.feature_===feature && this.layer_===layer){\n      /* ok */\n    } else {\n      this.feature_ = feature;\n      this.layer_ = layer;\n      if (feature) {\n        this.dispatchEvent({ \n          type: 'enter', \n          feature: feature, \n          layer: layer, \n          coordinate: e.coordinate, \n          pixel: e.pixel, \n          map: e.map, \n          dragging: e.dragging \n        });\n      } else {\n        this.dispatchEvent({ \n          type: 'leave', \n          coordinate: e.coordinate, \n          pixel: e.pixel, \n          map: e.map, \n          dragging: e.dragging \n        });\n      }\n    }\n    if (this.cursor_) {\n      var style = map.getTargetElement().style;\n      if (b) {\n        if (style.cursor != this.cursor_) {\n          this.previousCursor_ = style.cursor;\n          style.cursor = this.cursor_;\n        }\n      } else if (this.previousCursor_ !== undefined) {\n        style.cursor = this.previousCursor_;\n        this.previousCursor_ = undefined;\n      }\n    }\n  }\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Interaction to handle longtouch events\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @param {olx.interaction.LongTouchOptions} \n * \t@param {function | undefined} options.handleLongTouchEvent Function handling \"longtouch\" events, it will receive a mapBrowserEvent.\n *\t@param {interger | undefined} options.delay The delay for a long touch in ms, default is 1000\n */\nol.interaction.LongTouch = function(options)\n{\tif (!options) options = {};\n\tthis.delay_ = options.delay || 1000;\n\tvar ltouch = options.handleLongTouchEvent || function(){};\n\tvar _timeout = null;\n\tol.interaction.Interaction.call(this,\n\t{\thandleEvent: function(e)\n\t\t{\tif (this.getActive())\n\t\t\t{\tswitch (e.type)\n\t\t\t\t{\tcase 'pointerdown': \n\t\t\t\t\t\tif (_timeout) clearTimeout(_timeout);\n\t\t\t\t\t\t_timeout = setTimeout (function()\n\t\t\t\t\t\t\t{\te.type = \"longtouch\";\n\t\t\t\t\t\t\t\tltouch(e) \n\t\t\t\t\t\t\t}, this.delay_);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t/* case 'pointermove': */\n\t\t\t\t\tcase 'pointerdrag':\n\t\t\t\t\tcase 'pointerup':\n\t\t\t\t\t\tif (_timeout) \n\t\t\t\t\t\t{\tclearTimeout(_timeout);\n\t\t\t\t\t\t\t_timeout = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: break;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\tif (_timeout) \n\t\t\t\t{\tclearTimeout(_timeout);\n\t\t\t\t\t_timeout = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t});\n};\nol.ext.inherits(ol.interaction.LongTouch, ol.interaction.Interaction);\n\n// Use ol.getUid for Openlayers < v6\n/* Extent the ol/interaction/Modify with a getModifyFeatures\n * Get the features modified by the interaction\n * @return {Array<ol.Feature>} the modified features\n */\nol.interaction.Modify.prototype.getModifiedFeatures = function() {\n  var featuresById = {};\n  this.dragSegments_.forEach( function(s) {\n    var feature = s[0].feature;\n    // Openlayers > v.6\n    if (window.ol && window.ol.util) featuresById[ol.util.getUid(feature)] = feature;\n    // old version of Openlayers (< v.6) or ol all versions\n    else featuresById[ol.getUid(feature)] = feature;\n  });\n  var features = [];\n  for (var i in featuresById) features.push(featuresById[i]);\n  return features;\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Interaction for modifying feature geometries. Similar to the core ol/interaction/Modify.\n * The interaction is more suitable to use to handle feature modification: only features concerned \n * by the modification are passed to the events (instead of all feature with ol/interaction/Modify)\n * - the modifystart event is fired before the feature is modified (no points still inserted)\n * - the modifyend event is fired after the modification\n * - it fires a modifying event\n * @constructor\n * @extends {ol.interaction.Pointer}\n * @fires modifystart\n * @fires modifying\n * @fires modifyend\n * @fires select\n * @param {*} options\n *\t@param {ol.source.Vector} options.source a source to modify (configured with useSpatialIndex set to true)\n *\t@param {ol.source.Vector|Array<ol.source.Vector>} options.sources a list of source to modify (configured with useSpatialIndex set to true)\n *  @param {ol.Collection.<ol.Feature>} options.features collection of feature to modify\n *  @param {integer} options.pixelTolerance Pixel tolerance for considering the pointer close enough to a segment or vertex for editing. Default is 10.\n *  @param {function|undefined} options.filter a filter that takes a feature and return true if it can be modified, default always true.\n *  @param {ol.style.Style | Array<ol.style.Style> | undefined} options.style Style for the sketch features.\n *  @param {ol.EventsConditionType | undefined} options.condition A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event will be considered to add or move a vertex to the sketch. Default is ol.events.condition.primaryAction.\n *  @param {ol.EventsConditionType | undefined} options.deleteCondition A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled. By default, ol.events.condition.singleClick with ol.events.condition.altKeyOnly results in a vertex deletion.\n *  @param {ol.EventsConditionType | undefined} options.insertVertexCondition A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether a new vertex can be added to the sketch features. Default is ol.events.condition.always\n *  @param {boolean} options.wrapX Wrap the world horizontally on the sketch overlay, default false\n */\nol.interaction.ModifyFeature = function(options){\n  if (!options) options = {};\n  var dragging, modifying;\n  ol.interaction.Pointer.call(this,{\n    /*\n    handleDownEvent: this.handleDownEvent,\n    handleDragEvent: this.handleDragEvent,\n    handleMoveEvent: this.handleMoveEvent,\n    handleUpEvent: this.handleUpEvent,\n    */\n    handleEvent: function(e) {\n      switch(e.type) {\n        case 'pointerdown': {\n          dragging = this.handleDownEvent(e);\n          modifying = dragging || this._deleteCondition(e);\n          return !dragging;\n        }\n        case 'pointerup': {\n          dragging = false;\n          return this.handleUpEvent(e);\n        }\n        case 'pointerdrag': {\n          if (dragging) return this.handleDragEvent(e);\n          else return true;\n        }\n        case 'pointermove': {\n          if (!dragging) return this.handleMoveEvent(e);\n          else return true;\n        }\n        case 'singleclick':\n        case 'click': {\n          // Prevent click when modifying\n          return !modifying;\n        }\n        default: return true;\n      }\n    }\n  });\n  // Snap distance (in px)\n  this.snapDistance_ = options.pixelTolerance || 10;\n  // Split tolerance between the calculated intersection and the geometry\n  this.tolerance_ = 1e-10;\n  // Cursor\n  this.cursor_ = options.cursor;\n  // List of source to split\n  this.sources_ = options.sources ? (options.sources instanceof Array) ? options.sources:[options.sources] : [];\n  if (options.source) this.sources_.push (options.source);\n  if (options.features) this.sources_.push (new ol.source.Vector({ features: options.features }));\n  // Get all features candidate\n  this.filterSplit_ = options.filter || function(){ return true; };\n  this._condition = options.condition || ol.events.condition.primaryAction;\n  this._deleteCondition = options.deleteCondition || ol.events.condition.altKeyOnly;\n  this._insertVertexCondition = options.insertVertexCondition || ol.events.condition.always;\n  // Default style\n  var sketchStyle = function() {\n    return [ new ol.style.Style({\n        image: new ol.style.Circle({\n          radius: 6,\n          fill: new ol.style.Fill({ color: [0, 153, 255, 1] }),\n          stroke: new ol.style.Stroke({ color: '#FFF', width: 1.25 })\n        })\n      })\n    ];\n  }\n  // Custom style\n  if (options.style) {\n    if (typeof(options.style) === 'function') {\n      sketchStyle = options.style\n     } else {\n       sketchStyle = function() { return options.style; }\n     }\n  }\n  // Create a new overlay for the sketch\n  this.overlayLayer_ = new ol.layer.Vector({\n    source: new ol.source.Vector({\n      useSpatialIndex: false\n    }),\n    name:'Modify overlay',\n    displayInLayerSwitcher: false,\n    style: sketchStyle,\n    wrapX: options.wrapX\n  });\n};\nol.ext.inherits(ol.interaction.ModifyFeature, ol.interaction.Pointer);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.ModifyFeature.prototype.setMap = function(map) {\n  if (this.getMap()) this.getMap().removeLayer(this.overlayLayer_);\n  ol.interaction.Interaction.prototype.setMap.call (this, map);\n  this.overlayLayer_.setMap(map);\n};\n/**\n * Activate or deactivate the interaction + remove the sketch.\n * @param {boolean} active.\n * @api stable\n */\nol.interaction.ModifyFeature.prototype.setActive = function(active) {\n  ol.interaction.Interaction.prototype.setActive.call (this, active);\n  if (this.overlayLayer_) this.overlayLayer_.getSource().clear();\n};\n/** Get closest feature at pixel\n * @param {ol.Pixel} \n * @return {*} \n * @private\n */\nol.interaction.ModifyFeature.prototype.getClosestFeature = function(e) {\n  var f, c, d = this.snapDistance_+1;\n  for (var i=0; i<this.sources_.length; i++) {\n    var source = this.sources_[i];\n    f = source.getClosestFeatureToCoordinate(e.coordinate);\n    if (f && this.filterSplit_(f)) {\n      var ci = f.getGeometry().getClosestPoint(e.coordinate);\n      var di = ol.coordinate.dist2d(e.coordinate,ci) / e.frameState.viewState.resolution;\n      if (di < d){\n        d = di;\n        c = ci;\n      }\n      break;\n    }\n  }\n  if (d > this.snapDistance_) {\n    if (this.currentFeature) this.dispatchEvent({ type: 'select', selected: [], deselected: [this.currentFeature] })\n    this.currentFeature = null;\n    return false;\n  } else {\n    // Snap to node\n    var coord = this.getNearestCoord (c, f.getGeometry());\n    if (coord) {\n      coord = coord.coord;\n      var p = this.getMap().getPixelFromCoordinate(coord);\n      if (ol.coordinate.dist2d(e.pixel, p) < this.snapDistance_) {\n        c = coord;\n      }\n      //\n      if (this.currentFeature !== f) this.dispatchEvent({ type: 'select', selected: [f], deselected: [this.currentFeature] })\n      this.currentFeature = f;\n      return { source:source, feature:f, coord: c };\n    }\n  }\n}\n/** Get nearest coordinate in a list \n* @param {ol.coordinate} pt the point to find nearest\n* @param {ol.geom} coords list of coordinates\n* @return {*} the nearest point with a coord (projected point), dist (distance to the geom), ring (if Polygon)\n*/\nol.interaction.ModifyFeature.prototype.getNearestCoord = function(pt, geom) {\n  var i, l, p, p0, dm;\n  switch (geom.getType()) {\n    case 'Point': {\n      return { coord: geom.getCoordinates(), dist: ol.coordinate.dist2d(geom.getCoordinates(), pt) };\n    }\n    case 'MultiPoint': {\n      return this.getNearestCoord (pt, new ol.geom.LineString(geom.getCoordinates()));\n    }\n    case 'LineString':\n    case 'LinearRing': {\n      var d;\n      dm = Number.MAX_VALUE;\n      var coords = geom.getCoordinates();\n      for (i=0; i < coords.length; i++) {\n        d = ol.coordinate.dist2d (pt, coords[i]);\n        if (d < dm) {\n          dm = d;\n          p0 = coords[i];\n        }\n      }\n      return { coord: p0, dist: dm };\n    }\n    case 'MultiLineString': {\n      var lstring = geom.getLineStrings();\n      p0 = false, dm = Number.MAX_VALUE;\n      for (i=0; l=lstring[i]; i++) {\n        p = this.getNearestCoord(pt, l);\n        if (p && p.dist<dm) {\n          p0 = p;\n          dm = p.dist;\n          p0.ring = i;\n        }\n      }\n      return p0;\n    }\n    case 'Polygon': {\n      var lring = geom.getLinearRings();\n      p0 = false;\n      dm = Number.MAX_VALUE;\n      for (i=0; l=lring[i]; i++) {\n        p = this.getNearestCoord(pt, l);\n        if (p && p.dist<dm) {\n          p0 = p;\n          dm = p.dist;\n          p0.ring = i;\n        }\n      }\n      return p0;\n    }\n    case 'MultiPolygon': {\n      var poly = geom.getPolygons();\n      p0 = false;\n      dm = Number.MAX_VALUE;\n      for (i=0; l=poly[i]; i++) {\n        p = this.getNearestCoord(pt, l);\n        if (p && p.dist<dm) {\n          p0 = p;\n          dm = p.dist;\n          p0.poly = i;\n        }\n      }\n      return p0;\n    }\n    case 'GeometryCollection': {\n      var g = geom.getGeometries();\n      p0 = false;\n      dm = Number.MAX_VALUE;\n      for (i=0; l=g[i]; i++) {\n        p = this.getNearestCoord(pt, l);\n        if (p && p.dist<dm) {\n          p0 = p;\n          dm = p.dist;\n          p0.geom = i;\n        }\n      }\n      return p0;\n    }\n    default: return false;\n  }\n};\n/** Get arcs concerned by a modification \n * @param {ol.geom} geom the geometry concerned\n * @param {ol.coordinate} coord pointed coordinates\n */\nol.interaction.ModifyFeature.prototype.getArcs = function(geom, coord) {\n  var arcs = false;\n  var coords, i, s, l, g;\n  switch(geom.getType()) {\n    case 'Point': {\n      if (ol.coordinate.equal(coord, geom.getCoordinates())) {\n        arcs = { \n          geom: geom, \n          type: geom.getType(),\n          coord1: [],\n          coord2: [],\n          node: true\n        }\n      }\n      break;\n    }\n    case 'MultiPoint': {\n      coords = geom.getCoordinates();\n      for (i=0; i < coords.length; i++) {\n        if (ol.coordinate.equal(coord, coords[i])) {\n          arcs = { \n            geom: geom, \n            type: geom.getType(),\n            index: i,\n            coord1: [],\n            coord2: [],\n            node: true\n          }\n          break;\n        }\n      }\n      break;\n    }\n    case 'LinearRing': \n    case 'LineString': {\n      var p = geom.getClosestPoint(coord);\n      if (ol.coordinate.dist2d(p,coord) < 1.5*this.tolerance_) {\n        var split;\n        // Split the line in two\n        if (geom.getType() === 'LinearRing') {\n          g = new ol.geom.LineString(geom.getCoordinates());\n          split = g.splitAt(coord, this.tolerance_);\n        } else {\n          split = geom.splitAt(coord, this.tolerance_);\n        }\n        // If more than 2\n        if (split.length>2) {\n          coords = split[1].getCoordinates();\n          for (i=2; s=split[i]; i++) {\n            var c = s.getCoordinates();\n            c.shift();\n            coords = coords.concat(c);\n          }\n          split = [ split[0], new ol.geom.LineString(coords) ];\n        }\n        // Split in two\n        if (split.length === 2) {\n          var c0 = split[0].getCoordinates();\n          var c1 = split[1].getCoordinates();\n          var nbpt = c0.length + c1.length -1;\n          c0.pop();\n          c1.shift();\n          arcs = { \n            geom: geom, \n            type: geom.getType(),\n            coord1: c0, \n            coord2: c1,\n            node: (geom.getCoordinates().length === nbpt),\n            closed: false\n          }\n        } else if (split.length === 1) {\n          s = split[0].getCoordinates();\n          var start = ol.coordinate.equal(s[0], coord);\n          var end = ol.coordinate.equal(s[s.length-1], coord);\n          // Move first point\n          if (start) {\n            s.shift();\n            if (end) s.pop();\n            arcs = { \n              geom: geom, \n              type: geom.getType(),\n              coord1: [], \n              coord2: s,\n              node: true,\n              closed: end\n            }\n          } else if (end) {\n            // Move last point\n            s.pop()\n            arcs = { \n              geom: geom, \n              type: geom.getType(),\n              coord1: s, \n              coord2: [],\n              node: true,\n              closed: false\n            }\n          }\n        }\n      }\n      break;\n    }\n    case 'MultiLineString': {\n      var lstring = geom.getLineStrings();\n      for (i=0; l=lstring[i]; i++) {\n        arcs = this.getArcs(l, coord);\n        if (arcs) {\n          arcs.geom = geom;\n          arcs.type = geom.getType();\n          arcs.lstring = i;\n          break;\n        }\n      }\n      break;\n    }\n    case 'Polygon': {\n      var lring = geom.getLinearRings();\n      for (i=0; l=lring[i]; i++) {\n        arcs = this.getArcs(l, coord);\n        if (arcs) {\n          arcs.geom = geom;\n          arcs.type = geom.getType();\n          arcs.index = i;\n          break;\n        }\n      }\n      break;\n    }\n    case 'MultiPolygon': {\n      var poly = geom.getPolygons();\n      for (i=0; l=poly[i]; i++) {\n        arcs = this.getArcs(l, coord);\n        if (arcs) {\n          arcs.geom = geom;\n          arcs.type = geom.getType();\n          arcs.poly = i;\n          break;\n        }\n      }\n      break;\n    }\n    case 'GeometryCollection': {\n      g = geom.getGeometries();\n      for (i=0; l=g[i]; i++) {\n        arcs = this.getArcs(l, coord);\n        if (arcs) {\n          arcs.geom = geom;\n          arcs.g = i;\n          arcs.typeg = arcs.type;\n          arcs.type = geom.getType();\n          break;\n        }\n      }\n      break;\n    }\n    default: {\n      console.error('ol/interaction/ModifyFeature '+geom.getType()+' not supported!');\n      break;\n    }\n  }\n  return arcs;\n};\n/**\n * @param {ol.MapBrowserEvent} evt Map browser event.\n * @return {boolean} `true` to start the drag sequence.\n */\nol.interaction.ModifyFeature.prototype.handleDownEvent = function(evt) {\n  if (!this.getActive()) return false;\n  // Something to move ?\n  var current = this.getClosestFeature(evt);\n  if (current && (this._condition(evt) || this._deleteCondition(evt))) {\n    var features = [];\n    this.arcs = [];\n    // Get features concerned\n    this.sources_.forEach(function(s) {\n      var extent = ol.extent.buffer (ol.extent.boundingExtent([current.coord]), this.tolerance_);\n      features = features.concat(features, s.getFeaturesInExtent(extent));\n    }.bind(this));\n    // Get arcs concerned\n    this._modifiedFeatures = [];\n    features.forEach(function(f) {\n      var a = this.getArcs(f.getGeometry(), current.coord);\n      if (a) {\n        if (this._insertVertexCondition(evt) || a.node) {\n          a.feature = f;\n          this._modifiedFeatures.push(f);\n          this.arcs.push(a);\n        }\n      }\n    }.bind(this));\n    if (this._modifiedFeatures.length) {\n      if (this._deleteCondition(evt)) {\n        return !this._removePoint(current, evt); \n      } else {\n        this.dispatchEvent({ \n          type:'modifystart', \n          coordinate: current.coord,\n          originalEvent: evt.originalEvent,\n          features: this._modifiedFeatures\n        });\n        this.handleDragEvent({ \n          coordinate: current.coord,\n          originalEvent: evt.originalEvent\n        })\n        return true;\n      }\n    } else {\n      return true;\n    }\n  } else {\n    return false;\n  }\n};\n/** Get modified features\n * @return {Array<ol.Feature>} list of modified features\n */\nol.interaction.ModifyFeature.prototype.getModifiedFeatures = function() {\n  return this._modifiedFeatures || [];\n};\n/** Removes the vertex currently being pointed.\n */\nol.interaction.ModifyFeature.prototype.removePoint = function() {\n  this._removePoint({},{});\n};\n/**\n * @private\n */\nol.interaction.ModifyFeature.prototype._getModification = function(a) {\n  var coords = a.coord1.concat(a.coord2);\n  switch (a.type) {\n    case 'LineString': {\n      if (a.closed) coords.push(coords[0]);\n      if (coords.length>1) {\n        if (a.geom.getCoordinates().length != coords.length) {\n          a.coords = coords;\n          return true;\n        }\n      }\n      break;\n    }\n    case 'MultiLineString': {\n      if (a.closed) coords.push(coords[0]);\n      if (coords.length>1) {\n        var c = a.geom.getCoordinates();\n        if (c[a.lstring].length != coords.length) {\n          c[a.lstring] = coords;\n          a.coords = c;\n          return true;\n        }\n      }\n      break;\n    }\n    case 'Polygon': {\n      if (a.closed) coords.push(coords[0]);\n      if (coords.length>3) {\n        c = a.geom.getCoordinates();\n        if (c[a.index].length != coords.length) {\n          c[a.index] = coords;\n          a.coords = c;\n          return true;\n        }\n      }\n      break;\n    }\n    case 'MultiPolygon': {\n      if (a.closed) coords.push(coords[0]);\n      if (coords.length>3) {\n        c = a.geom.getCoordinates();\n        if (c[a.poly][a.index].length != coords.length) {\n          c[a.poly][a.index] = coords;\n          a.coords = c;\n          return true;\n        }\n      }\n      break;\n    }\n    case 'GeometryCollection': {\n      a.type = a.typeg;\n      var geom = a.geom;\n      var geoms = geom.getGeometries();\n      a.geom = geoms[a.g];\n      var found = this._getModification(a);\n      // Restore current arc\n      geom.setGeometries(geoms);\n      a.geom = geom;\n      a.type = 'GeometryCollection';\n      return found;\n    }\n    default: {\n      //console.error('ol/interaction/ModifyFeature '+a.type+' not supported!');\n      break;\n    }\n  }\n  return false;\n};\n/** Removes the vertex currently being pointed.\n * @private\n */\nol.interaction.ModifyFeature.prototype._removePoint = function(current, evt) {\n  if (!this.arcs) return false;\n  this.overlayLayer_.getSource().clear();\n  var found = false;\n  // Get all modifications\n  this.arcs.forEach(function(a) {\n    found = found || this._getModification(a);\n  }.bind(this));\n  // Almost one point is removed\n  if (found) {\n    this.dispatchEvent({ \n      type:'modifystart', \n      coordinate: current.coord,\n      originalEvent: evt.originalEvent,\n      features: this._modifiedFeatures\n    });\n    this.arcs.forEach(function(a) {\n      if (a.geom.getType() === 'GeometryCollection') {\n        if (a.coords) {\n          var geoms = a.geom.getGeometries();\n          geoms[a.g].setCoordinates(a.coords);\n          a.geom.setGeometries(geoms);\n        }\n      } else {\n        if (a.coords) a.geom.setCoordinates(a.coords);\n      }\n    }.bind(this));\n    this.dispatchEvent({ \n      type:'modifyend', \n      coordinate: current.coord,\n      originalEvent: evt.originalEvent,\n      features: this._modifiedFeatures\n    });\n  }\n  this.arcs = [];\n  return found;\n};\n/**\n * @private\n */\nol.interaction.ModifyFeature.prototype.handleUpEvent = function(e) {\n  if (!this.getActive()) return false;\n  if (!this.arcs || !this.arcs.length) return true;\n  this.overlayLayer_.getSource().clear();\n  this.dispatchEvent({ \n    type:'modifyend', \n    coordinate: e.coordinate,\n    originalEvent: e.originalEvent,\n    features: this._modifiedFeatures\n  });\n  this.arcs = [];\n  return true;\n};\n/**\n * @private\n */\nol.interaction.ModifyFeature.prototype.setArcCoordinates = function(a, coords) {\n  var c;\n  switch (a.type) {\n    case 'Point': {\n      a.geom.setCoordinates(coords[0]);\n      break;\n    }\n    case 'MultiPoint': {\n      c = a.geom.getCoordinates();\n      c[a.index] = coords[0];\n      a.geom.setCoordinates(c);\n      break;\n    }\n    case 'LineString': {\n      a.geom.setCoordinates(coords);\n      break;\n    }\n    case 'MultiLineString': {\n      c = a.geom.getCoordinates();\n      c[a.lstring] = coords;\n      a.geom.setCoordinates(c);\n      break;\n    }\n    case 'Polygon': {\n      c = a.geom.getCoordinates();\n      c[a.index] = coords;\n      a.geom.setCoordinates(c);\n      break;\n    }\n    case 'MultiPolygon': {\n      c = a.geom.getCoordinates();\n      c[a.poly][a.index] = coords;\n      a.geom.setCoordinates(c);\n      break;\n    }\n    case 'GeometryCollection': {\n      a.type = a.typeg;\n      var geom = a.geom;\n      var geoms = geom.getGeometries();\n      a.geom = geoms[a.g];\n      this.setArcCoordinates(a, coords);\n      geom.setGeometries(geoms);\n      a.geom = geom;\n      a.type = 'GeometryCollection';\n      break;\n    }\n  }\n};\n/**\n * @private\n */\nol.interaction.ModifyFeature.prototype.handleDragEvent = function(e) {\n  if (!this.getActive()) return false;\n  if (!this.arcs) return true;\n  // Show sketch\n  this.overlayLayer_.getSource().clear();\n  var p = new ol.Feature(new ol.geom.Point(e.coordinate));\n  this.overlayLayer_.getSource().addFeature(p);\n  // Nothing to do\n  if (!this.arcs.length) return true;\n  // Move arcs\n  this.arcs.forEach(function(a) {\n    var coords = a.coord1.concat([e.coordinate], a.coord2);\n    if (a.closed) coords.push(e.coordinate);\n    this.setArcCoordinates(a, coords);\n  }.bind(this));\n  this.dispatchEvent({ \n    type:'modifying', \n    coordinate: e.coordinate,\n    originalEvent: e.originalEvent,\n    features: this._modifiedFeatures\n  });\n  return true;\n};\n/**\n * @param {ol.MapBrowserEvent} evt Event.\n * @private\n */\nol.interaction.ModifyFeature.prototype.handleMoveEvent = function(e) {\n  if (!this.getActive()) return false;\n  this.overlayLayer_.getSource().clear();\n  var current = this.getClosestFeature(e);\n  // Draw sketch\n  if (current) {\n    var p = new ol.Feature(new ol.geom.Point(current.coord));\n    this.overlayLayer_.getSource().addFeature(p);\n  }\n  // Show cursor\n  var element = e.map.getTargetElement();\n  if (this.cursor_) {\n    if (current) {\n      if (element.style.cursor != this.cursor_) {\n        this.previousCursor_ = element.style.cursor;\n        element.style.cursor = this.cursor_;\n      }\n    } else if (this.previousCursor_ !== undefined) {\n      element.style.cursor = this.previousCursor_;\n      this.previousCursor_ = undefined;\n    }\n  }\n};\n/** Get the current feature to modify\n * @return {ol.Feature} \n */\nol.interaction.ModifyFeature.prototype.getCurrentFeature = function() {\n  return this.currentFeature;\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Modify interaction with a popup to delet a point on touch device\n * @constructor\n * @fires showpopup\n * @fires hidepopup\n * @extends {ol.interaction.Modify}\n * @param {olx.interaction.ModifyOptions} options\n * @param {String|undefined} options.title title to display, default \"remove point\"\n * @param {String|undefined} options.className CSS class name for the popup\n * @param {String|undefined} options.positioning positioning for the popup\n * @param {Number|Array<number>|undefined} options.offsetBox offset box for the popup\n * @param {Boolean|undefined} options.usePopup use a popup, default true\n */\nol.interaction.ModifyTouch = function(options) {\n  var self = this;\n  if (!options) options = {};\n  this._popup = new ol.Overlay.Popup ({\n    popupClass: options.className || 'modifytouch',\n    positioning: options.positioning || 'bottom-rigth',\n    offsetBox: options.offsetBox || 10\n  });\n  this._source = options.source;\n  this._features = options.features;\n  // popup content\n  var a = document.createElement('a');\n  a.appendChild(document.createTextNode(options.title || \"remove point\"));\n  a.onclick = function() {\n    self.removePoint();\n  };\n  this.setPopupContent(a);\n  var pixelTolerance = options.pixelTolerance || 0;\n  var searchDist = pixelTolerance +5;\n  // Check if there is a feature to select\n  options.condition = function(e) {\n    var features = this.getMap().getFeaturesAtPixel(e.pixel,{\n      hitTolerance: searchDist\n    });\n    var p0, p1, found = false;\n\t\tif (features) {\n      var search = this._features;\n      if (!search) {\n        p0 = [e.pixel[0] - searchDist, e.pixel[1] - searchDist]\n        p1 = [e.pixel[0] + searchDist, e.pixel[1] + searchDist]\n        p0 = this.getMap().getCoordinateFromPixel(p0);\n        p1 = this.getMap().getCoordinateFromPixel(p1);\n        var ext = ol.extent.boundingExtent([p0,p1]);\n        search = this._source.getFeaturesInExtent(ext);\n      } \n      if (search.getArray) search = search.getArray();\n      for (var i=0, f; f=features[i]; i++) {\n        if (search.indexOf(f) >= 0) break;\n      }\n      if (f) {\n        p0 = e.pixel;\n        p1 = f.getGeometry().getClosestPoint(e.coordinate);\n        p1 = this.getMap().getPixelFromCoordinate(p1);\n        var dx = p0[0] - p1[0];\n        var dy = p0[1] - p1[1];\n        found = (Math.sqrt(dx*dx+dy*dy) < searchDist);\n      }\n    }\n    // Show popup if any\n    this.showDeleteBt(found ? { type:'show', feature:f, coordinate: e.coordinate } : { type:'hide' });\n    return true;\n  };\n  // Hide popup on insert\n\toptions.insertVertexCondition = function() {\n\t\tthis.showDeleteBt({ type:'hide' });\n\t\treturn true;\n  }\n  ol.interaction.Modify.call(this, options);\n  this.on(['modifystart','modifyend'], function(){\n\t\tthis.showDeleteBt({ type:'hide', modifying: true });\n  });\n  // Use a popup ?\n  this.set('usePopup', options.usePopup !== false);\n};\nol.ext.inherits(ol.interaction.ModifyTouch, ol.interaction.Modify);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.ModifyTouch.prototype.setMap = function(map) {\t\n  if (this.getMap()) {\n    this.getMap().removeOverlay(this._popup);\n  }\n\tol.interaction.Modify.prototype.setMap.call (this, map);\n  if (this.getMap()) {\n    this.getMap().addOverlay(this._popup);\n  }\n};\n/** Activate the interaction and remove popup\n * @param {Boolean} b\n */\nol.interaction.ModifyTouch.prototype.setActive = function(b) {\t\n  ol.interaction.Modify.prototype.setActive.call (this, b);\n  this.showDeleteBt({ type:'hide' });\n};\n/**\n * Remove the current point\n */\nol.interaction.ModifyTouch.prototype.removePoint = function() {\t\n  // Prevent touch + click on popup \n  if (new Date() - this._timeout < 200) return;\n  // Remove point\n  ol.interaction.Modify.prototype.removePoint.call (this);\n  this.showDeleteBt({ type:'hide' });\n}\n/**\n * Show the delete button (menu)\n * @param {Event} e\n * @api stable\n */\nol.interaction.ModifyTouch.prototype.showDeleteBt = function(e) {\n  if (this.get('usePopup') && e.type==='show') {\n    this._popup.show(e.coordinate, this._menu);\n  } else {\n    this._popup.hide();\n  }\n  e.type += 'popup';\n  this.dispatchEvent(e);\n  // Date if popup start a timeout to prevent touch + click on the popup\n  this._timeout = new Date();\n};\n/**\n * Change the popup content\n * @param {DOMElement} html \n */\nol.interaction.ModifyTouch.prototype.setPopupContent = function(html) {\n  this._menu = html;\n}\n/**\n * Get the popup content\n * @return {DOMElement}\n */\nol.interaction.ModifyTouch.prototype.getPopupContent = function() {\n  return this._menu;\n}\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Offset interaction for offseting feature geometry\n * @constructor\n * @extends {ol.interaction.Pointer}\n * @fires offsetstart\n * @fires offsetting\n * @fires offsetend\n * @param {any} options\n *\t@param {ol.layer.Vector | Array<ol.layer.Vector>} options.layers list of feature to transform \n *\t@param {ol.Collection.<ol.Feature>} options.features collection of feature to transform\n *\t@param {ol.source.Vector | undefined} options.source source to duplicate feature when ctrl key is down\n *\t@param {boolean} options.duplicate force feature to duplicate (source must be set)\n *  @param {ol.style.Style | Array.<ol.style.Style> | ol.style.StyleFunction | undefined} style style for the sketch\n */\nol.interaction.Offset = function(options) {\n  if (!options) options = {};\n\t// Extend pointer\n\tol.interaction.Pointer.call(this, {\n    handleDownEvent: this.handleDownEvent_,\n    handleDragEvent: this.handleDragEvent_,\n    handleMoveEvent: this.handleMoveEvent_,\n    handleUpEvent: this.handleUpEvent_\n  });\n\t// Collection of feature to transform\n\tthis.features_ = options.features;\n\t// List of layers to transform\n  this.layers_ = options.layers ? (options.layers instanceof Array) ? options.layers:[options.layers] : null;\n  // duplicate\n  this.set('duplicate', options.duplicate);\n  this.source_ = options.source;\n  // Style\n  this._style = (typeof (options.style) === 'function') ? options.style : function () { \n    if (options.style) return options.style;\n    else return ol.style.Style.defaultStyle(true);\n  };\n  // init\n  this.previousCursor_ = false;\n};\nol.ext.inherits(ol.interaction.Offset, ol.interaction.Pointer);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.Offset.prototype.setMap = function(map) {\n\tol.interaction.Pointer.prototype.setMap.call (this, map);\n};\n/** Get Feature at pixel\n * @param {ol.MapBrowserEvent} evt Map browser event.\n * @return {any} a feature and the hit point\n * @private\n */\nol.interaction.Offset.prototype.getFeatureAtPixel_ = function(e) {\n  var self = this;\n\treturn this.getMap().forEachFeatureAtPixel(e.pixel,\n\t\tfunction(feature, layer) {\n      var current;\n\t\t\t// feature belong to a layer\n\t\t\tif (self.layers_) {\n        for (var i=0; i<self.layers_.length; i++) {\n          if (self.layers_[i]===layer) {\n            current = feature;\n            break;\n          }\n\t\t\t\t}\n\t\t\t}\n\t\t\t// feature in the collection\n\t\t\telse if (self.features_) {\n        self.features_.forEach (function(f) {\n          if (f===feature) {\n            current = feature \n          }\n        });\n\t\t\t}\n\t\t\t// Others\n\t\t\telse {\n        current = feature;\n      }\n      // Only poygon or linestring\n      var typeGeom = current.getGeometry().getType();\n      if (current && /Polygon|LineString/.test(typeGeom)) {\n        if (typeGeom==='Polygon' && current.getGeometry().getCoordinates().length>1) return false;\n        // test distance\n        var p = current.getGeometry().getClosestPoint(e.coordinate);\n        var dx = p[0]-e.coordinate[0];\n        var dy = p[1]-e.coordinate[1];\n        var d = Math.sqrt(dx*dx+dy*dy) / e.frameState.viewState.resolution;\n        if (d<5) {\n          return { \n            feature: current, \n            hit: p, \n            coordinates: current.getGeometry().getCoordinates(),\n            geom: current.getGeometry().clone(),\n            geomType: typeGeom\n          }\n        } else {\n          return false;\n        }\n      } else {\n        return false;\n      }\n\t\t},  { hitTolerance: 5 });\n};\n/**\n * @param {ol.MapBrowserEvent} e Map browser event.\n * @return {boolean} `true` to start the drag sequence.\n * @private\n */\nol.interaction.Offset.prototype.handleDownEvent_ = function(e) {\t\n  this.current_ = this.getFeatureAtPixel_(e);\n  if (this.current_) {\n    this.currentStyle_ = this.current_.feature.getStyle();\n    this.current_.feature.setStyle(this._style(this.current_.feature));\n    if (this.source_ && (this.get('duplicate') || e.originalEvent.ctrlKey)) {\n      this.current_.feature = this.current_.feature.clone();\n      this.source_.addFeature(this.current_.feature);\n    } else {\n      // Modify the current feature\n      this.dispatchEvent({ type:'modifystart', features: [ this.current_.feature ] });\n    }\n    this.dispatchEvent({ type:'offsetstart', feature: this.current_.feature, offset: 0 });\n    return true;\n  } else  {\n    return false;\n  }\n};\n/**\n * @param {ol.MapBrowserEvent} e Map browser event.\n * @private\n */\nol.interaction.Offset.prototype.handleDragEvent_ = function(e) {\n  var p = this.current_.geom.getClosestPoint(e.coordinate);\n  var d = ol.coordinate.dist2d(p, e.coordinate);\n  var seg, v1, v2, offset;\n  switch (this.current_.geomType) {\n    case  'Polygon': {\n      seg = ol.coordinate.findSegment(p, this.current_.coordinates[0]).segment;\n      if (seg) {\n        v1 = [ seg[1][0]-seg[0][0], seg[1][1]-seg[0][1] ];\n        v2 = [ e.coordinate[0]-p[0], e.coordinate[1]-p[1] ];\n        if (v1[0]*v2[1] - v1[1]*v2[0] > 0) {\n          d = -d;\n        }\n        offset = [];\n        for (var i=0; i<this.current_.coordinates.length; i++) {\n          offset.push( ol.coordinate.offsetCoords(this.current_.coordinates[i], i==0 ? d : -d) );\n        }\n        this.current_.feature.setGeometry(new ol.geom.Polygon(offset));\n      }\n      break;\n    }\n    case 'LineString': {\n      seg = ol.coordinate.findSegment(p, this.current_.coordinates).segment;\n      if (seg) {\n        v1 = [ seg[1][0]-seg[0][0], seg[1][1]-seg[0][1] ];\n        v2 = [ e.coordinate[0]-p[0], e.coordinate[1]-p[1] ];\n        if (v1[0]*v2[1] - v1[1]*v2[0] > 0) {\n          d = -d;\n        }\n        offset = ol.coordinate.offsetCoords(this.current_.coordinates, d);\n        this.current_.feature.setGeometry(new ol.geom.LineString(offset));\n      }\n      break;\n    }\n    default: {\n      break;\n    }\n  }\n  this.dispatchEvent({ type:'offsetting', feature: this.current_.feature, offset: d, segment: [p, e.coordinate], coordinate: e.coordinate });  \n};\n/**\n * @param {ol.MapBrowserEvent} e Map browser event.\n * @private\n */\nol.interaction.Offset.prototype.handleUpEvent_ = function(e) {\n  this.dispatchEvent({ type:'offsetend', feature: this.current_.feature, coordinate: e.coordinate }); \n  this.current_.feature.setStyle(this.currentStyle_);\n  this.current_ = false;\n};\n/**\n * @param {ol.MapBrowserEvent} e Event.\n * @private\n */\nol.interaction.Offset.prototype.handleMoveEvent_ = function(e) {\t\n  var f = this.getFeatureAtPixel_(e);\n  if (f) {\n    if (this.previousCursor_ === false) {\n      this.previousCursor_ = e.map.getTargetElement().style.cursor;\n    }\n    e.map.getTargetElement().style.cursor = 'pointer';\n  } else {\n    e.map.getTargetElement().style.cursor = this.previousCursor_;\n    this.previousCursor_ = false;\n  }\n};\n\n/*\t\n  Water ripple effect.\n  Original code (Java) by Neil Wallis \n  @link http://www.neilwallis.com/java/water.html\n  Original code (JS) by Sergey Chikuyonok (serge.che@gmail.com)\n  @link http://chikuyonok.ru\n  @link http://media.chikuyonok.ru/ripple/\n  Copyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n  @link https://github.com/Viglino\n*/\n/**\n * @constructor\n * @extends {ol.interaction.Pointer}\n * @param {*} options\n *  @param {ol/layer/Layer} options.layer layer to animate\n *  @param {number} options.radius raindrop radius\n *  @param {number} options.interval raindrop interval (in ms), default 1000\n */\nol.interaction.Ripple = function(options) {\n  ol.interaction.Pointer.call(this, {\n    handleDownEvent: this.rainDrop,\n    handleMoveEvent: this.rainDrop\n  });\n  // Default options\n  options = options||{};\n  this.riprad = options.radius || 3;\n  this.ripplemap = [];\n  this.last_map = [];\n  // Generate random ripples\n  this.rains (this.interval);\n  options.layer.on(['postcompose', 'postrender'], this.postcompose_.bind(this));\n};\nol.ext.inherits(ol.interaction.Ripple, ol.interaction.Pointer);\n/** Generate random rain drop\n*\t@param {integer} interval\n*/\nol.interaction.Ripple.prototype.rains = function(interval) {\n  if (this.onrain) clearTimeout (this.onrain);\n  var self = this;\n  var vdelay = (typeof(interval)==\"number\" ? interval : 1000)/2;\n  var delay = 3*vdelay/2;\n  var rnd = Math.random;\n  function rain() {\n    if (self.width) self.rainDrop([rnd() * self.width, rnd() * self.height]);\n    self.onrain = setTimeout (rain, rnd()*vdelay + delay);\n  }\n  // Start raining\n  if (delay) rain();\n}\n/** Disturb water at specified point\n*\t@param {ol.Pixel|ol.MapBrowserEvent}\n*/\nol.interaction.Ripple.prototype.rainDrop = function(e) {\n  if (!this.width) return;\n  var dx,dy;\n  if (e.pixel) {\n    dx = e.pixel[0]*this.ratio;\n    dy = e.pixel[1]*this.ratio;\n  } else {\n    dx = e[0]*this.ratio;\n    dy = e[1]*this.ratio;\n  }\n  dx <<= 0;\n  dy <<= 0;\n  for (var j = dy - this.riprad*this.ratio; j < dy + this.riprad*this.ratio; j++) {\n    for (var k = dx - this.riprad*this.ratio; k < dx + this.riprad*this.ratio; k++) {\n      this.ripplemap[this.oldind + (j * this.width) + k] += 128;\n    }\n  }\n}\n/** Postcompose function\n*/\nol.interaction.Ripple.prototype.postcompose_ = function(e) {\n  var ctx = e.context;\n  var canvas = ctx.canvas;\n  // Initialize when canvas is ready / modified\n  if (this.width != canvas.width || this.height != canvas.height) {\n    this.width = canvas.width;\n    this.height = canvas.height;\n    this.ratio = e.frameState.pixelRatio;\n    this.half_width = this.width >> 1;\n    this.half_height = this.height >> 1;\n    this.size = this.width * (this.height + 2) * 2;\n    this.oldind = this.width;\n    this.newind = this.width * (this.height + 3);\n    for (var i = 0; i < this.size; i++) {\n      this.last_map[i] = this.ripplemap[i] = 0;\n    }\n  }\n  this.texture = ctx.getImageData(0, 0, this.width, this.height);\n  this.ripple = ctx.getImageData(0, 0, this.width, this.height);\t\n  // Run animation\n  var a, b, data, cur_pixel, new_pixel;\n    var t = this.oldind; this.oldind = this.newind; this.newind = t;\n    i = 0;\n    var _rd = this.ripple.data,\n        _td = this.texture.data;\n    for (var y = 0; y < this.height; y++) {\n      for (var x = 0; x < this.width; x++) {\n          var _newind = this.newind + i,\n      _mapind = this.oldind + i;\n      data = (\n          this.ripplemap[_mapind - this.width] + \n          this.ripplemap[_mapind + this.width] + \n          this.ripplemap[_mapind - 1] + \n          this.ripplemap[_mapind + 1]) >> 1;\n      data -= this.ripplemap[_newind];\n      data -= data >> 5;\n      this.ripplemap[_newind] = data;\n      //where data=0 then still, where data>0 then wave\n      data = 1024 - data;\n      if (this.last_map[i] != data) {\n        this.last_map[i] = data;\n        //offsets\n        a = (((x - this.half_width) * data / 1024) << 0) + this.half_width;\n        b = (((y - this.half_height) * data / 1024) << 0) + this.half_height;\n        //bounds check\n        if (a >= this.width) a = this.width - 1;\n        if (a < 0) a = 0;\n        if (b >= this.height) b = this.height - 1;\n        if (b < 0) b = 0;\n        new_pixel = (a + (b * this.width)) * 4;\n        cur_pixel = i * 4;\n        /**/\n        _rd[cur_pixel] = _td[new_pixel];\n        _rd[cur_pixel + 1] = _td[new_pixel + 1];\n        _rd[cur_pixel + 2] = _td[new_pixel + 2];\n        /*/\n        // only in blue pixels \n                if (_td[new_pixel + 2]>_td[new_pixel + 1]\n          && _td[new_pixel + 2]>_td[new_pixel])\n        {\n                _rd[cur_pixel] = _td[new_pixel];\n                _rd[cur_pixel + 1] = _td[new_pixel + 1];\n                _rd[cur_pixel + 2] = _td[new_pixel + 2];\n        }\n        else this.ripplemap[_newind] = 0;\n        /**/\n      }\n      ++i;\n    }\n  }\n  ctx.putImageData(this.ripple, 0, 0);\n  // tell OL3 to continue postcompose animation\n  this.getMap().render(); \n};\n\n/*\n  Copyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (http://www.cecill.info/).\n  ol/interaction/SelectCluster is an interaction for selecting vector features in a cluster.\n*/\n/**\n * @classdesc\n * Interaction for selecting vector features in a cluster. \n * It can be used as an ol.interaction.Select. \n * When clicking on a cluster, it springs apart to reveal the features in the cluster.\n * Revealed features are selectable and you can pick the one you meant.\n * Revealed features are themselves a cluster with an attribute features that contain the original feature.\n * \n * @constructor\n * @extends {ol.interaction.Select}\n * @param {olx.interaction.SelectOptions=} options SelectOptions.\n *  @param {ol.style} options.featureStyle used to style the revealed features as options.style is used by the Select interaction.\n * \t@param {boolean} options.selectCluster false if you don't want to get cluster selected\n * \t@param {Number} options.pointRadius to calculate distance between the features\n * \t@param {bool} options.spiral means you want the feature to be placed on a spiral (or a circle)\n * \t@param {Number} options.circleMaxObjects number of object that can be place on a circle\n * \t@param {Number} options.maxObjects number of object that can be drawn, other are hidden\n * \t@param {bool} options.animate if the cluster will animate when features spread out, default is false\n * \t@param {Number} options.animationDuration animation duration in ms, default is 500ms\n * @fires ol.interaction.SelectEvent\n * @api stable\n */\nol.interaction.SelectCluster = function(options) {\n  options = options || {};\n  var fn; \n  this.pointRadius = options.pointRadius || 12;\n  this.circleMaxObjects = options.circleMaxObjects || 10;\n  this.maxObjects = options.maxObjects || 60;\n  this.spiral = (options.spiral !== false);\n  this.animate = options.animate;\n  this.animationDuration = options.animationDuration || 500;\n  this.selectCluster_ = (options.selectCluster !== false);\n  // Create a new overlay layer for \n  var overlay = this.overlayLayer_ = new ol.layer.Vector({\n    source: new ol.source.Vector({\n      features: new ol.Collection(),\n      wrapX: options.wrapX,\n      useSpatialIndex: true\n    }),\n    name:'Cluster overlay',\n    updateWhileAnimating: true,\n    updateWhileInteracting: true,\n    displayInLayerSwitcher: false,\n    style: options.featureStyle\n  });\n  // Add the overlay to selection\n  if (options.layers) {\n    if (typeof(options.layers) == \"function\") {\n      fn = options.layers;\n      options.layers = function(layer) {\n        return (layer===overlay || fn(layer));\n      };\n    } else if (options.layers.push) {\n      options.layers.push(this.overlayLayer_);\n    }\n  }\n  // Don't select links\n  if (options.filter) {\n    fn = options.filter;\n    options.filter = function(f,l){\n      //if (l===overlay && f.get(\"selectclusterlink\")) return false;\n      if (!l && f.get(\"selectclusterlink\")) return false;\n      else return fn(f,l);\n    };\n  } else options.filter = function(f,l) {\n    //if (l===overlay && f.get(\"selectclusterlink\")) return false; \n    if (!l && f.get(\"selectclusterlink\")) return false; \n    else return true;\n  };\n  this.filter_ = options.filter;\n  ol.interaction.Select.call(this, options);\n  this.on(\"select\", this.selectCluster.bind(this));\n};\nol.ext.inherits(ol.interaction.SelectCluster, ol.interaction.Select);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.SelectCluster.prototype.setMap = function(map) {\n  if (this.getMap()) {\n    this.getMap().removeLayer(this.overlayLayer_);\n  }\n  if (this._listener) ol.Observable.unByKey(this._listener);\n  this._listener = null;\n  ol.interaction.Select.prototype.setMap.call (this, map);\n  this.overlayLayer_.setMap(map);\n  // map.addLayer(this.overlayLayer_);\n  if (map && map.getView()) {\n    this._listener = map.getView().on('change:resolution', this.clear.bind(this));\n  }\n};\n/**\n * Clear the selection, close the cluster and remove revealed features\n * @api stable\n */\nol.interaction.SelectCluster.prototype.clear = function() {\n  this.getFeatures().clear();\n  this.overlayLayer_.getSource().clear();\n};\n/**\n * Get the layer for the revealed features\n * @api stable\n */\nol.interaction.SelectCluster.prototype.getLayer = function() {\n  return this.overlayLayer_;\n};\n/**\n * Select a cluster \n * @param {ol.SelectEvent | ol.Feature} a cluster feature ie. a feature with a 'features' attribute.\n * @api stable\n */\nol.interaction.SelectCluster.prototype.selectCluster = function (e) {\n  // It's a feature => convert to SelectEvent\n  if (e instanceof ol.Feature) {\n    e = { selected: [e] };\n  }\n  // Nothing selected\n  if (!e.selected.length) {\n    this.clear();\n    return;\n  }\n  // Get selection\n  var feature = e.selected[0];\n  // It's one of ours\n  if (feature.get('selectclusterfeature')) return;\n  // Clic out of the cluster => close it\n  var source = this.overlayLayer_.getSource();\n  source.clear();\n  var cluster = feature.get('features');\n  // Not a cluster (or just one feature)\n  if (!cluster || cluster.length==1) return;\n  // Remove cluster from selection\n  if (!this.selectCluster_) this.getFeatures().clear();\n  var center = feature.getGeometry().getCoordinates();\n  // Pixel size in map unit\n  var pix = this.getMap().getView().getResolution();\n  var r, a, i, max;\n  var p, cf, lk;\n  // The features\n  var features = [];\n  // Draw on a circle\n  if (!this.spiral || cluster.length <= this.circleMaxObjects) {\n    max = Math.min(cluster.length, this.circleMaxObjects);\n    r = pix * this.pointRadius * (0.5 + max / 4);\n    for (i=0; i<max; i++) {\n      a = 2*Math.PI*i/max;\n      if (max==2 || max == 4) a += Math.PI/4;\n      p = [ center[0]+r*Math.sin(a), center[1]+r*Math.cos(a) ];\n      cf = new ol.Feature({ 'selectclusterfeature':true, 'features':[cluster[i]], geometry: new ol.geom.Point(p) });\n      cf.setStyle(cluster[i].getStyle());\n      features.push(cf);\n      lk = new ol.Feature({ 'selectclusterlink':true, geometry: new ol.geom.LineString([center,p]) });\n      features.push(lk);\n    }\n  }\n  // Draw on a spiral\n  else {\n    // Start angle\n    a = 0;\n    var d = 2*this.pointRadius;\n    max = Math.min (this.maxObjects, cluster.length);\n    // Feature on a spiral\n    for (i=0; i<max; i++) {\n      // New radius => increase d in one turn\n      r = d/2 + d*a/(2*Math.PI);\n      // Angle\n      a = a + (d+0.1)/r;\n      var dx = pix*r*Math.sin(a)\n      var dy = pix*r*Math.cos(a)\n      p = [ center[0]+dx, center[1]+dy ];\n      cf = new ol.Feature({ 'selectclusterfeature':true, 'features':[cluster[i]], geometry: new ol.geom.Point(p) });\n      cf.setStyle(cluster[i].getStyle()); \n      features.push(cf);\n      lk = new ol.Feature({ 'selectclusterlink':true, geometry: new ol.geom.LineString([center,p]) });\n      features.push(lk);\n    }\n  }\n  source.clear();\n  if (this.animate) {\n    this.animateCluster_(center, features);\n  } else {\n    source.addFeatures(features);\n  }\n};\n/**\n * Animate the cluster and spread out the features\n * @param {ol.Coordinates} the center of the cluster\n */\nol.interaction.SelectCluster.prototype.animateCluster_ = function(center, features) {\n  // Stop animation (if one is running)\n  if (this.listenerKey_) {\n    ol.Observable.unByKey(this.listenerKey_);\n  }\n  // Features to animate\n  // var features = this.overlayLayer_.getSource().getFeatures();\n  if (!features.length) return;\n  var style = this.overlayLayer_.getStyle();\n  var stylefn = (typeof(style) == 'function') ? style : style.length ? function(){ return style; } : function(){ return [style]; } ;\n  var duration = this.animationDuration || 500;\n  var start = new Date().getTime();\n  // Animate function\n  function animate(event) {\n    var vectorContext = event.vectorContext || ol.render.getVectorContext(event);\n    // Retina device\n    var ratio = event.frameState.pixelRatio;\n    var res = this.getMap().getView().getResolution();\n    var e = ol.easing.easeOut((event.frameState.time - start) / duration);\n    for (var i=0, feature; feature = features[i]; i++) if (feature.get('features')) {\n      var pt = feature.getGeometry().getCoordinates();\n      pt[0] = center[0] + e * (pt[0]-center[0]);\n      pt[1] = center[1] + e * (pt[1]-center[1]);\n      var geo = new ol.geom.Point(pt);\n      // Image style\n      var st = stylefn(feature, res);\n      for (var s=0; s<st.length; s++) {\n        var sc;\n        // OL < v4.3 : setImageStyle doesn't check retina\n        var imgs = ol.Map.prototype.getFeaturesAtPixel ? false : st[s].getImage();\n        if (imgs) {\n          sc = imgs.getScale();\n          imgs.setScale(ratio); \n        }\n        // OL3 > v3.14\n        if (vectorContext.setStyle) {\n          vectorContext.setStyle(st[s]);\n          vectorContext.drawGeometry(geo);\n        }\n        // older version\n        else {\n          vectorContext.setImageStyle(imgs);\n          vectorContext.drawPointGeometry(geo);\n        }\n        if (imgs) imgs.setScale(sc);\n      }\n    }\n    // Stop animation and restore cluster visibility\n    if (e > 1.0) {\n      ol.Observable.unByKey(this.listenerKey_);\n      this.overlayLayer_.getSource().addFeatures(features);\n      this.overlayLayer_.changed();\n      return;\n    }\n    // tell OL3 to continue postcompose animation\n    event.frameState.animate = true;\n  }\n  // Start a new postcompose animation\n  this.listenerKey_ = this.overlayLayer_.on(['postcompose','postrender'], animate.bind(this));\n  // Start animation with a ghost feature\n  var feature = new ol.Feature(new ol.geom.Point(this.getMap().getView().getCenter()));\n  feature.setStyle(new ol.style.Style({ image: new ol.style.Circle({}) }));\n  this.overlayLayer_.getSource().addFeature(feature);\n};\n/** Helper function to get the extent of a cluster\n * @param {ol.feature} feature\n * @return {ol.extent|null} the extent or null if extent is empty (no cluster or superimposed points)\n */\nol.interaction.SelectCluster.prototype.getClusterExtent = function(feature) {\n  if (!feature.get('features')) return null;\n  var extent = ol.extent.createEmpty();\n  feature.get('features').forEach(function(f) {\n    extent = ol.extent.extend(extent, f.getGeometry().getExtent());\n  });\n  if (extent[0]===extent[2] && extent[1]===extent[3]) return null;\n  return extent;\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Interaction to snap to guidelines\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @param {*} options\n *  @param {number | undefined} options.pixelTolerance distance (in px) to snap to a guideline, default 10 px\n *  @param {bool | undefined} options.enableInitialGuides whether to draw initial guidelines based on the maps orientation, default false.\n *  @param {ol.style.Style | Array<ol.style.Style> | undefined} options.style Style for the sektch features.\n *  @param {*} options.vectorClass a vector layer class to create the guides with ol6, use ol/layer/VectorImage using ol6\n */\nol.interaction.SnapGuides = function(options) {\n  if (!options) options = {};\n  // Intersect 2 guides\n  function getIntersectionPoint (d1, d2) {\n    var d1x = d1[1][0] - d1[0][0];\n    var d1y = d1[1][1] - d1[0][1];\n    var d2x = d2[1][0] - d2[0][0];\n    var d2y = d2[1][1] - d2[0][1];\n    var det = d1x * d2y - d1y * d2x;\n    if (det != 0) {\n      var k = (d1x * d1[0][1] - d1x * d2[0][1] - d1y * d1[0][0] + d1y * d2[0][0]) / det;\n      return [d2[0][0] + k*d2x, d2[0][1] + k*d2y];\n    }\n    else return false;\n  }\n  function dist2D (p1,p2) {\n    var dx = p1[0]-p2[0];\n    var dy = p1[1]-p2[1];\n    return Math.sqrt(dx*dx+dy*dy);\n  }\n  // Snap distance (in px)\n  this.snapDistance_ = options.pixelTolerance || 10;\n  this.enableInitialGuides_ = options.enableInitialGuides || false;\n  // Default style\n  var sketchStyle = [\n    new ol.style.Style({\n      stroke: new ol.style.Stroke({\n        color: '#ffcc33',\n        lineDash: [8,5],\n        width: 1.25\n      })\n    })\n  ];\n  // Custom style\n  if (options.style) sketchStyle = options.style instanceof Array ? options.style : [options.style];\n  // Create a new overlay for the sketch\n  this.overlaySource_ = new ol.source.Vector({\n    features: new ol.Collection(),\n    useSpatialIndex: false\n  });\n  // Use ol/layer/VectorImage to render the snap guides as an image to improve performance on rerenderers\n  var vectorClass = options.vectorClass || ol.layer.Vector;\n  this.overlayLayer_ = new vectorClass({\n    // render the snap guides as an image to improve performance on rerenderers\n    renderMode: 'image',\n    source: this.overlaySource_,\n      style: function() {\n        return sketchStyle;\n      },\n      name:'Snap overlay',\n      displayInLayerSwitcher: false\n    });\n  // Use snap interaction\n  ol.interaction.Interaction.call(this, {\n    handleEvent: function(e) {\n      if (this.getActive()) {\n        var features = this.overlaySource_.getFeatures();\n        var prev = null;\n        var p = null;\n        var res = e.frameState.viewState.resolution;\n        for (var i=0, f; f = features[i]; i++) {\n          var c = f.getGeometry().getClosestPoint(e.coordinate);\n          if ( dist2D(c, e.coordinate) / res < this.snapDistance_) {\n            // Intersection on 2 lines\n            if (prev) {\n              var c2 = getIntersectionPoint(prev.getGeometry().getCoordinates(),  f.getGeometry().getCoordinates());\n              if (c2) {\n                if (dist2D(c2, e.coordinate) / res < this.snapDistance_) {\n                  p = c2;\n                }\n              }\n            } else {\n              p = c;\n            }\n            prev = f;\n          }\n        }\n        if (p) e.coordinate = p;\n      }\n      return true;\n    }\n  });\n};\nol.ext.inherits(ol.interaction.SnapGuides, ol.interaction.Interaction);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.SnapGuides.prototype.setMap = function(map) {\n  if (this.getMap()) this.getMap().removeLayer(this.overlayLayer_);\n  ol.interaction.Interaction.prototype.setMap.call (this, map);\n  this.overlayLayer_.setMap(map);\n  if (map) this.projExtent_ = map.getView().getProjection().getExtent();\n};\n/** Activate or deactivate the interaction.\n * @param {boolean} active\n */\nol.interaction.SnapGuides.prototype.setActive = function(active) {\n  this.overlayLayer_.setVisible(active);\n  ol.interaction.Interaction.prototype.setActive.call (this, active);\n}\n/** Clear previous added guidelines\n * @param {Array<ol.Feature> | undefined} features a list of feature to remove, default remove all feature\n */\nol.interaction.SnapGuides.prototype.clearGuides = function(features) {\n  if (!features) {\n    this.overlaySource_.clear();\n  } else {\n    for (var i=0, f; f=features[i]; i++) {\n      try {\n        this.overlaySource_.removeFeature(f);\n      } catch(e) {/* nothing to to */}\n    }\n  }\n};\n/** Get guidelines\n * @return {ol.Collection} guidelines features\n */\nol.interaction.SnapGuides.prototype.getGuides = function() {\n  return this.overlaySource_.getFeaturesCollection();\n}\n/** Add a new guide to snap to\n * @param {Array<ol.coordinate>} v the direction vector\n * @return {ol.Feature} feature guide\n */\nol.interaction.SnapGuides.prototype.addGuide = function(v, ortho) {\n  if (v) {\n    var map = this.getMap();\n    // Limit extent\n    var extent = map.getView().calculateExtent(map.getSize());\n    var guideLength = Math.max(\n      this.projExtent_[2] - this.projExtent_[0],\n      this.projExtent_[3] - this.projExtent_[1]\n    );\n    extent = ol.extent.buffer(extent, guideLength * 1.5);\n    //extent = ol.extent.boundingExtent(extent, this.projExtent_);\n    if (extent[0]<this.projExtent_[0]) extent[0]=this.projExtent_[0];\n    if (extent[1]<this.projExtent_[1]) extent[1]=this.projExtent_[1];\n    if (extent[2]>this.projExtent_[2]) extent[2]=this.projExtent_[2];\n    if (extent[3]>this.projExtent_[3]) extent[3]=this.projExtent_[3];\n    var dx = v[0][0] - v[1][0];\n    var dy = v[0][1] - v[1][1];\n    var d = 1 / Math.sqrt(dx*dx+dy*dy);\n    var generateLine = function(loopDir) {\n      var p, g = [];\n      var loopCond = guideLength*loopDir*2;\n      for (var i=0; loopDir > 0 ? i < loopCond : i > loopCond; i+=(guideLength * loopDir) / 100) {\n        if (ortho) p = [ v[0][0] + dy*d*i, v[0][1] - dx*d*i];\n        else p = [ v[0][0] + dx*d*i, v[0][1] + dy*d*i];\n        if (ol.extent.containsCoordinate(extent, p)) g.push(p);\n        else break;\n      }\n      return new ol.Feature(new ol.geom.LineString([g[0], g[g.length-1]]));\n    }\n    var f0 = generateLine(1);\n    var f1 = generateLine(-1);\n    this.overlaySource_.addFeature(f0);\n    this.overlaySource_.addFeature(f1);\n    return [f0, f1];\n  }\n};\n/** Add a new orthogonal guide to snap to\n * @param {Array<ol.coordinate>} v the direction vector\n * @return {ol.Feature} feature guide\n */\nol.interaction.SnapGuides.prototype.addOrthoGuide = function(v) {\n  return this.addGuide(v, true);\n};\n/** Listen to draw event to add orthogonal guidelines on the first and last point.\n * @param {_ol_interaction_Draw_} drawi a draw interaction to listen to\n * @api\n */\nol.interaction.SnapGuides.prototype.setDrawInteraction = function(drawi) {\n  var self = this;\n  // Number of points currently drawing\n  var nb = 0;\n  // Current guidelines\n  var features = [];\n  function setGuides(e) {\n    var coord = e.target.getCoordinates();\n    var s = 2;\n    switch (e.target.getType()) {\n      case 'Point':\n        return;\n      case 'Polygon':\n        coord = coord[0].slice(0, -1);\n        break;\n      default: break;\n    }\n    var l = coord.length;\n    if (l === s && self.enableInitialGuides_) {\n      var x = coord[0][0];\n      var y = coord[0][1];\n      coord = [[x, y], [x, y - 1]];\n    }\n    if (l != nb && (self.enableInitialGuides_ ? l >= s : l > s)) {\n      self.clearGuides(features);\n      // use try catch to remove a bug on freehand draw...\n      try {\n        var p1 = coord[l - s], p2 = coord[l - s - 1];\n        if (l > s && !(p1[0] === p2[0] && p1[1] === p2[1])) {\n          features = self.addOrthoGuide([coord[l - s], coord[l - s - 1]]);\n        }\n        features = features.concat(self.addGuide([coord[0], coord[1]]));\n        features = features.concat(self.addOrthoGuide([coord[0], coord[1]]));\n        nb = l;\n      } catch (e) { /* ok*/ }\n    }\n  }\n  // New drawing\n  drawi.on (\"drawstart\", function(e) {\n    // When geom is changing add a new orthogonal direction \n    e.feature.getGeometry().on(\"change\", setGuides);\n  });\n  // end drawing / deactivate => clear directions\n  drawi.on ([\"drawend\", \"change:active\"], function(e) {\n    self.clearGuides(features);\n    if (e.feature) e.feature.getGeometry().un(\"change\", setGuides);\n    nb = 0;\n    features = [];\n  });\n};\n/** Listen to modify event to add orthogonal guidelines relative to the currently dragged point\n * @param {_ol_interaction_Modify_} modifyi a modify interaction to listen to\n * @api\n */\nol.interaction.SnapGuides.prototype.setModifyInteraction = function (modifyi) {\n  function mod(d, n) {\n    return ((d % n) + n) % n;\n  }\n  var self = this;\n  // Current guidelines\n  var features = [];\n  function computeGuides(e) {\n    var selectedVertex = e.target.vertexFeature_\n    if (!selectedVertex) return;\n    var f = e.target.getModifiedFeatures()[0];\n    var geom = f.getGeometry();\n    var coord = geom.getCoordinates();\n    switch (geom.getType()) {\n      case 'Point':\n        return;\n      case 'Polygon':\n        coord = coord[0].slice(0, -1);\n        break;\n      default: break;\n    }\n    var modifyVertex = selectedVertex.getGeometry().getCoordinates();\n    var idx = coord.findIndex(function(c) {\n      return c[0] === modifyVertex[0] && c[1] === modifyVertex[1]\n    });\n    var l = coord.length;\n    self.clearGuides(features);\n    features = self.addOrthoGuide([coord[mod(idx - 1, l)], coord[mod(idx - 2, l)]]);\n    features = features.concat(self.addGuide([coord[mod(idx - 1, l)], coord[mod(idx - 2, l)]]));\n    features = features.concat(self.addGuide([coord[mod(idx + 1, l)], coord[mod(idx + 2, l)]]));\n    features = features.concat(self.addOrthoGuide([coord[mod(idx + 1, l)], coord[mod(idx + 2, l)]]));\n  }\n  function setGuides(e) {\n    // This callback is called before ol adds the vertex to the feature, so\n    // defer a moment for openlayers to add the new vertex\n    setTimeout(computeGuides, 0, e);\n  }\n  function drawEnd() {\n    self.clearGuides(features);\n    features = [];\n  }\n  // New drawing\n  modifyi.on(\"modifystart\", setGuides);\n  // end drawing, clear directions\n  modifyi.on(\"modifyend\", drawEnd);\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** An interaction to snap on pixel on a layer\n * The CenterTouch interaction modifies map browser event coordinate and pixel properties to force pointer on the viewport center to any interaction that them.\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @param {olx.interaction.InteractionOptions} options Options\n *  @param {ol.layer.Layer} options.layer layer to snap on\n */\nol.interaction.SnapLayerPixel = function(options) {\n  options = options || {};\n  // Get layer canevas context\n  this._layer = options.layer;\n  this._layer.on(['postcompose', 'postrender'], function(e) {\n    this._ctx = e.context;\n  }.bind(this));\n  var radius = options.radius || 8;\n  var size = 2*radius;\n  ol.interaction.Interaction.call(this, {\n    handleEvent: function(e) {\n      if (this._layer.getVisible() && this._layer.getOpacity() \n      && ol.events.condition.altKeyOnly(e) && this.getMap()) {\n        var x0 = e.pixel[0] - radius;\n        var y0 = e.pixel[1] - radius;\n        var imgd = this._ctx.getImageData(x0, y0, size, size);\n        var pix = imgd.data;\n        // Loop over each pixel and invert the color.\n        var x, y, xm, ym, max=-1; \n        var t = [];\n        for (x=0; x < size; x++) {\n          t.push([])\n          for (y=0; y < size; y++) {\n            var l = pix[3+ 4 * (x + y*size)];\n            t[x].push(l>10 ? l : 0)\n          }\n        }\n        for (x=1; x < size-1; x++) {\n          for (y=1; y < size-1; y++) {\n            var m = t[x][y+1] + t[x][y] + t[x][y+1] \n              + t[x-1][y-1] + t[x-1][y] + t[x-1][y+1] \n              + t[x+1][y-1] + t[x+1][y] + t[x+1][y+1];\n            if (m > max) {\n              max = m;\n              xm = x;\n              ym = y;\n            } \n          }\n        }\n        e.pixel = [x0+xm, y0+ym];\n        e.coordinate = this.getMap().getCoordinateFromPixel(e.pixel);\n        /*\n        e.coordinate = this.getMap().getView().getCenter();\n        e.pixel = this.getMap().getSize();\n        e.pixel = [ e.pixel[0]/2, e.pixel[1]/2 ];\n        */\n      }\n      return true; \n    }\n  });\n};\nol.ext.inherits(ol.interaction.SnapLayerPixel, ol.interaction.Interaction);\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Interaction split interaction for splitting feature geometry\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @fires  beforesplit, aftersplit, pointermove\n * @param {*} \n *  @param {ol.source.Vector|Array<ol.source.Vector>} options.source a list of source to split (configured with useSpatialIndex set to true)\n *  @param {ol.Collection.<ol.Feature>} options.features collection of feature to split\n *  @param {integer} options.snapDistance distance (in px) to snap to an object, default 25px\n *\t@param {string|undefined} options.cursor cursor name to display when hovering an objet\n *  @param {function|undefined} opttion.filter a filter that takes a feature and return true if it can be clipped, default always split.\n *  @param ol.style.Style | Array<ol.style.Style> | false | undefined} options.featureStyle Style for the selected features, choose false if you don't want feature selection. By default the default edit style is used.\n *  @param {ol.style.Style | Array<ol.style.Style> | undefined} options.sketchStyle Style for the sektch features. \n *  @param {function|undefined} options.tolerance Distance between the calculated intersection and a vertex on the source geometry below which the existing vertex will be used for the split.  Default is 1e-10.\n */\nol.interaction.Split = function(options) {\n  if (!options) options = {};\n  ol.interaction.Interaction.call(this, {\n    handleEvent: function(e) {\n      switch (e.type) {\n        case \"singleclick\":\n          return this.handleDownEvent(e);\n        case \"pointermove\":\n          return this.handleMoveEvent(e);\n        default: \n          return true;\n      }\n      //return true;\n    }\n  });\n  // Snap distance (in px)\n  this.snapDistance_ = options.snapDistance || 25;\n  // Split tolerance between the calculated intersection and the geometry\n  this.tolerance_ = options.tolerance || 1e-10;\n  // Cursor\n  this.cursor_ = options.cursor;\n  // List of source to split\n  this.sources_ = options.sources ? (options.sources instanceof Array) ? options.sources:[options.sources] : [];\n  if (options.features) {\n    this.sources_.push (new ol.source.Vector({ features: options.features }));\n  }\n  // Get all features candidate\n  this.filterSplit_ = options.filter || function(){ return true; };\n  // Default style\n  var white = [255, 255, 255, 1];\n  var blue = [0, 153, 255, 1];\n  var width = 3;\n  var fill = new ol.style.Fill({ color: 'rgba(255,255,255,0.4)' });\n  var stroke = new ol.style.Stroke({\n    color: '#3399CC',\n    width: 1.25\n  });\n  var sketchStyle = [\n    new ol.style.Style({\n      image: new ol.style.Circle({\n        fill: fill,\n        stroke: stroke,\n        radius: 5\n      }),\n      fill: fill,\n      stroke: stroke\n    })\n  ];\n  var featureStyle = [\n    new ol.style.Style({\n      stroke: new ol.style.Stroke({\n        color: white,\n        width: width + 2\n      })\n    }),\n    new ol.style.Style({\n      image: new ol.style.Circle({\n        radius: 2*width,\n        fill: new ol.style.Fill({\n          color: blue\n        }),\n        stroke: new ol.style.Stroke({\n          color: white,\n          width: width/2\n        })\n      }),\n      stroke: new ol.style.Stroke({\n          color: blue,\n          width: width\n        })\n    }),\n  ];\n  // Custom style\n  if (options.sketchStyle) sketchStyle = options.sketchStyle instanceof Array ? options.sketchStyle : [options.sketchStyle];\n  if (options.featureStyle) featureStyle = options.featureStyle instanceof Array ? options.featureStyle : [options.featureStyle];\n  // Create a new overlay for the sketch\n  this.overlayLayer_ = new ol.layer.Vector({\n    source: new ol.source.Vector({\n      useSpatialIndex: false\n    }),\n    name:'Split overlay',\n    displayInLayerSwitcher: false,\n    style: function(f) {\n      if (f._sketch_) return sketchStyle;\n      else return featureStyle;\n    }\n  });\n};\nol.ext.inherits(ol.interaction.Split, ol.interaction.Interaction);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.Split.prototype.setMap = function(map) {\n  if (this.getMap()) this.getMap().removeLayer(this.overlayLayer_);\n  ol.interaction.Interaction.prototype.setMap.call (this, map);\n  this.overlayLayer_.setMap(map);\n};\n/** Get closest feature at pixel\n * @param {ol.Pixel} \n * @return {ol.feature} \n * @private\n */\nol.interaction.Split.prototype.getClosestFeature = function(e) {\n  var source, f, c, g, d = this.snapDistance_+1;\n  // Look for closest point in the sources\n  this.sources_.forEach(function(si) {\n    var fi = si.getClosestFeatureToCoordinate(e.coordinate);\n    if (fi && fi.getGeometry().splitAt) {\n      var ci = fi.getGeometry().getClosestPoint(e.coordinate);\n      var gi = new ol.geom.LineString([e.coordinate,ci]);\n      var di = gi.getLength() / e.frameState.viewState.resolution;\n      if (di < d) {\n        source = si;\n        d = di;\n        f = fi;\n        g = gi;\n        c = ci;\n      }\n    }\n  });\n  // Snap ?\n  if (d > this.snapDistance_) {\n    return false;\n  } else {\n    // Snap to node\n    var coord = this.getNearestCoord (c, f.getGeometry().getCoordinates());\n    var p = this.getMap().getPixelFromCoordinate(coord);\n    if (ol.coordinate.dist2d(e.pixel, p) < this.snapDistance_) {\n      c = coord;\n    }\n    //\n    return { source:source, feature:f, coord: c, link: g };\n  }\n}\n/** Get nearest coordinate in a list \n* @param {ol.coordinate} pt the point to find nearest\n* @param {Array<ol.coordinate>} coords list of coordinates\n* @return {ol.coordinate} the nearest coordinate in the list\n*/\nol.interaction.Split.prototype.getNearestCoord = function(pt, coords) {\n  var d, dm=Number.MAX_VALUE, p0;\n  for (var i=0; i < coords.length; i++) {\n    d = ol.coordinate.dist2d (pt, coords[i]);\n    if (d < dm) {\n      dm = d;\n      p0 = coords[i];\n    }\n  }\n  return p0;\n};\n/**\n * @param {ol.MapBrowserEvent} evt Map browser event.\n * @return {boolean} `true` to start the drag sequence.\n */\nol.interaction.Split.prototype.handleDownEvent = function(evt) {\n  // Something to split ?\n  var current = this.getClosestFeature(evt);\n  if (current) {\n    var self = this;\n    self.overlayLayer_.getSource().clear();\n    var split = current.feature.getGeometry().splitAt(current.coord, this.tolerance_);\n    var i;\n    if (split.length > 1) {\n      var tosplit = [];\n      for (i=0; i<split.length; i++) {\n        var f = current.feature.clone();\n        f.setGeometry(split[i]);\n        tosplit.push(f);\n      }\n      self.dispatchEvent({ type:'beforesplit', original: current.feature, features: tosplit });\n      current.source.dispatchEvent({ type:'beforesplit', original: current.feature, features: tosplit });\n      current.source.removeFeature(current.feature);\n      for (i=0; i<tosplit.length; i++) {\n        current.source.addFeature(tosplit[i]);\n      }\n      self.dispatchEvent({ type:'aftersplit', original: current.feature, features: tosplit });\n      current.source.dispatchEvent({ type:'aftersplit', original: current.feature, features: tosplit });\n    }\n  }\n  return false;\n};\n/**\n * @param {ol.MapBrowserEvent} evt Event.\n */\nol.interaction.Split.prototype.handleMoveEvent = function(e) {\n  var map = e.map;\n  this.overlayLayer_.getSource().clear();\n  var current = this.getClosestFeature(e);\n  if (current && this.filterSplit_(current.feature)) {\n    var p, l;\n    // Draw sketch\n    this.overlayLayer_.getSource().addFeature(current.feature);\n    p = new ol.Feature(new ol.geom.Point(current.coord));\n    p._sketch_ = true;\n    this.overlayLayer_.getSource().addFeature(p);\n    //\n    l = new ol.Feature(current.link);\n    l._sketch_ = true;\n    this.overlayLayer_.getSource().addFeature(l);\n    // move event\n    this.dispatchEvent({\n      type: 'pointermove',\n      coordinate: e.coordinate,\n      frameState: e.frameState,\n      originalEvent: e.originalEvent,\n      map: e.map,\n      pixel: e.pixel,\n      feature: current.feature,\n      linkGeometry: current.link\n    });\n  } else {\n    this.dispatchEvent(e);\n  }\n  var element = map.getTargetElement();\n  if (this.cursor_) {\n    if (current) {\n      if (element.style.cursor != this.cursor_) {\n        this.previousCursor_ = element.style.cursor;\n        element.style.cursor = this.cursor_;\n      }\n    } else if (this.previousCursor_ !== undefined) {\n      element.style.cursor = this.previousCursor_;\n      this.previousCursor_ = undefined;\n    }\n  }\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/*eslint no-constant-condition: [\"error\", { \"checkLoops\": false }]*/\n/** Interaction splitter: acts as a split feature agent while editing vector features (LineString).\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @fires  beforesplit, aftersplit\n * @param {olx.interaction.SplitOptions} \n *\t- source {ol.source.Vector|Array{ol.source.Vector}} The target source (or array of source) with features to be split (configured with useSpatialIndex set to true)\n *\t- triggerSource {ol.source.Vector} Any newly created or modified features from this source will be used to split features on the target source. If none is provided the target source is used instead.\n *\t- features {ol.Collection.<ol.Feature>} A collection of feature to be split (replace source target).\n *\t- triggerFeatures {ol.Collection.<ol.Feature>} Any newly created or modified features from this collection will be used to split features on the target source (replace triggerSource).\n *\t- filter {function|undefined} a filter that takes a feature and return true if the feature is eligible for splitting, default always split.\n *\t- tolerance {function|undefined} Distance between the calculated intersection and a vertex on the source geometry below which the existing vertex will be used for the split. Default is 1e-10.\n * @todo verify auto intersection on features that split.\n */\nol.interaction.Splitter = function(options)\n{\tif (!options) options = {};\n\tol.interaction.Interaction.call(this,\n\t{\thandleEvent: function(e)\n\t\t\t{\t// Hack to get only one changeFeature when draging with ol.interaction.Modify on.\n\t\t\t\tif (e.type != \"pointermove\" && e.type != \"pointerdrag\")\n\t\t\t\t{\tif (this.lastEvent_)\n\t\t\t\t\t{\tthis.splitSource(this.lastEvent_.feature);\n\t\t\t\t\t\tthis.lastEvent_ = null;\n\t\t\t\t\t}\n\t\t\t\t\tthis.moving_ = false;\n\t\t\t\t}\n\t\t\t\telse this.moving_ = true;\n\t\t\t\treturn true; \n\t\t\t},\n\t});\n\t// Features added / remove\n\tthis.added_ = [];\n\tthis.removed_ = [];\n\t// Source to split\n\tif (options.features)\n\t{\tthis.source_ = new ol.source.Vector({ features: options.features });\n\t}\n\telse \n\t{\tthis.source_ = options.source ? options.source : new ol.source.Vector({ features: new ol.Collection() });\n\t}\n\tvar trigger = this.triggerSource;\n\tif (options.triggerFeatures)\n\t{\ttrigger = new ol.source.Vector({ features: options.triggerFeatures });\n\t}\n\tif (trigger)\n\t{\ttrigger.on(\"addfeature\", this.onAddFeature.bind(this));\n\t\ttrigger.on(\"changefeature\", this.onChangeFeature.bind(this));\n\t\ttrigger.on(\"removefeature\", this.onRemoveFeature.bind(this));\n\t}\n\telse\n\t{\tthis.source_.on(\"addfeature\", this.onAddFeature.bind(this));\n\t\tthis.source_.on(\"changefeature\", this.onChangeFeature.bind(this));\n\t\tthis.source_.on(\"removefeature\", this.onRemoveFeature.bind(this));\n\t}\n\t// Split tolerance between the calculated intersection and the geometry\n\tthis.tolerance_ = options.tolerance || 1e-10;\n\t// Get all features candidate\n\tthis.filterSplit_ = options.filter || function(){ return true; };\n};\nol.ext.inherits(ol.interaction.Splitter, ol.interaction.Interaction);\n/** Calculate intersection on 2 segs\n* @param {Array<_ol_coordinate_>} s1 first seg to intersect (2 points)\n* @param {Array<_ol_coordinate_>} s2 second seg to intersect (2 points)\n* @return { boolean | _ol_coordinate_ } intersection point or false no intersection\n*/\nol.interaction.Splitter.prototype.intersectSegs = function(s1,s2)\n{\tvar tol = this.tolerance_;\n\t// Solve\n\tvar x12 = s1[0][0] - s1[1][0];\n\tvar x34 = s2[0][0] - s2[1][0];\n\tvar y12 = s1[0][1] - s1[1][1];\n\tvar y34 = s2[0][1] - s2[1][1];\n\tvar det = x12 * y34 - y12 * x34;\n\t// No intersection\n\tif (Math.abs(det) < tol)\n\t{\treturn false;\n\t}\n\telse\n\t{\t// Outside segement\n\t\tvar r1 = ((s1[0][0] - s2[1][0])*y34 - (s1[0][1] - s2[1][1])*x34) / det;\n\t\tif (Math.abs(r1)<tol) return s1[0];\n\t\tif (Math.abs(1-r1)<tol) return s1[1];\n\t\tif (r1<0 || r1>1) return false;\n\t\tvar r2 = ((s1[0][1] - s2[1][1])*x12 - (s1[0][0] - s2[1][0])*y12) / det;\n\t\tif (Math.abs(r2)<tol) return s2[1];\n\t\tif (Math.abs(1-r2)<tol) return s2[0];\n\t\tif (r2<0 || r2>1) return false;\n\t\t// Intersection\n\t\tvar a = s1[0][0] * s1[1][1] - s1[0][1] * s1[1][0];\n\t\tvar b = s2[0][0] * s2[1][1] - s2[0][1] * s2[1][0];\n\t\tvar p = [(a * x34 - b * x12) / det, (a * y34 - b * y12) / det];\n\t\t// Test start / end\n/*\nconsole.log(\"r1: \"+r1)\nconsole.log(\"r2: \"+r2)\nconsole.log (\"s10: \"+(_ol_coordinate_.dist2d(p,s1[0])<tol)) ;\nconsole.log (\"s11: \"+(_ol_coordinate_.dist2d(p,s1[1])<tol)) ;\nconsole.log (\"s20: \"+(_ol_coordinate_.dist2d(p,s2[0])<tol)) ;\nconsole.log (\"s21: \"+(_ol_coordinate_.dist2d(p,s2[1])<tol)) ;\n*/\n\t\treturn p;\n\t}\n};\n/** Split the source using a feature\n* @param {ol.Feature} feature The feature to use to split.\n*/\nol.interaction.Splitter.prototype.splitSource = function(feature)\n{\t// Allready perform a split\n\tif (this.splitting) return;\n\tvar self = this;\n\tvar i, k, f2;\n\t// Start splitting\n\tthis.source_.dispatchEvent({ type:'beforesplit', feaure: feature, source: this.source_ });\n\tthis.splitting = true;\n\tthis.added_ = [];\n\tthis.removed_ = [];\n\tvar c = feature.getGeometry().getCoordinates();\n\tvar seg, split = [];\n\tfunction intersect (f)\n\t{\tif (f !== feature)\n\t\t{\tvar c2 = f.getGeometry().getCoordinates();\n\t\t\tfor (var j=0; j<c2.length-1; j++)\n\t\t\t{\tvar p = this.intersectSegs (seg, [c2[j],c2[j+1]]);\n\t\t\t\tif (p)\n\t\t\t\t{\tsplit.push(p);\n\t\t\t\t\tg = f.getGeometry().splitAt(p, this.tolerance_);\n\t\t\t\t\tif (g && g.length>1)\n\t\t\t\t\t{\tfound = f;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t// Split existing features\n\tfor (i=0; i<c.length-1; i++)\n\t{\tseg = [c[i],c[i+1]];\n\t\tvar extent = ol.extent.buffer(ol.extent.boundingExtent(seg), this.tolerance_ /*0.01*/ );\n\t\tvar g;\n\t\twhile (true)\n\t\t{\tvar found = false;\n\t\t\tthis.source_.forEachFeatureIntersectingExtent(extent, intersect.bind(this));\n\t\t\t// Split feature\n\t\t\tif (found)\n\t\t\t{\tvar f = found;\n\t\t\t\tthis.source_.removeFeature(f);\n\t\t\t\tfor (k=0; k<g.length; k++)\n\t\t\t\t{\tf2 = f.clone();\n\t\t\t\t\tf2.setGeometry(g[k]);\n\t\t\t\t\tthis.source_.addFeature(f2);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse break;\n\t\t}\n\t}\n\t// Auto intersect\n\tfor (i=0; i<c.length-2; i++)\n\t{\tfor (var j=i+1; j<c.length-1; j++)\n\t\t{\tvar p = this.intersectSegs ([c[i],c[i+1]], [c[j],c[j+1]]);\n\t\t\tif (p && p!=c[i+1])\n\t\t\t{\tsplit.push(p);\n\t\t\t}\n\t\t}\n\t}\n\t// Split original\n\tvar splitOriginal = false;\n\tif (split.length)\n\t{\tvar result = feature.getGeometry().splitAt(split, this.tolerance_);\n\t\tif (result.length>1)\n\t\t{\tfor (k=0; k<result.length; k++)\n\t\t\t{\tf2 = feature.clone();\n\t\t\t\tf2.setGeometry(result[k]);\n\t\t\t\tthis.source_.addFeature(f2);\n\t\t\t}\n\t\t\tsplitOriginal = true;\n\t\t}\n\t}\n\t// If the interaction is inserted after modify interaction, the objet is not consistant \n\t// > wait end of other interactions\n\tsetTimeout (function()\n\t{\tif (splitOriginal) self.source_.removeFeature(feature);\n\t\tself.source_.dispatchEvent({ type:'aftersplit', featureAdded: self.added_, featureRemoved: self.removed_, source: this.source_ });\n\t\t// Finish\n\t\tself.splitting = false;\n\t},0);\n};\n/** New feature source is added \n*/\nol.interaction.Splitter.prototype.onAddFeature = function(e)\n{\tthis.splitSource(e.feature);\n\tif (this.splitting) \n\t{\tthis.added_.push(e.feature);\n\t}\n\t/*\n\tif (this.splitting) return;\n\tvar self = this;\n\tsetTimeout (function() { self.splitSource(e.feature); }, 0);\n\t*/\n};\n/** Feature source is removed > count features added/removed\n*/\nol.interaction.Splitter.prototype.onRemoveFeature = function(e)\n{\tif (this.splitting) \n\t{\tvar n = this.added_.indexOf(e.feature);\n\t\tif (n==-1)\n\t\t{\tthis.removed_.push(e.feature);\n\t\t}\n\t\telse\n\t\t{\tthis.added_.splice(n,1);\n\t\t}\n\t}\n};\n/** Feature source is changing \n*/\nol.interaction.Splitter.prototype.onChangeFeature = function(e)\n{\tif (this.moving_) \n\t{\tthis.lastEvent_ = e;\n\t}\n\telse this.splitSource(e.feature);\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Interaction synchronize\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @param {*} options\n *  @param {Array<ol.Map>} options maps An array of maps to synchronize with the map of the interaction\n */\nol.interaction.Synchronize = function(options) {\n  if (!options) options={};\n  var self = this;\n  ol.interaction.Interaction.call(this, {\n    handleEvent: function(e) {\n      if (e.type==\"pointermove\") { self.handleMove_(e); }\n      return true;\n    }\n  });\n  this.maps = options.maps;\n};\nol.ext.inherits(ol.interaction.Synchronize, ol.interaction.Interaction);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.Synchronize.prototype.setMap = function(map) {\n  if (this._listener) {\n    ol.Observable.unByKey(this._listener.center);\n    ol.Observable.unByKey(this._listener.rotation);\n    ol.Observable.unByKey(this._listener.resolution);\n    this.getMap().getTargetElement().removeEventListener('mouseout', this._listener.mouseout);\n  }\n  this._listener = null;\n  ol.interaction.Interaction.prototype.setMap.call (this, map);\n  if (map) {\n    this._listener = {};\n    this._listener.center = this.getMap().getView().on('change:center', this.syncMaps.bind(this));\n    this._listener.rotation = this.getMap().getView().on('change:rotation', this.syncMaps.bind(this));\n    this._listener.resolution = this.getMap().getView().on('change:resolution', this.syncMaps.bind(this));\n    this._listener.mouseout = this.handleMouseOut_.bind(this);\n    if (this.getMap().getTargetElement()) {\n      this.getMap().getTargetElement().addEventListener('mouseout', this._listener.mouseout);\n    }\n    this.syncMaps();\n  }\n};\n/** Synchronize the maps\n*/\nol.interaction.Synchronize.prototype.syncMaps = function(e) {\n  var map = this.getMap();\n  if (map.get('lockView')) return;\n  if (!e) e = { type:'all' };\n  if (map) {\n    for (var i=0; i<this.maps.length; i++) {\n      this.maps[i].set('lockView', true);\n      switch (e.type) {\n        case 'change:rotation': {\n          if (this.maps[i].getView().getRotation() != map.getView().getRotation())\n            this.maps[i].getView().setRotation(map.getView().getRotation()); \n          break;\n        }\n        case 'change:center': {\n          if (this.maps[i].getView().getCenter() != map.getView().getCenter()) {\n            this.maps[i].getView().setCenter(map.getView().getCenter()); \n          }\n          break;\n        }\n        case 'change:resolution': {\n          if (this.maps[i].getView().getResolution() != map.getView().getResolution()) {\n            this.maps[i].getView().setResolution(map.getView().getResolution());\n          }\n          break;\n        }\n        default: {\n          this.maps[i].getView().setRotation(map.getView().getRotation());\n          this.maps[i].getView().setCenter(map.getView().getCenter());\n          this.maps[i].getView().setResolution(map.getView().getResolution());\n          break;\n        }\n      }\n      this.maps[i].set('lockView', false);\n    }\n  }\n};\n/** Cursor move > tells other maps to show the cursor\n* @param {ol.event} e \"move\" event\n*/\nol.interaction.Synchronize.prototype.handleMove_ = function(e) {\n  for (var i=0; i<this.maps.length; i++) {\n    this.maps[i].showTarget(e.coordinate);\n  }\n  this.getMap().showTarget();\n};\n/** Cursor out of map > tells other maps to hide the cursor\n* @param {event} e \"mouseOut\" event\n*/\nol.interaction.Synchronize.prototype.handleMouseOut_ = function(/*e*/) {\n  for (var i=0; i<this.maps.length; i++) {\n    if (this.maps[i]._targetOverlay) this.maps[i]._targetOverlay.setPosition(undefined);\n  }\n};\n/** Show a target overlay at coord\n* @param {ol.coordinate} coord\n*/\nol.Map.prototype.showTarget = function(coord) {\n  if (!this._targetOverlay) {\n    var elt = document.createElement(\"div\");\n    elt.classList.add(\"ol-target\");\n    this._targetOverlay = new ol.Overlay({ element: elt });\n    this._targetOverlay.setPositioning('center-center');\n    this.addOverlay(this._targetOverlay);\n    elt.parentElement.classList.add(\"ol-target-overlay\");\n    // hack to render targetOverlay before positioning it\n    this._targetOverlay.setPosition([0,0]);\n  }\n  this._targetOverlay.setPosition(coord);\n};\n/** Hide the target overlay\n*/\nol.Map.prototype.hideTarget = function() {\n  this.removeOverlay(this._targetOverlay);\n  this._targetOverlay = undefined;\n};\n\n/*\t\n  Tinker Bell effect on maps.\n  Copyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n  @link https://github.com/Viglino\n*/\n/**\n * @constructor\n * @extends {ol.interaction.Pointer}\n *\t@param {ol.interaction.TinkerBell.options}  options flashlight param\n*\t\t- color {ol.color} color of the sparkles\n*/\nol.interaction.TinkerBell = function(options) {\n  options = options || {};\n  ol.interaction.Pointer.call(this, {\n    handleDownEvent: this.onMove,\n    handleMoveEvent: this.onMove\n  });\n  this.set('color', options.color ? ol.color.asString(options.color) : \"#fff\");\n  this.sparkle = [0,0];\n  this.sparkles = [];\n  this.lastSparkle = this.time = new Date();\n  var self = this;\n  this.out_ = function() { self.isout_=true; };\n  this.isout_ = true;\n};\nol.ext.inherits(ol.interaction.TinkerBell, ol.interaction.Pointer);\n/** Set the map > start postcompose\n*/\nol.interaction.TinkerBell.prototype.setMap = function(map) {\n  if (this._listener) ol.Observable.unByKey(this._listener);\n  this._listener = null;\n  if (this.getMap()) {\n    map.getViewport().removeEventListener('mouseout', this.out_, false);\n    this.getMap().render();\n  }\n  ol.interaction.Pointer.prototype.setMap.call(this, map);\n  if (map) {\n    this._listener = map.on('postcompose', this.postcompose_.bind(this));\n    map.getViewport().addEventListener('mouseout', this.out_, false);\n  }\n};\nol.interaction.TinkerBell.prototype.onMove = function(e) {\n  this.sparkle = e.pixel;\n  this.isout_ = false;\n  this.getMap().render();\n};\n/** Postcompose function\n*/\nol.interaction.TinkerBell.prototype.postcompose_ = function(e) {\n  var delta = 15;\n  var ctx = e.context || ol.ext.getMapCanvas(this.getMap()).getContext('2d');\n  var dt = e.frameState.time - this.time;\n  this.time = e.frameState.time;\n  if (e.frameState.time-this.lastSparkle > 30 && !this.isout_) {\n    this.lastSparkle = e.frameState.time;\n    this.sparkles.push({ p:[this.sparkle[0]+Math.random()*delta-delta/2, this.sparkle[1]+Math.random()*delta], o:1 });\n  }\n  ctx.save();\n    ctx.scale(e.frameState.pixelRatio,e.frameState.pixelRatio);\n    ctx.fillStyle = this.get(\"color\");\n    for (var i=this.sparkles.length-1, p; p=this.sparkles[i]; i--) {\n      if (p.o < 0.2) {\n        this.sparkles.splice(0,i+1);\n        break;\n      }\n      ctx.globalAlpha = p.o;\n      ctx.beginPath();\n      ctx.arc (p.p[0], p.p[1], 2.2, 0, 2 * Math.PI, false);\n      ctx.fill();\n      p.o *= 0.98;\n      p.p[0] += (Math.random()-0.5);\n      p.p[1] += dt*(1+Math.random())/30;\n    }\n  ctx.restore();\n  // continue postcompose animation\n  if (this.sparkles.length) this.getMap().render(); \n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Interaction splitter: acts as a split feature agent while editing vector features (LineString).\n * @constructor\n * @extends {ol.interaction.Pointer}\n * @param {olx.interaction.TouchCompass} \n *\t- onDrag {function|undefined} Function handling \"drag\" events. It provides a dpixel and a traction (in projection) vector form the center of the compas\n *\t- size {Number} size of the compass in px, default 80\n *\t- alpha {Number} opacity of the compass, default 0.5\n */\nol.interaction.TouchCompass = function(options) {\n\toptions = options||{};\n\tvar opt = {};\n\t// Click on the compass\n\topt.handleDownEvent = function(e)\n\t{\tvar s = this.getCenter_();\n\t\tvar dx = e.pixel[0]-s[0];\n\t\tvar dy = e.pixel[1]-s[1];\n\t\tthis.start = e;\n\t\treturn (Math.sqrt(dx*dx+dy*dy) < this.size/2);\n\t};\n\t// Pn drag\n\topt.handleDragEvent = function(e)\n\t{\tif (!this.pos) \n\t\t{\tthis.pos = this.start;\n\t\t\tthis.getMap().renderSync();\n\t\t}\n\t\tthis.pos = e;\n\t};\n\t// Stop drag\n\topt.handleUpEvent = function()\n\t{\tthis.pos = false;\n\t\treturn true;\n\t};\n\tol.interaction.Pointer.call(this, opt);\n\tthis.ondrag_ = options.onDrag;\n\tthis.size = options.size || 80;\n\tthis.alpha = options.alpha || 0.5;\n\tif (!ol.interaction.TouchCompass.prototype.compass)\n\t{\tvar canvas = ol.interaction.TouchCompass.prototype.compass = document.createElement('canvas');\n\t\tvar ctx = canvas.getContext(\"2d\");\n\t\tvar s = canvas.width = canvas.height = this.size;\n\t\tvar w = s/10;\n\t\tvar r = s/2;\n\t\tvar r2 = 0.22*r;\n\t\tctx.translate(r,r);\n\t\tctx.fillStyle = \"#999\";\n\t\tctx.strokeStyle = \"#ccc\";\n\t\tctx.lineWidth = w;\n\t\tctx.beginPath();\n\t\tctx.arc (0,0, s*0.42, 0, 2*Math.PI);\n\t\tctx.fill();\n\t\tctx.stroke();\n\t\tctx.fillStyle = \"#99f\";\n\t\tctx.beginPath();\n\t\tctx.moveTo (0,0); \n\t\tctx.lineTo (r,0); ctx.lineTo (r2,r2); ctx.moveTo (0,0);\n\t\tctx.lineTo (-r,0); ctx.lineTo (-r2,-r2); ctx.moveTo (0,0);\n\t\tctx.lineTo (0,r); ctx.lineTo (-r2,r2); ctx.moveTo (0,0);\n\t\tctx.lineTo (0,-r); ctx.lineTo (r2,-r2); ctx.moveTo (0,0);\n\t\tctx.fill();\n\t\tctx.fillStyle = \"#eee\";\n\t\tctx.beginPath();\n\t\tctx.moveTo (0,0); \n\t\tctx.lineTo (r,0); ctx.lineTo (r2,-r2); ctx.moveTo (0,0);\n\t\tctx.lineTo (-r,0); ctx.lineTo (-r2,r2); ctx.moveTo (0,0);\n\t\tctx.lineTo (0,r); ctx.lineTo (r2,r2); ctx.moveTo (0,0);\n\t\tctx.lineTo (0,-r); ctx.lineTo (-r2,-r2); ctx.moveTo (0,0);\n\t\tctx.fill();\n\t}\n};\nol.ext.inherits(ol.interaction.TouchCompass, ol.interaction.Pointer);\n/** Compass Image as a JS Image object\n* @api\n*/\nol.interaction.TouchCompass.prototype.compass = null;\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {_ol_Map_} map Map.\n * @api stable\n */\nol.interaction.TouchCompass.prototype.setMap = function(map) {\n\tif (this._listener) ol.Observable.unByKey(this._listener);\n\tthis._listener = null;\n\tol.interaction.Pointer.prototype.setMap.call (this, map);\n\tif (map) {\n\t\tthis._listener = map.on('postcompose', this.drawCompass_.bind(this));\n\t\tol.ext.getMapCanvas(map);\n\t}\n};\n/**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\nol.interaction.TouchCompass.prototype.setActive = function(b)\n{\tol.interaction.Pointer.prototype.setActive.call (this, b);\n\tif (this.getMap()) this.getMap().renderSync();\n}\n/**\n * Get the center of the compass\n * @param {_ol_coordinate_}\n * @private\n */\nol.interaction.TouchCompass.prototype.getCenter_ = function()\n{\tvar margin = 10;\n\tvar s = this.size;\n\tvar c = this.getMap().getSize(); \n\treturn [c[0]/2, c[1]-margin-s/2];\n}\n/**\n * Draw the compass on post compose\n * @private\n */\nol.interaction.TouchCompass.prototype.drawCompass_ = function(e)\n{\tif (!this.getActive()) return;\n\tvar ctx = e.context || ol.ext.getMapCanvas(this.getMap()).getContext('2d');\n\tvar ratio = e.frameState.pixelRatio;\n\tctx.save();\n\tctx.scale(ratio,ratio);\n\tctx.globalAlpha = this.alpha;\n\tctx.strokeStyle = \"#fff\";\n\tctx.lineWidth = 5;\n\tvar s = this.size;\n\tvar c = this.getCenter_();\n\tctx.drawImage(this.compass, 0,0,this.compass.width,this.compass.height, c[0]-s/2, c[1]-s/2, s,s);\n\tif (this.pos)\n\t{\tvar dx = this.pos.pixel[0]-this.start.pixel[0];\n\t\tvar dy = this.pos.pixel[1]-this.start.pixel[1];\n\t\tfor (var i=1; i<=4; i++)\n\t\t{\tctx.beginPath();\n\t\t\tctx.arc (c[0] +dx/4*i, c[1] +dy/4*i, s/2*(0.6+0.4*i/4), 0, 2*Math.PI);\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\tctx.restore();\n\tif (this.pos)\n\t{\t// Get delta\n\t\tif (this.ondrag_) \n\t\t{\tvar r = this.getMap().getView().getResolution();\n\t\t\tvar delta = \n\t\t\t\t{\tdpixel: [ this.pos.pixel[0] - this.start.pixel[0], this.pos.pixel[1] - this.start.pixel[1] ]\n\t\t\t\t}\n\t\t\tdelta.traction = [ delta.dpixel[0]*r, -delta.dpixel[1]*r];\n\t\t\tthis.ondrag_(delta, this.pos);\n\t\t}\n\t\t// Continue animation\n\t\te.frameState.animate = true;\n\t}\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Handle a touch cursor to defer event position on overlay position\n * It can be used as abstract base class used for creating subclasses. \n * The TouchCursor interaction modifies map browser event coordinate and pixel properties to force pointer on the graphic cursor on the screen to any interaction that them.\n * @constructor\n * @extends {ol.interaction.DragOverlay}\n * @param {olx.interaction.InteractionOptions} options Options\n *  @param {string} options.className cursor class name\n *  @param {ol.coordinate} options.coordinate position of the cursor\n *  @param {Array<*>} options.buttons an array of buttons\n *  @param {number} options.maxButtons maximum number of buttons (default 5)\n */\nol.interaction.TouchCursor = function(options) {\n  options = options || {};\n  // List of listerner on the object\n  this._listeners = {};\n  // Interaction to defer position on top of the interaction \n  // this is done to enable other coordinates manipulation inserted after the interaction (snapping)\n  var offset = [-35,-35];\n  this.ctouch = new ol.interaction.Interaction({\n    handleEvent: function(e) {\n      if (!/drag/.test(e.type) && this.getMap()) {\n        e.coordinate = this.overlay.getPosition();\n        e.pixel = this.getMap().getPixelFromCoordinate(e.coordinate);\n        this._lastEvent = e;\n      } else {\n        var res = e.frameState.viewState.resolution\n        var cosa = Math.cos(e.frameState.viewState.rotation);\n        var sina = Math.sin(e.frameState.viewState.rotation);\n        e.coordinate = [\n          e.coordinate[0] + cosa*offset[0]*res + sina*offset[1]*res, \n          e.coordinate[1] + sina*offset[0]*res - cosa*offset[1]*res\n        ];\n        e.pixel = this.getMap().getPixelFromCoordinate(e.coordinate);\n      }\n      return true; \n    }.bind(this)\n  });\n  // Force interaction on top\n  this.ctouch.set('onTop', true);\n  // Add Overlay\n  this.overlay = new ol.Overlay.Fixed({\n    className: ('ol-touch-cursor '+(options.className||'')).trim(),\n    positioning: 'top-left',\n    element: ol.ext.element.create('DIV', {}),\n    stopEvent: false,\n  });\n  ol.interaction.DragOverlay.call(this, {\n    centerOnClick: false,\n    //offset: [-20,-20],\n    overlays: this.overlay\n  });\n  this.setPosition(options.coordinate, true);\n  this.set('maxButtons', options.maxButtons || 5);\n  if (options.buttons) {\n    if (options.buttons.length > this.get('maxButtons')) this.set('maxButtons', options.buttons.length);\n    var elt = this.overlay.element;\n    var begin = options.buttons.length > 4 ? 0 : 1;\n    options.buttons.forEach((function (b, i) {\n      if (i<5) {\n        ol.ext.element.create('DIV', {\n          className: ((b.className||'')+' ol-button ol-button-' + (i+begin)).trim(),\n          html: ol.ext.element.create('DIV', { html: b.html }),\n          click: b.click,\n          on: b.on,\n          parent: elt\n        })\n      }\n    }))\n  }\n  // Replace events to handle click\n  var dragging = false;\n  var start = false;\n  this.on('dragstart', function (e) {\n    this._pixel = this.getMap().getPixelFromCoordinate(this.overlay.getPosition())\n    start = e;\n    return !e.overlay;\n  })\n  this.on('dragend', function (e) {\n    this._pixel = this.getMap().getPixelFromCoordinate(this.overlay.getPosition())\n    if (!e.overlay) return true;\n    if (dragging) {\n      this.dispatchEvent({\n        type: 'dragend', \n        dragging: dragging,\n        originalEvent: e.originalEvent, \n        frameState: e.frameState,\n        pixel: this._pixel,\n        coordinate: this.overlay.getPosition() \n      });\n      dragging = false;\n    } else {\n      if (e.originalEvent.target === this.overlay.element) {\n        this.dispatchEvent({ \n          type: 'click', \n          dragging: dragging,\n          originalEvent: e.originalEvent, \n          frameState: e.frameState,\n          pixel: this._pixel,\n          coordinate: this.overlay.getPosition() \n        });\n      }\n    }\n    return false;\n  }.bind(this))\n  this.on('dragging', function (e) {\n    this._pixel = this.getMap().getPixelFromCoordinate(this.overlay.getPosition());\n    if (!e.overlay) return true;\n    dragging = true;\n    if (start) {\n      this.dispatchEvent({ \n        type: 'dragstart', \n        dragging: dragging,\n        originalEvent: start.originalEvent, \n        frameState: e.frameState,\n        pixel: this._pixel,\n        coordinate: start.coordinate\n      });\n      start = false;\n    }\n    this.dispatchEvent({ \n      type: 'dragging', \n      dragging: dragging,\n      originalEvent: e.originalEvent, \n      frameState: e.frameState,\n      pixel: this._pixel,\n      coordinate: this.overlay.getPosition() \n    });\n    return false;\n  }.bind(this))\n};\nol.ext.inherits(ol.interaction.TouchCursor, ol.interaction.DragOverlay);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {_ol_Map_} map Map.\n * @api stable\n */\nol.interaction.TouchCursor.prototype.setMap = function(map) {\n  // Reset\n  if (this.getMap()) {\n    this.getMap().removeInteraction(this.ctouch);\n    if (this.getActive()) this.getMap().removeOverlay(this.overlay);\n  }\n  for (var l in this._listeners) ol.Observable.unByKey(l);\n  this._listeners = {};\n  ol.interaction.DragOverlay.prototype.setMap.call (this, map);\n  // Set listeners\n  if (map) {\n    if (this.getActive()) {\n      map.addOverlay(this.overlay);\n      setTimeout( function() {\n        this.setPosition(this.getPosition() || map.getView().getCenter());\n      }.bind(this));\n    }\n    map.addInteraction(this.ctouch);\n    this._listeners.addInteraction = map.getInteractions().on('add', function(e) {\n      // Move on top\n      if (!e.element.get('onTop')) {\n        map.removeInteraction(this.ctouch);\n        map.addInteraction(this.ctouch);\n      }\n    }.bind(this));\n  }\n};\n/**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @param {ol.coordinate|null} position position of the cursor (when activating), default viewport center.\n * @observable\n * @api\n */\nol.interaction.TouchCursor.prototype.setActive = function(b, position) {\n  if (b!==this.getActive()) {\n    this.ctouch.setActive(b);\n    if (!b) {\n      this.setPosition();\n      this.overlay.element.classList.remove('active');\n      if (this._activate) clearTimeout(this._activate);\n      if (this.getMap()) this.getMap().removeOverlay(this.overlay);\n    } else {\n      if (this.getMap()) {\n        this.getMap().addOverlay(this.overlay);\n      }\n      if (position) {\n        this.setPosition(position);\n      } else if (this.getMap()) {\n        this.setPosition(this.getMap().getView().getCenter());\n      }\n      this._activate = setTimeout(function() {\n        this.overlay.element.classList.add('active');\n      }.bind(this), 100);\n    }\n    ol.interaction.DragOverlay.prototype.setActive.call (this, b);\n  } else if (position) {\n    this.setPosition(position);\n  } else if (this.getMap()) {\n    this.setPosition(this.getMap().getView().getCenter());\n  }\n};\n/** Set the position of the target\n * @param {ol.coordinate} coord\n */\nol.interaction.TouchCursor.prototype.setPosition = function (coord) {\n  this.overlay.setPosition(coord, true); \n  if (this.getMap() && coord) {\n    this._pixel = this.getMap().getPixelFromCoordinate(coord);\n  }\n};\n/** Offset the target position\n * @param {ol.coordinate} coord\n */\nol.interaction.TouchCursor.prototype.offsetPosition = function (coord) {\n  var pos = this.overlay.getPosition();\n  if (pos) this.overlay.setPosition([pos[0]+coord[0], pos[1]+coord[1]]); \n};\n/** Get the position of the target\n * @return {ol.coordinate}\n */\nol.interaction.TouchCursor.prototype.getPosition = function () {\n  return this.overlay.getPosition(); \n};\n/** Get pixel position\n * @return {ol.pixel}\n */\nol.interaction.TouchCursor.prototype.getPixel = function () {\n  if (this.getMap()) return this.getMap().getPixelFromCoordinate(this.getPosition());\n};\n/** Get cursor overlay\n * @return {ol.Overlay}\n */\nol.interaction.TouchCursor.prototype.getOverlay = function () {\n  return this.overlay; \n};\n/** Get cursor overlay element\n * @return {Element}\n */\nol.interaction.TouchCursor.prototype.getOverlayElement = function () {\n  return this.overlay.element; \n};\n/** Get cursor button element\n * @param {string|number} button the button className or the button index\n * @return {Element}\n */\nol.interaction.TouchCursor.prototype.getButtonElement = function (button) {\n  if (typeof(button) === 'number') return this.getOverlayElement().getElementsByClassName('ol-button')[button];\n  return this.getOverlayElement().getElementsByClassName(button)[0];\n};\n/** Remove a button element\n * @param {string|number|undefined} button the button className or the button index, if undefined remove all buttons, default remove all\n * @return {Element}\n */\nol.interaction.TouchCursor.prototype.removeButton = function (button) {\n  if (button===undefined) {\n    var buttons = this.getOverlayElement().getElementsByClassName('ol-button');\n    for (var i=buttons.length-1; i>=0; i--) {\n      this.getOverlayElement().removeChild(buttons[i]);\n    }\n  } else {\n    var elt = this.getButtonElement(button);\n    if (elt) this.getOverlayElement().removeChild(elt);\n  }\n};\n/** Add a button element\n * @param {*} button\n *  @param {string} options.className button class name\n *  @param {DOMElement|string} options.html button content\n *  @param {function} options.click onclick function\n *  @param {*} options.on an object with \n *  @param {boolean} options.before\n */\nol.interaction.TouchCursor.prototype.addButton = function (b) {\n  var buttons = this.getOverlayElement().getElementsByClassName('ol-button');\n  var max = (this.get('maxButtons') || 5);\n  if (buttons.length >= max) {\n    console.error('[ol/interaction/TouchCursor~addButton] too many button on the cursor (max='+max+')...')\n    return;\n  } \n  var button = ol.ext.element.create('DIV', {\n    className: ((b.className||'')+' ol-button').trim(),\n    html: ol.ext.element.create('DIV', { html: b.html }),\n    click: b.click,\n    on: b.on\n  });\n  if (!b.before || buttons.length===0) this.getOverlayElement().appendChild(button);\n  else this.getOverlayElement().insertBefore(button, buttons[0]);\n  // Reorder buttons\n  var start = buttons.length >= max ? 0 : 1;\n  for (var i=0; i<buttons.length; i++) {\n    buttons[i].className = buttons[i].className.replace(/ol-button-\\d/g, '').trim() + ' ol-button-' + (i+start);\n  }\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** TouchCursor interaction + ModifyFeature\n * @constructor\n * @extends {ol.interaction.TouchCursor}\n * @fires drawend\n * @fires change:type\n * @param {olx.interaction.InteractionOptions} options Options\n *  @param {string} options.className cursor class name\n *  @param {ol.coordinate} options.coordinate cursor position\n *  @param {string} options.type geometry type\n *  @param {Array<string>} options.types geometry types avaliable, default none\n *  @param {ol.source.Vector} options.source Destination source for the drawn features\n *  @param {ol.Collection<ol.Feature>} options.features Destination collection for the drawn features\n *  @param {number} options.clickTolerance The maximum distance in pixels for \"click\" event to add a point/vertex to the geometry being drawn. default 6\n *  @param {number} options.snapTolerance Pixel distance for snapping to the drawing finish, default 12\n *  @param {number} options.maxPoints The number of points that can be drawn before a polygon ring or line string is finished. By default there is no restriction.\n *  @param {number} options.minPoints The number of points that must be drawn before a polygon ring or line string can be finished. Default is 3 for polygon rings and 2 for line strings.\n *  @param {ol.style.Style} options.style Style for sketch features.\n *  @param {function} options.geometryFunction Function that is called when a geometry's coordinates are updated.\n *  @param {string} options.geometryName Geometry name to use for features created by the draw interaction.\n *  @param {boolean} options.wrapX Wrap the world horizontally on the sketch overlay, default false\n */\nol.interaction.TouchCursorDraw = function(options) {\n  options = options || {};\n  // Draw \n  var sketch = this.sketch = new ol.layer.SketchOverlay({\n    type: options.type\n  });\n  sketch.on('drawend', function(e) {\n    if (e.valid && options.source) options.source.addFeature(e.feature);\n    this.dispatchEvent(e);\n  }.bind(this));\n  sketch.on('drawstart', function(e) {\n    this.dispatchEvent(e);\n  }.bind(this));\n  sketch.on('drawabort', function(e) {\n    this.dispatchEvent(e);\n  }.bind(this));\n  // Create cursor\n  ol.interaction.TouchCursor.call(this, {\n    className: options.className,\n    coordinate: options.coordinate,\n  });\n  this.set('types', options.types);\n  this.setType(options.type);\n  this.on('click', function() {\n    this.sketch.addPoint(this.getPosition());\n  }.bind(this))\n  this.on('dragging', function() {\n    this.sketch.setPosition(this.getPosition());\n  }.bind(this))\n};\nol.ext.inherits(ol.interaction.TouchCursorDraw, ol.interaction.TouchCursor);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {_ol_Map_} map Map.\n * @api stable\n */\nol.interaction.TouchCursorDraw.prototype.setMap = function(map) {\n  ol.interaction.TouchCursor.prototype.setMap.call (this, map);\n  this.sketch.setMap(map);\n  if (map) {\n    this._listeners.movend = map.on('moveend', function() {\n      this.sketch.setPosition(this.getPosition())\n    }.bind(this))\n  }\n};\n/**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @param {ol.coordinate|null} position position of the cursor (when activating), default viewport center.\n * @observable\n * @api\n */\nol.interaction.TouchCursorDraw.prototype.setActive = function(b, position) {\n  ol.interaction.TouchCursor.prototype.setActive.call (this, b, position);\n  this.sketch.abortDrawing();\n  this.sketch.setPosition(position);\n  this.sketch.setVisible(b);\n};\n/**\n * Set Geometry type\n * @param {string} type Geometry type\n */\nol.interaction.TouchCursorDraw.prototype.setType = function(type) {\n  this.removeButton();\n  var sketch = this.sketch;\n  this.getOverlayElement().classList.remove(sketch.getGeometryType());\n  // Set type\n  var oldValue = sketch.setGeometryType();\n  type = sketch.setGeometryType(type);\n  this.getOverlayElement().classList.add(type);\n  this.dispatchEvent({\n    type: 'change:type',\n    oldValue: oldValue\n  });\n  // Next type\n  var types = this.get('types');\n  if (types && types.length) {\n    var next = types[(types.indexOf(type) + 1) % types.length];\n    this.addButton({\n      className: 'ol-button-type '+next, \n      click: function() {\n        this.setType(next)\n      }.bind(this)\n    });\n  }\n  // Add buttons\n  if (type !== 'Point') {\n    // Cancel drawing\n    this.addButton({\n      className: 'ol-button-x', \n      click: function() {\n        sketch.abortDrawing();\n      }\n    });\n    if (type !== 'Circle') {\n      // Add a new point (nothing to do, just click)\n      this.addButton({ \n        className: 'ol-button-check',\n        click: function() {\n          sketch.finishDrawing(true);\n        }\n      });\n      // Remove last point\n      this.addButton({  \n        className: 'ol-button-remove', \n        click: function() {\n          sketch.removeLastPoint();\n        }\n      });\n    }\n  }\n};\n/** Get geometry type\n */\nol.interaction.TouchCursorDraw.prototype.getType = function() {\n  return this.sketch.getGeometryType();\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** TouchCursor interaction + ModifyFeature\n * @constructor\n * @extends {ol.interaction.TouchCursor}\n * @param {olx.interaction.InteractionOptions} options Options\n *  @param {string} options.className cursor class name\n *  @param {ol.coordinate} options.coordinate cursor position\n *\t@param {ol.source.Vector} options.source a source to modify (configured with useSpatialIndex set to true)\n *\t@param {ol.source.Vector|Array<ol.source.Vector>} options.sources a list of source to modify (configured with useSpatialIndex set to true)\n *  @param {ol.Collection.<ol.Feature>} options.features collection of feature to modify\n *  @param {function|undefined} options.filter a filter that takes a feature and return true if it can be modified, default always true.\n *  @param {number} pixelTolerance Pixel tolerance for considering the pointer close enough to a segment or vertex for editing, default 10\n *  @param {ol.style.Style | Array<ol.style.Style> | undefined} options.style Style for the sketch features.\n *  @param {boolean} options.wrapX Wrap the world horizontally on the sketch overlay, default false\n */\nol.interaction.TouchCursorModify = function(options) {\n  options = options || {};\n  var drag = false;       // enable drag\n  var dragging = false;   // dragging a point\n  var del = false;        // deleting a point\n  // Modify interaction\n  var mod = this._modify = new ol.interaction.ModifyFeature ({ \n    source: options.source,\n    sources: options.sources,\n    features: options.features,\n    pixelTolerance: options.pixelTolerance,\n    filter: options.filter,\n    style: options.style || [ \n      new ol.style.Style({\n        image: new ol.style.RegularShape ({\n          points: 4,\n          radius: 10,\n          radius2: 0,\n          stroke: new ol.style.Stroke({\n            color: [255,255,255, .5],\n            width: 3\n          })\n        })\n      }),\n      new ol.style.Style({\n        image: new ol.style.RegularShape ({\n          points: 4,\n          radius: 10,\n          radius2: 0,\n          stroke: new ol.style.Stroke({\n            color: [0, 153, 255, 1],\n            width: 1.25\n          })\n        })\n      })\n    ],\n    wrapX: options.wrapX,\n    condition: function(e) {\n      return e.dragging || dragging;\n    },\n    deleteCondition: function() {\n      return del;\n    }\n  });\n  ol.interaction.TouchCursor.call(this, {\n    className: ('disable '+options.className).trim(),\n    coordinate: options.coordinate,\n    buttons: [{\n        // Dragging button\n        className: 'ol-button-move', \n        on: { \n          pointerdown: function() { drag = true; },\n          pointerup: function() { drag = false; }\n        }\n      }, { \n        // Add a new point to a line\n        className: 'ol-button-add', \n        click: function() { \n          dragging = true;\n          mod.handleDownEvent(this._lastEvent);\n          mod.handleUpEvent(this._lastEvent);\n          dragging = false;\n        }.bind(this)\n      }, { \n        // Remove a point\n        className: 'ol-button-remove', \n        click: function() { \n          del = true;\n          mod.handleDownEvent(this._lastEvent); \n          del = false;\n        }.bind(this)\n      }\n    ]\n  });\n  // Show when modification is active\n  mod.on('select', function(e) {\n    if (e.selected.length) {\n      this.getOverlayElement().classList.remove('disable')\n    } else {\n      this.getOverlayElement().classList.add('disable')\n    }\n  }.bind(this));\n  // Handle dragging, prevent drag outside the control\n  this.on('dragstart', function() {\n    if (drag) {\n      mod.handleDownEvent(this._lastEvent);\n    }\n  }.bind(this));\n  this.on('dragging', function(e) {\n    if (drag) mod.handleDragEvent(e);\n  });\n  this.on('dragend', function(e) {\n    mod.handleUpEvent(e);\n    drag = false;\n  });\n};\nol.ext.inherits(ol.interaction.TouchCursorModify, ol.interaction.TouchCursor);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {_ol_Map_} map Map.\n * @api stable\n */\nol.interaction.TouchCursorModify.prototype.setMap = function(map) {\n  if (this.getMap()) {\n    this.getMap().removeInteraction(this._modify);\n  }\n  if (map) {\n    map.addInteraction(this._modify);\n  }\n  ol.interaction.TouchCursor.prototype.setMap.call (this, map);\n};\n/**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @param {ol.coordinate|null} position position of the cursor (when activating), default viewport center.\n * @observable\n * @api\n */\nol.interaction.TouchCursorModify.prototype.setActive = function(b, position) {\n  ol.interaction.TouchCursor.prototype.setActive.call (this, b, position);\n  this._modify.setActive(b);\n};\n/**\n * Get the modify interaction.\n * @retunr {ol.interaction.ModifyFeature} \n * @observable\n * @api\n */\nol.interaction.TouchCursorModify.prototype.getInteraction = function() {\n  return this._modify;\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A TouchCursor to select objects on hovering the cursor\n * @constructor\n * @extends {ol.interaction.DragOverlay}\n * @param {olx.interaction.InteractionOptions} options Options\n *  @param {string} options.className cursor class name\n *  @param {ol.coordinate} options.coordinate position of the cursor\n */\nol.interaction.TouchCursorSelect = function(options) {\n  options = options || {};\n  ol.interaction.TouchCursor.call(this, {\n    className: 'ol-select '+(options.className || ''),\n    coordinate: options.coordinate\n  });\n  this._selection = null;\n  this._layerFilter = options.layerFilter;\n  this._filter = options._filter;\n  this._style = options.style || ol.style.Style.defaultStyle(true);\n  this.set('hitTolerance', options.hitTolerance || 0);\n  this.on(['change:active', 'dragging'], function() { this.select() });\n};\nol.ext.inherits(ol.interaction.TouchCursorSelect, ol.interaction.TouchCursor);\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {_ol_Map_} map Map.\n * @api stable\n */\nol.interaction.TouchCursorSelect.prototype.setMap = function(map) {\n  ol.interaction.TouchCursor.prototype.setMap.call (this, map);\n  if (map) {\n    // Select on move end\n    this._listeners.movend = map.on('moveend', function() {\n      this.select()\n    }.bind(this))\n  }\n};\n/** Get current selection\n * @return {ol.Feature|null}\n */\nol.interaction.TouchCursorSelect.prototype.getSelection = function() {\n  return this._selection ? this._selection.feature : null;\n};\n/** Set position\n * @param {ol.coordinate} coord\n */\nol.interaction.TouchCursorSelect.prototype.setPosition = function(coord) {\n  ol.interaction.TouchCursor.prototype.setPosition.call (this, coord);\n  this.select();\n};\n/** Select feature \n * @param {ol.Feature|undefined} f a feature to select or select at the cursor position\n */\nol.interaction.TouchCursorSelect.prototype.select = function(f) {\n  var current = this._selection;\n  if (this.getActive() && this.getPosition()) {\n    if (!f) {\n      var sel = this.getMap().getFeaturesAtPixel(this.getPixel(), {\n        layerFilter: this._layerFilter,\n        filter: this._filter,\n        hitTolerance: this.get('hitTolerance')\n      });\n      f = sel ? sel[0] : null;\n    }\n    if (f) {\n      if (current && f === current.feature) {\n        current = null;\n      } else {\n        this._selection = {\n          feature: f,\n          style: f.getStyle()\n        }\n        f.setStyle(this._style);\n        this.dispatchEvent({ type:'select', selected: [f], deselected: current ? [current.feature] : [] });\n      }\n    } else {\n      this._selection = null;\n      this.dispatchEvent({ type:'select', selected: [], deselected: current ? [current.feature] : [] });\n    }\n  } else {\n    this._selection = null;\n    this.dispatchEvent({ type:'select', selected: [], deselected: current ? [current.feature] : [] });\n  }\n  // Restore current style\n  if (current) {\n    current.feature.setStyle(current.style);\n  }\n  // \n  if (this._selection) this.getOverlayElement().classList.remove('disable');\n  else this.getOverlayElement().classList.add('disable');\n};\n\n/** Interaction rotate\n * @constructor\n * @extends {ol.interaction.Pointer}\n * @fires select | rotatestart | rotating | rotateend | translatestart | translating | translateend | scalestart | scaling | scaleend\n * @param {any} options\n *  @param {function} options.filter A function that takes a Feature and a Layer and returns true if the feature may be transformed or false otherwise.\n *  @param {Array<ol.Layer>} options.layers array of layers to transform,\n *  @param {ol.Collection<ol.Feature>} options.features collection of feature to transform,\n *\t@param {ol.EventsConditionType|undefined} options.condition A function that takes an ol.MapBrowserEvent and a feature collection and returns a boolean to indicate whether that event should be handled. default: ol.events.condition.always.\n *\t@param {ol.EventsConditionType|undefined} options.addCondition A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether that event should be handled ie. the feature will be added to the transforms features. default: ol.events.condition.never.\n *\t@param {number | undefined} options.hitTolerance Tolerance to select feature in pixel, default 0\n *\t@param {bool} options.translateFeature Translate when click on feature\n *\t@param {bool} options.translate Can translate the feature\n *  @param {bool} options.translateBBox Enable translate when the user drags inside the bounding box\n *\t@param {bool} options.stretch can stretch the feature\n *\t@param {bool} options.scale can scale the feature\n *\t@param {bool} options.rotate can rotate the feature\n *\t@param {bool} options.noFlip prevent the feature geometry to flip, default false\n *\t@param {bool} options.selection the intraction handle selection/deselection, if not use the select prototype to add features to transform, default true\n *\t@param {ol.events.ConditionType | undefined} options.keepAspectRatio A function that takes an ol.MapBrowserEvent and returns a boolean to keep aspect ratio, default ol.events.condition.shiftKeyOnly.\n *\t@param {ol.events.ConditionType | undefined} options.modifyCenter A function that takes an ol.MapBrowserEvent and returns a boolean to apply scale & strech from the center, default ol.events.condition.metaKey or ol.events.condition.ctrlKey.\n *\t@param {boolean} options.enableRotatedTransform Enable transform when map is rotated\n *\t@param {} options.style list of ol.style for handles\n *\n */\nol.interaction.Transform = function(options) {\n  if (!options) options = {};\n\tvar self = this;\n  this.selection_ = new ol.Collection();\n\t// Create a new overlay layer for the sketch\n\tthis.handles_ = new ol.Collection();\n\tthis.overlayLayer_ = new ol.layer.Vector({\n    source: new ol.source.Vector({\n      features: this.handles_,\n      useSpatialIndex: false,\n      wrapX: false // For vector editing across the -180° and 180° meridians to work properly, this should be set to false\n    }),\n    name:'Transform overlay',\n    displayInLayerSwitcher: false,\n    // Return the style according to the handle type\n    style: function (feature) {\n      return (self.style[(feature.get('handle')||'default')+(feature.get('constraint')||'')+(feature.get('option')||'')]);\n    },\n  });\n  // Extend pointer\n  ol.interaction.Pointer.call(this, {\n    handleDownEvent: this.handleDownEvent_,\n    handleDragEvent: this.handleDragEvent_,\n    handleMoveEvent: this.handleMoveEvent_,\n    handleUpEvent: this.handleUpEvent_\n  });\n  // Collection of feature to transform\n  this.features_ = options.features;\n  // Filter or list of layers to transform\n  if (typeof(options.filter)==='function') this._filter = options.filter;\n  this.layers_ = options.layers ? (options.layers instanceof Array) ? options.layers:[options.layers] : null;\n  this._handleEvent = options.condition || function() { return true; };\n  this.addFn_ = options.addCondition || function() { return false; };\n  /* Translate when click on feature */\n  this.set('translateFeature', (options.translateFeature!==false));\n  /* Can translate the feature */\n  this.set('translate', (options.translate!==false));\n  /* Translate when click on the bounding box */\n  this.set('translateBBox', (options.translateBBox===true));\n  /* Can stretch the feature */\n  this.set('stretch', (options.stretch!==false));\n  /* Can scale the feature */\n  this.set('scale', (options.scale!==false));\n  /* Can rotate the feature */\n  this.set('rotate', (options.rotate!==false));\n  /* Keep aspect ratio */\n  this.set('keepAspectRatio', (options.keepAspectRatio || function(e){ return e.originalEvent.shiftKey }));\n  /* Modify center */\n  this.set('modifyCenter', (options.modifyCenter || function(e){ return e.originalEvent.metaKey || e.originalEvent.ctrlKey }));\n  /* Prevent flip */\n  this.set('noFlip', (options.noFlip || false));\n  /* Handle selection */\n  this.set('selection', (options.selection !== false));\n  /*  */\n  this.set('hitTolerance', (options.hitTolerance || 0));\n  /* Enable view rotated transforms */\n  this.set('enableRotatedTransform', (options.enableRotatedTransform || false));\n  // Force redraw when changed\n  this.on ('propertychange', function() {\n    this.drawSketch_();\n  });\n  // setstyle\n  this.setDefaultStyle();\n};\nol.ext.inherits(ol.interaction.Transform, ol.interaction.Pointer);\n/** Cursors for transform\n*/\nol.interaction.Transform.prototype.Cursors = {\n  'default': 'auto',\n  'select': 'pointer',\n  'translate': 'move',\n  'rotate': 'move',\n  'rotate0': 'move',\n  'scale': 'nesw-resize',\n  'scale1': 'nwse-resize',\n  'scale2': 'nesw-resize',\n  'scale3': 'nwse-resize',\n  'scalev': 'ew-resize',\n  'scaleh1': 'ns-resize',\n  'scalev2': 'ew-resize',\n  'scaleh3': 'ns-resize'\n};\n/**\n * Remove the interaction from its current map, if any,  and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.Transform.prototype.setMap = function(map) {\n  var oldMap = this.getMap();\n  if (oldMap) {\n    var targetElement = oldMap.getTargetElement();\n    oldMap.removeLayer(this.overlayLayer_);\n    if (this.previousCursor_ && targetElement) {\n      targetElement.style.cursor = this.previousCursor_;\n    }\n    this.previousCursor_ = undefined;\n  }\n  ol.interaction.Pointer.prototype.setMap.call (this, map);\n  this.overlayLayer_.setMap(map);\n  if (map === null) {\n    this.select(null);\n  }\n  if (map !== null) {\n    this.isTouch = /touch/.test(map.getViewport().className);\n    this.setDefaultStyle();\n  }\n};\n/**\n * Activate/deactivate interaction\n * @param {bool}\n * @api stable\n */\nol.interaction.Transform.prototype.setActive = function(b) {\n  this.select(null);\n  this.overlayLayer_.setVisible(b);\n  ol.interaction.Pointer.prototype.setActive.call (this, b);\n};\n/** Set efault sketch style\n*/\nol.interaction.Transform.prototype.setDefaultStyle = function() {\n  // Style\n  var stroke = new ol.style.Stroke({ color: [255,0,0,1], width: 1 });\n  var strokedash = new ol.style.Stroke({ color: [255,0,0,1], width: 1, lineDash:[4,4] });\n  var fill0 = new ol.style.Fill({ color:[255,0,0,0.01] });\n  var fill = new ol.style.Fill({ color:[255,255,255,0.8] });\n  var circle = new ol.style.RegularShape({\n      fill: fill,\n      stroke: stroke,\n      radius: this.isTouch ? 12 : 6,\n      points: 15\n    });\n  circle.getAnchor()[0] = this.isTouch ? -10 : -5;\n  var bigpt = new ol.style.RegularShape({\n      fill: fill,\n      stroke: stroke,\n      radius: this.isTouch ? 16 : 8,\n      points: 4,\n      angle: Math.PI/4\n    });\n  var smallpt = new ol.style.RegularShape({\n      fill: fill,\n      stroke: stroke,\n      radius: this.isTouch ? 12 : 6,\n      points: 4,\n      angle: Math.PI/4\n    });\n  function createStyle (img, stroke, fill) {\n    return [ new ol.style.Style({image:img, stroke:stroke, fill:fill}) ];\n  }\n  /** Style for handles */\n  this.style = {\n    'default': createStyle (bigpt, strokedash, fill0),\n    'translate': createStyle (bigpt, stroke, fill),\n    'rotate': createStyle (circle, stroke, fill),\n    'rotate0': createStyle (bigpt, stroke, fill),\n    'scale': createStyle (bigpt, stroke, fill),\n    'scale1': createStyle (bigpt, stroke, fill),\n    'scale2': createStyle (bigpt, stroke, fill),\n    'scale3': createStyle (bigpt, stroke, fill),\n    'scalev': createStyle (smallpt, stroke, fill),\n    'scaleh1': createStyle (smallpt, stroke, fill),\n    'scalev2': createStyle (smallpt, stroke, fill),\n    'scaleh3': createStyle (smallpt, stroke, fill),\n  };\n  this.drawSketch_();\n}\n/**\n * Set sketch style.\n * @param {style} style Style name: 'default','translate','rotate','rotate0','scale','scale1','scale2','scale3','scalev','scaleh1','scalev2','scaleh3'\n * @param {ol.style.Style|Array<ol.style.Style>} olstyle\n * @api stable\n */\nol.interaction.Transform.prototype.setStyle = function(style, olstyle) {\n  if (!olstyle) return;\n  if (olstyle instanceof Array) this.style[style] = olstyle;\n  else this.style[style] = [ olstyle ];\n  for (var i=0; i<this.style[style].length; i++) {\n    var im = this.style[style][i].getImage();\n    if (im) {\n      if (style == 'rotate') im.getAnchor()[0] = -5;\n      if (this.isTouch) im.setScale(1.8);\n    }\n    var tx = this.style[style][i].getText();\n    if (tx) {\n      if (style == 'rotate') tx.setOffsetX(this.isTouch ? 14 : 7);\n      if (this.isTouch) tx.setScale(1.8);\n    }\n  }\n  this.drawSketch_();\n};\n/** Get Feature at pixel\n * @param {ol.Pixel}\n * @return {ol.feature}\n * @private\n */\nol.interaction.Transform.prototype.getFeatureAtPixel_ = function(pixel) {\n  var self = this;\n  return this.getMap().forEachFeatureAtPixel(pixel,\n    function(feature, layer) {\n      var found = false;\n      // Overlay ?\n      if (!layer) {\n        if (feature===self.bbox_) {\n          if (self.get('translateBBox')) {\n            return { feature: feature, handle: 'translate', constraint:'', option: '' };\n          } else {\n            return false;\n          }\n        }\n        self.handles_.forEach (function(f) { if (f===feature) found=true; });\n        if (found) return { feature: feature, handle:feature.get('handle'), constraint:feature.get('constraint'), option:feature.get('option') };\n      }\n      // No seletion\n      if (!self.get('selection')) {\n        // Return the currently selected feature the user is interacting with.\n        if (self.selection_.getArray().some(function(f) { return feature === f; })) {\n          return { feature: feature };\n        }\n        return null;\n      }\n      // filter condition\n      if (self._filter) {\n        if (self._filter(feature,layer)) return { feature: feature };\n        else return null;\n      }\n      // feature belong to a layer\n      else if (self.layers_) {\n        for (var i=0; i<self.layers_.length; i++) {\n          if (self.layers_[i]===layer) return { feature: feature };\n        }\n        return null;\n      }\n      // feature in the collection\n      else if (self.features_) {\n        self.features_.forEach (function(f) { if (f===feature) found=true; });\n        if (found) return { feature: feature };\n        else return null;\n      }\n      // Others\n      else return { feature: feature };\n    },\n    { hitTolerance: this.get('hitTolerance') }\n  ) || {};\n}\n/** Rotate feature from map view rotation\n * @param {ol.Feature} f the feature\n * @param {boolean} clone clone resulting geom\n * @param {ol.geom.Geometry} rotated geometry\n */\nol.interaction.Transform.prototype.getGeometryRotateToZero_ = function(f, clone) {\n  var origGeom = f.getGeometry();\n  var viewRotation = this.getMap().getView().getRotation();\n  if (viewRotation === 0 || !this.get('enableRotatedTransform')) {\n    return (clone) ? origGeom.clone() : origGeom;\n  }\n  var rotGeom = origGeom.clone();\n  rotGeom.rotate(viewRotation * -1, this.getMap().getView().getCenter());\n  return rotGeom;\n}\n/** Draw transform sketch\n* @param {boolean} draw only the center\n*/\nol.interaction.Transform.prototype.drawSketch_ = function(center) {\n  var i, f, geom;\n  this.overlayLayer_.getSource().clear();\n  if (!this.selection_.getLength()) return;\n  var viewRotation = this.getMap().getView().getRotation();\n  var ext = this.getGeometryRotateToZero_(this.selection_.item(0)).getExtent();\n  // Clone and extend\n  ext = ol.extent.buffer(ext, 0);\n  this.selection_.forEach(function (f) {\n    var extendExt = this.getGeometryRotateToZero_(f).getExtent();\n    ol.extent.extend(ext, extendExt);\n  }.bind(this));\n  if (center===true) {\n    if (!this.ispt_) {\n      this.overlayLayer_.getSource().addFeature(new ol.Feature( { geometry: new ol.geom.Point(this.center_), handle:'rotate0' }) );\n      geom = ol.geom.Polygon.fromExtent(ext);\n      if (this.get('enableRotatedTransform') && viewRotation !== 0) {\n        geom.rotate(viewRotation, this.getMap().getView().getCenter())\n      }\n      f = this.bbox_ = new ol.Feature(geom);\n      this.overlayLayer_.getSource().addFeature (f);\n    }\n  }\n  else {\n    if (this.ispt_) {\n      var p = this.getMap().getPixelFromCoordinate([ext[0], ext[1]]);\n      ext = ol.extent.boundingExtent([\n        this.getMap().getCoordinateFromPixel([p[0]-10, p[1]-10]),\n        this.getMap().getCoordinateFromPixel([p[0]+10, p[1]+10])\n      ]);\n    }\n    geom = ol.geom.Polygon.fromExtent(ext);\n    if (this.get('enableRotatedTransform') && viewRotation !== 0) {\n      geom.rotate(viewRotation, this.getMap().getView().getCenter())\n    }\n    f = this.bbox_ = new ol.Feature(geom);\n    var features = [];\n    var g = geom.getCoordinates()[0];\n    if (!this.ispt_) {\n      features.push(f);\n      // Middle\n      if (!this.iscircle_ && this.get('stretch') && this.get('scale')) for (i=0; i<g.length-1; i++) {\n        f = new ol.Feature( { geometry: new ol.geom.Point([(g[i][0]+g[i+1][0])/2,(g[i][1]+g[i+1][1])/2]), handle:'scale', constraint:i%2?\"h\":\"v\", option:i });\n        features.push(f);\n      }\n      // Handles\n      if (this.get('scale')) for (i=0; i<g.length-1; i++) {\n        f = new ol.Feature( { geometry: new ol.geom.Point(g[i]), handle:'scale', option:i });\n        features.push(f);\n      }\n      // Center\n      if (this.get('translate') && !this.get('translateFeature')) {\n        f = new ol.Feature( { geometry: new ol.geom.Point([(g[0][0]+g[2][0])/2, (g[0][1]+g[2][1])/2]), handle:'translate' });\n        features.push(f);\n      }\n    }\n    // Rotate\n    if (!this.iscircle_ && this.get('rotate')) {\n      f = new ol.Feature( { geometry: new ol.geom.Point(g[3]), handle:'rotate' });\n      features.push(f);\n    }\n    // Add sketch\n    this.overlayLayer_.getSource().addFeatures(features);\n  }\n};\n/** Select a feature to transform\n* @param {ol.Feature} feature the feature to transform\n* @param {boolean} add true to add the feature to the selection, default false\n*/\nol.interaction.Transform.prototype.select = function(feature, add) {\n  if (!feature) {\n    this.selection_.clear();\n    this.drawSketch_();\n    return;\n  }\n  if (!feature.getGeometry || !feature.getGeometry()) return;\n  // Add to selection\n  if (add) {\n    this.selection_.push(feature);\n  } else {\n\tvar index = this.selection_.getArray().indexOf(feature);\n\tthis.selection_.removeAt(index);\t\n  }\n  this.ispt_ = (this.selection_.getLength()===1 ? (this.selection_.item(0).getGeometry().getType() == \"Point\") : false);\n  this.iscircle_ = (this.selection_.getLength()===1 ? (this.selection_.item(0).getGeometry().getType() == \"Circle\") : false);\n  this.drawSketch_();\n  this.watchFeatures_();\n  // select event\n  this.dispatchEvent({ type:'select', feature: feature, features: this.selection_ });\n};\n/** Update the selection collection.\n* @param {ol.Collection<ol.Feature>} features the features to transform\n*/\nol.interaction.Transform.prototype.setSelection = function(features) {\n  this.selection_.clear();\n  features.forEach(function(feature) {\n    this.selection_.push(feature);\n  }.bind(this));\n  this.ispt_ = (this.selection_.getLength()===1 ? (this.selection_.item(0).getGeometry().getType() == \"Point\") : false);\n  this.iscircle_ = (this.selection_.getLength()===1 ? (this.selection_.item(0).getGeometry().getType() == \"Circle\") : false);\n  this.drawSketch_();\n  this.watchFeatures_();\n  // select event\n  this.dispatchEvent({ type:'select', features: this.selection_ });\n};\n/** Watch selected features\n * @private\n */\nol.interaction.Transform.prototype.watchFeatures_ = function() {\n  // Listen to feature modification\n  if (this._featureListeners) {\n    this._featureListeners.forEach(function (l) {\n      ol.Observable.unByKey(l)\n    });\n  }\n  this._featureListeners = [];\n  this.selection_.forEach(function(f) {\n    this._featureListeners.push(\n      f.on('change', function() {\n        if (!this.isUpdating_) {\n          this.drawSketch_();\n        }\n      }.bind(this))\n    );\n  }.bind(this));\n};\n/**\n * @param {ol.MapBrowserEvent} evt Map browser event.\n * @return {boolean} `true` to start the drag sequence.\n * @private\n */\nol.interaction.Transform.prototype.handleDownEvent_ = function(evt) {\n  if (!this._handleEvent(evt, this.selection_)) return;\n  var sel = this.getFeatureAtPixel_(evt.pixel);\n  var feature = sel.feature;\n  if (this.selection_.getLength()\n    && this.selection_.getArray().indexOf(feature) >= 0\n    && ((this.ispt_ && this.get('translate')) || this.get('translateFeature'))\n  ){\n    sel.handle = 'translate';\n  }\n  if (sel.handle) {\n    this.mode_ = sel.handle;\n    this.opt_ = sel.option;\n    this.constraint_ = sel.constraint;\n    // Save info\n    var viewRotation = this.getMap().getView().getRotation();\n    this.coordinate_ = evt.coordinate;\n    this.pixel_ = evt.pixel;\n    this.geoms_ = [];\n    this.rotatedGeoms_ = [];\n    var extent = ol.extent.createEmpty();\n    var rotExtent = ol.extent.createEmpty();\n    for (var i=0, f; f=this.selection_.item(i); i++) {\n      this.geoms_.push(f.getGeometry().clone());\n      extent = ol.extent.extend(extent, f.getGeometry().getExtent());\n      if (this.get('enableRotatedTransform') && viewRotation !== 0) {\n        var rotGeom = this.getGeometryRotateToZero_(f, true);\n        this.rotatedGeoms_.push(rotGeom);\n        rotExtent = ol.extent.extend(rotExtent, rotGeom.getExtent());\n      }\n    }\n    this.extent_ = (ol.geom.Polygon.fromExtent(extent)).getCoordinates()[0];\n    if (this.get('enableRotatedTransform') && viewRotation !== 0) {\n      this.rotatedExtent_ = (ol.geom.Polygon.fromExtent(rotExtent)).getCoordinates()[0];\n    }\n    if (this.mode_==='rotate') {\n      this.center_ = this.getCenter() || ol.extent.getCenter(extent);\n      // we are now rotating (cursor down on rotate mode), so apply the grabbing cursor\n      var element = evt.map.getTargetElement();\n      element.style.cursor = this.Cursors.rotate0;\n      this.previousCursor_ = element.style.cursor;\n    } else {\n      this.center_ = ol.extent.getCenter(extent);\n    }\n    this.angle_ = Math.atan2(this.center_[1]-evt.coordinate[1], this.center_[0]-evt.coordinate[0]);\n    this.dispatchEvent({\n      type: this.mode_+'start',\n      feature: this.selection_.item(0), // backward compatibility\n      features: this.selection_,\n      pixel: evt.pixel,\n      coordinate: evt.coordinate\n    });\n    return true;\n  }\n  else if (this.get('selection')) {\n    if (feature){\n      if (!this.addFn_(evt)) this.selection_.clear();\n      var index = this.selection_.getArray().indexOf(feature);\n      if (index < 0) this.selection_.push(feature);\n      else this.selection_.removeAt(index);\n    } else {\n      this.selection_.clear();\n    }\n    this.ispt_ = this.selection_.getLength()===1 ? (this.selection_.item(0).getGeometry().getType() == \"Point\") : false;\n    this.iscircle_ = (this.selection_.getLength()===1 ? (this.selection_.item(0).getGeometry().getType() == \"Circle\") : false);\n    this.drawSketch_();\n    this.watchFeatures_();\n    this.dispatchEvent({ type:'select', feature: feature, features: this.selection_, pixel: evt.pixel, coordinate: evt.coordinate });\n    return false;\n  }\n};\n/**\n * Get features to transform\n * @return {ol.Collection<ol.Feature>}\n */\nol.interaction.Transform.prototype.getFeatures = function() {\n  return this.selection_;\n};\n/**\n * Get the rotation center\n * @return {ol.coordinates|undefined}\n */\nol.interaction.Transform.prototype.getCenter = function() {\n  return this.get('center');\n};\n/**\n * Set the rotation center\n * @param {ol.coordinates|undefined} c the center point, default center on the objet\n */\nol.interaction.Transform.prototype.setCenter = function(c) {\n  return this.set('center', c);\n}\n/**\n * @param {ol.MapBrowserEvent} evt Map browser event.\n * @private\n */\nol.interaction.Transform.prototype.handleDragEvent_ = function(evt) {\n  if (!this._handleEvent(evt, this.features_)) return;\n  var viewRotation = this.getMap().getView().getRotation();\n  var i, f, geometry;\n  var pt0 = [this.coordinate_[0], this.coordinate_[1]];\n  var pt = [evt.coordinate[0], evt.coordinate[1]];\n  this.isUpdating_ = true;\n  switch (this.mode_) {\n    case 'rotate': {\n      var a = Math.atan2(this.center_[1]-pt[1], this.center_[0]-pt[0]);\n      if (!this.ispt) {\n        // var geometry = this.geom_.clone();\n        // geometry.rotate(a-this.angle_, this.center_);\n        // this.feature_.setGeometry(geometry);\n        for (i=0, f; f=this.selection_.item(i); i++) {\n          geometry = this.geoms_[i].clone();\n          geometry.rotate(a - this.angle_, this.center_);\n          // bug: ol, bad calculation circle geom extent\n          if (geometry.getType() == 'Circle') geometry.setCenterAndRadius(geometry.getCenter(), geometry.getRadius());\n          f.setGeometry(geometry);\n        }\n      }\n      this.drawSketch_(true);\n      this.dispatchEvent({\n        type:'rotating',\n        feature: this.selection_.item(0),\n        features: this.selection_,\n        angle: a-this.angle_,\n        pixel: evt.pixel,\n        coordinate: evt.coordinate\n      });\n      break;\n    }\n    case 'translate': {\n      var deltaX = pt[0] - pt0[0];\n      var deltaY = pt[1] - pt0[1];\n      //this.feature_.getGeometry().translate(deltaX, deltaY);\n      for (i=0, f; f=this.selection_.item(i); i++) {\n        f.getGeometry().translate(deltaX, deltaY);\n      }\n      this.handles_.forEach(function(f) {\n        f.getGeometry().translate(deltaX, deltaY);\n      });\n      this.coordinate_ = evt.coordinate;\n      this.dispatchEvent({\n        type:'translating',\n        feature: this.selection_.item(0),\n        features: this.selection_,\n        delta:[deltaX,deltaY],\n        pixel: evt.pixel,\n        coordinate: evt.coordinate\n      });\n      break;\n    }\n    case 'scale': {\n      var center = this.center_;\n      if (this.get('modifyCenter')(evt)) {\n        var extentCoordinates = this.extent_;\n        if (this.get('enableRotatedTransform') && viewRotation !== 0) {\n          extentCoordinates = this.rotatedExtent_;\n        }\n        center = extentCoordinates[(Number(this.opt_)+2)%4];\n      }\n      var downCoordinate = this.coordinate_;\n      var dragCoordinate = evt.coordinate;\n      if (this.get('enableRotatedTransform') && viewRotation !== 0) {\n        var downPoint = new ol.geom.Point(this.coordinate_);\n        downPoint.rotate(viewRotation * -1, center);\n        downCoordinate = downPoint.getCoordinates();\n        var dragPoint = new ol.geom.Point(evt.coordinate);\n        dragPoint.rotate(viewRotation * -1, center);\n        dragCoordinate = dragPoint.getCoordinates();\n      }\n      var scx = ((dragCoordinate)[0] - (center)[0]) / (downCoordinate[0] - (center)[0]);\n      var scy = ((dragCoordinate)[1] - (center)[1]) / (downCoordinate[1] - (center)[1]);\n      if (this.get('enableRotatedTransform') && viewRotation !== 0) {\n        var centerPoint = new ol.geom.Point(center);\n        centerPoint.rotate(viewRotation * -1, this.getMap().getView().getCenter());\n        center = centerPoint.getCoordinates();\n      }\n      if (this.get('noFlip')) {\n        if (scx<0) scx=-scx;\n        if (scy<0) scy=-scy;\n      }\n      if (this.constraint_) {\n        if (this.constraint_==\"h\") scx=1;\n        else scy=1;\n      } else {\n        if (this.get('keepAspectRatio')(evt)) {\n          scx = scy = Math.min(scx,scy);\n        }\n      }\n      for (i=0, f; f=this.selection_.item(i); i++) {\n        geometry = (viewRotation === 0 || !this.get('enableRotatedTransform')) ? this.geoms_[i].clone() : this.rotatedGeoms_[i].clone();\n        geometry.applyTransform(function(g1, g2, dim) {\n          if (dim<2) return g2;\n          for (var j=0; j<g1.length; j+=dim) {\n            if (scx!=1) g2[j] = center[0] + (g1[j]-center[0])*scx;\n            if (scy!=1) g2[j+1] = center[1] + (g1[j+1]-center[1])*scy;\n          }\n          // bug: ol, bad calculation circle geom extent\n          if (geometry.getType() == 'Circle') geometry.setCenterAndRadius(geometry.getCenter(), geometry.getRadius());\n          return g2;\n        });\n        if (this.get('enableRotatedTransform') && viewRotation !== 0) {\n          //geometry.rotate(viewRotation, rotationCenter);\n          geometry.rotate(viewRotation, this.getMap().getView().getCenter());\n        }\n        f.setGeometry(geometry);\n      }\n      this.drawSketch_();\n      this.dispatchEvent({\n        type:'scaling',\n        feature: this.selection_.item(0),\n        features: this.selection_,\n        scale:[scx,scy],\n        pixel: evt.pixel,\n        coordinate: evt.coordinate\n      });\n      break;\n    }\n    default: break;\n  }\n  this.isUpdating_ = false;\n};\n/**\n * @param {ol.MapBrowserEvent} evt Event.\n * @private\n */\nol.interaction.Transform.prototype.handleMoveEvent_ = function(evt) {\n  if (!this._handleEvent(evt, this.features_)) return;\n  // console.log(\"handleMoveEvent\");\n  if (!this.mode_) {\n    var sel = this.getFeatureAtPixel_(evt.pixel);\n    var element = evt.map.getTargetElement();\n    if (sel.feature) {\n      var c = sel.handle ? this.Cursors[(sel.handle||'default')+(sel.constraint||'')+(sel.option||'')] : this.Cursors.select;\n      if (this.previousCursor_===undefined) {\n        this.previousCursor_ = element.style.cursor;\n      }\n      element.style.cursor = c;\n    } else {\n      if (this.previousCursor_!==undefined) element.style.cursor = this.previousCursor_;\n      this.previousCursor_ = undefined;\n    }\n  }\n};\n/**\n * @param {ol.MapBrowserEvent} evt Map browser event.\n * @return {boolean} `false` to stop the drag sequence.\n */\nol.interaction.Transform.prototype.handleUpEvent_ = function(evt) {\n  // remove rotate0 cursor on Up event, otherwise it's stuck on grab/grabbing\n  if (this.mode_ === 'rotate') {\n    var element = evt.map.getTargetElement();\n    element.style.cursor = this.Cursors.default;\n    this.previousCursor_ = undefined;\n  }\n  //dispatchEvent\n  this.dispatchEvent({\n    type:this.mode_+'end',\n    feature: this.selection_.item(0),\n    features: this.selection_,\n    oldgeom: this.geoms_[0],\n    oldgeoms: this.geoms_\n  });\n  this.drawSketch_();\n  this.mode_ = null;\n  return false;\n};\n/** Get the features that are selected for transform\n * @return ol.Collection\n */\nol.interaction.Transform.prototype.getFeatures = function() {\n  return this.selection_;\n};\n\n/** Undo/redo interaction\n * @constructor\n * @extends {ol.interaction.Interaction}\n * @fires undo\n * @fires redo\n * @param {*} options\n */\nol.interaction.UndoRedo = function(options) {\n  if (!options) options = {};\n\tol.interaction.Interaction.call(this, {\t\n    handleEvent: function() { \n      return true; \n    }\n  });\n  this._undoStack = [];\n  this._redoStack = [];\n  // Block counter\n  this._block = 0;\n  // Start recording\n  this._record = true;\n  // Custom definitions\n  this._defs = {};\n};\nol.ext.inherits(ol.interaction.UndoRedo, ol.interaction.Interaction);\n/** Add a custom undo/redo\n * @param {string} action the action key name\n * @param {function} undoFn function called when undoing\n * @param {function} redoFn function called when redoing\n * @api\n */\nol.interaction.UndoRedo.prototype.define = function(action, undoFn, redoFn) {\n  this._defs['_'+action] = { undo: undoFn, redo: redoFn };\n};\n/** Set a custom undo/redo\n * @param {string} action the action key name\n * @param {any} prop an object that will be passed in the undo/redo fucntions of the action\n * @return {boolean} true if the action is defined\n */\nol.interaction.UndoRedo.prototype.push = function(action, prop) {\n  if (this._defs['_'+action]) {\n    this._undoStack.push({type: '_'+action, prop: prop });\n    return true;\n  } else {\n    return false;\n  }\n};\n/** Activate or deactivate the interaction, ie. records or not events on the map.\n * @param {boolean} active\n * @api stable\n */\nol.interaction.UndoRedo.prototype.setActive = function(active) {\n  ol.interaction.Interaction.prototype.setActive.call (this, active);\n  this._record = active;\n};\n/**\n * Remove the interaction from its current map, if any, and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {ol.Map} map Map.\n * @api stable\n */\nol.interaction.UndoRedo.prototype.setMap = function(map) {\n  if (this._mapListener) {\n    this._mapListener.forEach(function(l) { ol.Observable.unByKey(l); })\n  }\n  this._mapListener = [];\n  ol.interaction.Interaction.prototype.setMap.call (this, map);\n  // Watch blocks\n  if (map) {\n    this._mapListener.push(map.on('undoblockstart', this.blockStart.bind(this)));\n    this._mapListener.push(map.on('undoblockend', this.blockEnd.bind(this)));\n  }\n  // Watch sources\n  this._watchSources();\n  this._watchInteractions();\n};\n/** Watch for changes in the map sources\n * @private\n */\nol.interaction.UndoRedo.prototype._watchSources = function() {\n  var map = this.getMap();\n  // Clear listeners\n  if (this._sourceListener) {\n    this._sourceListener.forEach(function(l) { ol.Observable.unByKey(l); })\n  }\n  this._sourceListener = [];\n  // Ges vector layers \n  function getVectorLayers(layers, init) {\n    if (!init) init = [];\n    layers.forEach(function(l) {\n      if (l instanceof ol.layer.Vector) {\n        init.push(l);\n      } else if (l.getLayers) {\n        getVectorLayers(l.getLayers(), init);\n      }\n    });\n    return init;\n  }\n  if (map) {\n    // Watch the vector sources in the map \n    var vectors = getVectorLayers(map.getLayers());\n    vectors.forEach((function(l) {\n      var s = l.getSource();\n      this._sourceListener.push( s.on(['addfeature', 'removefeature'], this._onAddRemove.bind(this)) );\n      this._sourceListener.push( s.on('clearstart', this.blockStart.bind(this)) );\n      this._sourceListener.push( s.on('clearend', this.blockEnd.bind(this)) );\n    }).bind(this));\n    // Watch new inserted/removed\n    this._sourceListener.push( map.getLayers().on(['add', 'remove'], this._watchSources.bind(this) ) );\n  }\n};\n/** Watch for interactions\n * @private\n */\nol.interaction.UndoRedo.prototype._watchInteractions = function() {\n  var map = this.getMap();\n  // Clear listeners\n  if (this._interactionListener) {\n    this._interactionListener.forEach(function(l) { ol.Observable.unByKey(l); })\n  }\n  this._interactionListener = [];\n  if (map) {\n    // Watch the interactions in the map \n    map.getInteractions().forEach((function(i) {\n      this._interactionListener.push(i.on(\n        ['setattributestart', 'modifystart', 'rotatestart', 'translatestart', 'scalestart', 'deletestart', 'deleteend', 'beforesplit', 'aftersplit'], \n        this._onInteraction.bind(this)\n      ));\n    }).bind(this));\n    // Watch new inserted / unwatch removed\n    this._interactionListener.push( map.getInteractions().on(\n      ['add', 'remove'], \n      this._watchInteractions.bind(this)\n    ));\n  }\n};\n/** A feature is added / removed\n */\nol.interaction.UndoRedo.prototype._onAddRemove = function(e) {\n  if (this._record) {\n    this._undoStack.push({type: e.type, source: e.target, feature: e.feature });\n    this._redoStack = [];\n  }\n};\nol.interaction.UndoRedo.prototype._onInteraction = function(e) {\n  var fn = this._onInteraction[e.type];\n  if (fn) fn.call(this,e);\n};\n/** Set attribute\n * @private\n */\nol.interaction.UndoRedo.prototype._onInteraction.setattributestart = function(e) {\n  this.blockStart();\n  var newp = Object.assign({}, e.properties);\n  e.features.forEach(function(f) {\n    var oldp = {};\n    for (var p in newp) {\n      oldp[p] = f.get(p);\n    }\n    this._undoStack.push({\n      type: 'changeattribute', \n      feature: f, \n      newProperties: newp,\n      oldProperties: oldp\n    });\n  }.bind(this));\n  this.blockEnd();\n};\nol.interaction.UndoRedo.prototype._onInteraction.rotatestart = \nol.interaction.UndoRedo.prototype._onInteraction.translatestart = \nol.interaction.UndoRedo.prototype._onInteraction.scalestart = \nol.interaction.UndoRedo.prototype._onInteraction.modifystart = function (e) {\n  this.blockStart();\n  e.features.forEach(function(m) {\n    this._undoStack.push({type: 'changefeature', feature: m, oldFeature: m.clone()  });\n  }.bind(this));\n  this.blockEnd();\n};\n/** Start an undo block\n * @api\n */\nol.interaction.UndoRedo.prototype.blockStart = function () {\n  this._undoStack.push({ type: 'blockstart' });\n  this._redoStack = [];\n};\n/** @private\n */\nol.interaction.UndoRedo.prototype._onInteraction.beforesplit =\nol.interaction.UndoRedo.prototype._onInteraction.deletestart =\nol.interaction.UndoRedo.prototype.blockStart;\n/** End an undo block\n * @api\n */\nol.interaction.UndoRedo.prototype.blockEnd = function () {\n  this._undoStack.push({ type: 'blockend' });\n};\n/** @private\n */\nol.interaction.UndoRedo.prototype._onInteraction.aftersplit =\nol.interaction.UndoRedo.prototype._onInteraction.deleteend =\nol.interaction.UndoRedo.prototype.blockEnd;\n/** handle undo/redo\n * @private\n */\nol.interaction.UndoRedo.prototype._handleDo = function(e, undo) {\n  // Not active\n  if (!this.getActive()) return;\n  // Stop recording while undoing\n  this._record = false;\n  switch (e.type) {\n    case 'addfeature': {\n      if (undo) e.source.removeFeature(e.feature);\n      else e.source.addFeature(e.feature);\n      break;\n    }\n    case 'removefeature': {\n      if (undo) e.source.addFeature(e.feature);\n      else e.source.removeFeature(e.feature);\n      break;\n    }\n    case 'changefeature': {\n      var geom = e.feature.getGeometry();\n      e.feature.setGeometry(e.oldFeature.getGeometry());\n      e.oldFeature.setGeometry(geom);\n      break;\n    }\n    case 'changeattribute': {\n      var newp = e.newProperties;\n      var oldp = e.oldProperties;\n      for (var p in oldp) {\n        if (oldp === undefined) e.feature.unset(p);\n        else e.feature.set(p, oldp[p]);\n      }\n      e.oldProperties = newp;\n      e.newProperties = oldp;\n      break;\n    }\n    case 'blockstart': {\n      this._block += undo ? -1 : 1;\n      break;\n    }\n    case 'blockend': {\n      this._block += undo ? 1 : -1;\n      break;\n    }\n    default: {\n      if (this._defs[e.type]) {\n        if (undo) this._defs[e.type].undo(e.prop);\n        else this._defs[e.type].redo(e.prop);\n      } else {\n        console.warn('[UndoRedoInteraction]: \"'+e.type.substr(1)+'\" is not defined.');\n      }\n    }\n  }\n  // Handle block\n  if (this._block<0) this._block = 0;\n  if (this._block) {\n    if (undo) this.undo();\n    else this.redo();\n  }\n  this._record = true;\n  // Dispatch event\n  this.dispatchEvent( { \n    type: undo ? 'undo' : 'redo',\n    action: e\n  });\n};\n/** Undo last operation\n * @api\n */\nol.interaction.UndoRedo.prototype.undo = function() {\n  var e = this._undoStack.pop();\n  if (!e) return;\n  this._redoStack.push(e);\n  this._handleDo(e, true);\n};\n/** Redo last operation\n * @api\n */\nol.interaction.UndoRedo.prototype.redo = function() {\n  var e = this._redoStack.pop();\n  if (!e) return;\n  this._undoStack.push(e);\n  this._handleDo(e, false);\n};\n/** Clear undo stack\n * @api\n */\nol.interaction.UndoRedo.prototype.clear = function() {\n  this._undoStack = [];\n  this._redoStack = [];\n};\n/** Check if undo is avaliable\n * @return {number} the number of undo \n * @api\n */\nol.interaction.UndoRedo.prototype.hasUndo = function() {\n  return this._undoStack.length;\n};\n/** Check if redo is avaliable\n * @return {number} the number of redo\n * @api\n */\nol.interaction.UndoRedo.prototype.hasRedo = function() {\n  return this._redoStack.length;\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Abstract base class; normally only used for creating subclasses. Bin collector for data\n * @constructor\n * @extends {ol.source.Vector}\n * @param {Object} options ol.source.VectorOptions + grid option\n *  @param {ol.source.Vector} options.source Source\n *  @param {boolean} options.listenChange listen changes (move) on source features to recalculate the bin, default true\n *  @param {fucntion} [options.geometryFunction] Function that takes an ol.Feature as argument and returns an ol.geom.Point as feature's center.\n *  @param {function} [options.flatAttributes] Function takes a bin and the features it contains and aggragate the features in the bin attributes when saving\n */\nol.source.BinBase = function (options) {\n  options = options || {};\n  this._bindModify = this._onModifyFeature.bind(this);\n  this._watch = true;\n  ol.source.Vector.call(this, options);\n  this._origin = options.source;\n  this._listen = (options.listenChange !== false);\n  // Geometry function\n  this._geomFn = options.geometryFunction || ol.coordinate.getFeatureCenter || function (f) { return f.getGeometry().getFirstCoordinate(); };\n  // Existing features\n  this.reset();\n  // Future features\n  this._origin.on('addfeature', this._onAddFeature.bind(this));\n  this._origin.on('removefeature', this._onRemoveFeature.bind(this));\n  this._origin.on('clearstart', this._onClearFeature.bind(this));\n  this._origin.on('clearend', this._onClearFeature.bind(this));\n  if (typeof (options.flatAttributes) === 'function') this._flatAttributes = options.flatAttributes;\n};\nol.ext.inherits(ol.source.BinBase, ol.source.Vector);\n/**\n * On add feature\n * @param {ol.events.Event} e\n * @param {ol.Feature} bin\n * @private\n */\nol.source.BinBase.prototype._onAddFeature = function (e, bin, listen) {\n  var f = e.feature || e.target;\n  bin = bin || this.getBinAt(this._geomFn(f), true);\n  if (bin) bin.get('features').push(f);\n  if (this._listen && listen!==false) f.on('change', this._bindModify);\n};\n/**\n *  On remove feature\n *  @param {ol.events.Event} e\n *  @param {ol.Feature} bin\n *  @private\n */\nol.source.BinBase.prototype._onRemoveFeature = function (e, bin, listen) {\n  if (!this._watch) return;\n  var f = e.feature || e.target;\n  bin = bin || this.getBinAt(this._geomFn(f));\n  if (bin) {\n    // Remove feature from bin\n    var features = bin.get('features');\n    for (var i=0, fi; fi=features[i]; i++) {\n      if (fi===f) {\n        features.splice(i, 1);\n        break;\n      }\n    }\n    // Remove bin if no features\n    if (!features.length) {\n      this.removeFeature(bin);\n    }\n  } else {\n    // console.log(\"[ERROR:Bin] remove feature: feature doesn't exists anymore.\");\n  }\n  if (this._listen && listen!==false) f.un('change', this._bindModify);\n};\n/** When clearing features remove the listener\n * @private\n */\nol.source.BinBase.prototype._onClearFeature = function (e) {\n  if (e.type==='clearstart') {\n    if (this._listen) {\n      this._origin.getFeatures().forEach(function (f) {\n        f.un('change', this._bindModify);\n      }.bind(this));\n    }\n    this.clear();\n    this._watch = false;\n  } else {\n    this._watch = true;\n  }\n};\n/**\n * Get the bin that contains a feature\n * @param {ol.Feature} f the feature\n * @return {ol.Feature} the bin or null it doesn't exit\n */\nol.source.BinBase.prototype.getBin = function (feature) {\n  var bins = this.getFeatures();\n  for (var i=0, b; b = bins[i]; i++) {\n    var features = b.get('features');\n    for (var j=0, f; f=features[j]; j++) {\n      if (f===feature) return b;\n    }\n  }\n  return null;\n}\n/** Get the grid geometry at the coord \n * @param {ol.Coordinate} coord\n * @param {Object} attributes add key/value to this object to add properties to the grid feature\n * @returns {ol.geom.Polygon} \n * @api\n */\nol.source.BinBase.prototype.getGridGeomAt = function (coord /*, attributes */) {\n  return new ol.geom.Polygon([coord]);\n};\n/** Get the bean at a coord\n * @param {ol.Coordinate} coord\n * @param {boolean} create true to create if doesn't exit\n * @return {ol.Feature} the bin or null it doesn't exit\n */\nol.source.BinBase.prototype.getBinAt = function (coord, create) {\n  var attributes = {};\n  var g = this.getGridGeomAt(coord, attributes);\n  if (!g) return null;\n  var center = g.getInteriorPoint ? g.getInteriorPoint().getCoordinates() : g.getInteriorPoints().getCoordinates()[0];// ol.extent.getCenter(g.getExtent());\n  var features = this.getFeaturesAtCoordinate( center );\n  var bin = features[0];\n  if (!bin && create) {\n    attributes.geometry = g;\n    attributes.features = [];\n    attributes.center = center;\n    bin = new ol.Feature(attributes);\n    this.addFeature(bin);\n  }\n  return bin || null;\n};\n/**\n *  A feature has been modified\n *  @param {ol.events.Event} e\n *  @private\n */\nol.source.BinBase.prototype._onModifyFeature = function (e) {\n  var bin = this.getBin(e.target);\n  var bin2 = this.getBinAt(this._geomFn(e.target), 'create');\n  if (bin !== bin2) {\n    // remove from the bin\n    if (bin) {\n      this._onRemoveFeature(e, bin, false);\n    }\n    // insert in the new bin\n    if (bin2) {\n      this._onAddFeature(e, bin2, false);\n    }\n  }\n  this.changed();\n};\n/** Clear all bins and generate a new one. \n */\nol.source.BinBase.prototype.reset = function () {\n  this.clear();\n  var features = this._origin.getFeatures();\n  for (var i = 0, f; f = features[i]; i++) {\n    this._onAddFeature({ feature: f });\n  }\n  this.changed();\n};\n/**\n * Get features without circular dependencies (vs. getFeatures)\n * @return {Array<ol.Feature>}\n */\nol.source.BinBase.prototype.getGridFeatures = function () {\n  var features = [];\n  this.getFeatures().forEach(function (f) {\n    var bin = new ol.Feature(f.getGeometry().clone());\n    for (var i in f.getProperties()) {\n      if (i!=='features' && i!=='geometry') {\n        bin.set(i, f.get(i));\n      }\n    }\n    bin.set('nb', f.get('features').length);\n    this._flatAttributes(bin, f.get('features'));\n    features.push(bin);\n  }.bind(this));\n  return features;\n};\n/** Create bin attributes using the features it contains when exporting \n * @param {ol.Feature} bin the bin to export\n * @param {Array<ol.Features>} features the features it contains\n */\nol.source.BinBase.prototype._flatAttributes = function(/*bin, features*/) {\n};\n/**\n * Get the orginal source\n * @return {ol.source.Vector}\n */\nol.source.BinBase.prototype.getSource = function () {\n  return this._origin;\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n  @classdesc\n  ol.source.DBPedia is a DBPedia layer source that load DBPedia located content in a vector layer.\n  olx.source.DBPedia: olx.source.Vector\n  {\turl: {string} Url for DBPedia SPARQL \n  }\n  Inherits from:\n  <ol.source.Vector>\n*/\n/**\n* @constructor ol.source.DBPedia\n* @extends {ol.source.Vector}\n* @param {olx.source.DBPedia=} opt_options\n*/\nol.source.DBPedia = function(opt_options) {\n  var options = opt_options || {};\n  options.loader = this._loaderFn;\n  /** Url for DBPedia SPARQL */\n  this._url = options.url || \"http://fr.dbpedia.org/sparql\";\n  /** Max resolution to load features  */\n  this._maxResolution = options.maxResolution || 100;\n  /** Result language */\n  this._lang = options.lang || \"fr\";\n  /** Query limit */\n  this._limit = options.limit || 1000;\n  /** Default attribution */\n  if (!options.attributions) options.attributions = [ \"&copy; <a href='http://dbpedia.org/'>DBpedia</a> CC-by-SA\" ];\n  // Bbox strategy : reload at each move\n    if (!options.strategy) options.strategy = ol.loadingstrategy.bbox;\n  ol.source.Vector.call (this, options);\n};\nol.ext.inherits(ol.source.DBPedia, ol.source.Vector);\n/** Decode RDF attributes and choose to add feature to the layer\n* @param {feature} the feature\n* @param {attributes} RDF attributes\n* @param {lastfeature} last feature added (null if none)\n* @return {boolean} true: add the feature to the layer\n* @API stable\n*/\nol.source.DBPedia.prototype.readFeature = function (feature, attributes, lastfeature) {\n  // Copy RDF attributes values\n  for (var i in attributes) {\n    if (attributes[i].type==='uri') attributes[i].value = encodeURI(attributes[i].value);\n    feature.set (i, attributes[i].value);\n  }\n  // Prevent same feature with different type duplication\n  if (lastfeature && lastfeature.get(\"subject\") == attributes.subject.value) {\n    // Kepp dbpedia.org type ?\n    // if (bindings[i].type.match (\"dbpedia.org\") lastfeature.get(\"type\") = bindings[i].type.value;\n    // Concat types\n    lastfeature.set(\"type\", lastfeature.get(\"type\") +\"\\n\"+ attributes.type.value);\n    return false;\n  } else {\n    return true;\n  }\n};\n/** Set RDF query subject, default: select label, thumbnail, abstract and type\n* @API stable\n*/\nol.source.DBPedia.prototype.querySubject = function () {\n  return \"?subject rdfs:label ?label. \"\n    + \"OPTIONAL {?subject dbpedia-owl:thumbnail ?thumbnail}.\"\n    + \"OPTIONAL {?subject dbpedia-owl:abstract ?abstract} . \"\n    + \"OPTIONAL {?subject rdf:type ?type}\";\n}\n/** Set RDF query filter, default: select language\n* @API stable\n*/\nol.source.DBPedia.prototype.queryFilter = function () {\n  return\t \"lang(?label) = '\"+this._lang+\"' \"\n    + \"&& lang(?abstract) = '\"+this._lang+\"'\"\n  // Filter on type \n  //+ \"&& regex (?type, 'Monument|Sculpture|Museum', 'i')\"\n}\n/** Loader function used to load features.\n* @private\n*/\nol.source.DBPedia.prototype._loaderFn = function(extent, resolution, projection) {\n  if (resolution > this._maxResolution) return;\n  var self = this;\n  var bbox = ol.proj.transformExtent(extent, projection, \"EPSG:4326\");\n  // SPARQL request: for more info @see http://fr.dbpedia.org/\n  var query =\t\"PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> \"\n        + \"SELECT DISTINCT * WHERE { \"\n        + \"?subject geo:lat ?lat . \"\n        + \"?subject geo:long ?long . \"\n        + this.querySubject()+\" . \"\n        + \"FILTER(\"+this.queryFilter()+\") . \"\n        // Filter bbox\n        + \"FILTER(xsd:float(?lat) <= \" + bbox[3] + \" && \" + bbox[1] + \" <= xsd:float(?lat) \"\n        + \"&& xsd:float(?long) <= \" + bbox[2] + \" && \" + bbox[0] + \" <= xsd:float(?long) \"\n        + \") . \"\n        + \"} LIMIT \"+this._limit;\n  // Ajax request to get the tile\n  ol.ext.Ajax.get({\n    url: this._url,\n    data: { query: query, format:\"json\" },\n    success: function(data) {\n      var bindings = data.results.bindings;\n      var features = [];\n      var att, pt, feature, lastfeature = null;\n      for ( var i in bindings ) {\n        att = bindings[i];\n        pt = [Number(bindings[i].long.value), Number(bindings[i].lat.value)];\n        feature = new ol.Feature(new ol.geom.Point(ol.proj.transform (pt,\"EPSG:4326\",projection)));\n        if (self.readFeature(feature, att, lastfeature)) {\n          features.push(feature);\n          lastfeature = feature;\n        }\n      }\n      self.addFeatures(features);\n    }});\n};\nol.style.clearDBPediaStyleCache;\nol.style.dbPediaStyleFunction; \n(function(){\n// Style cache\nvar styleCache = {};\n/** Reset the cache (when fonts are loaded)\n*/\nol.style.clearDBPediaStyleCache = function() {\n  styleCache = {};\n}\n/** Get a default style function for dbpedia\n* @param {} options\n* @param {string|function|undefined} options.glyph a glyph name or a function that takes a feature and return a glyph\n* @param {number} options.radius radius of the symbol, default 8\n* @param {ol.style.Fill} options.fill style for fill, default navy\n* @param {ol.style.stroke} options.stroke style for stroke, default 2px white\n* @param {string} options.prefix a prefix if many style used for the same type\n*\n* @require ol.style.FontSymbol and FontAwesome defs are required for dbPediaStyleFunction()\n*/\nol.style.dbPediaStyleFunction = function(options) {\n  if (!options) options={};\n  // Get font function using dbPedia type\n  var getFont;\n  switch (typeof(options.glyph)) {\n    case \"function\": getFont = options.glyph; break;\n    case \"string\": getFont = function(){ return options.glyph; }; break;\n    default: {\n      getFont = function (f) {\n        var type = f.get(\"type\");\n        if (type) {\n          if (type.match(\"/Museum\")) return \"fa-camera\";\n          else if (type.match(\"/Monument\")) return \"fa-building\";\n          else if (type.match(\"/Sculpture\")) return \"fa-android\";\n          else if (type.match(\"/Religious\")) return \"fa-institution\";\n          else if (type.match(\"/Castle\")) return \"fa-key\";\n          else if (type.match(\"Water\")) return \"fa-tint\";\n          else if (type.match(\"Island\")) return \"fa-leaf\";\n          else if (type.match(\"/Event\")) return \"fa-heart\";\n          else if (type.match(\"/Artwork\")) return \"fa-asterisk\";\n          else if (type.match(\"/Stadium\")) return \"fa-futbol-o\";\n          else if (type.match(\"/Place\")) return \"fa-street-view\";\n        }\n        return \"fa-star\";\n      }\n      break;\n    }\n  }\n  // Default values\n  var radius = options.radius || 8;\n  var fill = options.fill || new ol.style.Fill({ color:\"navy\"});\n  var stroke = options.stroke || new ol.style.Stroke({ color: \"#fff\", width: 2 });\n  var prefix = options.prefix ? options.prefix+\"_\" : \"\";\n  // Vector style function\n  return function (feature) {\n    var glyph = getFont(feature);\n    var k = prefix + glyph;\n    var style = styleCache[k];\n    if (!style) {\n      styleCache[k] = style = new ol.style.Style ({\n        image: new ol.style.FontSymbol({\n          glyph: glyph, \n          radius: radius, \n          fill: fill,\n          stroke: stroke\n        })\n      });\n    }\n    return [style];\n  }\n};\n})();\n\n/*\tCopyright (c) 2018 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** DFCI source: a source to display the French DFCI grid on a map\n * @see http://ccffpeynier.free.fr/Files/dfci.pdf\n * @constructor ol.source.DFCI\n * @extends {ol/source/Vector}\n * @param {any} options Vector source options\n *  @param {Array<Number>} resolutions a list of resolution to change the drawing level, default [1000,100,20]\n */\nol.source.DFCI = function(options) {\n\toptions = options || {};\n\toptions.loader = this._calcGrid;\n  options.strategy =  function(extent, resolution) {\n    if (this.resolution && this.resolution != resolution){\n      this.clear();\n      this.refresh();\n    }\n    return [extent];\n  }\n  this._bbox = [[0,1600000],[11*100000, 1600000+10*100000]];\n  ol.source.Vector.call (this, options);\n  this.set('resolutions', options.resolutions || [1000,100,20]);\n  // Add Lambert IIe proj \n  if (!proj4.defs[\"EPSG:27572\"]) proj4.defs(\"EPSG:27572\",\"+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs\");\n  ol.proj.proj4.register(proj4);\n};\nol.ext.inherits(ol.source.DFCI, ol.source.Vector);\n/** Cacluate grid according extent/resolution\n */\nol.source.DFCI.prototype._calcGrid = function (extent, resolution, projection) {\n  // Show step 0\n  var f, ext, res = this.get('resolutions');\n  if (resolution > (res[0] || 1000)) {\n    if (this.resolution != resolution) {\n      if (!this._features0) {\n        ext = [this._bbox[0][0], this._bbox[0][1],this._bbox[1][0], this._bbox[1][1]];\n        this._features0 = this._getFeatures(0, ext, projection);\n      }\n      this.addFeatures(this._features0);\n    }\n  }\n  else if (resolution > (res[1] || 100)) {\n    this.clear();\n    ext = ol.proj.transformExtent(extent, projection, 'EPSG:27572');\n    f = this._getFeatures(1, ext, projection)\n    this.addFeatures(f);\n  }\n  else if (resolution > (res[2] || 0)) {\n    this.clear();\n    ext = ol.proj.transformExtent(extent, projection, 'EPSG:27572');\n    f = this._getFeatures(2, ext, projection)\n    this.addFeatures(f);\n  }\n  else {\n    this.clear();\n    ext = ol.proj.transformExtent(extent, projection, 'EPSG:27572');\n    f = this._getFeatures(3, ext, projection)\n    this.addFeatures(f);\n  }\n  // reset load\n  this.resolution = resolution;\n};\n/**\n * Get middle point\n * @private\n */\nol.source.DFCI.prototype._midPt = function(p1,p2) {\n  return [(p1[0]+p2[0])/2, (p1[1]+p2[1])/2];\n};\n/**\n * Get feature with geom\n * @private\n */\nol.source.DFCI.prototype._trFeature = function(geom, id, level, projection) {\n  var g  = new ol.geom.Polygon([geom]);\n  var f = new ol.Feature(g.transform('EPSG:27572', projection));\n  f.set('id', id);\n  f.set('level', level);\n  return f;\n};\n/** Get features\n * \n */\nol.source.DFCI.prototype._getFeatures = function (level, extent, projection) {\n  var features = [];\n  var i;\n  var step = 100000;\n  if (level>0) step /= 5;\n  if (level>1) step /= 10;\n  var p0 = [\n    Math.max(this._bbox[0][0], Math.floor(extent[0]/step)*step), \n    Math.max(this._bbox[0][1], Math.floor(extent[1]/step)*step)\n  ];\n  var p1 = [\n    Math.min(this._bbox[1][0]+99999, Math.floor(extent[2]/step)*step), \n    Math.min(this._bbox[1][1]+99999, Math.floor(extent[3]/step)*step)\n  ];\n  for (var x=p0[0]; x<=p1[0]; x += step) {\n    for (var y=p0[1]; y<=p1[1]; y += step) {\n      var p, geom = [ [x,y], [x+step, y], [x+step, y+step], [x , y+step], [x,y]];\n      if (level>2) {\n        var m = this._midPt(geom[0],geom[2]);\n        // .5\n        var g = [];\n        for (i=0; i<geom.length; i++) {\n          g.push(this._midPt(geom[i],m))\n        }\n        features.push(this._trFeature(g, ol.coordinate.toDFCI([x,y], 2)+'.5', level, projection));\n        // .1 > .4\n        for (i=0; i<4; i++) {\n          g = [];\n          g.push(geom[i]);\n          g.push(this._midPt(geom[i],geom[(i+1)%4]));\n          g.push(this._midPt(m,g[1]));\n          g.push(this._midPt(m,geom[i]));\n          p = this._midPt(geom[i],geom[(i+3)%4]);\n          g.push(this._midPt(m,p));\n          g.push(p);\n          g.push(geom[i]);\n          features.push(this._trFeature(g, ol.coordinate.toDFCI([x,y], 2)+'.'+(4-i), level, projection));\n        }\n      } else {\n        features.push(this._trFeature(geom, ol.coordinate.toDFCI([x,y], level), level, projection));\n      }\n    }\n  }\n  return features\n};\n\n/*\tCopyright (c) 2018 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** DayNight source: a source to display day/night on a map\n * @constructor \n * @extends {ol.source.Vector}\n * @param {any} options Vector source options\n *  @param {string|Date} time source date time\n *  @param {number} step step in degree for coordinate precision\n */\nol.source.DayNight = function(options) {\n  options = options || {};\n  options.loader = this._loader\n  options.strategy = ol.loadingstrategy.all;\n  ol.source.Vector.call (this, options);\n  this.set('time', options.time || new Date());\n  this.set('step', options.step || 1);\n};\nol.ext.inherits(ol.source.DayNight, ol.source.Vector);\n(function(){\n/** Loader\n * @private\n */\nol.source.DayNight.prototype._loader = function(extent, resolution, projection) {\n  var lonlat = this.getCoordinates(this.get('time'));\n  var geom = new ol.geom.Polygon([lonlat]);\n  geom.transform('EPSG:4326', projection);\n  this.addFeature(new ol.Feature(geom));\n};\n/** Set source date time\n * @param {string|Date} time source date time\n */\nol.source.DayNight.prototype.setTime = function(time) {\n  this.set('time', time);\n  this.refresh();\n};\n/** Compute the position of the Sun in ecliptic coordinates at julianDay.\n * @see http://en.wikipedia.org/wiki/Position_of_the_Sun \n * @param {number} julianDay\n * @private\n */\nfunction _sunEclipticPosition(julianDay) {\n  var deg2rad = Math.PI / 180;\n  // Days since start of J2000.0\n  var n = julianDay - 2451545.0;\n  // mean longitude of the Sun\n  var L = 280.460 + 0.9856474 * n;\n  L %= 360;\n  // mean anomaly of the Sun\n  var g = 357.528 + 0.9856003 * n;\n  g %= 360;\n  // ecliptic longitude of Sun\n  var lambda = L + 1.915 * Math.sin(g * deg2rad) +\n    0.02 * Math.sin(2 * g * deg2rad);\n  // distance from Sun in AU\n  var R = 1.00014 - 0.01671 * Math.cos(g * deg2rad) -\n    0.0014 * Math.cos(2 * g * deg2rad);\n  return { lambda: lambda, R: R };\n}\n/** \n * @see http://en.wikipedia.org/wiki/Axial_tilt#Obliquity_of_the_ecliptic_.28Earth.27s_axial_tilt.29\n * @param {number} julianDay\n * @private\n */\nfunction _eclipticObliquity(julianDay) {\n  var n = julianDay - 2451545.0;\n  // Julian centuries since J2000.0\n  var T = n / 36525;\n  var epsilon = 23.43929111 -\n    T * (46.836769 / 3600\n      - T * (0.0001831 / 3600\n        + T * (0.00200340 / 3600\n          - T * (0.576e-6 / 3600\n            - T * 4.34e-8 / 3600))));\n  return epsilon;\n}\n/* Compute the Sun's equatorial position from its ecliptic position.\n * @param {number} sunEclLng sun lon in degrees\n * @param {number} eclObliq secliptic position in degrees\n * @return {number} position in degrees\n * @private\n */\nfunction _sunEquatorialPosition(sunEclLon, eclObliq) {\n  var rad2deg = 180 / Math.PI;\n  var deg2rad = Math.PI / 180;\n  var alpha = Math.atan(Math.cos(eclObliq * deg2rad)\n    * Math.tan(sunEclLon * deg2rad)) * rad2deg;\n  var delta = Math.asin(Math.sin(eclObliq * deg2rad)\n    * Math.sin(sunEclLon * deg2rad)) * rad2deg;\n  var lQuadrant = Math.floor(sunEclLon / 90) * 90;\n  var raQuadrant = Math.floor(alpha / 90) * 90;\n  alpha = alpha + (lQuadrant - raQuadrant);\n  return {alpha: alpha, delta: delta};\n}\n/** Get night-day separation line\n * @param {string} time DateTime string, default yet\n * @param {string} options use 'line' to get the separation line, 'day' to get the day polygon, 'night' to get the night polygon or 'daynight' to get both polygon, default 'night'\n * @return {Array<ol.Point>|Array<Array<ol.Point>>}\n */\nol.source.DayNight.prototype.getCoordinates = function (time, options) {\n  var rad2deg = 180 / Math.PI;\n  var deg2rad = Math.PI / 180;\n  var date = time ? new Date(time) : new Date();\n  // Calculate the present UTC Julian Date. \n  // Function is valid after the beginning of the UNIX epoch 1970-01-01 and ignores leap seconds. \n  var julianDay = (date / 86400000) + 2440587.5;\n  // Calculate Greenwich Mean Sidereal Time (low precision equation).\n  // http://aa.usno.navy.mil/faq/docs/GAST.php \n  var gst = (18.697374558 + 24.06570982441908 * (julianDay - 2451545.0)) % 24;\n  var lonlat = [];\n  var sunEclPos = _sunEclipticPosition(julianDay);\n  var eclObliq = _eclipticObliquity(julianDay);\n  var sunEqPos = _sunEquatorialPosition(sunEclPos.lambda, eclObliq);\n  var step = this.get('step') || 1;\n  for (var i = -180; i <= 180; i += step) {\n    var lon = i;\n    // Hour angle (indegrees) of the sun for a longitude on Earth.\n    var ha = (gst * 15 + lon) - sunEqPos.alpha;\n    // Latitude     \n    var lat = Math.atan(-Math.cos(ha * deg2rad) /\n      Math.tan(sunEqPos.delta * deg2rad)) * rad2deg;\n    // New point\n    lonlat.push([lon, lat]);\n  }\n  switch (options) {\n    case 'line': break;\n    case 'day': sunEqPos.delta *= -1;\n    // fallthrough\n    default: {\n      // Close polygon\n      lat = (sunEqPos.delta < 0) ? 90 : -90;\n      for(var tlon=180; tlon>=-180; tlon-=step){\n        lonlat.push([tlon,lat]);\n      }\n      lonlat.push(lonlat[0])\n      break;\n    }\n  }\n  // Return night + day polygon\n  if (options === 'daynight') {\n    var day = [];\n    lonlat.forEach(function (t) { day.push(t.slice()); });\n    day[0][1] = -day[0][1];\n    day[day.length-1][1] = -day[0][1];\n    day[day.length-1][1] = -day[0][1];\n    lonlat = [ lonlat, day ];\n  }\n  // Return polygon\n  return lonlat;\n};\n})();\n\n/*eslint no-constant-condition: [\"error\", { \"checkLoops\": false }]*/\n/** Delaunay source\n * Calculate a delaunay triangulation from points in a source\n * @param {*} options extend ol/source/Vector options\n *  @param {ol/source/Vector} options.source the source that contains the points\n */\nol.source.Delaunay = function(options) {\n  options = options || {};\n  this._nodes = options.source;\n  delete options.source;\n  ol.source.Vector.call (this, options);\n  // Convex hull\n  this.hull = [];\n  // A new node is added to the source node: calculate the new triangulation\n  this._nodes.on('addfeature', this._onAddNode.bind(this));\n  // A new node is removed from the source node: calculate the new triangulation\n  this._nodes.on('removefeature', this._onRemoveNode.bind(this));\n  this.set ('epsilon', options.epsilon || .0001)\n};\nol.ext.inherits(ol.source.Delaunay, ol.source.Vector);\n/** Clear source (and points)\n * @param {boolean} opt_fast\n */\nol.source.Delaunay.prototype.clear = function(opt_fast) {\n  ol.source.Vector.prototype.clear.call(this, opt_fast);\n  this.getNodeSource().clear(opt_fast);\n};\n/** Add a new triangle in the source\n * @param {Array<ol/coordinates>} pts\n */\nol.source.Delaunay.prototype._addTriangle = function(pts) {\n  pts.push(pts[0]);\n  var triangle = new ol.Feature(new ol.geom.Polygon([pts]));\n  this.addFeature(triangle);\n  this.flip.push(triangle);\n  return triangle;\n};\n/** Get nodes \n */\nol.source.Delaunay.prototype.getNodes = function () {\n  return this._nodes.getFeatures();\n};\n/** Get nodes source\n */\nol.source.Delaunay.prototype.getNodeSource = function () {\n  return this._nodes;\n};\n/**\n * A point has been removed\n * @param {ol/source/Vector.Event} evt \n */\nol.source.Delaunay.prototype._onRemoveNode = function(evt) {\n  // console.log(evt)\n  var pt = evt.feature.getGeometry().getCoordinates();\n  if (!pt) return;\n  // Still there (when removing duplicated points)\n  if (this.getNodesAt(pt).length) return;\n  // console.log('removenode', evt.feature)\n  // Get associated triangles\n  var triangles = this.getTrianglesAt(pt);\n  this.flip=[];\n  // Get hole\n  var i;\n  var edges = [];\n  while (triangles.length) {\n    var tr = triangles.pop()\n    this.removeFeature(tr);\n    tr = tr.getGeometry().getCoordinates()[0];\n    var pts = [];\n    for (i=0; i<3; i++) {\n      p = tr[i];\n      if (!ol.coordinate.equal(p,pt)) {\n        pts.push(p);\n      }\n    }\n    edges.push(pts);\n  }\n  pts = edges.pop();\n/* DEBUG\nvar se = '';\nedges.forEach(function(e){\n  se += ' - '+this.listpt(e);\n}.bind(this));\nconsole.log('EDGES', se);\n*/\n  i = 0;\n  function testEdge(p0, p1, index) {\n    if (ol.coordinate.equal(p0, pts[index])) {\n      if (index) pts.push(p1);\n      else pts.unshift(p1);\n      return true\n    }\n    return false;\n  }\n  while (true) {\n    var e = edges[i];\n    if ( testEdge(e[0], e[1], 0) \n      || testEdge(e[1], e[0], 0)\n      || testEdge(e[0], e[1], pts.length-1)\n      || testEdge(e[1], e[0], pts.length-1)\n    ) {\n      edges.splice(i,1);\n      i = 0;\n    } else {\n      i++\n    }\n    if (!edges.length) break;\n    if (i>=edges.length) {\n//      console.log(this.listpt(pts), this.listpt(edges));\n      throw '[DELAUNAY:removePoint] No edge found';\n    }\n  }\n  // Closed = interior\n// console.log('PTS', this.listpt(pts))\n  var closed = ol.coordinate.equal(pts[0], pts[pts.length-1]);\n  if (closed) pts.pop();\n  // Update convex hull: remove pt + add new ones\n  var p;\n  for (i; p=this.hull[i]; i++) {\n    if (ol.coordinate.equal(pt,p)) {\n      this.hull.splice(i,1);\n      break;\n    }\n  }\n  this.hull = ol.coordinate.convexHull(this.hull.concat(pts));\n// select.getFeatures().clear();\n  // \n  var clockwise = function (t) {\n    var i1, s = 0;\n    for (var i=0; i<t.length; i++) {\n      i1 = (i+1) % t.length;\n      s += (t[i1][0] - t[i][0]) * (t[i1][1] + t[i][1]);\n    }\n//    console.log(s)\n    return (s>=0 ? 1:-1)\n  };\n  // Add ears\n  // interior point : ear area and object area have the same sign\n  // extrior point : add a new point and close\n  var clock;\n  var enveloppe = pts.slice();\n  if (closed) {\n    clock = clockwise(pts);\n  } else {\n//    console.log('ouvert', pts, pts.slice().push(pt))\n    enveloppe.push(pt);\n    clock = clockwise(enveloppe);\n  }\n// console.log('S=',clock,'CLOSED',closed)\n// console.log('E=',this.listpt(enveloppe))\n  for (i=0; i<=pts.length+1; i++) {\n    if (pts.length<3) break;\n    var t = [\n      pts[i % pts.length],\n      pts[(i+1) % pts.length],\n      pts[(i+2) % pts.length] \n    ];\n    if (clockwise(t)===clock) {\n      var ok = true;\n      for (var k=i+3; k<i+pts.length; k++) {\n//        console.log('test '+k, this.listpt([pts[k % pts.length]]))\n        if (this.inCircle(pts[k % pts.length], t)) {\n          ok = false;\n          break;\n        }\n      }\n      if (ok) {\n// console.log(this.listpt(t),'ok');\n        this._addTriangle(t);\n        // remove\n        pts.splice((i+1) % pts.length, 1);\n        // and restart\n        i = -1;\n      }\n    }\n// else console.log(this.listpt(t),'nok');\n  }\n/* DEBUG * /\nif (pts.length>3) console.log('oops');\nconsole.log('LEAV',this.listpt(pts));\nvar ul = $('ul.triangles').html('');\n$('<li>')\n.text('E:'+this.listpt(enveloppe)+' - '+clock+' - '+closed)\n.data('triangle', new ol.Feature(new ol.geom.Polygon([enveloppe])))\n.click(function(){\n  var t = $(this).data('triangle');\n  select.getFeatures().clear();\n  select.getFeatures().push(t);\n})\n.appendTo(ul);\nfor (var i=0; i<this.flip.length; i++) {\n  $('<li>')\n    .text(this.listpt(this.flip[i].getGeometry().getCoordinates()[0])\n        +' - ' + clockwise(this.flip[i].getGeometry().getCoordinates()[0]))\n    .data('triangle', this.flip[i])\n    .click(function(){\n      var t = $(this).data('triangle');\n      select.getFeatures().clear();\n      select.getFeatures().push(t);\n    })\n    .appendTo(ul);\n}\n/**/\n  // Flip?\n  this.flipTriangles();\n};\n/**\n * A new point has been added\n * @param {ol/source/VectorEvent} e \n */\nol.source.Delaunay.prototype._onAddNode = function(e) {\n  var finserted = e.feature;\n  var i, p;\n  // Not a point!\n  if (finserted.getGeometry().getType() !== 'Point') {\n    this._nodes.removeFeature(finserted);\n    return;\n  }\n  // Reset flip table\n  this.flip = [];\n  var nodes = this.getNodes();\n  // The point\n  var pt = finserted.getGeometry().getCoordinates();\n  // Test existing point\n  if (this.getNodesAt(pt).length > 1) {\n    // console.log('remove duplicated points')\n    this._nodes.removeFeature(finserted);\n    return;\n  }\n  // Triangle needs at least 3 points\n  if (nodes.length <= 3) {\n    if (nodes.length===3) {\n      var pts = [];\n      for (i=0; i<3; i++) pts.push(nodes[i].getGeometry().getCoordinates());\n      this._addTriangle(pts);\n      this.hull = ol.coordinate.convexHull(pts);\n    }\n    return;\n  }\n  // Get the triangle\n  var t = this.getFeaturesAtCoordinate(pt)[0];\n  if (t) {\n    this.removeFeature(t);\n    t.set('del', true);\n    var c = t.getGeometry().getCoordinates()[0];\n    for (i=0; i<3; i++) {\n      this._addTriangle([ pt, c[i], c[(i+1)%3]]);\n    }\n  } else {\n    // Calculate new convex hull\n    var hull2 = this.hull.slice();\n    hull2.push(pt);\n    hull2 = ol.coordinate.convexHull(hull2);\n    // Search for points\n    for (i=0; p=hull2[i]; i++) {\n      if (ol.coordinate.equal(p,pt)) break;\n    }\n    i = (i!==0 ? i-1 : hull2.length-1);\n    var p0 = hull2[i];\n    var stop = hull2[(i+2) % hull2.length];\n    for (i=0; p=this.hull[i]; i++) {\n      if (ol.coordinate.equal(p,p0)) break;\n    }\n    // Connect to the hull\n    while (true) {\n      // DEBUG: prevent infinit loop\n      if (i>1000) {\n        console.error('[DELAUNAY:addPoint] Too many iterations')\n        break;\n      }\n      i++;\n      p = this.hull[i % this.hull.length];\n      this._addTriangle([pt, p, p0]);\n      p0 = p;\n      if (p[0] === stop[0] && p[1] === stop[1]) break;\n    }\n    this.hull = hull2;\n  }\n  this.flipTriangles();\n};\n/** Flipping algorithme: test new inserted triangle and flip\n */\nol.source.Delaunay.prototype.flipTriangles = function ()\t{\n  var count = 1000; // Count to prevent too many iterations\n  var pi;\n  while (this.flip.length) {\n    // DEBUG: prevent infinite loop\n    if (count--<0) {\n      console.error('[DELAUNAY:flipTriangles] Too many iterations')\n      break;\n    }\n    var tri = this.flip.pop();\n    if (tri.get('del')) continue;\n    var ti = tri.getGeometry().getCoordinates()[0];\n    for (var k=0; k<3; k++) {\n      // Get facing triangles\n      var mid = [(ti[(k+1)%3][0]+ti[k][0])/2, (ti[(k+1)%3][1]+ti[k][1])/2];\n      var triangles = this.getTrianglesAt(mid);\n      var pt1 = null;\n      // Get opposite point\n      if (triangles.length>1) {\n        var t0 = triangles[0].getGeometry().getCoordinates()[0];\n        var t1 = triangles[1].getGeometry().getCoordinates()[0];\n        for (pi=0; pi<t1.length; pi++) {\n          if (!this._ptInTriangle(t1[pi], t0)) {\n            pt1 = t1[pi];\n            break;\n          }\n        }\n      }\n      if (pt1) {\n        // Is in circle ?\n        if (this.inCircle(pt1, t0)) {\n          var pt2;\n          // Get opposite point\n          for (pi=0; pi<t0.length; pi++) {\n            if (!this._ptInTriangle(t0[pi], t1)) {\n              pt2 = t0.splice(pi,1)[0];\n              break;\n            }\n          }\n          // Flip triangles\n          if (this.intersectSegs([pt1, pt2], t0)) {\n            while (triangles.length) {\n              var tmp = triangles.pop();\n              tmp.set('del', true);\n              this.removeFeature(tmp);\n            }\n            this._addTriangle([pt1, pt2, t0[0]]);\n            this._addTriangle([pt1, pt2, t0[1]]);\n          }\n        }\n      }\n    }\n  }\n};\n/** Test intersection beetween 2 segs\n * @param {Array<ol.coordinates>} d1\n * @param {Array<ol.coordinates>} d2\n * @return {bbolean}\n */\nol.source.Delaunay.prototype.intersectSegs = function (d1, d2)\t{\n  var d1x = d1[1][0] - d1[0][0];\n  var d1y = d1[1][1] - d1[0][1];\n  var d2x = d2[1][0] - d2[0][0];\n  var d2y = d2[1][1] - d2[0][1];\n  var det = d1x * d2y - d1y * d2x;\n  if (det != 0) {\n    var k = (d1x * d1[0][1] - d1x * d2[0][1] - d1y * d1[0][0] + d1y * d2[0][0]) / det;\n    // Intersection: return [d2[0][0] + k*d2x, d2[0][1] + k*d2y];\n    return (0<k && k<1);\n  }\n  else return false;\n};\n/** Test pt is a triangle's node\n * @param {ol.coordinate} pt\n * @param {Array<ol.coordinate>} triangle\n * @return {boolean}\n */\nol.source.Delaunay.prototype._ptInTriangle = function(pt, triangle) {\n  for (var i=0, p; p=triangle[i]; i++) {\n    if (ol.coordinate.equal(pt,p)) return true;\n  }\n  return false;\n};\n/** List points in a triangle (assume points get an id) for debug purposes\n * @param {Array<ol.coordinate>} pts\n * @return {String} ids list\n */\nol.source.Delaunay.prototype.listpt = function (pts) {\n  var s = '';\n  for (var i=0, p; p = pts[i]; i++) {\n    var c = this._nodes.getClosestFeatureToCoordinate(p);\n    if (!ol.coordinate.equal(c.getGeometry().getCoordinates(), p)) c=null;\n    s += (s?', ':'') + (c ? c.get('id') : '?');\n  }\n  return s;\n};\n/** Test if coord is within triangle's circumcircle \n * @param {ol.coordinate} coord\n * @param {Array<ol.coordinate>} triangle\n * @return {boolean}\n */\nol.source.Delaunay.prototype.inCircle = function (coord, triangle) {\n  var c = this.getCircumCircle(triangle);\n  return ol.coordinate.dist2d(coord, c.center) < c.radius;\n}\n/** Calculate the circumcircle of a triangle\n * @param {Array<ol.coordinate>} triangle\n * @return {*}\n */\nol.source.Delaunay.prototype.getCircumCircle = function (triangle) {\n  var x1 = triangle[0][0];\n  var y1 = triangle[0][1];\n  var x2 = triangle[1][0];\n  var y2 = triangle[1][1];\n  var x3 = triangle[2][0];\n  var y3 = triangle[2][1];\n  var m1 = (x1-x2)/(y2-y1);\n  var m2 = (x1-x3)/(y3-y1);\n  var b1 = ((y1+y2)/2) - m1*(x1+x2)/2;\n  var b2 = ((y1+y3)/2) - m2*(x1+x3)/2;\n  var cx = (b2-b1)/(m1-m2);\n  var cy = m1*cx + b1;\n  var center = [cx, cy];\n  return  { \n    center: center, \n    radius: ol.coordinate.dist2d(center,triangle[0])\n  };\n};\n/** Get triangles at a point\n */\nol.source.Delaunay.prototype.getTrianglesAt = function(coord) {\n  var extent = ol.extent.buffer (ol.extent.boundingExtent([coord]), this.get('epsilon'));\n  var result = [];\n  this.forEachFeatureIntersectingExtent(extent, function(f){\n    result.push(f);\n  });\n  return result;\n};\n/** Get nodes at a point\n */\nol.source.Delaunay.prototype.getNodesAt = function(coord) {\n  var extent = ol.extent.buffer (ol.extent.boundingExtent([coord]), this.get('epsilon'));\n  return this._nodes.getFeaturesInExtent(extent);\n};\n/** Get Voronoi\n * @param {boolean} border include border, default false\n * @return { Array< ol.geom.Polygon > }\n */\nol.source.Delaunay.prototype.calculateVoronoi = function(border) {\n  var voronoi = [];\n  this.getNodes().forEach(function(f) {\n    var pt = f.getGeometry().getCoordinates();\n    var isborder = false;\n    if (border !== true) {\n      for (var i=0; i<this.hull.length; i++) {\n        if (ol.coordinate.equal(pt, this.hull[i])) {\n          isborder = true;\n          break;\n        }\n      }\n    }\n    if (!isborder) {\n      var tr = this.getTrianglesAt(pt);\n      var pts = [];\n      tr.forEach(function(triangle) {\n        var c = this.getCircumCircle(triangle.getGeometry().getCoordinates()[0]);\n        pts.push({\n          pt: c.center,\n          d: Math.atan2(c.center[1]-pt[1],c.center[0]-pt[0])\n        })\n      }.bind(this));\n      pts.sort(function(a,b) { return a.d - b.d });\n      var poly = [];\n      pts.forEach(function(p) {\n        poly.push(p.pt);\n      });\n      poly.push(poly[0]);\n      var prop = f.getProperties();\n      prop.geometry = new ol.geom.Polygon([poly]);\n      voronoi.push(new ol.Feature(prop));\n    }\n  }.bind(this));\n  return voronoi;\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A source that use a set of feature to collect data on it.\n * If a binSource is provided the bin is recalculated when features change.\n * @constructor\n * @extends {ol.source.Vector}\n * @param {Object} options ol.source.VectorOptions + grid option\n *  @param {ol.source.Vector} options.source source to collect in the bin\n *  @param {ol.source.Vector} options.binSource a source to use as bin collector, default none\n *  @param {Array<ol.Feature>} options.features the features, ignored if binSource is provided, default none\n *  @param {number} [options.size] size of the grid in meter, default 200m\n *  @param {function} [options.geometryFunction] Function that takes an ol.Feature as argument and returns an ol.geom.Point as feature's center.\n *  @param {function} [options.flatAttributes] Function takes a bin and the features it contains and aggragate the features in the bin attributes when saving\n */\nol.source.FeatureBin = function (options) {\n  options = options || {};\n  if (options.binSource) {\n    this._sourceFeature = options.binSource;\n    // When features change recalculate the bin...\n    var timout;\n    this._sourceFeature.on(['addfeature','changefeature','removefeature'], function() {\n      if (timout) {\n        // Do it only one time\n        clearTimeout(timout);\n      }\n      timout = setTimeout(function () {\n        this.reset();\n      }.bind(this));\n    }.bind(this));\n  } else {\n    this._sourceFeature = new ol.source.Vector ({ features: options.features || [] });\n  }\n  ol.source.BinBase.call(this, options);\n};\nol.ext.inherits(ol.source.FeatureBin, ol.source.BinBase);\n/** Set features to use as bin collector\n * @param {ol.Feature} features\n */\nol.source.FeatureBin.prototype.setFeatures = function (features) {\n  this._sourceFeature.clear();\n  this._sourceFeature.addFeatures(features || []);\n  this.reset();\n};\n/** Get the grid geometry at the coord \n * @param {ol.Coordinate} coord\n * @returns {ol.geom.Polygon} \n * @api\n */\nol.source.FeatureBin.prototype.getGridGeomAt = function (coord, attributes) {\n  var f = this._sourceFeature.getFeaturesAtCoordinate(coord)[0];\n  if (!f) return null;\n  var a = f.getProperties();\n  for (var i in a) {\n    if (i!=='geometry') attributes[i] = a[i];\n  }\n  return f.getGeometry();\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n  ol.source.GeoImage is a layer source with georeferencement to place it on a map.\n  olx.source.GeoImageOptions:\n  {\turl: {string} url of the static image\n    image: {image} the static image, if not provided, use url to load an image\n    imageCenter: {ol.Coordinate} of the center of the image\n    imageScale: {ol.Size|Number} [scalex, scaley] of the image\n    imageRotate: {number} angle of the image in radian, default 0\n    imageCrop: {ol.Extent} of the image to be show (in the image) default: [0,0,imageWidth,imageHeight]\n    imageMask: {Array.<ol.Coordinate>} - linestring to mask the image on the map\n  }\n*/\n/** Layer source with georeferencement to place it on a map\n* @constructor \n* @extends {ol.source.ImageCanvas}\n* @param {olx.source.GeoImageOptions=} options\n*/\nol.source.GeoImage = function(opt_options) {\n  var options = { \n    attributions: opt_options.attributions,\n    logo: opt_options.logo,\n    projection: opt_options.projection\n  };\n  // options.projection = opt_options.projection;\n  // Coordinate of the image center \n  this.center = opt_options.imageCenter;\n  // Scale of the image \n  this.scale = opt_options.imageScale;\n  // Rotation of the image\n  this.rotate = opt_options.imageRotate ? opt_options.imageRotate : 0;\n  // Crop of the image\n  this.crop = opt_options.imageCrop;\n  // Mask of the image\n  this.mask = opt_options.imageMask;\n  // Load Image\n  this._image = (opt_options.image ? opt_options.image : new Image );\n  this._image.crossOrigin = opt_options.crossOrigin; // 'anonymous';\n  // Show image on load\n  var self = this;\n  this._image.onload = function() {\n    self.setCrop (self.crop);\n    self.changed();\n  }\n  if (!opt_options.image) this._image.src = opt_options.url;\n  // Draw image on canvas\n  options.canvasFunction = function(extent, resolution, pixelRatio, size /*, projection*/ ) {\n    var canvas = document.createElement('canvas');\n    canvas.width = size[0];\n    canvas.height = size[1];\n    var ctx = canvas.getContext('2d');\n    if (!this._imageSize) return canvas;\n    // transform coords to pixel\n    function tr(xy) {\n      return [\n        (xy[0]-extent[0])/(extent[2]-extent[0]) * size[0],\n        (xy[1]-extent[3])/(extent[1]-extent[3]) * size[1]\n      ];\n    }\n    // Clipping mask\n    if (this.mask) {\n      ctx.beginPath();\n      var p = tr(this.mask[0]);\n      ctx.moveTo(p[0],p[1]);\n      for (var i=1; i<this.mask.length; i++) {\n        p = tr(this.mask[i]);\n        ctx.lineTo(p[0],p[1]);\n      }\n      ctx.clip();\n    }\n    // Draw\n    var pixel = tr(this.center);\n    var dx = (this._image.naturalWidth/2 - this.crop[0]) *this.scale[0] /resolution *pixelRatio;\n    var dy = (this._image.naturalHeight/2 - this.crop[1]) *this.scale[1] /resolution *pixelRatio;\n    var sx = this._imageSize[0]*this.scale[0]/resolution *pixelRatio;\n    var sy = this._imageSize[1]*this.scale[1]/resolution *pixelRatio;\n    ctx.translate(pixel[0],pixel[1]);\n    if (this.rotate) ctx.rotate(this.rotate);\n    ctx.drawImage(this._image, this.crop[0], this.crop[1], this._imageSize[0], this._imageSize[1], -dx, -dy, sx,sy);\n    return canvas;\n  }\n  ol.source.ImageCanvas.call (this, options);\t\n  this.setCrop (this.crop);\n  // Calculate extent on change\n  this.on('change', function() {\n    this.set('extent', this.calculateExtent());\n  }.bind(this));\n};\nol.ext.inherits(ol.source.GeoImage, ol.source.ImageCanvas);\n/**\n * Get coordinate of the image center.\n * @return {ol.Coordinate} coordinate of the image center.\n * @api stable\n */\nol.source.GeoImage.prototype.getCenter = function() {\n  return this.center;\n}\n/**\n * Set coordinate of the image center.\n * @param {ol.Coordinate} coordinate of the image center.\n * @api stable\n */\nol.source.GeoImage.prototype.setCenter = function(center) {\n  this.center = center;\n  this.changed();\n}\n/**\n * Get image scale.\n * @return {ol.size} image scale (along x and y axis).\n * @api stable\n */\nol.source.GeoImage.prototype.getScale = function() {\n  return this.scale;\n}\n/**\n * Set image scale.\n * @param {ol.size|Number} image scale (along x and y axis or both).\n * @api stable\n */\nol.source.GeoImage.prototype.setScale = function(scale) {\n  switch (typeof(scale)) {\n    case 'number':\n      scale = [scale,scale];\n      break;\n    case 'object': \n      if (scale.length != 2) return;\n      break;\n    default: return;\n  }\n  this.scale = scale;\n  this.changed();\n};\n/**\n * Get image rotation.\n * @return {Number} rotation in degre.\n * @api stable\n */\nol.source.GeoImage.prototype.getRotation = function() {\n  return this.rotate;\n};\n/**\n * Set image rotation.\n * @param {Number} rotation in radian.\n * @api stable\n */\nol.source.GeoImage.prototype.setRotation = function(angle) {\n  this.rotate = angle;\n  this.changed();\n};\n/**\n * Get the image.\n * @api stable\n */\nol.source.GeoImage.prototype.getGeoImage = function() {\n  return this._image;\n};\n/**\n * Get image crop extent.\n * @return {ol.extent} image crop extent.\n * @api stable\n */\nol.source.GeoImage.prototype.getCrop = function() {\n  return this.crop;\n};\n/**\n * Set image mask.\n * @param {ol.geom.LineString} coords of the mask\n * @api stable\n */\nol.source.GeoImage.prototype.setMask = function(mask) {\n  this.mask = mask;\n  this.changed();\n};\n/**\n * Get image mask.\n * @return {ol.geom.LineString} coords of the mask\n * @api stable\n */\nol.source.GeoImage.prototype.getMask = function() {\n  return this.mask;\n};\n/**\n * Set image crop extent.\n * @param {ol.extent|Number} image crop extent or a number to crop from original size.\n * @api stable\n */\nol.source.GeoImage.prototype.setCrop = function(crop) {\n  // Image not loaded => get it latter\n  if (!this._image.naturalWidth) {\n    this.crop = crop;\n    return;\n  }\n  if (crop) {\n    switch (typeof(crop)) {\n      case 'number':\n        crop = [crop,crop,this._image.naturalWidth-crop,this._image.naturalHeight-crop];\n        break;\n      case 'object': \n        if (crop.length != 4) return;\n        break;\n      default: return;\n    }\n    crop = ol.extent.boundingExtent([ [crop[0],crop[1]], [crop[2],crop[3]] ]);\n    this.crop = [ Math.max(0,crop[0]), Math.max(0,crop[1]), Math.min(this._image.naturalWidth,crop[2]), Math.min(this._image.naturalHeight,crop[3]) ];\n  }\n  else this.crop = [0,0, this._image.naturalWidth,this._image.naturalHeight];\n  if (this.crop[2]<=this.crop[0]) this.crop[2] = this.crop[0]+1;\n  if (this.crop[3]<=this.crop[1]) this.crop[3] = this.crop[1]+1;\n  this._imageSize = [ this.crop[2]-this.crop[0], this.crop[3]-this.crop[1] ];\n  this.changed();\n};\n/** Get the extent of the source.\n * @param {module:ol/extent~Extent} extent If provided, no new extent will be created. Instead, that extent's coordinates will be overwritten.\n * @return {ol.extent}\n */\nol.source.GeoImage.prototype.getExtent = function(opt_extent) {\n  if (opt_extent) {\n    var ext = this.get('extent');\n    for (var i=0; i<opt_extent.length; i++) {\n      opt_extent[i] = ext[i];\n    }\n    return ext;\n  } else {\n    return this.get('extent');\n  }\n};\n/** Calculate the extent of the source image.\n * @param {boolean} usemask return the mask extent, default return the image extent\n * @return {ol.extent}\n */\nol.source.GeoImage.prototype.calculateExtent = function(usemask) {\n  var polygon;\n  if (usemask!==false && this.getMask()) {\n    polygon = new ol.geom.Polygon([this.getMask()])\n  } else {\n    var center = this.getCenter();\n    var scale = this.getScale();\n    var width = this.getGeoImage().width * scale[0];\n    var height = this.getGeoImage().height * scale[1];\n    var extent = ol.extent.boundingExtent([\n      [ center[0]-width/2, center[1]-height/2 ],\n      [ center[0]+width/2, center[1]+height/2 ]\n    ]);\n    polygon = ol.geom.Polygon.fromExtent(extent);\n    polygon.rotate(-this.getRotation(), center);\n  }\n  var ext = polygon.getExtent();\n  return ext;\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** ol.source.GeoRSS is a source that load Wikimedia Commons content in a vector layer.\n * @constructor \n * @extends {ol.source.Vector}\n * @param {*} options source options\n *  @param {string} options.url GeoRSS feed url\n */\nol.source.GeoRSS = function(options) {\n  options = options || {};\n  options.loader = this._loaderFn;\n  ol.source.Vector.call (this, options);\n};\nol.ext.inherits(ol.source.GeoRSS, ol.source.Vector);\n/** Loader function used to load features.\n* @private\n*/\nol.source.GeoRSS.prototype._loaderFn = function(extent, resolution, projection){\n  // Ajax request to get source\n  ol.ext.Ajax.get({\n    url: this.getUrl(),\n    dataType: 'XML',\n    error: function(){ console.log('oops'); },\n    success: function(xml) {\n      var features = (new ol.format.GeoRSS()).readFeatures(xml, { featureProjection: projection });\n      this.addFeatures(features);\n    }.bind(this)\n  });\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** IGN's Geoportail WMTS source\n * @constructor\n * @extends {ol.source.WMTS}\n * @param {olx.source.Geoportail=} options WMTS options \n *  @param {string=} options.layer Geoportail layer name\n *  @param {number} options.minZoom\n *  @param {number} options.maxZoom\n *  @param {string} options.server\n *  @param {string} options.gppKey api key, default 'choisirgeoportail'\n *  @param {string} options.authentication basic authentication associated with the gppKey as btoa(\"login:pwd\")\n *  @param {string} options.format image format, default 'image/jpeg'\n *  @param {string} options.style layer style, default 'normal'\n *  @param {string} options.crossOrigin default 'anonymous'\n *  @param {string} options.wrapX default true\n */\nol.source.Geoportail = function (layer, options) {\n  options = options || {};\n  if (layer.layer) {\n    options = layer;\n    layer = options.layer;\n  }\n  var matrixIds = new Array();\n  var resolutions = new Array();//[156543.03392804103,78271.5169640205,39135.75848201024,19567.879241005125,9783.939620502562,4891.969810251281,2445.9849051256406,1222.9924525628203,611.4962262814101,305.74811314070485,152.87405657035254,76.43702828517625,38.218514142588134,19.109257071294063,9.554628535647034,4.777314267823517,2.3886571339117584,1.1943285669558792,0.5971642834779396,0.29858214173896974,0.14929107086948493,0.07464553543474241];\n  var size = ol.extent.getWidth(ol.proj.get('EPSG:3857').getExtent()) / 256;\n  for (var z=0; z <= (options.maxZoom ? options.maxZoom : 20) ; z++) {\n    matrixIds[z] = z ; \n    resolutions[z] = size / Math.pow(2, z);\n  }\n  var tg = new ol.tilegrid.WMTS ({\n    origin: [-20037508, 20037508],\n    resolutions: resolutions,\n    matrixIds: matrixIds\n  });\n  tg.minZoom = (options.minZoom ? options.minZoom : 0);\n  var attr = [ ol.source.Geoportail.prototype.attribution ];\n  if (options.attributions) attr = options.attributions;\n  this._server = options.server || 'https://wxs.ign.fr/geoportail/wmts';\n  this._gppKey = options.gppKey || 'choisirgeoportail';\n  var wmts_options = {\n    url: this.serviceURL(),\n    layer: layer,\n    matrixSet: 'PM',\n    format: options.format ? options.format : 'image/jpeg',\n    projection: 'EPSG:3857',\n    tileGrid: tg,\n    style: options.style ? options.style : 'normal',\n    attributions: attr,\n    crossOrigin: (typeof options.crossOrigin == 'undefined') ? 'anonymous' : options.crossOrigin,\n    wrapX: !(options.wrapX===false)\n  };\n  ol.source.WMTS.call(this, wmts_options);\n  // Load url using basic authentification\n  if (options.authentication) {\n    this.setTileLoadFunction(ol.source.Geoportail.tileLoadFunctionWithAuthentication(options.authentication, this.getFormat()));\n  }\n};\nol.ext.inherits(ol.source.Geoportail, ol.source.WMTS);\n/** Standard IGN-GEOPORTAIL attribution \n*/\nol.source.Geoportail.prototype.attribution = '<a href=\"http://www.geoportail.gouv.fr/\">Géoportail</a> &copy; <a href=\"http://www.ign.fr/\">IGN-France</a>';\n/** Get service URL according to server url or standard url\n*/\nol.source.Geoportail.prototype.serviceURL = function() {\n  if (this._server) {\n    return this._server.replace (/^(https?:\\/\\/[^/]*)(.*)$/, \"$1/\"+this._gppKey+\"$2\") ;\n  } else {\n    return (window.geoportailConfig ? window.geoportailConfig.url : \"https://wxs.ign.fr/\") +this._gppKey+ \"/geoportail/wmts\" ;\n  }\n};\n/**\n * Return the associated API key of the Map.\n * @function\n * @return the API key.\n * @api stable\n */\nol.source.Geoportail.prototype.getGPPKey = function() {\n  return this._gppKey;\n};\n/**\n * Set the associated API key to the Map.\n * @param {String} key the API key.\n * @param {String} authentication as btoa(\"login:pwd\")\n * @api stable\n */\nol.source.Geoportail.prototype.setGPPKey = function(key, authentication) {\n  this._gppKey = key;\n  var serviceURL = this.serviceURL();\n  this.setTileUrlFunction (function() {\n    var url = ol.source.Geoportail.prototype.getTileUrlFunction().apply(this, arguments);\n    if (url) {\n      var args = url.split(\"?\");\n      return serviceURL+\"?\"+args[1];\n    }\n    else return url;\n  });\n  // Load url using basic authentification\n  if (authentication) {\n    this.setTileLoadFunction(ol.source.Geoportail.tileLoadFunctionWithAuthentication(authentication, this.getFormat()));\n  }\n};\n/** Return the GetFeatureInfo URL for the passed coordinate, resolution, and\n * projection. Return `undefined` if the GetFeatureInfo URL cannot be\n * constructed.\n * @param {ol.Coordinate} coord \n * @param {Number} resolution \n * @param {ol.proj.Projection} projection default the source projection\n * @param {Object} options \n *  @param {string} options.INFO_FORMAT response format text/plain, text/html, application/json, default text/plain\n * @return {String|undefined} GetFeatureInfo URL.\n */\nol.source.Geoportail.prototype.getFeatureInfoUrl  = function(coord, resolution, projection, options) {\n  options = options || {};\n  if (!projection) projection = this.getProjection();\n  var tileCoord = this.tileGrid.getTileCoordForCoordAndResolution(coord, resolution);\n  var ratio = 1;\n  var url = this.getTileUrlFunction()(tileCoord, ratio, projection);\n  if (!url) return url;\n  var tileResolution = this.tileGrid.getResolution(tileCoord[0]);\n  var tileExtent = this.tileGrid.getTileCoordExtent(tileCoord);\n  var i = Math.floor((coord[0] - tileExtent[0]) / (tileResolution / ratio));\n  var j = Math.floor((tileExtent[3] - coord[1]) / (tileResolution / ratio));\n  return url.replace(/Request=GetTile/i, 'Request=getFeatureInfo')\n    +'&INFOFORMAT='+(options.INFO_FORMAT||'text/plain')\n    +'&I='+i\n    +'&J='+j;\n};\n/** Get feature info\n * @param {ol.Coordinate} coord \n * @param {Number} resolution \n * @param {ol.proj.Projection} projection default the source projection\n * @param {Object} options \n *  @param {string} options.INFO_FORMAT response format text/plain, text/html, application/json, default text/plain\n *  @param {function} options.callback a function that take the response as parameter\n *  @param {function} options.error function called when an error occurred\n */\nol.source.Geoportail.prototype.getFeatureInfo = function(coord, resolution, options) {\n  var url = this.getFeatureInfoUrl(coord, resolution, null, options);\n  ol.ext.Ajax.get({\n    url: url,\n    dataType: options.format || 'text/plain',\n    options: { \n      encode: false \n    },\n    success: function(resp) {\n      if (options.callback) options.callback(resp);\n    },\n    error: options.error || function(){}\n  })\n};\n/** Get a tile load function to load tiles with basic authentication\n * @param {string} authentication as btoa(\"login:pwd\")\n * @param {string} format mime type\n * @return {function} tile load function to load tiles with basic authentication\n */\nol.source.Geoportail.tileLoadFunctionWithAuthentication = function(authentication, format) {\n  if (!authentication) return undefined;\n  return function(tile, src) {\n    var xhr = new XMLHttpRequest();\n    xhr.open(\"GET\", src);\n    xhr.setRequestHeader(\"Authorization\", \"Basic \" + authentication);\n    xhr.responseType = \"arraybuffer\";\n    xhr.onload = function () {\n      var arrayBufferView = new Uint8Array(this.response);\n      var blob = new Blob([arrayBufferView], { type: format });\n      var urlCreator = window.URL || window.webkitURL;\n      var imageUrl = urlCreator.createObjectURL(blob);\n      tile.getImage().src = imageUrl;\n    };\n    xhr.onerror = function () {\n      tile.getImage().src = \"\";\n    };\n    xhr.send();\n  };\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A source for grid binning\n * @constructor\n * @extends {ol.source.Vector}\n * @param {Object} options ol.source.VectorOptions + grid option\n *  @param {ol.source.Vector} options.source Source\n *  @param {number} [options.size] size of the grid in meter, default 200m\n *  @param {function} [options.geometryFunction] Function that takes an ol.Feature as argument and returns an ol.geom.Point as feature's center.\n *  @param {function} [options.flatAttributes] Function takes a bin and the features it contains and aggragate the features in the bin attributes when saving\n */\nol.source.GridBin = function (options) {\n  options = options || {};\n  ol.source.BinBase.call(this, options);\n  this.set('gridProjection', options.gridProjection || 'EPSG:4326');\n  this.set('size', options.size || 1);\n};\nol.ext.inherits(ol.source.GridBin, ol.source.BinBase);\n/** Set grid projection\n * @param {ol.ProjectionLike} proj\n */\nol.source.GridBin.prototype.setGridProjection = function (proj) {\n  this.set('gridProjection', proj);\n  this.reset();\n};\n/** Set grid size\n * @param {number} size\n */\nol.source.GridBin.prototype.setSize = function (size) {\n  this.set('size', size);\n  this.reset();\n};\n/** Get the grid geometry at the coord \n * @param {ol.Coordinate} coord\n * @returns {ol.geom.Polygon} \n * @api\n */\nol.source.GridBin.prototype.getGridGeomAt = function (coord) {\n  coord = ol.proj.transform (coord, this.getProjection() || 'EPSG:3857', this.get('gridProjection'));\n  var size = this.get('size');\n  var x = size * Math.floor(coord[0] / size);\n  var y = size * Math.floor(coord[1] / size);\n  var geom = new ol.geom.Polygon([[[x,y], [x+size,y], [x+size,y+size], [x,y+size], [x,y]]]);\n  return geom.transform(this.get('gridProjection'), this.getProjection() || 'EPSG:3857');\n};\n\n/*\tCopyright (c) 2017-2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A source for hexagonal binning\n * @constructor\n * @extends {ol.source.Vector}\n * @param {Object} options ol.source.VectorOptions + ol.HexGridOptions\n *  @param {ol.source.Vector} options.source Source\n *  @param {number} [options.size] size of the hexagon in map units, default 80000\n *  @param {ol.coordinate} [options.origin] origin of the grid, default [0,0]\n *  @param {HexagonLayout} [options.layout] grid layout, default pointy\n *  @param {function} [options.geometryFunction] Function that takes an ol.Feature as argument and returns an ol.geom.Point as feature's center.\n *  @param {function} [options.flatAttributes] Function takes a bin and the features it contains and aggragate the features in the bin attributes when saving\n */\nol.source.HexBin = function (options) {\n  options = options || {};\n  /** The HexGrid\n   * \t@type {ol.HexGrid}\n   */\n  this._hexgrid = new ol.HexGrid(options);\n  ol.source.BinBase.call(this, options);\n};\nol.ext.inherits(ol.source.HexBin, ol.source.BinBase);\n/** Get the hexagon geometry at the coord \n * @param {ol.Coordinate} coord\n * @returns {ol.geom.Polygon} \n * @api\n */\nol.source.HexBin.prototype.getGridGeomAt = function (coord) {\n  var h = this._hexgrid.coord2hex(coord);\n  return new ol.geom.Polygon([this._hexgrid.getHexagon(h)])\n};\n/**\tSet the inner HexGrid size.\n * \t@param {number} newSize\n * \t@param {boolean} noreset If true, reset will not be called (It need to be called through)\n */\nol.source.HexBin.prototype.setSize = function (newSize, noreset) {\n  this._hexgrid.setSize(newSize);\n  if (!noreset) {\n    this.reset();\n  }\n}\n/**\tGet the inner HexGrid size.\n * \t@return {number}\n */\nol.source.HexBin.prototype.getSize = function () {\n  return this._hexgrid.getSize();\n}\n/**\tSet the inner HexGrid layout.\n * \t@param {HexagonLayout} newLayout\n * \t@param {boolean} noreset If true, reset will not be called (It need to be called through)\n */\nol.source.HexBin.prototype.setLayout = function (newLayout, noreset) {\n  this._hexgrid.setLayout(newLayout);\n  if (!noreset) {\n    this.reset();\n  }\n}\n/**\tGet the inner HexGrid layout.\n * \t@return {HexagonLayout}\n */\nol.source.HexBin.prototype.getLayout = function () {\n  return this._hexgrid.getLayout();\n};\n/**\tSet the inner HexGrid origin.\n * \t@param {ol.Coordinate} newLayout\n * \t@param {boolean} noreset If true, reset will not be called (It need to be called through)\n */\nol.source.HexBin.prototype.setOrigin = function (newLayout, noreset) {\n  this._hexgrid.setOrigin(newLayout);\n  if (!noreset) {\n    this.reset();\n  }\n};\n/**\tGet the inner HexGrid origin.\n * \t@return {ol.Coordinate}\n */\nol.source.HexBin.prototype.getOrigin = function () {\n  return this._hexgrid.getOrigin();\n};\n/**\n * Get hexagons without circular dependencies (vs. getFeatures)\n * @return {Array<ol.Feature>}\n */\nol.source.HexBin.prototype.getHexFeatures = function () {\n  return ol.source.BinBase.prototype.getGridFeatures.call(this);\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A source for INSEE grid\n * @constructor\n * @extends {ol.source.Vector}\n * @param {Object} options ol.source.VectorOptions + grid option\n *  @param {ol.source.Vector} options.source Source\n *  @param {number} [options.size] size of the grid in meter, default 200m\n *  @param {function} [options.geometryFunction] Function that takes an ol.Feature as argument and returns an ol.geom.Point as feature's center.\n *  @param {function} [options.flatAttributes] Function takes a bin and the features it contains and aggragate the features in the bin attributes when saving\n */\nol.source.InseeBin = function (options) {\n  options = options || {};\n  this._grid = new ol.InseeGrid({ size: options.size });\n  ol.source.BinBase.call(this, options);\n};\nol.ext.inherits(ol.source.InseeBin, ol.source.BinBase);\n/** Set grid size\n * @param {number} size\n */\nol.source.InseeBin.prototype.setSize = function (size) {\n  if (this.getSize() !== size) {\n    this._grid.set('size', size);\n    this.reset();\n  }\n};\n/** Get grid size\n * @return {number} size\n */\nol.source.InseeBin.prototype.getSize = function () {\n  return this._grid.get('size');\n};\n/** Get the grid geometry at the coord \n * @param {ol.Coordinate} coord\n * @returns {ol.geom.Polygon} \n * @api\n */\nol.source.InseeBin.prototype.getGridGeomAt = function (coord) {\n  return this._grid.getGridAtCoordinate(coord, this.getProjection());\n};\n/** Get grid extent \n * @param {ol.ProjectionLike} proj\n * @return {ol.Extent}\n */\nol.source.InseeBin.prototype.getGridExtent = function (proj) {\n  return this._grid.getExtent(proj);\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n\t@classdesc\n\tol.source.Mapillary is a source that load Mapillary's geotagged photos in a vector layer.\n\tInherits from:\n\t<ol.source.Vector>\n*/\n/**\n* @constructor ol.source.Mapillary\n* @extends {ol.source.Vector}\n* @param {olx.source.Mapillary=} options\n*/\nol.source.Mapillary = function(opt_options)\n{\tvar options = opt_options || {};\n\toptions.loader = this._loaderFn;\n\t/** Max resolution to load features  */\n\tthis._maxResolution = options.maxResolution || 100;\n\t/** Query limit */\n\tthis._limit = options.limit || 100;\n\t/** Default attribution */\n\tif (!options.attributions) options.attributions = [ \"&copy; <a href='https://www.mapillary.com/'>Mapillary</a>\" ];\n\t// Bbox strategy : reload at each move\n    if (!options.strategy) options.strategy = ol.loadingstrategy.bbox;\n\t// Init parent\n\tol.source.Vector.call (this, options);\n\t// Client ID\n\t// this.set(\"clientId\", options.clientId);\n};\nol.ext.inherits(ol.source.Mapillary, ol.source.Vector);\n/** Decode wiki attributes and choose to add feature to the layer\n* @param {feature} the feature\n* @param {attributes} wiki attributes\n* @return {boolean} true: add the feature to the layer\n* @API stable\n*/\nol.source.Mapillary.prototype.readFeature = function (/*feature, attributes*/)\n{\t// Allways read feature (no filter)\n\treturn true;\n};\n/** Loader function used to load features.\n* @private\n*/\nol.source.Mapillary.prototype._loaderFn = function(extent, resolution, projection)\n{\tif (resolution > this._maxResolution) return;\n\tvar bbox = ol.proj.transformExtent(extent, projection, \"EPSG:4326\");\n\t// Commons API: for more info @see https://www.mapillary.com/developer\n\tvar date = Date.now() - 6 * 30 * 24 * 60 * 60 * 1000;\n\tvar url = \"https://a.mapillary.com/v2/search/im?client_id=\"\n\t\t+ this.get('clientId')\n\t\t+ \"&max_lat=\" + bbox[3]\n\t\t+ \"&max_lon=\" + bbox[2]\n\t\t+ \"&min_lat=\" + bbox[1]\n\t\t+ \"&min_lon=\" + bbox[0]\n\t\t+ \"&limit=\"+(this._limit-1)\n\t\t+ \"&start_time=\" + date;\n\t// Ajax request to get the tile\n\tol.ext.Ajax.get(\n\t{\turl: url,\n\t\tdataType: 'jsonp', \n\t\tsuccess: function(data) \n\t\t{\tconsole.log(data);\n\t\t\t/*\n\t\t\tvar features = [];\n\t\t\tvar att, pt, feature, lastfeature = null;\n\t\t\tif (data.query && data.query.pages) return;\n\t\t\tfor ( var i in data.query.pages)\n\t\t\t{\tatt = data.query.pages[i];\n\t\t\t\tif (att.coordinates && att.coordinates.length ) \n\t\t\t\t{\tpt = [att.coordinates[0].lon, att.coordinates[0].lat];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\tvar meta = att.imageinfo[0].metadata;\n\t\t\t\t\tif (!meta)\n\t\t\t\t\t{\t//console.log(att);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tpt = [];\n\t\t\t\t\tfor (var k=0; k<meta.length; k++)\n\t\t\t\t\t{\tif (meta[k].name==\"GPSLongitude\") pt[0] = meta[k].value;\n\t\t\t\t\t\tif (meta[k].name==\"GPSLatitude\") pt[1] = meta[k].value;\n\t\t\t\t\t}\n\t\t\t\t\tif (!pt.length) \n\t\t\t\t\t{\t//console.log(att);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfeature = new ol.Feature(new ol.geom.Point(ol.proj.transform (pt,\"EPSG:4326\",projection)));\n\t\t\t\tatt.imageinfo[0].title = att.title;\n\t\t\t\tif (self.readFeature(feature, att.imageinfo[0]))\n\t\t\t\t{\tfeatures.push(feature);\n\t\t\t\t}\n\t\t\t}\n\t\t\tself.addFeatures(features);\n\t\t\t*/\n    }});\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A source to turn your maps into oil paintings...\n * Original idea:  Santhosh G https://www.codeproject.com/Articles/471994/OilPaintEffect\n * JS implementation: Loktar (https://github.com/loktar00) https://codepen.io/loktar00/full/Fhzot/\n * @constructor\n * @extends {ol.source.Vector}\n * @param {Object} options\n *  @param {Array<ol/source/Source|ol/layer/Layer>} sources Input sources or layers. For vector data, use an VectorImage layer.\n *  @param {number} radius default 4\n *  @param {number} intensity default 25\n */\nol.source.OilPainting = function (options) {\n  options.operation = this._operation;\n  options.operationType = 'image';\n  ol.source.Raster.call(this, options);\n  this.set('radius', options.radius || 4);\n  this.set('intensity', options.intensity || 25);\n  this.on('beforeoperations', function (event) {\n    var w = Math.round((event.extent[2]-event.extent[0])/event.resolution);\n    var h = Math.round((event.extent[3]-event.extent[1])/event.resolution);\n    event.data.image = new ImageData(w,h);\n    event.data.radius = Number(this.get('radius')) || 1;\n    event.data.intensity = Number(this.get('intensity'));\n  }.bind(this));\n};\nol.ext.inherits(ol.source.OilPainting, ol.source.Raster);\n/** Set value and force change\n */\nol.source.OilPainting.prototype.set = function(key, val) {\n  if (val) {\n    switch (key) {\n      case 'intensity': \n      case 'radius': {\n        val = Number(val);\n        if (val<1) val = 1;\n        this.changed();\n        break;\n      }\n    }\n  }\n  return ol.source.Raster.prototype.set.call(this, key, val);\n};\n/**\n * @private\n */\nol.source.OilPainting.prototype._operation = function(pixels, data) {\n  var width = pixels[0].width,\n    height = pixels[0].height,\n    imgData = pixels[0],\n    pixData = imgData.data,\n    pixelIntensityCount = [];\n  var destImageData = data.image,\n    destPixData = destImageData.data,\n    intensityLUT = [],\n    rgbLUT = [];\n  for (var y = 0; y < height; y++) {\n    intensityLUT[y] = [];\n    rgbLUT[y] = [];\n    for (var x = 0; x < width; x++) {\n      var idx = (y * width + x) * 4,\n        r = pixData[idx],\n        g = pixData[idx + 1],\n        b = pixData[idx + 2],\n        avg = (r + g + b) / 3;\n      intensityLUT[y][x] = Math.round((avg * data.intensity) / 255);\n      rgbLUT[y][x] = {\n        r: r,\n        g: g,\n        b: b\n      };\n    }\n  }\n  var radius = data.radius;\n  for (y = 0; y < height; y++) {\n    for (x = 0; x < width; x++) {\n      pixelIntensityCount = [];\n      // Find intensities of nearest pixels within radius.\n      for (var yy = -radius; yy <= radius; yy++) {\n        for (var xx = -radius; xx <= radius; xx++) {\n          if (y + yy > 0 && y + yy < height && x + xx > 0 && x + xx < width) {\n            var intensityVal = intensityLUT[y + yy][x + xx];\n            if (!pixelIntensityCount[intensityVal]) {\n              pixelIntensityCount[intensityVal] = {\n                val: 1,\n                r: rgbLUT[y + yy][x + xx].r,\n                g: rgbLUT[y + yy][x + xx].g,\n                b: rgbLUT[y + yy][x + xx].b\n              }\n            } else {\n              pixelIntensityCount[intensityVal].val++;\n              pixelIntensityCount[intensityVal].r += rgbLUT[y + yy][x + xx].r;\n              pixelIntensityCount[intensityVal].g += rgbLUT[y + yy][x + xx].g;\n              pixelIntensityCount[intensityVal].b += rgbLUT[y + yy][x + xx].b;\n            }\n          }\n        }\n      }\n      pixelIntensityCount.sort(function (a, b) {\n        return b.val - a.val;\n      });\n      var curMax = pixelIntensityCount[0].val,\n        dIdx = (y * width + x) * 4;\n      destPixData[dIdx] = ~~ (pixelIntensityCount[0].r / curMax);\n      destPixData[dIdx + 1] = ~~ (pixelIntensityCount[0].g / curMax);\n      destPixData[dIdx + 2] = ~~ (pixelIntensityCount[0].b / curMax);\n      destPixData[dIdx + 3] = 255;\n    }\n  }\n  return destImageData;\n};\n\n/*\tCopyright (c) 2018 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * OSM layer using the Ovepass API\n * @constructor ol.source.Overpass\n * @extends {ol.source.Vector}\n * @param {any} options\n *  @param {string} options.url service url, default: https://overpass-api.de/api/interpreter\n *  @param {Array<string>} options.filter an array of tag filters, ie. [\"key\", \"key=value\", \"key~value\", ...]\n *  @param {boolean} options.node get nodes, default: true\n *  @param {boolean} options.way get ways, default: true\n *  @param {boolean} options.rel get relations, default: false\n *  @param {number} options.maxResolution maximum resolution to load features\n *  @param {string|ol.Attribution|Array<string>} options.attributions source attribution, default OSM attribution\n *  @param {ol.loadingstrategy} options.strategy loading strategy, default ol.loadingstrategy.bbox\n */\nol.source.Overpass = function(options) {\n\toptions = options || {};\n\toptions.loader = this._loaderFn;\n\t/** Ovepass API Url */\n\tthis._url = options.url || 'https://overpass-api.de/api/interpreter';\n\t/** Max resolution to load features  */\n\tthis._maxResolution = options.maxResolution || 100;\n\t/** Default attribution */\n\tif (!options.attributions) {\n    options.attributions = ol.source.OSM.ATTRIBUTION;\n  }\n\t// Bbox strategy : reload at each move\n  if (!options.strategy) options.strategy = ol.loadingstrategy.bbox;\n  ol.source.Vector.call (this, options);\n  this._types = {\n    node: options.node!==false,\n    way: options.way!==false,\n    rel: options.rel===true\n  };\n  this._filter = options.filter;\n};\nol.ext.inherits(ol.source.Overpass, ol.source.Vector);\n/** Loader function used to load features.\n* @private\n*/\nol.source.Overpass.prototype._loaderFn = function(extent, resolution, projection) {\n  if (resolution > this._maxResolution) return;\n\tvar self = this;\n  var bbox = ol.proj.transformExtent(extent, projection, \"EPSG:4326\");\n  bbox = bbox[1] + ',' + bbox[0] + ',' + bbox[3] + ',' + bbox[2];\n  // Overpass QL\n  var query = '[bbox:'+bbox+'][out:xml][timeout:25];';\n  query += '(';\n  // Search attributes\n  for (var t in this._types) {\n    if (this._types[t]) {\n      query += t;\n      for (var n=0, filter; filter = this._filter[n]; n++) {\n        query += '['+filter+']';\n      }\n      query += ';'\n    }\n  }\n  query +=');out;>;out skel qt;'\n  var ajax = new XMLHttpRequest();\n\tajax.open('POST', this._url, true);\n\tajax.onload = function () {\n    var features = new ol.format.OSMXML().readFeatures(this.responseText,{featureProjection: projection});\n    var result = [];\n    // Remove duplicated features\n    for (var i=0, f; f=features[i]; i++) {\n      if (!self.hasFeature(f)) result.push(f);\n    }\n    self.addFeatures(result);\n\t};\n\tajax.onerror = function () {\n\t\tconsole.log(arguments);\n\t};\n  ajax.send('data='+query);\n};\n/**\n * Search if feature is allready loaded\n * @param {ol.Feature} feature\n * @return {boolean} \n * @private\n */\nol.source.Overpass.prototype.hasFeature = function(feature) {\n\tvar p = feature.getGeometry().getFirstCoordinate();\n\tvar id = feature.getId();\n\tvar existing = this.getFeaturesInExtent([p[0]-0.1, p[1]-0.1, p[0]+0.1, p[1]+0.1]);\n\tfor (var i=0, f; f=existing[i]; i++) {\n\t\tif (id===f.getId()) {\n      return true;\n    }\n\t}\n\treturn false;\n};\n\n(function () {\n  var clear = ol.source.Vector.prototype.clear;\n  /** Overwrite ol/source/Vector clear to fire clearstart / clearend event\n   */\n  ol.source.Vector.prototype.clear = function(opt_fast) {\n    this.dispatchEvent({ type: 'clearstart' });\n    clear.call(this, opt_fast)\n    this.dispatchEvent({ type: 'clearend' });\n  };\n})();\n\n/** \n * @classdesc 3D vector layer rendering\n * @constructor\n * @extends {pl.layer.Image}\n * @param {Object} options\n *  @param {ol.layer.Vector} options.source the source to display in 3D\n *  @param {ol.style.Style} options.styler drawing style\n *  @param {number} options.maxResolution  max resolution to render 3D\n *  @param {number} options.defaultHeight default height if none is return by a propertie\n *  @param {function|string|Number} options.height a height function (returns height giving a feature) or a popertie name for the height or a fixed value\n *  @param {Array<number>} options.center center of the view, default [.5,1]\n */\nol.layer.Vector3D = function (options) {\n  options = options || {};\n  this._source = options.source;\n  this.height_ = this.getHfn (options.height);\n  var canvas = document.createElement('canvas');\n  ol.layer.Image.call (this, { \n    source: new ol.source.ImageCanvas({\n      canvasFunction: function(extent, resolution, pixelRatio, size /*, projection*/ ) {\n        canvas.width = size[0];\n        canvas.height = size[1];\n        return canvas;\n      }\n    }), \n    center: options.center || [.5,1],\n    defaultHeight: options.defaultHeight || 0,\n    maxResolution: options.maxResolution || Infinity \n  });\n  this.setStyle(options.style);\n  this.on (['postcompose', 'postrender'], this.onPostcompose_.bind(this));\n}\nol.ext.inherits(ol.layer.Vector3D, ol.layer.Image);\n/**\n * Set the height function for the layer\n * @param {function|string|Number} height a height function (returns height giving a feature) or a popertie name or a fixed value\n */\nol.layer.Vector3D.prototype.setHeight = function(height) {\n  this.height_ = this.getHfn (height);\n  this.changed();\n};\n/**\n * Set style associated with the layer\n * @param {ol.style.Style} s\n */\nol.layer.Vector3D.prototype.setStyle = function(s) {\n  if (s instanceof ol.style.Style) this._style = s;\n  else this._style = new ol.style.Style();\n  if (!this._style.getStroke()) {\n    this._style.setStroke(new ol.style.Stroke({\n      width: 1,\n      color: 'red'\n    }));\n  }\n  if (!this._style.getFill()) {\n    this._style.setFill( new ol.style.Fill({ color: 'rgba(0,0,255,0.5)'}) );\n  }\n  if (!this._style.getText()) {\n    this._style.setText( new ol.style.Fill({ \n      color: 'red'}) \n    );\n  }\n  // Get the geometry\n  if (s && s.getGeometry()) {\n    var geom = s.getGeometry();\n    if (typeof(geom)==='function') {\n      this.set('geometry', geom);\n    } else {\n      this.set('geometry', function() { return geom; });\n    }\n  } else {\n    this.set('geometry', function(f) { return f.getGeometry(); });\n  }\n};\n/**\n * Get style associated with the layer\n * @return {ol.style.Style}\n */\nol.layer.Vector3D.prototype.getStyle = function() {\n  return this._style;\n};\n/** Calculate 3D at potcompose\n * @private\n */\nol.layer.Vector3D.prototype.onPostcompose_ = function(e) {\n  var res = e.frameState.viewState.resolution;\n  if (res > this.get('maxResolution')) return;\n  this.res_ = res*400;\n  if (this.animate_) {\n    var elapsed = e.frameState.time - this.animate_;\n    if (elapsed < this.animateDuration_) {\n      this.elapsedRatio_ = this.easing_(elapsed / this.animateDuration_);\n      // tell OL3 to continue postcompose animation\n      e.frameState.animate = true;\n    } else {\n      this.animate_ = false;\n      this.height_ = this.toHeight_\n    }\n  }\n  var ratio = e.frameState.pixelRatio;\n  var ctx = e.context;\n  var m = this.matrix_ = e.frameState.coordinateToPixelTransform;\n  // Old version (matrix)\n  if (!m) {\n    m = e.frameState.coordinateToPixelMatrix,\n    m[2] = m[4];\n    m[3] = m[5];\n    m[4] = m[12];\n    m[5] = m[13];\n  }\n  this.center_ = [ \n    ctx.canvas.width*this.get('center')[0]/ratio, \n    ctx.canvas.height*this.get('center')[1]/ratio \n  ];\n  var f = this._source.getFeaturesInExtent(e.frameState.extent);\n  ctx.save();\n    ctx.scale(ratio,ratio);\n    var s = this.getStyle();\n    ctx.lineWidth = s.getStroke().getWidth();\n    ctx.lineCap = s.getStroke().getLineCap();\n    ctx.strokeStyle = ol.color.asString(s.getStroke().getColor());\n    ctx.fillStyle = ol.color.asString(s.getFill().getColor());\n    var builds = [];\n    for (var i=0; i<f.length; i++) {\n      builds.push (this.getFeature3D_ (f[i], this._getFeatureHeight(f[i])));\n    }\n    this.drawFeature3D_ (ctx, builds);\n  ctx.restore();\n};\n/** Create a function that return height of a feature\n * @param {function|string|number} h a height function or a popertie name or a fixed value\n * @return {function} function(f) return height of the feature f\n * @private\n */\nol.layer.Vector3D.prototype.getHfn= function(h) {\n  switch (typeof(h)) {\n    case 'function': return h;\n    case 'string': {\n      var dh = this.get('defaultHeight');\n        return (function(f) {\n          return (Number(f.get(h)) || dh); \n        });\n      }\n    case 'number': return (function(/*f*/) { return h; });\n    default: return (function(/*f*/) { return 10; });\n  }\n};\n/** Animate rendering\n * @param {*} options\n *  @param {string|function|number} options.height an attribute name or a function returning height of a feature or a fixed value\n *  @param {number} options.duration the duration of the animatioin ms, default 1000\n *  @param {ol.easing} options.easing an ol easing function\n *\t@api\n */\nol.layer.Vector3D.prototype.animate = function(options) {\n  options = options || {};\n  this.toHeight_ = this.getHfn(options.height);\n  this.animate_ = new Date().getTime();\n  this.animateDuration_ = options.duration ||1000;\n  this.easing_ = options.easing || ol.easing.easeOut;\n  // Force redraw\n  this.changed();\n};\n/** Check if animation is on\n*\t@return {bool}\n*/\nol.layer.Vector3D.prototype.animating = function() {\n  if (this.animate_ && new Date().getTime() - this.animate_ > this.animateDuration_) {\n    this.animate_ = false;\n  }\n  return !!this.animate_;\n}\n/** Get height for a feature\n * @param {ol.Feature} f\n * @return {number}\n * @private\n */\nol.layer.Vector3D.prototype._getFeatureHeight = function (f) {\n  if (this.animate_) {\n    var h1 = this.height_(f);\n    var h2 = this.toHeight_(f);\n    return (h1*(1-this.elapsedRatio_)+this.elapsedRatio_*h2);\n  }\n  else return this.height_(f);\n};\n/** Get hvector for a point\n * @private\n */\nol.layer.Vector3D.prototype.hvector_ = function (pt, h) {\n  var p0 = [\n    pt[0]*this.matrix_[0] + pt[1]*this.matrix_[1] + this.matrix_[4],\n    pt[0]*this.matrix_[2] + pt[1]*this.matrix_[3] + this.matrix_[5]\n  ];\n  return {\n    p0: p0, \n    p1: [\n      p0[0] + h/this.res_ * (p0[0]-this.center_[0]),\n      p0[1] + h/this.res_ * (p0[1]-this.center_[1])\n    ]\n  };\n};\n/** Get a vector 3D for a feature\n * @private\n */\nol.layer.Vector3D.prototype.getFeature3D_ = function (f, h) {\n  var geom = this.get('geometry')(f);\n  var c = geom.getCoordinates();\n  switch (geom.getType()) {\n    case \"Polygon\":\n      c = [c];\n    // fallthrough\n    case \"MultiPolygon\":\n      var build = [];\n      for (var i=0; i<c.length; i++) {\n        for (var j=0; j<c[i].length; j++) {\n          var b = [];\n          for (var k=0; k<c[i][j].length; k++) {\n            b.push( this.hvector_(c[i][j][k], h) );\n          }\n          build.push(b);\n        }\n      }\n      return { type:\"MultiPolygon\", feature: f, geom: build };\n    case \"Point\":\n      return { type:\"Point\", feature: f, geom: this.hvector_(c,h) };\n    default: return {};\n  }\n};\n/** Draw 3D feature\n * @private\n */\nol.layer.Vector3D.prototype.drawFeature3D_ = function(ctx, build) {\n  var i,j, b, k;\n  // Construct\n  for (i=0; i<build.length; i++) {\t\n    switch (build[i].type) {\n      case \"MultiPolygon\": {\n        for (j=0; j<build[i].geom.length; j++) {\n          b = build[i].geom[j];\n          for (k=0; k < b.length; k++) {\n            ctx.beginPath();\n            ctx.moveTo(b[k].p0[0], b[k].p0[1]);\n            ctx.lineTo(b[k].p1[0], b[k].p1[1]);\n            ctx.stroke();\n          }\n        }\n        break;\n      }\n      case \"Point\": {\n        var g = build[i].geom;\n          ctx.beginPath();\n          ctx.moveTo(g.p0[0], g.p0[1]);\n          ctx.lineTo(g.p1[0], g.p1[1]);\n          ctx.stroke();\n          break;\n        }\n      default: break;\n    }\n  }\n  // Roof\n  for (i=0; i<build.length; i++) {\n    switch (build[i].type) {\n      case \"MultiPolygon\": {\n        ctx.beginPath();\n        for (j=0; j<build[i].geom.length; j++) {\n          b = build[i].geom[j];\n          if (j==0) {\n            ctx.moveTo(b[0].p1[0], b[0].p1[1]);\n            for (k=1; k < b.length; k++) {\n              ctx.lineTo(b[k].p1[0], b[k].p1[1]);\n            }\n          } else {\n            ctx.moveTo(b[0].p1[0], b[0].p1[1]);\n            for (k=b.length-2; k>=0; k--) {\n              ctx.lineTo(b[k].p1[0], b[k].p1[1]);\n            }\n          }\n          ctx.closePath();\n        }\n        ctx.fill(\"evenodd\");\n        ctx.stroke();\n        break;\n      }\n      case \"Point\": {\n        b = build[i];\n        var t = b.feature.get('label');\n        if (t) {\n          var p = b.geom.p1;\n          var m = ctx.measureText(t);\n          var h = Number (ctx.font.match(/\\d+(\\.\\d+)?/g).join([]));\n          ctx.fillRect (p[0]-m.width/2 -5, p[1]-h -5, m.width +10, h +10)\n          ctx.strokeRect (p[0]-m.width/2 -5, p[1]-h -5, m.width +10, h +10)\n          ctx.save()\n            ctx.fillStyle = ol.color.asString(this._style.getText().getFill().getColor());\n            ctx.textAlign = 'center';\n            ctx.textBaseline = 'bottom';\n            ctx.fillText ( t, p[0], p[1] );\n          ctx.restore();\n        }\n        break;\n      }\n      default: break;\n    }\n  }\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n  @classdesc\n  ol.source.WikiCommons is a source that load Wikimedia Commons content in a vector layer.\n  Inherits from:\n  <ol.source.Vector>\n*/\n/**\n* @constructor ol.source.WikiCommons\n* @extends {ol.source.Vector}\n* @param {olx.source.WikiCommons=} options\n*/\nol.source.WikiCommons = function(opt_options) {\n  var options = opt_options || {};\n  options.loader = this._loaderFn;\n  /** Max resolution to load features  */\n  this._maxResolution = options.maxResolution || 100;\n  /** Result language */\n  this._lang = options.lang || \"fr\";\n  /** Query limit */\n  this._limit = options.limit || 100;\n  /** Default attribution */\n  if (!options.attributions) options.attributions = [ \"&copy; <a href='https://commons.wikimedia.org/'>Wikimedia Commons</a>\" ];\n  // Bbox strategy : reload at each move\n    if (!options.strategy) options.strategy = ol.loadingstrategy.bbox;\n  ol.source.Vector.call (this, options);\n};\nol.ext.inherits(ol.source.WikiCommons, ol.source.Vector);\n/** Decode wiki attributes and choose to add feature to the layer\n* @param {feature} the feature\n* @param {attributes} wiki attributes\n* @return {boolean} true: add the feature to the layer\n* @API stable\n*/\nol.source.WikiCommons.prototype.readFeature = function (feature, attributes){\n  feature.set(\"descriptionurl\", attributes.descriptionurl);\n  feature.set(\"url\", attributes.url);\n  feature.set(\"title\", attributes.title.replace(/^file:|.jpg$/ig,\"\"));\n  feature.set(\"thumbnail\", attributes.url.replace(/^(.+wikipedia\\/commons)\\/([a-zA-Z0-9]\\/[a-zA-Z0-9]{2})\\/(.+)$/,\"$1/thumb/$2/$3/200px-$3\"));\n  feature.set(\"user\", attributes.user);\n  if (attributes.extmetadata && attributes.extmetadata.LicenseShortName) feature.set(\"copy\", attributes.extmetadata.LicenseShortName.value);\n  return true;\n};\n/** Loader function used to load features.\n* @private\n*/\nol.source.WikiCommons.prototype._loaderFn = function(extent, resolution, projection){\n  if (resolution > this._maxResolution) return;\n  var self = this;\n  var bbox = ol.proj.transformExtent(extent, projection, \"EPSG:4326\");\n  // Commons API: for more info @see https://commons.wikimedia.org/wiki/Commons:API/MediaWiki\n  var url = \"https://commons.wikimedia.org/w/api.php?action=query&format=json&origin=*&prop=coordinates|imageinfo\"\n    + \"&generator=geosearch&iiprop=timestamp|user|url|extmetadata|metadata|size&iiextmetadatafilter=LicenseShortName\"\n    + \"&ggsbbox=\" + bbox[3] + \"|\" + bbox[0] + \"|\" + bbox[1] + \"|\" + bbox[2]\n    + \"&ggslimit=\"+this._limit\n    + \"&iilimit=\"+(this._limit-1)\n    + \"&ggsnamespace=6\";\n  // Ajax request to get the tile\n  ol.ext.Ajax.get({\n    url: url,\n    success: function(data) {\n      //console.log(data);\n      var features = [];\n      var att, pt, feature;\n      if (!data.query || !data.query.pages) return;\n      for ( var i in data.query.pages){\n        att = data.query.pages[i];\n        if (att.coordinates && att.coordinates.length ) {\n          pt = [att.coordinates[0].lon, att.coordinates[0].lat];\n        } else {\n          var meta = att.imageinfo[0].metadata;\n          if (!meta) {\n            //console.log(att);\n            continue;\n          }\n          pt = [];\n          var found=0;\n          for (var k=0; k<meta.length; k++) {\n            if (meta[k].name==\"GPSLongitude\") {\n              pt[0] = meta[k].value;\n              found++;\n            }\n            if (meta[k].name==\"GPSLatitude\") {\n              pt[1] = meta[k].value;\n              found++;\n            }\n          }\n          if (found!=2) {\n            //console.log(att);\n            continue;\n          }\n        }\n        feature = new ol.Feature(new ol.geom.Point(ol.proj.transform (pt,\"EPSG:4326\",projection)));\n        att.imageinfo[0].title = att.title;\n        if (self.readFeature(feature, att.imageinfo[0])) {\n          features.push(feature);\n        }\n      }\n      self.addFeatures(features);\n  }});\n};\n\n/*\n  Copyright (c) 2015 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (http://www.cecill.info/).\n  ol.layer.AnimatedCluster is a vector layer that animate cluster\n*/\n/**\n *  A vector layer for animated cluster\n * @constructor \n * @extends {ol.layer.Vector}\n * @param {olx.layer.AnimatedClusterOptions=} options extend olx.layer.Options\n *  @param {Number} options.animationDuration animation duration in ms, default is 700ms \n *  @param {ol.easingFunction} animationMethod easing method to use, default ol.easing.easeOut\n */\nol.layer.AnimatedCluster = function(opt_options) {\n  var options = opt_options || {};\n  ol.layer.Vector.call (this, options);\n  this.oldcluster = new ol.source.Vector();\n  this.clusters = [];\n  this.animation={start:false};\n  this.set('animationDuration', typeof(options.animationDuration)=='number' ? options.animationDuration : 700);\n  this.set('animationMethod', options.animationMethod || ol.easing.easeOut);\n  // Save cluster before change\n  this.getSource().on('change', this.saveCluster.bind(this));\n  // Animate the cluster\n  this.on(['precompose','prerender'], this.animate.bind(this));\n  this.on(['postcompose','postrender'], this.postanimate.bind(this));\n};\nol.ext.inherits(ol.layer.AnimatedCluster, ol.layer.Vector);\n/** save cluster features before change\n * @private\n */\nol.layer.AnimatedCluster.prototype.saveCluster = function() {\n  if (this.oldcluster) {\n    this.oldcluster.clear();\n    if (!this.get('animationDuration')) return;\n    var features = this.getSource().getFeatures();\n    if (features.length && features[0].get('features')) {\n      this.oldcluster.addFeatures (this.clusters);\n      this.clusters = features.slice(0);\n      this.sourceChanged = true;\n    }\n  }\n};\n/** \n * Get the cluster that contains a feature\n * @private\n*/\nol.layer.AnimatedCluster.prototype.getClusterForFeature = function(f, cluster) {\n  for (var j=0, c; c=cluster[j]; j++) {\n    var features = c.get('features');\n    if (features && features.length) {\n      for (var k=0, f2; f2=features[k]; k++) {\n        if (f===f2) {\n          return c;\n        }\n      }\n    }\n  }\n  return false;\n};\n/** \n * Stop animation \n * @private \n */\nol.layer.AnimatedCluster.prototype.stopAnimation = function() {\n  this.animation.start = false;\n  this.animation.cA = [];\n  this.animation.cB = [];\n};\n/** \n * animate the cluster\n * @private\n */\nol.layer.AnimatedCluster.prototype.animate = function(e) {\n  var duration = this.get('animationDuration');\n  if (!duration) return;\n  var resolution = e.frameState.viewState.resolution;\n  var i, c0, a = this.animation;\n  var time = e.frameState.time;\n  // Start a new animation, if change resolution and source has changed\n  if (a.resolution != resolution && this.sourceChanged) {\n    var extent = e.frameState.extent;\n    if (a.resolution < resolution) {\n      extent = ol.extent.buffer(extent, 100*resolution);\n      a.cA = this.oldcluster.getFeaturesInExtent(extent);\n      a.cB = this.getSource().getFeaturesInExtent(extent);\n      a.revers = false;\n    } else {\n      extent = ol.extent.buffer(extent, 100*resolution);\n      a.cA = this.getSource().getFeaturesInExtent(extent);\n      a.cB = this.oldcluster.getFeaturesInExtent(extent);\n      a.revers = true;\n    }\n    a.clusters = [];\n    for (i=0, c0; c0=a.cA[i]; i++) {\n      var f = c0.get('features');\n      if (f && f.length) {\n        var c = this.getClusterForFeature (f[0], a.cB);\n        if (c) a.clusters.push({ f:c0, pt:c.getGeometry().getCoordinates() });\n      }\n    }\n    // Save state\n    a.resolution = resolution;\n    this.sourceChanged = false;\n    // No cluster or too much to animate\n    if (!a.clusters.length || a.clusters.length>1000) {\n      this.stopAnimation();\n      return;\n    }\n    // Start animation from now\n    time = a.start = (new Date()).getTime();\n  }\n  // Run animation\n  if (a.start) {\n    var vectorContext = e.vectorContext || ol.render.getVectorContext(e);\n    var d = (time - a.start) / duration;\n    // Animation ends\n    if (d > 1.0) {\n      this.stopAnimation();\n      d = 1;\n    }\n    d = this.get('animationMethod')(d);\n    // Animate\n    var style = this.getStyle();\n    var stylefn = (typeof(style) == 'function') ? style : style.length ? function(){ return style; } : function(){ return [style]; } ;\n    // Layer opacity\n    e.context.save();\n    e.context.globalAlpha = this.getOpacity();\n    for (i=0, c; c=a.clusters[i]; i++) {\n      var pt = c.f.getGeometry().getCoordinates();\n      var dx = pt[0]-c.pt[0];\n      var dy = pt[1]-c.pt[1];\n      if (a.revers) {\n        pt[0] = c.pt[0] + d * dx;\n        pt[1] = c.pt[1] + d * dy;\n      } else {\n        pt[0] = pt[0] - d * dx;\n        pt[1] = pt[1] - d * dy;\n      }\n      // Draw feature\n      var st = stylefn(c.f, resolution, true);\n      if (!st.length) st = [st];\n      // If one feature: draw the feature\n      if (c.f.get(\"features\").length===1 && !dx && !dy) {\n        f = c.f.get(\"features\")[0];\n      }\n      // else draw a point\n      else {\n        var geo = new ol.geom.Point(pt);\n        f = new ol.Feature(geo);\n      }\n      for (var k=0, s; s=st[k]; k++) {\n        // Multi-line text\n        if (s.getText() && /\\n/.test(s.getText().getText())) {\n          var offsetX = s.getText().getOffsetX();\n          var offsetY = s.getText().getOffsetY();\n          var rot = s.getText().getRotation() || 0;\n          var fontSize = Number((s.getText().getFont() || '10px').match(/\\d+/)) * 1.2;\n          var str = s.getText().getText().split('\\n')\n          var dl, nb = str.length-1;\n          var s2 = s.clone();\n          // Draw each lines\n          str.forEach(function(t, i) {\n            if (i==1) {\n              // Allready drawn\n              s2.setImage();\n              s2.setFill();\n              s2.setStroke();\n            }\n            switch (s.getText().getTextBaseline()) {\n              case 'alphabetic':\n              case 'ideographic':\n              case 'bottom': {\n                dl = nb;\n                break;\n              }\n              case 'hanging':\n              case 'top': {\n                dl = 0;\n                break;\n              }\n              default : {\n                dl = nb/2;\n                break;\n              }\n            }\n            s2.getText().setOffsetX(offsetX - Math.sin(rot)*fontSize*(i - dl));\n            s2.getText().setOffsetY(offsetY + Math.cos(rot)*fontSize*(i - dl));\n            s2.getText().setText(t);\n            vectorContext.drawFeature(f, s2);\n          });\n        } else {\n          vectorContext.drawFeature(f, s);\n        }\n        /* OLD VERSION OL < 4.3\n        // Retina device\n        var ratio = e.frameState.pixelRatio;\n        var sc;\n        // OL < v4.3 : setImageStyle doesn't check retina\n        var imgs = ol.Map.prototype.getFeaturesAtPixel ? false : s.getImage();\n        if (imgs)\n        {\tsc = imgs.getScale(); \n          imgs.setScale(sc*ratio); \n        }\n        // OL3 > v3.14\n        if (vectorContext.setStyle)\n        {\t// If one feature: draw the feature\n          if (c.f.get(\"features\").length===1 && !dx && !dy) {\n            vectorContext.drawFeature(c.f.get(\"features\")[0], s);\n          }\n          // else draw a point\n          else {\n            vectorContext.setStyle(s);\n            vectorContext.drawGeometry(geo);\n          }\n        }\n        // older version\n        else\n        {\tvectorContext.setImageStyle(imgs);\n          vectorContext.setTextStyle(s.getText());\n          vectorContext.drawPointGeometry(geo);\n        }\n        if (imgs) imgs.setScale(sc);\n        */\n      }\n    }\n    e.context.restore();\n    // tell ol to continue postcompose animation\n    e.frameState.animate = true;\n    // Prevent layer drawing (clip with null rect)\n    e.context.save();\n    e.context.beginPath();\n    e.context.rect(0,0,0,0);\n    e.context.clip();\n    this.clip_ = true;\n  }\n  return;\n};\n/**  \n * remove clipping after the layer is drawn\n * @private\n */\nol.layer.AnimatedCluster.prototype.postanimate = function(e) {\n  if (this.clip_) {\n    e.context.restore();\n    this.clip_ = false;\n  }\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc\n * Image layer to use with a GeoImage source and return the extent calcaulted with this source.\n * @extends {ol.layer.Image}\n * @param {Object=} options Layer Image options.\n * @api\n */\nol.layer.GeoImage = function(options) {\n  ol.layer.Image.call(this, options);\n}\nol.ext.inherits (ol.layer.GeoImage, ol.layer.Image);\n/**\n * Return the {@link module:ol/extent~Extent extent} of the source associated with the layer.\n * @return {ol.Extent} The layer extent.\n * @observable\n * @api\n */\nol.layer.GeoImage.prototype.getExtent = function() {\n  return this.getSource().getExtent();\n}\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n// \n/** IGN's Geoportail WMTS layer definition\n * @constructor \n * @extends {ol.layer.Tile}\n * @param {olx.layer.WMTSOptions=} options WMTS options if not defined default are used\n *  @param {string} options.layer Geoportail layer name\n *  @param {string} options.gppKey Geoportail API key\n *  @param {olx.source.WMTSOptions=} tileoptions WMTS options if not defined default are used\n */\nol.layer.Geoportail = function(layer, options, tileoptions) {\n  options = options || {};\n  tileoptions = tileoptions || {};\n  // use function(options, tileoption) when layer is set in options\n  if (layer.layer) {\n    tileoptions = options;\n    options = layer;\n    layer = options.layer;\n  }\n  var maxZoom = options.maxZoom;\n  var capabilities = window.geoportailConfig ? window.geoportailConfig.capabilities[options.gppKey || options.key] || window.geoportailConfig.capabilities[\"default\"] || ol.layer.Geoportail.capabilities : ol.layer.Geoportail.capabilities;\n  capabilities = capabilities[layer];\n  if (!capabilities) {\n    capabilities = { title: layer, originators: [] };\n    console.error(\"ol.layer.Geoportail: no layer definition for \\\"\"+layer+\"\\\"\\nTry to use ol/layer/Geoportail~loadCapabilities() to get it.\");\n    // throw new Error(\"ol.layer.Geoportail: no layer definition for \\\"\"+layer+\"\\\"\");\n  }\n  // tile options & default params\n  for (var i in capabilities) if (typeof\ttileoptions[i]== \"undefined\") tileoptions[i] = capabilities[i];\n  this._originators = capabilities.originators;\n  if (!tileoptions.gppKey) tileoptions.gppKey = options.gppKey || options.key;\n  options.source = new ol.source.Geoportail(layer, tileoptions);\n  if (!options.title) options.title = capabilities.title;\n  if (!options.name) options.name = layer;\n  options.layer = layer;\n  if (!options.queryable) options.queryable = capabilities.queryable;\n  if (!options.desc) options.desc = capabilities.desc;\n  if (!options.extent && capabilities.bbox) {\n    if (capabilities.bbox[0]>-170 && capabilities.bbox[2]<170) {\n      options.extent = ol.proj.transformExtent(capabilities.bbox, 'EPSG:4326', 'EPSG:3857');\n    }\n  }\n  options.maxZoom = maxZoom;\n  // calculate layer max resolution\n  if (!options.maxResolution && tileoptions.minZoom) {\n    options.source.getTileGrid().minZoom -= (tileoptions.minZoom>1 ? 2 : 1);\n    options.maxResolution = options.source.getTileGrid().getResolution(options.source.getTileGrid().minZoom)\n    options.source.getTileGrid().minZoom = tileoptions.minZoom;\n  }\n  ol.layer.Tile.call (this, options);\n  // BUG GPP: Attributions constraints are not set properly :(\n/** /\n  // Set attribution according to the originators\n  var counter = 0;\n  // Get default attribution\n  var getAttrib = function(title, o) {\n    if (this.get('attributionMode')==='logo') {\n      if (!title) return ol.source.Geoportail.prototype.attribution;\n      else return '<a href=\"'+o.href+'\"><img src=\"'+o.logo+'\" title=\"&copy; '+o.attribution+'\" /></a>';\n    } else {\n      if (!title) return ol.source.Geoportail.prototype.attribution;\n      else return '&copy; <a href=\"'+o.href+'\" title=\"&copy; '+(o.attribution||title)+'\" >'+title+'</a>'\n    }\n  }.bind(this);\n  var currentZ, currentCenter = [];\n  var setAttribution = function(e) {\n    var a, o, i;\n    counter--;\n    if (!counter) {\n      var z = e.frameState.viewState.zoom;\n      console.log(e)\n      if (z===currentZ \n        && e.frameState.viewState.center[0]===currentCenter[0]\n        && e.frameState.viewState.center[1]===currentCenter[1]){\n          return;\n      }\n      currentZ = z;\n      currentCenter = e.frameState.viewState.center;\n      var ex = e.frameState.extent;\n      ex = ol.proj.transformExtent (ex, e.frameState.viewState.projection, 'EPSG:4326');\n      if (this._originators) {\n        var attrib = this.getSource().getAttributions();\n        // ol v5\n        if (typeof(attrib)==='function') attrib = attrib();\n        attrib.splice(0, attrib.length);\n        var maxZoom = 0;\n        for (a in this._originators) {\n          o = this._originators[a];\n          for (i=0; i<o.constraint.length; i++) {\n            if (o.constraint[i].maxZoom > maxZoom\n              && ol.extent.intersects(ex, o.constraint[i].bbox)) {\n                maxZoom = o.constraint[i].maxZoom;\n            }\n          }\t\n        }\n        if (maxZoom < z) z = maxZoom;\n        if (this.getSource().getTileGrid() && z < this.getSource().getTileGrid().getMinZoom()) {\n          z = this.getSource().getTileGrid().getMinZoom();\n        }\n        for (a in this._originators) {\n          o = this._originators[a];\n          if (!o.constraint.length) {\n            attrib.push (getAttrib(a, o));\n          } else {\n            for (i=0; i<o.constraint.length; i++) {\n              if ( z <= o.constraint[i].maxZoom \n                && z >= o.constraint[i].minZoom \n                && ol.extent.intersects(ex, o.constraint[i].bbox)) {\n                  attrib.push (getAttrib(a, o));\n                  break;\n              }\n            }\n          }\n        }\n        if (!attrib.length) attrib.push ( getAttrib() );\n        this.getSource().setAttributions(attrib);\n      }\n    }\n  }.bind(this);\n  this.on('precompose', function(e) {\n    counter++;\n    setTimeout(function () { setAttribution(e) }, 500);\n  });\n/**/\n};\nol.ext.inherits (ol.layer.Geoportail, ol.layer.Tile);\n/** Default capabilities for main layers\n */\nol.layer.Geoportail.capabilities = {\n// choisirgeoportail\n  \"GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2\",\"title\":\"Plan IGN v2\",\"format\":\"image/png\",\"style\":\"normal\",\"queryable\":false,\"tilematrix\":\"PM\",\"minZoom\":0,\"maxZoom\":19,\"bbox\":[-175,-85,175,85],\"desc\":\"Cartographie multi-échelles sur le territoire national, issue des bases de données vecteur de l’IGN, mis à jour régulièrement et réalisée selon un processus entièrement automatisé. Version actuellement en beta test\",\"originators\":{\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":0,\"maxZoom\":19,\"constraint\":[{\"minZoom\":0,\"maxZoom\":19,\"bbox\":[-175,-85,175,85]}]}}},\n  \"CADASTRALPARCELS.PARCELLAIRE_EXPRESS\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"CADASTRALPARCELS.PARCELLAIRE_EXPRESS\",\"title\":\"PCI vecteur\",\"format\":\"image/png\",\"style\":\"PCI vecteur\",\"queryable\":false,\"tilematrix\":\"PM\",\"minZoom\":0,\"maxZoom\":19,\"bbox\":[-63.37252,-21.475586,55.925865,51.31212],\"desc\":\"Plan cadastral informatisé vecteur de la DGFIP.\",\"originators\":{\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":0,\"maxZoom\":19,\"constraint\":[{\"minZoom\":0,\"maxZoom\":19,\"bbox\":[-63.37252,-21.475586,55.925865,51.31212]}]}}},\n  \"ORTHOIMAGERY.ORTHOPHOTOS\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"ORTHOIMAGERY.ORTHOPHOTOS\",\"title\":\"Photographies aériennes\",\"format\":\"image/jpeg\",\"style\":\"normal\",\"queryable\":true,\"tilematrix\":\"PM\",\"minZoom\":0,\"bbox\":[-178.18713,-22.767689,167.94624,51.11242],\"desc\":\"Photographies aériennes\",\"originators\":{\"CRCORSE\":{\"href\":\"http://www.corse.fr//\",\"attribution\":\"CRCORSE\",\"logo\":\"https://wxs.ign.fr/static/logos/CRCORSE/CRCORSE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[8.428783,41.338627,9.688606,43.08541]}]},\"SIGLR\":{\"href\":\"http://www.siglr.org//\",\"attribution\":\"SIGLR\",\"logo\":\"https://wxs.ign.fr/static/logos/SIGLR/SIGLR.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[1.6784439,42.316307,4.8729386,44.978218]}]},\"BOURGOGNE-FRANCHE-COMTE\":{\"href\":\"https://www.bourgognefranchecomte.fr/\",\"attribution\":\"Auvergne\",\"logo\":\"https://wxs.ign.fr/static/logos/BOURGOGNE-FRANCHE-COMTE/BOURGOGNE-FRANCHE-COMTE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[2.837849,46.131435,7.1713247,48.408287]}]},\"FEDER_AUVERGNE\":{\"href\":\"http://www.europe-en-auvergne.eu/\",\"attribution\":\"Auvergne\",\"logo\":\"https://wxs.ign.fr/static/logos/FEDER_AUVERGNE/FEDER_AUVERGNE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[2.0398402,44.60505,3.38408,45.49146]}]},\"FEDER_PAYSDELALOIRE\":{\"href\":\"https://www.europe.paysdelaloire.fr/\",\"attribution\":\"Pays-de-la-Loire\",\"logo\":\"https://wxs.ign.fr/static/logos/FEDER_PAYSDELALOIRE/FEDER_PAYSDELALOIRE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[-2.457367,46.19304,0.951426,48.57609]}]},\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":13,\"maxZoom\":20,\"constraint\":[{\"minZoom\":19,\"maxZoom\":19,\"bbox\":[-63.160706,-21.401262,55.84643,51.11242]},{\"bbox\":[0.035491213,43.221077,6.0235267,49.696926]},{\"minZoom\":20,\"maxZoom\":20,\"bbox\":[0.035491213,43.221077,6.0235267,49.696926]},{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[-178.18713,-21.401329,55.85611,51.11242]}]},\"E-MEGALIS\":{\"href\":\"http://www.e-megalisbretagne.org//\",\"attribution\":\"Syndicat mixte de coopération territoriale (e-Megalis)\",\"logo\":\"https://wxs.ign.fr/static/logos/E-MEGALIS/E-MEGALIS.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[-3.7059498,47.971947,-1.8486879,48.99035]}]},\"FEDER2\":{\"href\":\"http://www.europe-en-france.gouv.fr/\",\"attribution\":\"Fonds européen de développement économique et régional\",\"logo\":\"https://wxs.ign.fr/static/logos/FEDER2/FEDER2.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[1.3577043,48.824635,4.269964,50.37648]}]},\"PREFECTURE_GUADELOUPE\":{\"href\":\"www.guadeloupe.pref.gouv.fr/\",\"attribution\":\"guadeloupe\",\"logo\":\"https://wxs.ign.fr/static/logos/PREFECTURE_GUADELOUPE/PREFECTURE_GUADELOUPE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[-61.82342,14.371942,-60.787838,16.521578]}]},\"OCCITANIE\":{\"href\":\"https://www.laregion.fr/\",\"attribution\":\"La Région Occitanie; Pyrénées - Méditerranée\",\"logo\":\"https://wxs.ign.fr/static/logos/OCCITANIE/OCCITANIE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[2.2086434,48.805965,2.4859917,48.915382]}]},\"RGD_SAVOIE\":{\"href\":\"http://www.rgd.fr\",\"attribution\":\"Régie de Gestion de Données des Pays de Savoie (RGD 73-74)\",\"logo\":\"https://wxs.ign.fr/static/logos/RGD_SAVOIE/RGD_SAVOIE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":19,\"maxZoom\":19,\"bbox\":[5.7759595,45.65335,7.0887337,46.438328]},{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[5.5923314,45.017353,7.2323394,46.438328]}]},\"CG45\":{\"href\":\"http://www.loiret.com\",\"attribution\":\"Le conseil général du Loiret\",\"logo\":\"https://wxs.ign.fr/static/logos/CG45/CG45.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[1.4883244,47.471867,3.1349874,48.354233]}]},\"CRAIG\":{\"href\":\"http://www.craig.fr\",\"attribution\":\"Centre Régional Auvergnat de l'Information Géographique (CRAIG)\",\"logo\":\"https://wxs.ign.fr/static/logos/CRAIG/CRAIG.gif\",\"minZoom\":13,\"maxZoom\":20,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[2.0398402,44.60505,6.4295278,46.8038]},{\"minZoom\":20,\"maxZoom\":20,\"bbox\":[2.2243388,44.76621,2.7314367,45.11295]}]},\"e-Megalis\":{\"href\":\"http://www.e-megalisbretagne.org//\",\"attribution\":\"Syndicat mixte de coopération territoriale (e-Megalis)\",\"logo\":\"https://wxs.ign.fr/static/logos/e-Megalis/e-Megalis.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[-5.1937118,47.23789,-0.98568505,48.980812]}]},\"PPIGE\":{\"href\":\"http://www.ppige-npdc.fr/\",\"attribution\":\"PPIGE\",\"logo\":\"https://wxs.ign.fr/static/logos/PPIGE/PPIGE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[1.5212119,49.957302,4.2673664,51.090965]}]},\"CG06\":{\"href\":\"http://www.cg06.fr\",\"attribution\":\"Département Alpes Maritimes (06) en partenariat avec : Groupement Orthophoto 06 (NCA, Ville de Cannes, CARF, CASA,CG06, CA de Grasse) \",\"logo\":\"https://wxs.ign.fr/static/logos/CG06/CG06.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[6.6093955,43.44647,7.7436337,44.377018]}]},\"MEGALIS-BRETAGNE\":{\"href\":\"https://www.megalisbretagne.org/\",\"attribution\":\"Syndicat mixte Mégalis Bretagne\",\"logo\":\"https://wxs.ign.fr/static/logos/MEGALIS-BRETAGNE/MEGALIS-BRETAGNE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[-5.2086344,47.591938,-3.3396015,48.808697]}]},\"FEDER\":{\"href\":\"http://www.europe-en-france.gouv.fr/\",\"attribution\":\"Fonds européen de développement économique et régional\",\"logo\":\"https://wxs.ign.fr/static/logos/FEDER/FEDER.gif\",\"minZoom\":0,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[-1.9662633,42.316307,8.25674,50.18387]},{\"minZoom\":0,\"maxZoom\":12,\"bbox\":[-2.400665,41.333557,9.560094,50.366302]}]},\"LANGUEDOC-ROUSSILLON\":{\"href\":\"https://www.laregion.fr/\",\"attribution\":\"Région Occitanie\",\"logo\":\"https://wxs.ign.fr/static/logos/LANGUEDOC-ROUSSILLON/LANGUEDOC-ROUSSILLON.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[1.6784439,42.63972,4.208843,43.979004]}]},\"GRAND_EST\":{\"href\":\"https://www.grandest.fr/\",\"attribution\":\"Hauts-de-France\",\"logo\":\"https://wxs.ign.fr/static/logos/GRAND_EST/GRAND_EST.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[5.362788,47.390827,7.6924667,49.58011]}]},\"CNES_AUVERGNE\":{\"href\":\"http://www.cnes.fr/\",\"attribution\":\"Centre national d'études spatiales (CNES)\",\"logo\":\"https://wxs.ign.fr/static/logos/CNES_AUVERGNE/CNES_AUVERGNE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[2.2656832,45.279934,4.0227704,46.8038]}]},\"HAUTS_DE_FRANCE\":{\"href\":\"https://www.hautsdefrance.fr/\",\"attribution\":\"Hauts-de-France\",\"logo\":\"https://wxs.ign.fr/static/logos/HAUTS_DE_FRANCE/HAUTS_DE_FRANCE.gif\",\"minZoom\":13,\"maxZoom\":19,\"constraint\":[{\"minZoom\":13,\"maxZoom\":19,\"bbox\":[2.0740242,48.81521,4.3390365,51.11242]}]},\"MPM\":{\"href\":\"http://www.marseille-provence.com/\",\"attribution\":\"Marseille Provence Métropole\",\"logo\":\"https://wxs.ign.fr/static/logos/MPM/MPM.gif\",\"minZoom\":20,\"maxZoom\":20,\"constraint\":[{\"minZoom\":20,\"maxZoom\":20,\"bbox\":[5.076959,43.153347,5.7168245,43.454994]}]},\"DITTT\":{\"href\":\"http://www.dittt.gouv.nc/portal/page/portal/dittt/\",\"attribution\":\"Direction des Infrastructures, de la Topographie et des Transports Terrestres\",\"logo\":\"https://wxs.ign.fr/static/logos/DITTT/DITTT.gif\",\"minZoom\":13,\"maxZoom\":18,\"constraint\":[{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[163.47784,-22.767689,167.94624,-19.434975]}]},\"CNES_978\":{\"href\":\"http://www.cnes.fr/\",\"attribution\":\"Centre national d'études spatiales (CNES)\",\"logo\":\"https://wxs.ign.fr/static/logos/CNES_978/CNES_978.gif\",\"minZoom\":13,\"maxZoom\":18,\"constraint\":[{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[-63.160706,18.04345,-62.962185,18.133898]}]},\"CNES_ALSACE\":{\"href\":\"http://www.cnes.fr/\",\"attribution\":\"Centre national d'études spatiales (CNES)\",\"logo\":\"https://wxs.ign.fr/static/logos/CNES_ALSACE/CNES_ALSACE.gif\",\"minZoom\":13,\"maxZoom\":18,\"constraint\":[{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[6.8086324,47.39981,7.668318,48.32695]}]},\"CNES_974\":{\"href\":\"http://www.cnes.fr/\",\"attribution\":\"Centre national d'études spatiales (CNES)\",\"logo\":\"https://wxs.ign.fr/static/logos/CNES_974/CNES_974.gif\",\"minZoom\":13,\"maxZoom\":18,\"constraint\":[{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[55.205757,-21.401262,55.84643,-20.862825]}]},\"CNES_975\":{\"href\":\"http://www.cnes.fr/\",\"attribution\":\"Centre national d'études spatiales (CNES)\",\"logo\":\"https://wxs.ign.fr/static/logos/CNES_975/CNES_975.gif\",\"minZoom\":13,\"maxZoom\":18,\"constraint\":[{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[-56.410988,46.734093,-56.10308,47.149963]}]},\"CNES_976\":{\"href\":\"http://www.cnes.fr/\",\"attribution\":\"Centre national d'études spatiales (CNES)\",\"logo\":\"https://wxs.ign.fr/static/logos/CNES_976/CNES_976.gif\",\"minZoom\":13,\"maxZoom\":18,\"constraint\":[{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[44.916977,-13.089187,45.30442,-12.564543]}]},\"CNES_977\":{\"href\":\"http://www.cnes.fr/\",\"attribution\":\"Centre national d'études spatiales (CNES)\",\"logo\":\"https://wxs.ign.fr/static/logos/CNES_977/CNES_977.gif\",\"minZoom\":13,\"maxZoom\":18,\"constraint\":[{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[-62.952805,17.862621,-62.78276,17.98024]}]},\"CNES\":{\"href\":\"http://www.cnes.fr/\",\"attribution\":\"Centre national d'études spatiales (CNES)\",\"logo\":\"https://wxs.ign.fr/static/logos/CNES/CNES.gif\",\"minZoom\":13,\"maxZoom\":16,\"constraint\":[{\"minZoom\":13,\"maxZoom\":16,\"bbox\":[-55.01953,1.845384,-50.88867,6.053161]}]},\"ASTRIUM\":{\"href\":\"http://www.geo-airbusds.com/\",\"attribution\":\"Airbus Defence and Space\",\"logo\":\"https://wxs.ign.fr/static/logos/ASTRIUM/ASTRIUM.gif\",\"minZoom\":13,\"maxZoom\":16,\"constraint\":[{\"minZoom\":13,\"maxZoom\":16,\"bbox\":[-55.01953,1.845384,-50.88867,6.053161]}]},\"CNES_971\":{\"href\":\"http://www.cnes.fr/\",\"attribution\":\"Centre national d'études spatiales (CNES)\",\"logo\":\"https://wxs.ign.fr/static/logos/CNES_971/CNES_971.gif\",\"minZoom\":13,\"maxZoom\":18,\"constraint\":[{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[-61.82342,15.819616,-60.99497,16.521578]}]},\"CNES_972\":{\"href\":\"http://www.cnes.fr/\",\"attribution\":\"Centre national d'études spatiales (CNES)\",\"logo\":\"https://wxs.ign.fr/static/logos/CNES_972/CNES_972.gif\",\"minZoom\":13,\"maxZoom\":18,\"constraint\":[{\"minZoom\":13,\"maxZoom\":18,\"bbox\":[-61.247208,14.371855,-60.778458,14.899901]}]}}},\n// other layers\n  \"GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD\",\"title\":\"Carte IGN\",\"format\":\"image/jpeg\",\"style\":\"normal\",\"queryable\":false,\"tilematrix\":\"PM\",\"minZoom\":0,\"maxZoom\":18,\"bbox\":[-179.62723,-84.5047,179.74588,85.47958],\"desc\":\"Cartographie topographique multi-échelles du territoire français issue des bases de données vecteur de l’IGN - emprise nationale, visible du 1/200 au 1/130000000\",\"originators\":{\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":0,\"maxZoom\":18,\"constraint\":[{\"minZoom\":5,\"maxZoom\":5,\"bbox\":[-179.57285,-83.84196,178.4975,85.36646]},{\"minZoom\":0,\"maxZoom\":2,\"bbox\":[-175.99709,-84.42859,175.99709,84.2865]},{\"minZoom\":3,\"maxZoom\":3,\"bbox\":[-176.23093,-84.5047,179.08267,84.89126]},{\"minZoom\":4,\"maxZoom\":4,\"bbox\":[-179.62723,-84.0159,-179.21112,85.47958]},{\"minZoom\":6,\"maxZoom\":8,\"bbox\":[-179.49689,-84.02368,179.74588,85.30035]},{\"minZoom\":15,\"maxZoom\":18,\"bbox\":[-5.6663494,41.209736,10.819784,51.175068]},{\"minZoom\":14,\"maxZoom\":14,\"bbox\":[-5.713191,40.852314,11.429714,51.44377]},{\"minZoom\":13,\"maxZoom\":13,\"bbox\":[-63.37252,13.428586,11.429714,51.44377]},{\"minZoom\":11,\"maxZoom\":12,\"bbox\":[-63.37252,13.428586,11.496459,51.444122]},{\"minZoom\":9,\"maxZoom\":9,\"bbox\":[-64.81273,13.428586,11.496459,51.444016]},{\"minZoom\":10,\"maxZoom\":10,\"bbox\":[-63.37252,13.428586,11.496459,51.444016]}]}}},\n  \"GEOGRAPHICALGRIDSYSTEMS.SLOPES.MOUNTAIN\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"GEOGRAPHICALGRIDSYSTEMS.SLOPES.MOUNTAIN\",\"title\":\"Carte des pentes\",\"format\":\"image/png\",\"style\":\"normal\",\"queryable\":false,\"tilematrix\":\"PM\",\"minZoom\":0,\"maxZoom\":17,\"bbox\":[-63.161392,-21.544624,56.001812,51.099052],\"desc\":\"Carte des zones ayant une valeur de pente supérieure à 30°-35°-40°-45° d'après la BD ALTI au pas de 5m\",\"originators\":{\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":0,\"maxZoom\":17,\"constraint\":[{\"minZoom\":0,\"maxZoom\":17,\"bbox\":[-5.1504726,41.32521,9.570543,51.099052]}]}}},\n  \"ADMINEXPRESS_COG_2018\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"ADMINEXPRESS_COG_2018\",\"title\":\"ADMINEXPRESS_COG (2018)\",\"format\":\"image/png\",\"style\":\"normal\",\"queryable\":true,\"tilematrix\":\"PM\",\"minZoom\":6,\"maxZoom\":16,\"bbox\":[-63.37252,-21.475586,55.925865,51.31212],\"desc\":\"Limites administratives COG mises à jour en continu. État en Mai 2018.\",\"originators\":{\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":6,\"maxZoom\":16,\"constraint\":[{\"minZoom\":6,\"maxZoom\":16,\"bbox\":[-63.37252,-21.475586,55.925865,51.31212]}]}}},\n  \"ELEVATION.SLOPES\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"ELEVATION.SLOPES\",\"title\":\"Altitude\",\"format\":\"image/jpeg\",\"style\":\"normal\",\"queryable\":true,\"tilematrix\":\"PM\",\"minZoom\":6,\"maxZoom\":14,\"bbox\":[-178.20589,-22.595179,167.43176,50.93085],\"desc\":\"La couche altitude se compose d'un MNT (Modèle Numérique de Terrain) affiché en teintes hypsométriques et issu de la BD ALTI®.\",\"originators\":{\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":6,\"maxZoom\":14,\"constraint\":[{\"minZoom\":6,\"maxZoom\":14,\"bbox\":[55.205746,-21.392344,55.846554,-20.86271]}]}}},\n  \"GEOGRAPHICALGRIDSYSTEMS.MAPS.BDUNI.J1\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"GEOGRAPHICALGRIDSYSTEMS.MAPS.BDUNI.J1\",\"title\":\"Plan IGN j+1\",\"format\":\"image/png\",\"style\":\"normal\",\"queryable\":false,\"tilematrix\":\"PM\",\"minZoom\":0,\"maxZoom\":18,\"bbox\":[-179.5,-75,179.5,75],\"desc\":\"Plan IGN j+1\",\"originators\":{\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":0,\"maxZoom\":18,\"constraint\":[{\"minZoom\":0,\"maxZoom\":18,\"bbox\":[-179,-80,179,80]}]}}},\n  \"ADMINEXPRESS_COG_CARTO_2018\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"ADMINEXPRESS_COG_CARTO_2018\",\"title\":\"ADMINEXPRESS_COG_CARTO (2018)\",\"format\":\"image/png\",\"style\":\"normal\",\"queryable\":true,\"tilematrix\":\"PM\",\"minZoom\":6,\"maxZoom\":16,\"bbox\":[-63.37252,-21.475586,55.925865,51.31212],\"desc\":\"Limites administratives COG généralisées mises à jour en continu. État en Mai 2018.\",\"originators\":{\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":6,\"maxZoom\":16,\"constraint\":[{\"minZoom\":6,\"maxZoom\":16,\"bbox\":[-63.37252,-21.475586,55.925865,51.31212]}]}}},\n  \"GEOGRAPHICALGRIDSYSTEMS.MAPS\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"GEOGRAPHICALGRIDSYSTEMS.MAPS\",\"title\":\"Cartes IGN\",\"format\":\"image/jpeg\",\"style\":\"normal\",\"queryable\":true,\"tilematrix\":\"PM\",\"minZoom\":0,\"maxZoom\":18,\"bbox\":[-180,-75,180,80],\"desc\":\"Cartes IGN\",\"originators\":{\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":0,\"maxZoom\":18,\"constraint\":[{\"minZoom\":7,\"maxZoom\":7,\"bbox\":[-178.20573,-68.138855,144.84375,51.909786]},{\"minZoom\":8,\"maxZoom\":8,\"bbox\":[-178.20573,-68.138855,168.24327,51.909786]},{\"minZoom\":13,\"maxZoom\":13,\"bbox\":[-178.20573,-67.101425,168.24327,51.44377]},{\"minZoom\":14,\"maxZoom\":14,\"bbox\":[-178.20573,-67.101425,168.23909,51.44377]},{\"minZoom\":11,\"maxZoom\":12,\"bbox\":[-178.20573,-67.101425,168.24327,51.444122]},{\"minZoom\":9,\"maxZoom\":10,\"bbox\":[-178.20573,-68.138855,168.24327,51.444016]},{\"minZoom\":15,\"maxZoom\":15,\"bbox\":[-178.20573,-46.502903,168.23909,51.175068]},{\"minZoom\":16,\"maxZoom\":16,\"bbox\":[-178.20573,-46.502903,168.29811,51.175068]},{\"minZoom\":0,\"maxZoom\":6,\"bbox\":[-180,-60,180,80]},{\"minZoom\":18,\"maxZoom\":18,\"bbox\":[-5.6663494,41.209736,10.819784,51.175068]},{\"minZoom\":17,\"maxZoom\":17,\"bbox\":[-179.5,-75,179.5,75]}]},\"DITTT\":{\"href\":\"http://www.dittt.gouv.nc/portal/page/portal/dittt/\",\"attribution\":\"Direction des Infrastructures, de la Topographie et des Transports Terrestres\",\"logo\":\"https://wxs.ign.fr/static/logos/DITTT/DITTT.gif\",\"minZoom\":8,\"maxZoom\":16,\"constraint\":[{\"minZoom\":8,\"maxZoom\":10,\"bbox\":[163.47784,-22.972307,168.24327,-19.402702]},{\"minZoom\":11,\"maxZoom\":13,\"bbox\":[163.47784,-22.972307,168.24327,-19.494438]},{\"minZoom\":14,\"maxZoom\":15,\"bbox\":[163.47784,-22.764496,168.23909,-19.493542]},{\"minZoom\":16,\"maxZoom\":16,\"bbox\":[163.47784,-22.809465,168.29811,-19.403923]}]}}},\n  \"TRANSPORTNETWORKS.ROADS\": {\"server\":\"https://wxs.ign.fr/geoportail/wmts\",\"layer\":\"TRANSPORTNETWORKS.ROADS\",\"title\":\"Routes\",\"format\":\"image/png\",\"style\":\"normal\",\"queryable\":false,\"tilematrix\":\"PM\",\"minZoom\":6,\"maxZoom\":18,\"bbox\":[-63.969162,-21.49687,55.964417,71.584076],\"desc\":\"Affichage du réseau routier français et européen.\",\"originators\":{\"IGN\":{\"href\":\"http://www.ign.fr\",\"attribution\":\"Institut national de l'information géographique et forestière\",\"logo\":\"https://wxs.ign.fr/static/logos/IGN/IGN.gif\",\"minZoom\":6,\"maxZoom\":18,\"constraint\":[{\"minZoom\":15,\"maxZoom\":18,\"bbox\":[-63.37252,-21.475586,55.925865,51.31212]},{\"minZoom\":6,\"maxZoom\":14,\"bbox\":[-63.969162,-21.49687,55.964417,71.584076]}]}}},\n};\n/** Load capabilities from the service\n * @param {string} gppKey the API key to get capabilities for\n * @return {*} Promise-like response\n */\nol.layer.Geoportail.loadCapabilities = function(gppKey, all) {\n  var onSuccess = function() {}\n  var onError = function() {}\n  var onFinally = function() {};\n  this.getCapabilities(gppKey,all).then(function(c) {\n    ol.layer.Geoportail.capabilities = c;\n    onSuccess(c);\n  }).catch(function(e) { \n    onError(e);\n  }).finally(function(c) {\n    onFinally(c);\n  });\n  var response = {\n    then: function (callback) {\n      if (typeof(callback)==='function') onSuccess = callback;\n      return response;\n    },\n    catch: function (callback) {\n      if (typeof(callback)==='function') onError = callback;\n      return response;\n    },\n    finally: function (callback) {\n      if (typeof(callback)==='function') onFinally = callback;\n      return response;\n    }\n  }\n  return response;\n};\n/** Get Key capabilities\n * @param {string} gppKey the API key to get capabilities for\n * @return {*} Promise-like response\n */\nol.layer.Geoportail.getCapabilities = function(gppKey) {\n  var capabilities = {};\n  var onSuccess = function() {}\n  var onError = function() {}\n  var onFinally = function() {}\n  var geopresolutions = [156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,0.5971642833948135,0.29858214169740677,0.14929107084870338];\n  // Transform resolution to zoom\n  function getZoom(res) {\n    res = Number(res) * 0.000281;\n    for (var r=0; r<geopresolutions.length; r++) \n      if (res>geopresolutions[r]) return r;\n  }\n  // Merge constraints \n  function mergeConstraints(ori) {\n    for (var i=ori.constraint.length-1; i>0; i--) {\n      for (var j=0; j<i; j++) {\n        var bok = true;\n        for (var k=0; k<4; k++) {\n          if (ori.constraint[i].bbox[k] != ori.constraint[j].bbox[k]) {\n            bok = false;\n            break;\n          }\n        }\n        if (!bok) continue;\n        if (ori.constraint[i].maxZoom == ori.constraint[j].minZoom \n        || ori.constraint[j].maxZoom == ori.constraint[i].minZoom \n        || ori.constraint[i].maxZoom+1 == ori.constraint[j].minZoom \n        || ori.constraint[j].maxZoom+1 == ori.constraint[i].minZoom\n        || ori.constraint[i].minZoom-1 == ori.constraint[j].maxZoom\n        || ori.constraint[j].minZoom-1 == ori.constraint[i].maxZoom) {\n          ori.constraint[j].maxZoom = Math.max(ori.constraint[i].maxZoom, ori.constraint[j].maxZoom);\n          ori.constraint[j].minZoom = Math.min(ori.constraint[i].minZoom, ori.constraint[j].minZoom);\n          ori.constraint.splice(i,1);\n          break;\n        }\n      }\n    }\n  }\n  // Get capabilities\n  ol.ext.Ajax.get({\n    url: 'https://wxs.ign.fr/'+gppKey+'/autoconf/',\n    dataType: 'TEXT',\n    error: function (e) {\n      onError(e);\n      onFinally({});\n    },\n    success: function(resp) {\n      var parser = new DOMParser();\n      var config = parser.parseFromString(resp,\"text/xml\");\n      var layers = config.getElementsByTagName('Layer');\n      for (var i=0, l; l=layers[i]; i++) {\n        // WMTS ?\n        if (!/WMTS/.test(l.getElementsByTagName('Server')[0].attributes['service'].value)) continue;\n//        if (!all && !/geoportail\\/wmts/.test(l.find(\"OnlineResource\").attr(\"href\"))) continue;\n        var service = {\n          server: l.getElementsByTagName('gpp:Key')[0].innerHTML.replace(gppKey+\"/\",\"\"), \n          layer: l.getElementsByTagName('Name')[0].innerHTML,\n          title: l.getElementsByTagName('Title')[0].innerHTML,\n          format: l.getElementsByTagName('Format')[0].innerHTML,\n          style: l.getElementsByTagName('Style')[0].getElementsByTagName('Name')[0].innerHTML,\n          queryable: (l.attributes.queryable.value==='1'),\n          tilematrix: 'PM',\n          minZoom: getZoom(l.getElementsByTagName('sld:MaxScaleDenominator')[0].innerHTML),\n          maxZoom: getZoom(l.getElementsByTagName('sld:MinScaleDenominator')[0].innerHTML),\n          bbox: JSON.parse('['+l.getElementsByTagName('gpp:BoundingBox')[0].innerHTML+']'),\n          desc: l.getElementsByTagName('Abstract')[0].innerHTML.replace(/^<!\\[CDATA\\[(.*)\\]\\]>$/, '$1')\n        };\n        service.originators = {};\n        var origin = l.getElementsByTagName('gpp:Originator');\n        for (var k=0, o; o=origin[k]; k++) {\n          var ori = service.originators[o.attributes['name'].value] = {\n            href: o.getElementsByTagName('gpp:URL')[0].innerHTML,\n            attribution: o.getElementsByTagName('gpp:Attribution')[0].innerHTML,\n            logo: o.getElementsByTagName('gpp:Logo')[0].innerHTML,\n            minZoom: 20,\n            maxZoom: 0,\n            constraint: []\n          };\n          // Scale contraints\n          var constraint = o.getElementsByTagName('gpp:Constraint');\n          for (var j=0, c; c=constraint[j]; j++) {\n            var zmax = getZoom(c.getElementsByTagName('sld:MinScaleDenominator')[0].innerHTML);\n            var zmin = getZoom(c.getElementsByTagName('sld:MaxScaleDenominator')[0].innerHTML);\n            if (zmin > ori.maxZoom) ori.maxZoom = zmin;\n            if (zmin < ori.minZoom) ori.minZoom = zmin;\n            if (zmax>ori.maxZoom) ori.maxZoom = zmax;\n            if (zmax<ori.minZoom) ori.minZoom = zmax;\n            ori.constraint.push({\n              minZoom: zmin,\n              maxZoom: zmax,\n              bbox: JSON.parse('['+c.getElementsByTagName('gpp:BoundingBox')[0].innerHTML+']')\n            });\n          }\n          // Merge constraints\n          mergeConstraints(ori)\n        }\n        capabilities[service.layer] = service;\n      }\n      onSuccess(capabilities);\n      onFinally(capabilities);\n    }\n  });\n  // Promise like response\n  var response = {\n    then: function (callback) {\n      if (typeof(callback)==='function') onSuccess = callback;\n      return response;\n    },\n    catch: function (callback) {\n      if (typeof(callback)==='function') onError = callback;\n      return response;\n    },\n    finally: function (callback) {\n      if (typeof(callback)==='function') onFinally = callback;\n      return response;\n    },\n  }\n  return response;\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Return a preview image of the source.\n * @param {ol.Coordinate|undefined} lonlat The center of the preview.\n * @param {number} resolution of the preview.\n * @return {String} the preview url\n * @api\n */\nol.source.Source.prototype.getPreview = function(/*lonlat, resolution*/) {\n  return \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAk6QAAJOkBUCTn+AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANeSURBVHic7ZpPiE1RHMc/780MBhkik79JSUlIUbOxI+wkI2yRhYSUlJLNpJF/xcpiJBmZGBZsNM1CkmhKITGkGbH0/BuPmXnP4rxbb/TOn3fvOffeec6nfqvb/b7f93fveeec37ng8Xg8Ho/nf6Uu4d+fDswFssCvhHOJhaXAMeApMAQUyyIPPAdOAiuTStAVy4EHjDWsix5gdRLJ2mY34ulWYz6IEeA4kIk9awtkgTOEM/5vdAKT4k0/Ou3YMR/ELcbRm9AKFLBbgCJwNE4TYZkJfMG++SIwDCyLz0o4bI17WdyJz0r1TAZ+oDcxCBwAFgIzEIuhvcBbg3sLwOK4DFXLFvQGniCGSSUagS4DjUPOHESkA3XiOWCORqMR6Nfo9DjI3QqPUSd+ylBnv0Zn0GrWFvmIOvGNhjqrNDp/EAutyFgRKUM2tgO+Gur81FxvAKYZaimxXYBvmuuLDHWWaK4X0RfJCNsF6NdcbzXU2a65PohYFKWOc+jn8PUajbWIXaBKp9NB7lZYh34OzwFbFfd/NtDYYSth27urLGIm0M31AL3APWAAmIooymaDnPIl/Vz4NN1yHrd7gcvxWQnHAuA3bsyPop8hUsE13BSgK04TUViBeFo2zedJ8S6wElexW4D2eNOPTjNi6WvD/DtEr8E6tk6GGoAmxFY2iFHE9NZiQf8gogiB9gTEH23izAZuE77vHyU+ANucO1QwD3hD/MbLowAcdm20EmkwXx4n3NodS9rMB2HabYpEWs0HcRqHp0fNwAvJD+eBTZr7p6BvmQVxUaEzEbiruNfJekH15L8jtrEm7JJolEcOmKXRqQOuKDQuY7HZY8s8iNfzkSLxIuI43FTrkkLnOlBfRW4VsWk+oAX5weknxFAxJQNckGgVgZuIRVoomoGXEmGTMa+iQ6K7M4SW7k24QYgiuDQPYinbhugiF4H3RGtzZYCzyIvQXfpNI1ybLyeLpf5+iTbkRbiP2EcocTHm4+YI8iI8RFHwWjAfsA95Q+YZFU6wasl8wB7kReijtNbIILa0vcg/PRlGfPQwHmlCviDqAzaA+OREtzqr1ejOIDorxlNEjTGUBV4nnUWCvAJxGDlA8q9j3DEArAn2zvXAfOwfl6eVAmJrPpJ0Ih6Px+PxeJLjLwPul3vj5d0eAAAAAElFTkSuQmCC\";\n};\n/**\n * Return the tile image of the source.\n * @param {ol.Coordinate|undefined} lonlat The center of the preview.\n * @param {number} resolution of the preview.\n * @return {String} the preview url\n * @api\n */\nol.source.Tile.prototype.getPreview = function(lonlat, resolution) {\n  if (!lonlat) lonlat = [21020, 6355964];\n  if (!resolution) resolution = 150;\n  var coord = this.getTileGrid().getTileCoordForCoordAndResolution(lonlat, resolution);\n  var fn = this.getTileUrlFunction();\n  return fn.call(this, coord, this.getProjection());\n};\n/**\n * Return the tile image of the source.\n * @param {ol.Coordinate|undefined} lonlat The center of the preview.\n * @param {number} resolution of the preview.\n * @return {String} the preview url\n * @api\n */\nol.source.TileWMS.prototype.getPreview = function(lonlat, resolution) {\n  if (!lonlat) lonlat = [21020, 6355964];\n  if (!resolution) resolution = 150;\n  var fn = this.getTileUrlFunction();\n  if (fn) {\n    var tileGrid = this.getTileGrid() || this.getTileGridForProjection(this.getProjection());\n    var coord = tileGrid.getTileCoordForCoordAndResolution(lonlat, resolution);\n    return fn.call(this, coord, 1, this.getProjection());\n  }\n  // Use getfeature info instead\n  var url = this.getGetFeatureInfoUrl ? \n    this.getGetFeatureInfoUrl(lonlat, resolution, this.getProjection() || 'EPSG:3857', {})\n    : this.getFeatureInfoUrl(lonlat, resolution, this.getProjection() || 'EPSG:3857', {});\n  url = url.replace(/getfeatureinfo/i,\"GetMap\");\n  return url;\n};\n/**\n * Return a preview for the layer.\n * @param {ol.Coordinate|undefined} lonlat The center of the preview.\n * @param {number} resolution of the preview.\n * @return {Array<String>} list of preview url\n * @api\n */\nol.layer.Base.prototype.getPreview = function(lonlat, resolution, projection) {\n  if (this.get(\"preview\")) return [ this.get(\"preview\") ];\n  if (!resolution) resolution = 150;\n  // Get middle resolution\n  if (resolution < this.getMinResolution() || resolution > this.getMaxResolution()) {\n    var rmin = this.getMinResolution(),\n      rmax = this.getMaxResolution();\n    if (rmax>100000) rmax = 156543;\t// min zoom : world\n    if (rmin<0.15) rmin = 0.15;\t// max zoom \n    resolution = rmax;\n    while (rmax>rmin) {\n      rmin *= 2;\n      rmax /= 2;\n      resolution = rmin;\n    }\n  }\n  var e = this.getExtent();\n  if (!lonlat) lonlat = [21020, 6355964];\t// Default lonlat\n  if (e && !ol.extent.containsCoordinate(e,lonlat)) lonlat = [ (e[0]+e[2])/2, (e[1]+e[3])/2 ];\n  if (projection) lonlat = ol.proj.transform (lonlat, projection, this.getSource().getProjection());\n  if (this.getSource && this.getSource()) {\n    return [ this.getSource().getPreview(lonlat, resolution) ];\n  }\n  return [];\n};\n/**\n * Return a preview for the layer.\n * @param {_ol_coordinate_|undefined} lonlat The center of the preview.\n * @param {number} resolution of the preview.\n * @return {Array<String>} list of preview url\n * @api\n */\nol.layer.Group.prototype.getPreview = function(lonlat, resolution) {\n  if (this.get(\"preview\")) return [ this.get(\"preview\") ];\n  var t = [];\n  if (this.getLayers) {\n    var l = this.getLayers().getArray();\n    for (var i=0; i<l.length; i++) {\n      t = t.concat(l[i].getPreview(lonlat, resolution));\n    }\n  }\n  return t;\n};\n\n/** ol.layer.Vector.prototype.setRender3D\n * @extends {ol.layer.Vector}\n * @param {ol.render3D}\n */\nol.layer.Vector.prototype.setRender3D = function (r) {\n  r.setLayer(this);\n}\n/** \n * @classdesc\n *  3D vector layer rendering\n * @constructor\n * @param {Object} param\n *  @param {ol.layer.Vector} param.layer the layer to display in 3D\n *  @param {ol.style.Style} options.style drawing style\n *  @param {function|boolean} param.active a function that returns a boolean or a boolean ,default true\n *  @param {boolean} param.ghost use ghost style\n *  @param {number} param.maxResolution  max resolution to render 3D\n *  @param {number} param.defaultHeight default height if none is return by a propertie\n *  @param {function|string|Number} param.height a height function (returns height giving a feature) or a popertie name for the height or a fixed value\n */\nol.render3D = function (options) {\n  options = options || {};\n  options.maxResolution = options.maxResolution || 100\n  options.defaultHeight = options.defaultHeight || 0;\n  ol.Object.call (this, options);\n  this.setStyle(options.style);\n  this.set('ghost', options.ghost);\n  this.setActive(options.active || options.active!==false);\n  this.height_ = options.height = this.getHfn (options.height);\n  if (options.layer) this.setLayer(options.layer);\n}\nol.ext.inherits(ol.render3D, ol.Object);\n/**\n * Set style associated with the renderer\n * @param {ol.style.Style} s\n */\nol.render3D.prototype.setStyle = function(s) {\n  if (s instanceof ol.style.Style) this._style = s;\n  else this._style = new ol.style.Style ();\n  if (!this._style.getStroke()) {\n    this._style.setStroke(new ol.style.Stroke({\n      width: 1,\n      color: 'red'\n    }));\n  }\n  if (!this._style.getFill()) {\n    this._style.setFill( new ol.style.Fill({ color: 'rgba(0,0,255,0.5)'}) );\n  }\n  // Get the geometry\n  if (s && s.getGeometry()) {\n    var geom = s.getGeometry();\n    if (typeof(geom)==='function') {\n      this.set('geometry', geom);\n    } else {\n      this.set('geometry', function() { return geom; });\n    }\n  } else {\n    this.set('geometry', function(f) { return f.getGeometry(); });\n  }\n};\n/**\n * Get style associated with the renderer\n * @return {ol.style.Style}\n */\nol.render3D.prototype.getStyle = function() {\n  return this._style;\n};\n/** Set active\n * @param {function|boolean} active\n */\nol.render3D.prototype.setActive = function(active) {\n  if (typeof(active)==='function') {\n    this._active = active;\n  }\n  else {\n    this._active = function() { return active; };\n  }\n  if (this.layer_) this.layer_.changed();\n};\n/** Get active\n * @return {boolean} \n */\nol.render3D.prototype.getActive = function() {\n  return this._active();\n};\n/** Calculate 3D at potcompose\n*/\nol.render3D.prototype.onPostcompose_ = function(e) {\n  if (!this.getActive()) return;\n  var res = e.frameState.viewState.resolution;\n  if (res > this.get('maxResolution')) return;\n  this.res_ = res*400;\n  if (this.animate_) {\n    var elapsed = e.frameState.time - this.animate_;\n    if (elapsed < this.animateDuration_) {\n      this.elapsedRatio_ = this.easing_(elapsed / this.animateDuration_);\n      // tell OL3 to continue postcompose animation\n      e.frameState.animate = true;\n    } else {\n      this.animate_ = false;\n      this.height_ = this.toHeight_\n    }\n  }\n  var ratio = e.frameState.pixelRatio;\n  var ctx = e.context;\n  var m = this.matrix_ = e.frameState.coordinateToPixelTransform;\n  // Old version (matrix)\n  if (!m) {\n    m = e.frameState.coordinateToPixelMatrix,\n    m[2] = m[4];\n    m[3] = m[5];\n    m[4] = m[12];\n    m[5] = m[13];\n  }\n  this.center_ = [ ctx.canvas.width/2/ratio, ctx.canvas.height/ratio ];\n  var f = this.layer_.getSource().getFeaturesInExtent(e.frameState.extent);\n  ctx.save();\n    ctx.scale(ratio,ratio);\n    var s = this.getStyle();\n    ctx.lineWidth = s.getStroke().getWidth();\n    ctx.strokeStyle = ol.color.asString(s.getStroke().getColor());\n    ctx.fillStyle = ol.color.asString(s.getFill().getColor());\n    var builds = [];\n    for (var i=0; i<f.length; i++) {\n      var h = this.getFeatureHeight(f[i])\n      if (h) builds.push (this.getFeature3D_ (f[i], h));\n    }\n    if (this.get('ghost')) this.drawGhost3D_ (ctx, builds);\n    else this.drawFeature3D_ (ctx, builds);\n  ctx.restore();\n};\n/** Set layer to render 3D\n*/\nol.render3D.prototype.setLayer = function(l) {\n  if (this._listener) {\n    this._listener.forEach( function(l) { \n      ol.Observable.unByKey(l); \n    });\n  }\n  this.layer_ = l;\n  this._listener = l.on (['postcompose', 'postrender'], this.onPostcompose_.bind(this));\n}\n/** Create a function that return height of a feature\n*\t@param {function|string|number} h a height function or a popertie name or a fixed value\n*\t@return {function} function(f) return height of the feature f\n*/\nol.render3D.prototype.getHfn= function(h) {\n  switch (typeof(h)) {\n    case 'function': return h;\n    case 'string': {\n      var dh = this.get('defaultHeight');\n        return (function(f) {\n          return (Number(f.get(h)) || dh); \n        });\n      }\n    case 'number': return (function(/*f*/) { return h; });\n    default: return (function(/*f*/) { return 10; });\n  }\n}\n/** Animate rendering\n * @param {olx.render3D.animateOptions}\n *  @param {string|function|number} param.height an attribute name or a function returning height of a feature or a fixed value\n *  @param {number} param.duration the duration of the animatioin ms, default 1000\n *  @param {ol.easing} param.easing an ol easing function\n *\t@api\n */\nol.render3D.prototype.animate = function(options) {\n  options = options || {};\n  this.toHeight_ = this.getHfn(options.height);\n  this.animate_ = new Date().getTime();\n  this.animateDuration_ = options.duration ||1000;\n  this.easing_ = options.easing || ol.easing.easeOut;\n  // Force redraw\n  this.layer_.changed();\n}\n/** Check if animation is on\n*\t@return {bool}\n*/\nol.render3D.prototype.animating = function() {\n  if (this.animate_ && new Date().getTime() - this.animate_ > this.animateDuration_) {\n    this.animate_ = false;\n  }\n  return !!this.animate_;\n}\n/** \n*/\nol.render3D.prototype.getFeatureHeight = function (f) {\n  if (this.animate_) {\n    var h1 = this.height_(f);\n    var h2 = this.toHeight_(f);\n    return (h1*(1-this.elapsedRatio_)+this.elapsedRatio_*h2);\n  }\n  else return this.height_(f);\n};\n/**\n*/\nol.render3D.prototype.hvector_ = function (pt, h) {\n  var p0 = [\n    pt[0]*this.matrix_[0] + pt[1]*this.matrix_[1] + this.matrix_[4],\n    pt[0]*this.matrix_[2] + pt[1]*this.matrix_[3] + this.matrix_[5]\n  ];\n  return {\n    p0: p0, \n    p1: [\n      p0[0] + h/this.res_ * (p0[0]-this.center_[0]),\n      p0[1] + h/this.res_ * (p0[1]-this.center_[1])\n    ]\n  };\n};\n/**\n*/\nol.render3D.prototype.getFeature3D_ = function (f, h) {\n  var geom = this.get('geometry')(f);\n  var c = geom.getCoordinates();\n  switch (geom.getType()) {\n    case \"Polygon\":\n      c = [c];\n    // fallthrough\n    case \"MultiPolygon\":\n      var build = [];\n      for (var i=0; i<c.length; i++) {\n        for (var j=0; j<c[i].length; j++) {\n          var b = [];\n          for (var k=0; k<c[i][j].length; k++) {\n            b.push( this.hvector_(c[i][j][k], h) );\n          }\n          build.push(b);\n        }\n      }\n      return { type:\"MultiPolygon\", feature: f, geom: build, height: h };\n    case \"Point\":\n      return { type:\"Point\", feature: f, geom: this.hvector_(c,h), height: h };\n    default: return {};\n  }\n}\n/**\n*/\nol.render3D.prototype.drawFeature3D_ = function(ctx, build) {\n  var i,j, b, k;\n  // Construct\n  for (i=0; i<build.length; i++) {\t\n    switch (build[i].type) {\n      case \"MultiPolygon\": {\n        for (j=0; j<build[i].geom.length; j++) {\n          b = build[i].geom[j];\n          for (k=0; k < b.length; k++) {\n            ctx.beginPath();\n            ctx.moveTo(b[k].p0[0], b[k].p0[1]);\n            ctx.lineTo(b[k].p1[0], b[k].p1[1]);\n            ctx.stroke();\n          }\n        }\n        break;\n      }\n      case \"Point\": {\n        var g = build[i].geom;\n          ctx.beginPath();\n          ctx.moveTo(g.p0[0], g.p0[1]);\n          ctx.lineTo(g.p1[0], g.p1[1]);\n          ctx.stroke();\n          break;\n        }\n      default: break;\n    }\n  }\n  // Roof\n  for (i=0; i<build.length; i++) {\n    switch (build[i].type) {\n      case \"MultiPolygon\": {\n        ctx.beginPath();\n        for (j=0; j<build[i].geom.length; j++) {\n          b = build[i].geom[j];\n          if (j==0) {\n            ctx.moveTo(b[0].p1[0], b[0].p1[1]);\n            for (k=1; k < b.length; k++) {\n              ctx.lineTo(b[k].p1[0], b[k].p1[1]);\n            }\n          } else {\n            ctx.moveTo(b[0].p1[0], b[0].p1[1]);\n            for (k=b.length-2; k>=0; k--) {\n              ctx.lineTo(b[k].p1[0], b[k].p1[1]);\n            }\n          }\n          ctx.closePath();\n        }\n        ctx.fill(\"evenodd\");\n        ctx.stroke();\n        break;\n      }\n      case \"Point\": {\n        b = build[i];\n        var t = b.feature.get('label');\n        if (t) {\n          var p = b.geom.p1;\n          var f = ctx.fillStyle;\n          ctx.fillStyle = ctx.strokeStyle;\n          ctx.textAlign = 'center';\n          ctx.textBaseline = 'bottom';\n          ctx.fillText ( t, p[0], p[1] );\n          var m = ctx.measureText(t);\n          var h = Number (ctx.font.match(/\\d+(\\.\\d+)?/g).join([]));\n          ctx.fillStyle = \"rgba(255,255,255,0.5)\";\n          ctx.fillRect (p[0]-m.width/2 -5, p[1]-h -5, m.width +10, h +10)\n          ctx.strokeRect (p[0]-m.width/2 -5, p[1]-h -5, m.width +10, h +10)\n          ctx.fillStyle = f;\n          //console.log(build[i].feature.getProperties())\n        }\n        break;\n      }\n      default: break;\n    }\n  }\n};\nol.render3D.prototype.drawGhost3D_ = function(ctx, build) {\n  var i,j, b, k;\n  // Construct\n  for (i=0; i<build.length; i++) {\t\n    switch (build[i].type) {\n      case \"MultiPolygon\": {\n        for (j=0; j<build[i].geom.length; j++) {\n          b = build[i].geom[j];\n          for (k=0; k < b.length-1; k++) {\n            ctx.beginPath();\n              ctx.moveTo(b[k].p0[0], b[k].p0[1]);\n              ctx.lineTo(b[k].p1[0], b[k].p1[1]);\n              ctx.lineTo(b[k+1].p1[0], b[k+1].p1[1]);\n              ctx.lineTo(b[k+1].p0[0], b[k+1].p0[1]);\n              ctx.lineTo(b[k].p0[0], b[k].p0[1]);\n              var m = [(b[k].p0[0] + b[k+1].p0[0]) /2, (b[k].p0[1] + b[k+1].p0[1]) /2];\n              var h = [b[k].p0[1] - b[k+1].p0[1], - b[k].p0[0] + b[k+1].p0[0]];\n              var c = ol.coordinate.getIntersectionPoint(\n                [m, [m[0] + h[0], m[1]+ h[1]]],\n                [b[k].p1, b[k+1].p1]\n              );\n              var gradient = ctx.createLinearGradient(\n                m[0], m[1],              \n                c[0], c[1]\n              );\n              gradient.addColorStop(0, 'rgba(255,255,255,.2)');\n              gradient.addColorStop(1, 'rgba(255,255,255,0)');\n              ctx.fillStyle = gradient;\n              ctx.fill();\n          }\n        }\n        break;\n      }\n      case \"Point\": {\n        var g = build[i].geom;\n          ctx.beginPath();\n          ctx.moveTo(g.p0[0], g.p0[1]);\n          ctx.lineTo(g.p1[0], g.p1[1]);\n          ctx.stroke();\n          break;\n        }\n      default: break;\n    }\n  }\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A sketch layer used as overlay to handle drawing sketch (helper for drawing tools)\n * @constructor \n * @extends {ol/layer/Vector}\n * @fires drawstart\n * @fires drawend\n * @fires drawabort\n * @param {*} options \n *  @param {string} options.type Geometry type, default LineString\n *  @param {ol.style.Style|Array<ol.style.Style>} options.style Drawing style\n *  @param {ol.style.Style|Array<ol.style.Style>} options.sketchStyle Sketch style\n */\nol.layer.SketchOverlay = function(options) {\n  options = options || {};\n  var style = options.style || ol.style.Style.defaultStyle(true);\n  var sketchStyle = options.sketchStyle;\n  if (!sketchStyle) {\n    sketchStyle = ol.style.Style.defaultStyle();\n    sketchStyle = [\n      new ol.style.Style({\n        image: new ol.style.RegularShape ({\n          points: 4,\n          radius: 10,\n          radius2: 0,\n          stroke: new ol.style.Stroke({\n            color: [255,255,255, .5],\n            width: 3\n          })\n        })\n      }),\n      sketchStyle[0].clone()\n    ];\n    sketchStyle[1].setImage(new ol.style.RegularShape ({\n      points: 4,\n      radius: 10,\n      radius2: 0,\n      stroke: new ol.style.Stroke({\n        color: [0, 153, 255, 1],\n        width: 1.25\n      })\n    }));\n  }\n  this._geom = [];\n  ol.layer.Vector.call (this, {\n    name: 'sketch',\n    source: new ol.source.Vector({ useSpatialIndex: false }),\n    style: function(f) {\n      return (f.get('sketch') ? sketchStyle : style);\n    },\n    updateWhileAnimating: true,\n    updateWhileInteracting: true\n  });\n  // Sketch features\n  this.getSource().addFeatures([\n    new ol.Feature({\n      sketch: true,\n      geometry: new ol.geom.Point([])\n    }),\n    new ol.Feature({\n      sketch: true,\n      geometry: new ol.geom.LineString([])\n    }),\n    new ol.Feature(),\n    new ol.Feature(new ol.geom.Point([]))\n  ]);\n  this.setGeometryType(options.type);\n};\nol.ext.inherits (ol.layer.SketchOverlay, ol.layer.Vector);\n/** Set geometry type\n * @param {string} type Geometry type\n * @return {string} the current type\n */\nol.layer.SketchOverlay.prototype.setGeometryType = function(type) {\n  var t = /^Point$|^LineString$|^Polygon$|^Circle$/.test(type) ? type : 'LineString';\n  if (t !== this._type) {\n    this.abortDrawing();\n    this._type = t;\n  }\n  return this._type;\n};\n/** Get geometry type\n * @return {string} Geometry type\n */\nol.layer.SketchOverlay.prototype.getGeometryType = function() {\n  return this._type;\n};\n/** Add a new Point to the sketch\n * @param {ol.coordinate} coord\n * @return {boolean} true if point has been added, false if same coord\n */\nol.layer.SketchOverlay.prototype.addPoint = function(coord) {\n  if (this._lastCoord !== this._position) {\n    if (!this._geom.length) {\n      this.startDrawing();\n    }\n    this._geom.push(coord);\n    this._lastCoord = coord; \n    this._position = coord; \n    this.drawSketch();\n    if (this.getGeometryType() === 'Point') {\n      this.finishDrawing();\n    }\n    if (this.getGeometryType() === 'Circle' && this._geom.length>=2) {\n      this.finishDrawing();\n    }\n    return true;\n  }\n  return false;\n};\n/** Remove the last Point from the sketch\n */\nol.layer.SketchOverlay.prototype.removeLastPoint = function() {\n  this._geom.pop();\n  this._lastCoord = this._geom[this._geom.length-1];\n  this.drawSketch();\n};\n/** Strat a new drawing\n * @param {*} options\n *  @param {string} type Geometry type, default the current type\n *  @param {Array<ol.coordinate>} coordinates a list of coordinates to extend\n *  @param {ol.Feature} feature a feature to extend (LineString or Polygon only)\n *  @param {boolean} atstart extent coordinates or feature at start, default false (extend at end)\n */\nol.layer.SketchOverlay.prototype.startDrawing = function(options) {\n  options = options || {};\n  this._geom = [];\n  if (options.type) this.setGeometryType(options.type);\n  this.drawSketch();\n  if (!this._drawing) {\n    this.dispatchEvent({\n      type: 'drawstart',\n      feature: this.getFeature()\n    });\n  }\n  this._drawing = true;\n};\n/** Finish drawing\n * @return {ol.Feature} the drawed feature\n */\nol.layer.SketchOverlay.prototype.finishDrawing = function(valid) {\n  var f = this.getSource().getFeatures()[2].clone();\n  var isvalid = !!f;\n  switch (this.getGeometryType()) {\n    case 'Circle': \n    case 'LineString': {\n      isvalid = this._geom.length > 1;\n      break;\n    }\n    case 'Polygon': {\n      isvalid = this._geom.length > 2;\n      break;\n    }\n  }\n  if (valid && !isvalid) return false;\n  this._geom = [];\n  this._lastCoord = null;\n  this.drawSketch();\n  if (this._drawing) {\n    this.dispatchEvent({\n      type: 'drawend',\n      valid: isvalid,\n      feature: f\n    });\n  }\n  this._drawing = false\n  return f;\n};\n/** Abort drawing\n */\nol.layer.SketchOverlay.prototype.abortDrawing = function() {\n  if (this._drawing) {\n    this.dispatchEvent({\n      type: 'drawabort',\n      feature: this.getFeature()\n    });\n  }\n  this._drawing = false;\n  this._geom = [];\n  this._lastCoord = null;\n  this.drawSketch();\n};\n/** Set current position\n * @param {ol.coordinate} coord\n */\nol.layer.SketchOverlay.prototype.setPosition = function(coord) {\n  this._position = coord;\n  this.drawLink();\n};\n/** Get current position\n * @return {ol.coordinate} \n */\nol.layer.SketchOverlay.prototype.getPosition = function() {\n  return this._position;\n};\n/** Draw/refresh link\n */\nol.layer.SketchOverlay.prototype.drawLink = function() {\n  var features = this.getSource().getFeatures();\n  if (this._position) {\n    if (this._lastCoord && this._lastCoord === this._position) {\n      features[0].getGeometry().setCoordinates([]);\n    } else {\n      features[0].getGeometry().setCoordinates(this._position);\n    }\n    if (this._geom.length) {\n      if (this.getGeometryType()==='Circle') {\n        features[1].setGeometry(new ol.geom.Circle(this._geom[0], ol.coordinate.dist2d(this._geom[0], this._position)));\n      } else if (this.getGeometryType()==='Polygon') {\n        features[1].setGeometry(new ol.geom.LineString([ this._lastCoord, this._position, this._geom[0] ]));\n      } else {\n        features[1].setGeometry(new ol.geom.LineString([ this._lastCoord, this._position ]));\n      }\n    } else {\n      features[1].setGeometry(new ol.geom.LineString([]));\n    }\n  } else {\n    features[0].getGeometry().setCoordinates([]);\n    features[1].setGeometry(new ol.geom.LineString([]));\n  }\n};\n/** Get current feature\n */\nol.layer.SketchOverlay.prototype.getFeature = function() {\n  return this.getSource().getFeatures()[2];\n};\n/** Draw/refresh sketch\n */\nol.layer.SketchOverlay.prototype.drawSketch = function() {\n  this.drawLink();\n  var features = this.getSource().getFeatures();\n  if (!this._geom.length) {\n    features[2].setGeometry(null);\n    features[3].setGeometry(new ol.geom.Point([]));\n  } else {\n    if (!this._lastCoord) this._lastCoord = this._geom[this._geom.length-1];\n    features[3].getGeometry().setCoordinates(this._lastCoord);\n    switch (this._type) {\n      case 'Point': {\n        features[2].setGeometry(new ol.geom.Point(this._lastCoord));\n        break;\n      }\n      case 'Circle': {\n        if (!features[2].getGeometry()) {\n          features[2].setGeometry(new ol.geom.Circle(this._geom[0], ol.coordinate.dist2d(this._geom[0], this._geom[this._geom.length-1])));\n        } else {\n          features[2].getGeometry().setRadius(ol.coordinate.dist2d(this._geom[0], this._geom[this._geom.length-1]));\n        }\n        break;\n      }\n      case 'LineString': {\n        if (!features[2].getGeometry()) {\n          features[2].setGeometry(new ol.geom.LineString(this._geom));\n        } else {\n          features[2].getGeometry().setCoordinates(this._geom);\n        }\n        break;\n      }\n      case 'Polygon': {\n        this._geom.push(this._geom[0]);\n        if (!features[2].getGeometry()) {\n          features[2].setGeometry(new ol.geom.Polygon([this._geom]));\n        } else {\n          features[2].getGeometry().setCoordinates([this._geom]);\n        }\n        this._geom.pop();\n        break;\n      }\n      default: {\n        console.error('[ol/layer/SketchOverlay~drawSketch] geometry type not supported ('+this._type+')');\n        break;\n      }\n    }\n  }\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A map with a perspective\n * @constructor \n * @extends {ol.Map}\n * @fires change:perspective\n * @param {olx.MapOptions=} options \n *  @param {ol.events.condition} tiltCondition , default altKeyOnly\n */\nol.PerspectiveMap = function(options) {\n  // Map div\n  var divMap = options.target instanceof Element ? options.target : document.getElementById(options.target);\n  if (window.getComputedStyle(divMap).position !== 'absolute') {\n    divMap.style.position = 'relative';\n  }\n  divMap.style.overflow = 'hidden';\n  // Create map inside\n  var map = ol.ext.element.create('DIV', {\n    className: 'ol-perspective-map',\n    parent: divMap\n  });\n  var opts = {};\n  Object.assign(opts, options);\n  opts.target = map;\n  // enhance pixel ratio\n  //opts.pixelRatio = 2;\n  ol.Map.call (this, opts);\n  this._tiltCondition = options.tiltCondition || ol.events.condition.altKeyOnly;\n};\nol.ext.inherits (ol.PerspectiveMap, ol.Map);\n/** Get pixel ratio for the map\n */\nol.PerspectiveMap.prototype.getPixelRatio = function(){\n  return window.devicePixelRatio;\n};\n/** Set perspective angle\n * @param {number} angle the perspective angle 0 (vertical) - 30 (max), default 0\n * @param {*} options\n *  @param {number} options.duration The duration of the animation in milliseconds, default 500\n *  @param {function} options.easing The easing function used during the animation, defaults to ol.easing.inAndOut).\n */\nol.PerspectiveMap.prototype.setPerspective = function(angle, options) {\n  options = options || {};\n  // max angle\n  if (angle > 30) angle = 30;\n  else if (angle<0) angle = 0;\n  var fromAngle = this._angle || 0;\n  var toAngle = Math.round(angle*10)/10;\n  var style = this.getTarget().querySelector('.ol-layers').style;\n  cancelAnimationFrame(this._animatedPerspective)\n  requestAnimationFrame(function(t) {\n    this._animatePerpective(t, t, style, fromAngle, toAngle, options.duration, options.easing||ol.easing.inAndOut);\n  }.bind(this))\n};\n/** Animate the perspective\n * @param {number} t0 starting timestamp\n * @param {number} t current timestamp\n * @param {CSSStyleDeclaration} style style to modify\n * @param {number} fromAngle starting angle\n * @param {number} toAngle ending angle\n * @param {number} duration The duration of the animation in milliseconds, default 500\n * @param {function} easing The easing function used during the animation, defaults to ol.easing.inAndOut).\n * @private\n */\nol.PerspectiveMap.prototype._animatePerpective = function(t0, t, style, fromAngle, toAngle, duration, easing ) {\n  var dt, end;\n  if (duration === 0) {\n    dt = 1;\n    end = true;\n  } else {\n    dt = (t-t0)/(duration||500);\n    end = (dt>=1);\n  }\n  dt = easing(dt);\n  var angle;\n  if (end) {\n    angle = this._angle = toAngle;\n  } else {\n    angle = this._angle = fromAngle + (toAngle-fromAngle)*dt;\n  }\n  var fac = angle/30;\n  // apply transform to the style\n  style.transform = 'translateY(-'+(17*fac)+'%) perspective(200px) rotateX('+angle+'deg) scaleY('+(1-fac/2)+')';\n  this.getMatrix3D(true);\n  this.render();\n  if (!end) {\n    requestAnimationFrame(function(t) {\n      this._animatePerpective(t0, t, style, fromAngle, toAngle, duration||500, easing||ol.easing.inAndOut);\n    }.bind(this))  \n  }\n  // Dispatch event\n  this.dispatchEvent({\n    type: 'change:perspective', \n    angle: angle,\n    animating: !end\n  });\n};\n/** Convert to pixel coord according to the perspective\n * @param {MapBrowserEvent} mapBrowserEvent The event to handle.\n */\nol.PerspectiveMap.prototype.handleMapBrowserEvent = function(e) {\n  e.pixel = [\n    e.originalEvent.offsetX / this.getPixelRatio(), \n    e.originalEvent.offsetY / this.getPixelRatio()\n  ];\n  e.coordinate = this.getCoordinateFromPixel(e.pixel);\n  ol.Map.prototype.handleMapBrowserEvent.call (this, e);\n  // Change perspective on tilt condition\n  if (this._tiltCondition(e)) {\n    switch(e.type) {\n      case 'pointerdown': {\n        this._dragging = e.originalEvent.offsetY;\n        break;\n      }\n      case 'pointerup': {\n        this._dragging = false;\n        break;\n      }\n      case 'pointerdrag': {\n        if (this._dragging !== false) { \n          var angle = e.originalEvent.offsetY > this._dragging ? .5 : -.5;\n          if (angle) {\n            this.setPerspective((this._angle||0) + angle, { duration: 0 });\n          }\n          this._dragging = e.originalEvent.offsetY;\n        }\n        break;\n      }\n    }\n  } else {\n    this._dragging = false;\n  }\n};\n/** Get map full teansform matrix3D\n * @return {Array<Array<number>>} \n */\nol.PerspectiveMap.prototype.getMatrix3D = function (compute) {\n  if (compute) {\n    var ele = this.getTarget().querySelector('.ol-layers');\n    // Get transform matrix3D from CSS\n    var tx = ol.matrix3D.getTransform(ele);\n    // Get the CSS transform origin from the transformed parent - default is '50% 50%'\n    var txOrigin = ol.matrix3D.getTransformOrigin(ele);\n    // Compute the full transform that is applied to the transformed parent (-origin * tx * origin)\n    this._matrixTransform = ol.matrix3D.computeTransformMatrix(tx, txOrigin);\n  }\n  if (!this._matrixTransform) this._matrixTransform = ol.matrix3D.identity();\n  return this._matrixTransform;\n};\n/** Get pixel at screen from coordinate.\n * The default getPixelFromCoordinate get pixel in the perspective.\n * @param {ol.coordinate} coord\n * @param {ol.pixel} \n */\nol.PerspectiveMap.prototype.getPixelScreenFromCoordinate = function (coord) {\n  // Get pixel in the transform system\n  var px = this.getPixelFromCoordinate(coord);\n  // Get transform matrix3D from CSS\n  var fullTx = this.getMatrix3D();\n  // Transform the point using full transform\n  var pixel = ol.matrix3D.transformVertex(fullTx, px);\n  // Perform the homogeneous divide to apply perspective to the points (divide x,y,z by the w component).\n  pixel = ol.matrix3D.projectVertex(pixel);\n  return [pixel[0], pixel[1]];\n};\n/** Not working...\n * \n */\nol.PerspectiveMap.prototype.getPixelFromPixelScreen = function (px) {\n  // Get transform matrix3D from CSS\n  var fullTx = ol.matrix3D.inverse(this.getMatrix3D());\n  // Transform the point using full transform\n  var pixel = ol.matrix3D.transformVertex(fullTx, px);\n  // Perform the homogeneous divide to apply perspective to the points (divide x,y,z by the w component).\n  pixel = ol.matrix3D.projectVertex(pixel);\n  return [pixel[0], pixel[1]];  \n};\n/* Overwrited Overlay function to handle overlay positing in a perspective map */\n(function() {\nvar _updatePixelPosition = ol.Overlay.prototype.updatePixelPosition;\n/** Update pixel projection in a perspective map (apply projection to the position)\n * @private\n */\nol.Overlay.prototype.updatePixelPosition = function () {\n  var map = this.getMap();\n  if (map && map instanceof ol.PerspectiveMap) {\n    var position = this.getPosition();\n    if (!map || !map.isRendered() || !position) {\n      this.setVisible(false);\n      return;\n    }\n    // Get pixel at screen\n    var pixel = map.getPixelScreenFromCoordinate(position);\n    var mapSize = map.getSize();\n    pixel[0] -= mapSize[0]/4\n    pixel[1] -= mapSize[1]/4\n    /* for ol v6.2.x\n    // Offset according positioning\n    var pos = this.getPositioning();\n    if (/bottom/.test(pos)) {\n      pixel[1] += mapSize[1]/4\n    } else {\n      pixel[1] -= mapSize[1]/4\n    }\n    if (/right/.test(pos)) {\n      pixel[0] += mapSize[0]/4\n    } else {\n      pixel[0] -= mapSize[0]/4\n    }\n    */\n    // Update\n    this.updateRenderedPosition(pixel , mapSize);\n  } else {\n    _updatePixelPosition.call(this);\n  }\n};\n/**/\n})();\n\n/*\n  Copyright (c) 2020 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/*global ol*/\nif (window.ol && !ol.particule) {\n  ol.particule = {};\n}\n/** Abstract base class; normally only used for creating subclasses. \n * An object with coordinates, draw and update\n * @constructor\n * @extends {ol.Object}\n * @param {*} options\n *  @param {ol.Overlay} options.overlay\n *  @param {ol.pixel} coordinate the position of the particule\n */\nol.particule.Base = function(options) {\n  if (!options) options = {};\n  ol.Object.call(this);\n  this.setOverlay(options.overlay) ;\n  this.coordinate = options.coordinate || [0,0];\n};\nol.ext.inherits(ol.particule.Base, ol.Object);\n/** Set the particule overlay\n * @param {ol.Overlay} overl\n */\nol.particule.Base.prototype.setOverlay = function(overlay) {\n  this._overlay = overlay;\n};\n/** Get the particule overlay\n * @return {ol.Overlay}\n */\nol.particule.Base.prototype.getOverlay = function() {\n  return this._overlay;\n};\n/** Draw the particule\n * @param { CanvasRenderingContext2D } ctx\n */\nol.particule.Base.prototype.draw = function(/* ctx */) {\n};\n/** Update the particule\n * @param {number} dt timelapes since last call\n */\nol.particule.Base.prototype.update = function(/* dt */) {\n};\n/** Update the particule\n * @param {number} dt timelapes since last call\n */\nol.particule.Base.prototype.getRandomCoord = function(dt) {\n  if (this.getOverlay().randomCoord) return this.getOverlay().randomCoord();\n  else return [dt,0];\n};\n\n/*\n  Copyright (c) 2020 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A cloud particule to display clouds over the map\n * @constructor\n * @extends {ol.particule.Base}\n * @param {*} options\n *  @param {ol.Overlay} options.overlay\n *  @param {ol.pixel} coordinate the position of the particule\n */\nol.particule.Bird = function(options) {\n  if (!options) options = {};\n  ol.particule.Base.call(this, options);\n  this.bird = new Image();\n  this.bird.src = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAABDCAQAAAD+S8VaAAAAAnNCSVQICFXsRgQAAAAJcEhZcwAAAvMAAALzAdLpCioAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAG90lEQVR42uWaaVRTRxTHJ4AUUIoIiqISOArIDiIhBBfccCMoR0vVUpXjTqun4Fr1tO5i3YuodaFqRMECKm4VUHEhUvWgBYuilgpiRVZpCARI3r8fWA4hYY9AXu77+ObNzO/O8u787xDSyeYSTzSICpu+DjV0ogrze84PBneByuJv3JpbBlx6MEBbJfG/8S2RAACFXXtU0gERN1BjCc9UEN/e7I2w1gFPinv3UDkHbFiGOqOwJVjlHMALRT3LLJ7trGIOuHwFUsY7q2IOuJ0u7YB//pswWFn6/vnUcbOCAn7ctfnUrsijl85dv5pw786fd9OTsvg5/JykN3fTb6ZcTDgVvefIkqXmVvKr0NN/IUQDO7C1qwJrOwyftIZ7cmIiN21eZlB+SOUtFKNl9kF0hb9ujmyVM73FMmWv3m+2J4zxw74NDN5/5vT1qzeT7j3n5/Bz7mcmPk24cy32Ai8i9Pj2nwIX+jo4kc8UMMqeXr5bfC6N/2tUHrdsCQ4gAR/QNhNRJ8+6GklXH7xStlxW+ViLxrpjqBswJ/z4rYyCFrQnwJPCxGe/x53i+fO+XOth2xpsvQm+PkfGP3YuYIo1oInTyIJiLDFtoZfUP+AXeaW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47y/GHohtLf45ITvVuLyfyKLI5RlntyJSXx2+P+gaejt5O7FNCSEkcFHTuAmPom6/qqxJqFRee33wHGc6rVLjXtym8C8nTTcnDNMh/n5BfnN8mFY18jWdbPlceeBViEsPi16xxFSL7ncjukVelTvxUzsxjOlAUzsULv8/GfdEJa7G7D7YWLCcUzbNkfb42zaXNaG2h4XTHH/n9x+bjIHKqeAdNMZf55fbrKBYLNq+lqb433lkFrUk5hNKdu6mIf5XA1KetzibR+09TLcfonrMtVYlNKk9h2gV//FCW3tCFmMXT0nOe83bxpklbdDJqrD+BC1mwUzTtOw2Sl/UFjpsh8ci2pHirFgxV8nxV/oJxO2RwR6+HNFbmfkZ15PaqwQe/VmJ+R18Aql37XTAsQ9EefUBW6NeEk34IaWN8HkIQk+Jva0SzwGXP6p1XDeEoqB1qx/L0B3dKY+VSr0JDurDFNaK2ZoYg5142sx1m3LEYxUsq+Vv8ejVSv8bdJ/UXySds9eDB4JwEnFIRS6KUIi/8RJxCEEARte74GBR6DycFpGgtZNFPkHrHgOx61miSaPDEOtEn8qWwvepZMc5Mel3ItZmHbbM12wSXV/snMHZQ6eRlzEzI9d9rnftskwERhXVNxF7ik1Krd87pbLCbWYR9Y7v0f/htaJHbsoDhwAAAABJRU5ErkJggg==\";\n  this.set('size', [this.bird.width || 50, this.bird.height || 50]);\n};\nol.ext.inherits(ol.particule.Bird, ol.particule.Base);\n/** Draw the particule\n * @param {CanvasRenderingContext2D } ctx\n */\nol.particule.Bird.prototype.draw = function(ctx) {\n  //ctx.drawImage(this.bird, this.coordinate[0], this.coordinate[1]);\n  var angle = this.getOverlay().get('angle');\n  ctx.save();\n    ctx.translate (this.coordinate[0], this.coordinate[1]);\n    ctx.rotate(angle+Math.PI/2);\n    ctx.scale(.5,.5);\n    ctx.drawImage( this.bird, -this.bird.width/2, -this.bird.height/2 );\n  ctx.restore();\n};\n/** Update the particule\n * @param {number} dt timelapes since last call\n */\nol.particule.Bird.prototype.update = function(dt) {\n  var speed = this.getOverlay().get('speed') * dt / this.getOverlay()._fps;\n  var angle = this.getOverlay().get('angle');\n  this.coordinate[0] += speed * Math.cos(angle);\n  this.coordinate[1] += speed * Math.sin(angle);\n};\n\n/*\n  Copyright (c) 2020 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A cloud particule to display clouds over the map\n * @constructor\n * @extends {ol.particule.Base}\n * @param {*} options\n *  @param {ol.Overlay} options.overlay\n *  @param {ol.pixel} coordinate the position of the particule\n */\nol.particule.Cloud = function(options) {\n  if (!options) options = {};\n  ol.particule.Base.call(this, options);\n  this.set('size', [100,100])\n  var canvas = document.createElement('CANVAS');\n  canvas.width = 200;\n  canvas.height = 200;\n  var ctx = canvas.getContext('2d');\n  var grd = this.gradient = ctx.createRadialGradient(50,50, 0, 50,50, 50);\n  grd.addColorStop(0, 'rgba(255,255,255,.2');\n  grd.addColorStop(1, 'rgba(255,255,255,0');\n  // Create cloud image\n  this.image = canvas;\n  for (var k=0; k<7; k++) {\n    ctx.save();\n      var x = Math.random()*100;\n      var y = Math.random()*100;\n      ctx.translate (x,y);\n      ctx.fillStyle = grd;\n      ctx.fillRect(0,0,canvas.width,canvas.height);\n    ctx.restore();\n  }\n};\nol.ext.inherits(ol.particule.Cloud, ol.particule.Base);\n/** Draw the particule\n * @param {CanvasRenderingContext2D } ctx\n */\nol.particule.Cloud.prototype.draw = function(ctx) {\n  ctx.save();\n    ctx.translate (this.coordinate[0], this.coordinate[1]);\n    ctx.drawImage(this.image, -this.image.width/2, -this.image.width/2);\n  ctx.restore();\n};\n/** Update the particule\n * @param {number} dt timelapes since last call\n */\nol.particule.Cloud.prototype.update = function(dt) {\n  var speed = this.getOverlay().get('speed') * dt / this.getOverlay()._fps;\n  var angle = this.getOverlay().get('angle');\n  this.coordinate[0] += speed * Math.cos(angle);\n  this.coordinate[1] += speed * Math.sin(angle);\n};\n\n/*\n  Copyright (c) 2020 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Rain particules to display clouds over the map\n * @constructor\n * @extends {ol.particule.Base}\n * @param {*} options\n *  @param {ol.Overlay} options.overlay\n *  @param {ol.pixel} coordinate the position of the particule\n */\nol.particule.Rain = function(options) {\n  if (!options) options = {};\n  ol.particule.Base.call(this, options);\n  this.z = Math.floor(Math.random()*5) + 1;\n  var canvas = document.createElement('CANVAS');\n  canvas.width = 50;\n  canvas.height = 50;\n  var ctx = canvas.getContext('2d');\n  this.gradient = ctx.createRadialGradient(0,0, 0, 0,0, 25);\n  this.gradient.addColorStop(0, 'rgba(0,0,80,0)');\n  this.gradient.addColorStop(1, 'rgba(0,0,80,.3)');\n};\nol.ext.inherits(ol.particule.Rain, ol.particule.Base);\n/** Draw the particule\n * @param {CanvasRenderingContext2D } ctx\n */\nol.particule.Rain.prototype.draw = function(ctx) {\n  ctx.save();\n    var angle = this.getOverlay().get('angle');\n    ctx.beginPath();\n    var x1 = Math.cos(angle) * 10 * (1+this.z/2);\n    var y1 = Math.sin(angle) * 10 * (1+this.z/2);\n    ctx.lineWidth = Math.round(this.z/2);\n    ctx.strokeStyle = this.gradient;\n    ctx.translate (this.coordinate[0], this.coordinate[1]);\n    ctx.moveTo(0,0);\n    ctx.lineTo(x1, y1);\n    ctx.stroke();\n  ctx.restore();\n};\n/** Update the particule\n * @param {number} dt timelapes since last call\n */\nol.particule.Rain.prototype.update = function(dt) {\n  var dl = this.getOverlay().get('speed') * dt / this.getOverlay()._fps * this.z;\n  var angle = this.getOverlay().get('angle');\n  this.coordinate[0] += dl * Math.cos(angle);\n  this.coordinate[1] += dl * Math.sin(angle);\n};\n\n/*\n  Copyright (c) 2020 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Raindrop particules to display clouds over the map\n * @constructor\n * @extends {ol.particule.Base}\n * @param {*} options\n *  @param {ol.Overlay} options.overlay\n *  @param {ol.pixel} coordinate the position of the particule\n */\nol.particule.RainDrop = function(options) {\n  if (!options) options = {};\n  ol.particule.Base.call(this, options);\n  this.size = 0;\n  // Drops\n  var canvas = document.createElement('CANVAS');\n  canvas.width = 100;\n  canvas.height = 100;\n  var ctx = canvas.getContext('2d');\n  var grd = ctx.createRadialGradient(50,50, 0, 50,50, 50);\n  grd.addColorStop(0, 'rgba(128,128,192,.8');\n  grd.addColorStop(1, 'rgba(128,128,192,0');\n  this.image = canvas;\n  ctx.fillStyle = grd;\n  ctx.fillRect(0,0,canvas.width,canvas.height);\n};\nol.ext.inherits(ol.particule.RainDrop, ol.particule.Base);\n/** Draw the particule\n * @param {CanvasRenderingContext2D } ctx\n */\nol.particule.RainDrop.prototype.draw = function(ctx) {\n  if (this.size>0) {\n    ctx.save();\n      ctx.translate (this.coordinate[0], this.coordinate[1]);\n      ctx.globalAlpha = this.size/50;\n      ctx.scale(1-this.size/50,1-this.size/50);\n      ctx.drawImage(this.image, -50,-50);\n    ctx.restore();\n  }\n};\n/** Update the particule\n * @param {number} dt timelapes since last call\n */\nol.particule.RainDrop.prototype.update = function(dt) {\n  if (this.size>0 || Math.random() < .01) {\n    if (this.size<=0) {\n      this.size = 50;\n      this.coordinates = this.getRandomCoord();\n    }\n    this.size = this.size - Math.round(dt/20);\n  }\n};\n\n/*\n  Copyright (c) 2020 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Rain particules to display clouds over the map\n * @constructor\n * @extends {ol.particule.Base}\n * @param {*} options\n *  @param {ol.Overlay} options.overlay\n *  @param {ol.pixel} coordinate the position of the particule\n */\nol.particule.Snow = function(options) {\n  if (!options) options = {};\n  ol.particule.Base.call(this, options);\n  this.z = (Math.floor(Math.random()*5) + 1) / 5;\n  this.angle = Math.random() * Math.PI;\n  // Snow fakes\n  var canvas = document.createElement('CANVAS');\n  canvas.width = 20;\n  canvas.height = 20;\n  var ctx = canvas.getContext('2d');\n  var grd = ctx.createRadialGradient(10,10, 0, 10,10, 10);\n  grd.addColorStop(0, \"rgba(255, 255, 255,1)\");  // white\n  grd.addColorStop(.8, \"rgba(210, 236, 242,.8)\");  // bluish\n  grd.addColorStop(1, \"rgba(237, 247, 249,0)\");   // lighter bluish\n  this.image = canvas;\n  ctx.fillStyle = grd;\n  ctx.fillRect(0,0,canvas.width,canvas.height);\n};\nol.ext.inherits(ol.particule.Snow, ol.particule.Base);\n/** Draw the particule\n * @param {CanvasRenderingContext2D } ctx\n */\nol.particule.Snow.prototype.draw = function(ctx) {\n  ctx.save();\n    ctx.translate (this.coordinate[0], this.coordinate[1]);\n    ctx.globalAlpha = .4 + this.z/2;\n    ctx.scale(this.z,this.z);\n    ctx.drawImage(this.image, -10,-10);\n  ctx.restore();\n};\n/** Update the particule\n * @param {number} dt timelapes since last call\n */\nol.particule.Snow.prototype.update = function(dt) {\n  var speed = this.getOverlay().get('speed') * dt / this.getOverlay()._fps * this.z * 5;\n  var angle = this.getOverlay().get('angle');\n  this.angle = this.angle + dt / this.getOverlay()._fps / 100;\n  this.coordinate[0] += Math.sin(this.angle + this.z) * 2 + speed * Math.cos(angle);\n  this.coordinate[1] += Math.cos(this.angle) + speed * Math.sin(angle);\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc\n * A popup element to be displayed over the map and attached to a single map\n * location. The popup are customized using CSS.\n *\n * @example\nvar popup = new ol.Overlay.Popup();\nmap.addOverlay(popup);\npopup.show(coordinate, \"Hello!\");\npopup.hide();\n*\n* @constructor\n* @extends {ol.Overlay}\n* @fires show\n* @fires hide\n* @param {} options Extend Overlay options \n*\t@param {String} options.popupClass the a class of the overlay to style the popup.\n*\t@param {bool} options.closeBox popup has a close box, default false.\n*\t@param {function|undefined} options.onclose: callback function when popup is closed\n*\t@param {function|undefined} options.onshow callback function when popup is shown\n*\t@param {Number|Array<number>} options.offsetBox an offset box\n*\t@param {ol.OverlayPositioning | string | undefined} options.positioning \n*\t\tthe 'auto' positioning var the popup choose its positioning to stay on the map.\n* @api stable\n*/\nol.Overlay.Popup = function (options) {\n  var self = this;\n  options = options || {};\n  if (typeof(options.offsetBox)==='number') this.offsetBox = [options.offsetBox,options.offsetBox,options.offsetBox,options.offsetBox];\n  else this.offsetBox = options.offsetBox;\n  // Popup div\n  var element = document.createElement(\"div\");\n  //element.classList.add('ol-overlaycontainer-stopevent');\n  options.element = element;\n  // Anchor div\n  var anchorElement = document.createElement(\"div\");\n  anchorElement.classList.add(\"anchor\");\n  element.appendChild(anchorElement);\n  // Content\n  this.content = ol.ext.element.create(\"div\", { \n    html: options.html || '',\n    className: \"ol-popup-content\",\n    parent: element\n  });\n  // Closebox\n  this.closeBox = options.closeBox;\n  this.onclose = options.onclose;\n  this.onshow = options.onshow;\n  var button = document.createElement(\"button\");\n  button.classList.add(\"closeBox\");\n  if (options.closeBox) button.classList.add('hasclosebox');\n  button.setAttribute('type', 'button');\n  element.insertBefore(button, anchorElement);\n  button.addEventListener(\"click\", function() {\n    self.hide();\n  });\n  // Stop event\n  if (options.stopEvent) {\n    element.addEventListener(\"mousedown\", function(e){ e.stopPropagation(); });\n    element.addEventListener(\"touchstart\", function(e){ e.stopPropagation(); });\n  }\n  ol.Overlay.call(this, options);\n  this._elt = element;\n  // call setPositioning first in constructor so getClassPositioning is called only once\n  this.setPositioning(options.positioning || 'auto');\n  this.setPopupClass(options.popupClass || options.className || 'default');\n  // Show popup on timeout (for animation purposes)\n  if (options.position) {\n    setTimeout(function(){ this.show(options.position); }.bind(this));\n  }\n};\nol.ext.inherits(ol.Overlay.Popup, ol.Overlay);\n/**\n * Get CSS class of the popup according to its positioning.\n * @private\n */\nol.Overlay.Popup.prototype.getClassPositioning = function () {\n  var c = \"\";\n  var pos = this.getPositioning();\n  if (/bottom/.test(pos)) c += \"ol-popup-bottom \";\n  if (/top/.test(pos)) c += \"ol-popup-top \";\n  if (/left/.test(pos)) c += \"ol-popup-left \";\n  if (/right/.test(pos)) c += \"ol-popup-right \";\n  if (/^center/.test(pos)) c += \"ol-popup-middle \";\n  if (/center$/.test(pos)) c += \"ol-popup-center \";\n  return c;\n};\n/**\n * Set a close box to the popup.\n * @param {bool} b\n * @api stable\n */\nol.Overlay.Popup.prototype.setClosebox = function (b) {\n  this.closeBox = b;\n  if (b) this.element.classList.add(\"hasclosebox\");\n  else this.element.classList.remove(\"hasclosebox\");\n};\n/**\n * Set the CSS class of the popup.\n * @param {string} c class name.\n * @api stable\n */\nol.Overlay.Popup.prototype.setPopupClass = function (c) {\n  this.element.className = \"\";\n    var classesPositioning = this.getClassPositioning().split(' ')\n      .filter(function(className) {\n        return className.length > 0;\n      });\n    var classes = [\"ol-popup\"];\n    if (c) {\n      c.split(' ').filter(function(className) {\n        return className.length > 0;\n      })\n      .forEach(function(className) {\n        classes.push(className);\n      });\n    } else {\n      classes.push(\"default\");\n    }\n      classesPositioning.forEach(function(className) {\n        classes.push(className);\n      });\n    if (this.closeBox) {\n      classes.push(\"hasclosebox\");\n    }\n    this.element.classList.add.apply(this.element.classList, classes);\n};\n/**\n * Add a CSS class to the popup.\n * @param {string} c class name.\n * @api stable\n */\nol.Overlay.Popup.prototype.addPopupClass = function (c) {\n  this.element.classList.add(c);\n};\n/**\n * Remove a CSS class to the popup.\n * @param {string} c class name.\n * @api stable\n */\nol.Overlay.Popup.prototype.removePopupClass = function (c) {\n  this.element.classList.remove(c);\n};\n/**\n * Set positionning of the popup\n * @param {ol.OverlayPositioning | string | undefined} pos an ol.OverlayPositioning \n * \t\tor 'auto' to var the popup choose the best position\n * @api stable\n */\nol.Overlay.Popup.prototype.setPositioning = function (pos) {\n  if (pos === undefined)\n    return;\n  if (/auto/.test(pos)) {\n    this.autoPositioning = pos.split('-');\n    if (this.autoPositioning.length==1) this.autoPositioning[1]=\"auto\";\n  }\n  else this.autoPositioning = false;\n  pos = pos.replace(/auto/g,\"center\");\n  if (pos==\"center\") pos = \"bottom-center\";\n  this.setPositioning_(pos);\n};\n/** @private\n * @param {ol.OverlayPositioning | string | undefined} pos\n */\nol.Overlay.Popup.prototype.setPositioning_ = function (pos) {\n  if (this.element) {\n    ol.Overlay.prototype.setPositioning.call(this, pos);\n    this.element.classList.remove(\"ol-popup-top\", \"ol-popup-bottom\", \"ol-popup-left\", \"ol-popup-right\", \"ol-popup-center\", \"ol-popup-middle\");\n    var classes = this.getClassPositioning().split(' ')\n      .filter(function(className) {\n        return className.length > 0;\n      });\n    this.element.classList.add.apply(this.element.classList, classes);\n  }\n};\n/** Check if popup is visible\n* @return {boolean}\n*/\nol.Overlay.Popup.prototype.getVisible = function () {\n  return this.element.classList.contains(\"visible\");\n};\n/**\n * Set the position and the content of the popup.\n * @param {ol.Coordinate|string} coordinate the coordinate of the popup or the HTML content.\n * @param {string|undefined} html the HTML content (undefined = previous content).\n * @example\nvar popup = new ol.Overlay.Popup();\n// Show popup\npopup.show([166000, 5992000], \"Hello world!\");\n// Move popup at coord with the same info\npopup.show([167000, 5990000]);\n// set new info\npopup.show(\"New informations\");\n* @api stable\n*/\nol.Overlay.Popup.prototype.show = function (coordinate, html) {\n  if (!html && typeof(coordinate)=='string') {\n    html = coordinate; \n    coordinate = null;\n  }\n  if (coordinate===true) {\n    coordinate = this.getPosition();\n  }\n  var self = this;\n  var map = this.getMap();\n  if (!map) return;\n  if (html && html !== this.prevHTML) {\n    // Prevent flickering effect\n    this.prevHTML = html;\n    this.content.innerHTML = \"\";\n    if (html instanceof Element) {\n      this.content.appendChild(html);\n    } else {\n      this.content.insertAdjacentHTML('beforeend', html);\n    }\n    // Refresh when loaded (img)\n    Array.prototype.slice.call(this.content.querySelectorAll('img'))\n      .forEach(function(image) {\n        image.addEventListener(\"load\", function() {\n          map.renderSync();\n        });\n      });\n  }\n  if (coordinate) {\n    // Auto positionning\n    if (this.autoPositioning) {\n      var p = map.getPixelFromCoordinate(coordinate);\n      var s = map.getSize();\n      var pos=[];\n      if (this.autoPositioning[0]=='auto') {\n        pos[0] = (p[1]<s[1]/3) ? \"top\" : \"bottom\";\n      }\n      else pos[0] = this.autoPositioning[0];\n      pos[1] = (p[0]<2*s[0]/3) ? \"left\" : \"right\";\n      this.setPositioning_(pos[0]+\"-\"+pos[1]);\n      if (this.offsetBox) {\n        this.setOffset([this.offsetBox[pos[1]==\"left\"?2:0], this.offsetBox[pos[0]==\"top\"?3:1] ]);\n      }\n    } else {\n      if (this.offsetBox){\n        this.setOffset(this.offsetBox);\n      }\n    }\n    // Show\n    this.setPosition(coordinate);\n    // Set visible class (wait to compute the size/position first)\n    this.element.parentElement.style.display = '';\n    if (typeof (this.onshow) == 'function') this.onshow();\n    this.dispatchEvent({ type: 'show' })\n    this._tout = setTimeout (function() {\n      self.element.classList.add(\"visible\"); \n    }, 0);\n  }\n};\n/**\n * Hide the popup\n * @api stable\n */\nol.Overlay.Popup.prototype.hide = function () {\n  if (this.getPosition() == undefined) return;\n  if (typeof (this.onclose) == 'function') this.onclose();\n  this.setPosition(undefined);\n  if (this._tout) clearTimeout(this._tout);\n  this.element.classList.remove(\"visible\");\n  this.dispatchEvent({ type: 'hide' });\n};\n\n/*\tCopyright (c) 2020 Jean-Marc VIGLINO,\n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** An overlay to play animations on top of the map\n * The overlay define a set of particules animated on top of the map.\n * Particules are objects with coordinates.\n * They are dawn in a canvas using the draw particule method. \n * The update particule method updates the particule position according to the timelapse\n *\n * @constructor\n * @extends {ol.Overlay}\n * @param {*} options\n *  @param {String} options.className class of the Overlay\n *  @param {number} option.density particule density, default .5\n *  @param {number} option.speed particule speed, default 4\n *  @param {number} option.angle particule angle in radian, default PI/4\n *  @param {boolean} options.animate start animation, default true\n *  @param {number} options.fps frame per second, default 25\n */\nol.Overlay.AnimatedCanvas = function(options) {\n  if (!options) options = {};\n  this._canvas = ol.ext.element.create('CANVAS', {\n    className: ((options.className || '') + ' ol-animated-overlay').trim()\n  });\n  this._ctx = this._canvas.getContext('2d');\n  ol.Overlay.call(this, {\n    element: this._canvas,\n    stopEvent: false\n  });\n  this._listener = [];\n  this._time = 0;\n  this._particuleClass = options.particule || ol.particule.Base;\n  if (options.createParticule) this._createParticule = options.createParticule;\n  // 25fps\n  this._fps = 1000 / (options.fps || 25);\n  // Default particules properties\n  var p = this._createParticule();\n  this._psize = p.get('size') || [50,50];\n  this.set('density', options.density || .5);\n  this.set('speed', options.speed || 4);\n  this.set('angle', typeof(options.angle) === 'number' ? options.angle : Math.PI / 4);\n  if (options.animate !== false) this.setAnimation(true);\n  // Prevent animation when window on background\n  document.addEventListener(\"visibilitychange\", function() {\n    this._pause = true;\n  }.bind(this));\n};\nol.ext.inherits(ol.Overlay.AnimatedCanvas, ol.Overlay);\n/** Set the visibility\n * @param {boolean} b\n */\nol.Overlay.AnimatedCanvas.prototype.setVisible = function (b) {\n  this.element.style.display = b ? 'block' : 'none';\n  if (b) this.setAnimation(this.get('animation'));\n}\n/** Get the visibility\n * @return {boolean} b\n */\nol.Overlay.AnimatedCanvas.prototype.getVisible = function () {\n  return this.element.style.display != 'none';\n}\n/** No update for this overlay\n */\nol.Overlay.AnimatedCanvas.prototype.updatePixelPosition = function () {};\n/**\n * Set the map instance the overlay is associated with\n * @param {ol.Map} map The map instance.\n */\nol.Overlay.AnimatedCanvas.prototype.setMap = function (map) {\n  if (this.getMap()) {\n    this.getMap().getViewport().querySelector('.ol-overlaycontainer').removeChild(this._canvas);\n  }\n  this._listener.forEach(function(l) {\n    ol.Observable.unByKey(l);\n  });\n  this._listener = [];\n  ol.Overlay.prototype.setMap.call(this, map);\n  if (map) {\n    var size = map.getSize();\n    this._canvas.width = size[0];\n    this._canvas.height = size[1];\n    this.draw();\n    this._listener.push (map.on('change:size', function()  {\n      var size = map.getSize();\n      if (this._canvas.width !== size[0] || this._canvas.height !== size[1]) {\n        this._canvas.width = size[0];\n        this._canvas.height = size[1];\n        this.draw();\n      }\n    }.bind(this)));\n  }\n};\n/** Create particules or return exiting ones\n */\nol.Overlay.AnimatedCanvas.prototype.getParticules = function() {\n  var w = this._psize[0];\n  var h = this._psize[1];\n  var d = (this.get('density') * this._canvas.width * this._canvas.height / w / h) << 0;\n  if (!this._particules) this._particules = [];\n  if (d > this._particules.length) {\n    for (var i=this._particules.length; i<d; i++) {\n      this._particules.push(this._createParticule(this, this.randomCoord()));\n    } \n  } else {\n    this._particules.length = d;\n  }\n  return this._particules;\n};\n/** Create a particule\n * @private\n */\nol.Overlay.AnimatedCanvas.prototype._createParticule = function(overlay, coordinate) {\n  return new this._particuleClass({\n    overlay: overlay, \n    coordinate: coordinate\n  });\n};\n/** Get random coordinates on canvas\n */\nol.Overlay.AnimatedCanvas.prototype.randomCoord = function() {\n  return [ \n    Math.random()*(this._canvas.width + this._psize[0]) - this._psize[0]/2 , \n    Math.random()*(this._canvas.height + this._psize[1]) - this._psize[1]/2 \n  ];\n};\n/** Draw canvas overlay (draw each particules)\n * @param {number} dt timelapes since last call\n */\nol.Overlay.AnimatedCanvas.prototype.draw = function(dt) {\n  var ctx = this._ctx;\n  this.clear();\n  ctx.beginPath();\n  this.getParticules().forEach(function(p) {\n    if (dt) {\n      p.update(dt);\n      this.testExit(p);\n    }\n    p.draw(this._ctx);\n  }.bind(this));\n};\n/** Test if particule exit the canvas and add it on other side\n * @param {*} p the point to test\n * @param {ol.size} size size of the overlap\n */\nol.Overlay.AnimatedCanvas.prototype.testExit = function(p) {\n  var size = this._psize;\n  if (p.coordinate[0] < -size[0]) {\n    p.coordinate[0] = this._canvas.width + size[0];\n    p.coordinate[1] = Math.random() * (this._canvas.height+size[1]) - size[1]/2;\n  } else if (p.coordinate[0] > this._canvas.width +size[0]) {\n    p.coordinate[0] = -size[0];\n    p.coordinate[1] = Math.random() * (this._canvas.height+size[1]) - size[1]/2;\n  } else if (p.coordinate[1] < -size[1]) {\n    p.coordinate[0] = Math.random() * (this._canvas.width+size[0]) - size[0]/2;\n    p.coordinate[1] = this._canvas.height + size[1];\n  } else if (p.coordinate[1] > this._canvas.height +size[1]) {\n    p.coordinate[0] = Math.random() * (this._canvas.width+size[0]) - size[0]/2;\n    p.coordinate[1] = -size[1];\n  }\n};\n/** Clear canvas\n */\nol.Overlay.AnimatedCanvas.prototype.clear = function() {\n  this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n};\n/** Get overlay canvas\n * @return {CanvasElement}\n */\nol.Overlay.AnimatedCanvas.prototype.getCanvas = function() {\n  return this._canvas;\n};\n/** Set canvas animation\n * @param {boolean} anim, default true\n * @api\n */\nol.Overlay.AnimatedCanvas.prototype.setAnimation = function(anim) {\n  anim = (anim!==false);\n  this.set('animation', anim);\n  if (anim) {\n    this._pause = true;\n    requestAnimationFrame(this._animate.bind(this));\n  } else {\n    this.dispatchEvent({ type:'animation:stop', time: this._time });\n  }\n};\n/**\n * @private\n */\nol.Overlay.AnimatedCanvas.prototype._animate = function(time) {\n  if (this.getVisible() && this.get('animation')) {\n    if (this._pause) {\n      // reset time\n      requestAnimationFrame(function(time){\n        this._time = time;\n        requestAnimationFrame(this._animate.bind(this));\n      }.bind(this));  \n    } else {\n      // Test fps\n      if (time - this._time > this._fps) {\n        this.draw(time - this._time);\n        this._time = time;\n      }\n      requestAnimationFrame(this._animate.bind(this));\n    }\n  }\n  this._pause = false;\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc\n * An overlay fixed on the map. \n * Use setPosition(coord, true) to force the overlay position otherwise the position will be ignored.\n *\n * @example\nvar popup = new ol.Overlay.Fixed();\nmap.addOverlay(popup);\npopup.setposition(position, true);\n*\n* @constructor\n* @extends {ol.Overlay}\n* @param {} options Extend Overlay options \n* @api stable\n*/\nol.Overlay.Fixed = function (options) {\n  ol.Overlay.call(this, options);\n};\nol.ext.inherits(ol.Overlay.Fixed, ol.Overlay);\n/** Prevent modifying position and use a force argument to force positionning.\n * @param {ol.coordinate} position\n * @param {boolean} force true to change the position, default false\n */\nol.Overlay.Fixed.prototype.setPosition = function(position, force) {\n  if (this.getMap() && position) {\n    this._pixel = this.getMap().getPixelFromCoordinate(position);\n  }\n  ol.Overlay.prototype.setPosition.call(this, position)\n  if (force) {\n    ol.Overlay.prototype.updatePixelPosition.call(this);\n  } \n};\n/** Update position according the pixel position\n */\nol.Overlay.Fixed.prototype.updatePixelPosition = function() {\n  if (this.getMap() && this._pixel && this.getPosition()) {\n    var pixel = this.getMap().getPixelFromCoordinate(this.getPosition())\n    if (Math.round(pixel[0]*1000) !== Math.round(this._pixel[0]*1000) \n      || Math.round(pixel[0]*1000) !== Math.round(this._pixel[0]*1000) ) {\n      this.setPosition(this.getMap().getCoordinateFromPixel(this._pixel));\n    }\n  }\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc\n *\tThe Magnify overlay add a \"magnifying glass\" effect to an OL3 map that displays \n*\ta portion of the map in a different zoom (and actually display different content).\n*\n* @constructor\n* @extends {ol.Overlay}\n* @param {olx.OverlayOptions} options Overlay options \n* @api stable\n*/\nol.Overlay.Magnify = function (options) {\n  var elt = document.createElement(\"div\");\n      elt.className = \"ol-magnify\";\n  this._elt = elt;\n  ol.Overlay.call(this, {\n    positioning: options.positioning || \"center-center\",\n    element: this._elt,\n    stopEvent: false\n  });\n  // Create magnify map\n  this.mgmap_ = new ol.Map({\n    controls: new ol.Collection(),\n    interactions: new ol.Collection(),\n    target: options.target || this._elt,\n    view: new ol.View({ projection: options.projection }),\n    layers: options.layers\n  });\n  this.mgview_ = this.mgmap_.getView();\n  this.external_ = options.target?true:false;\n  this.set(\"zoomOffset\", options.zoomOffset||1);\n  this.set(\"active\", true);\n  this.on(\"propertychange\", this.setView_.bind(this));\n};\nol.ext.inherits(ol.Overlay.Magnify, ol.Overlay);\n/**\n * Set the map instance the overlay is associated with.\n * @param {ol.Map} map The map instance.\n */\nol.Overlay.Magnify.prototype.setMap = function(map) {\n  if (this.getMap()) {\n    this.getMap().getViewport().removeEventListener(\"mousemove\", this.onMouseMove_);\n  }\n  if (this._listener) ol.Observable.unByKey(this._listener);\n  this._listener = null;\n  ol.Overlay.prototype.setMap.call(this, map);\n  map.getViewport().addEventListener(\"mousemove\", this.onMouseMove_.bind(this));\n  this._listener = map.getView().on('propertychange', this.setView_.bind(this));\n  this.setView_();\n};\n/** Get the magnifier map\n*\t@return {_ol_Map_}\n*/\nol.Overlay.Magnify.prototype.getMagMap = function() {\n  return this.mgmap_;\n};\n/** Magnify is active\n*\t@return {boolean}\n*/\nol.Overlay.Magnify.prototype.getActive = function() {\n  return this.get(\"active\");\n};\n/** Activate or deactivate\n*\t@param {boolean} active\n*/\nol.Overlay.Magnify.prototype.setActive = function(active) {\n  return this.set(\"active\", active);\n};\n/** Mouse move\n * @private\n */\nol.Overlay.Magnify.prototype.onMouseMove_ = function(e) {\n  var self = this;\n  if (!self.get(\"active\")) {\n    self.setPosition();\n  } else {\n    var px = self.getMap().getEventCoordinate(e);\n    if (!self.external_) self.setPosition(px);\n    self.mgview_.setCenter(px);\n    if (!self._elt.querySelector('canvas') || self._elt.querySelector('canvas').style.display ==\"none\") self.mgmap_.updateSize();\n  }\n};\n/** View has changed\n * @private\n */\nol.Overlay.Magnify.prototype.setView_ = function(e) {\n  if (!this.get(\"active\")) {\n    this.setPosition();\n    return;\n  }\n  if (!e) {\n    // refresh all\n    this.setView_({key:'rotation'});\n    this.setView_({key:'resolution'});\n    return;\n  }\n  // Set the view params\n  switch (e.key) {\n    case 'rotation':\n      this.mgview_.setRotation(this.getMap().getView().getRotation());\n      break;\n    case 'zoomOffset':\n    case 'resolution': {\n      var z = Math.max(0,this.getMap().getView().getZoom()+Number(this.get(\"zoomOffset\")));\n      this.mgview_.setZoom(z);\n      break;\n    }\n    default: break;\n  }\n};\n\n/*\tCopyright (c) 2018 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc\n * A placemark element to be displayed over the map and attached to a single map\n * location. The placemarks are customized using CSS.\n *\n * @example\nvar popup = new ol.Overlay.Placemark();\nmap.addOverlay(popup);\npopup.show(coordinate);\npopup.hide();\n*\n* @constructor\n* @extends {ol.Overlay}\n* @param {} options Extend ol/Overlay/Popup options \n*\t@param {String} options.color placemark color\n*\t@param {String} options.backgroundColor placemark color\n*\t@param {String} options.contentColor placemark color\n*\t@param {Number} options.radius placemark radius in pixel\n*\t@param {String} options.popupClass the a class of the overlay to style the popup.\n*\t@param {function|undefined} options.onclose: callback function when popup is closed\n*\t@param {function|undefined} options.onshow callback function when popup is shown\n* @api stable\n*/\nol.Overlay.Placemark = function (options) {\n  options = options || {};\n  options.popupClass = (options.popupClass || '') + ' placemark anim'\n  options.positioning = 'bottom-center',\n  ol.Overlay.Popup.call(this, options);\n  this.setPositioning = function(){};\n  if (options.color) this.element.style.color = options.color;\n  if (options.backgroundColor ) this.element.style.backgroundColor  = options.backgroundColor ;\n  if (options.contentColor ) this.setContentColor(options.contentColor);\n  if (options.size) this.setRadius(options.size);\n};\nol.ext.inherits(ol.Overlay.Placemark, ol.Overlay.Popup);\n/**\n * Set the position and the content of the placemark (hide it before to enable animation).\n * @param {ol.Coordinate|string} coordinate the coordinate of the popup or the HTML content.\n * @param {string|undefined} html the HTML content (undefined = previous content).\n */\nol.Overlay.Placemark.prototype.show = function(coordinate, html) {\n  if (coordinate===true) {\n    coordinate = this.getPosition();\n  }\n  this.hide();\n  ol.Overlay.Popup.prototype.show.apply(this, [coordinate, html]);\n};\n/**\n * Set the placemark color.\n * @param {string} color\n */\nol.Overlay.Placemark.prototype.setColor = function(color) {\n  this.element.style.color = color;\n};\n/**\n * Set the placemark background color.\n * @param {string} color\n */\nol.Overlay.Placemark.prototype.setBackgroundColor = function(color) {\n  this._elt.style.backgroundColor = color;\n};\n/**\n * Set the placemark content color.\n * @param {string} color\n */\nol.Overlay.Placemark.prototype.setContentColor = function(color) {\n  var c = this.element.getElementsByClassName('ol-popup-content')[0];\n  if (c) c.style.color = color;\n};\n/**\n * Set the placemark class.\n * @param {string} name\n */\nol.Overlay.Placemark.prototype.setClassName = function(name) {\n  var oldclass = this.element.className;\n  this.element.className = 'ol-popup placemark ol-popup-bottom ol-popup-center ' \n    + (/visible/.test(oldclass) ? 'visible ' : '')\n    + (/anim/.test(oldclass) ? 'anim ' : '')\n    + name;\n};\n/**\n * Set the placemark radius.\n * @param {number} size size in pixel\n */\nol.Overlay.Placemark.prototype.setRadius = function(size) {\n  this.element.style.fontSize = size + 'px';\n};\n\n/*\tCopyright (c) 2018 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Template attributes for popup\n * @typedef {Object} TemplateAttributes\n * @property {string} title\n * @property {function} format a function that takes an attribute and a feature and returns the formated attribute\n * @property {string} before string to instert before the attribute (prefix)\n * @property {string} after string to instert after the attribute (sudfix)\n * @property {boolean|function} visible boolean or a function (feature, value) that decides the visibility of a attribute entry\n */\n/** Template \n * @typedef {Object} Template\n * @property {string|function} title title of the popup, attribute name or a function that takes a feature and returns the title\n * @property {Object.<TemplateAttributes>} attributes a list of template attributes \n */\n/**\n * A popup element to be displayed on a feature.\n *\n * @constructor\n * @extends {ol.Overlay.Popup}\n * @fires show\n * @fires hide\n * @fires select\n * @param {} options Extend Popup options \n *  @param {String} options.popupClass the a class of the overlay to style the popup.\n *  @param {bool} options.closeBox popup has a close box, default false.\n *  @param {function|undefined} options.onclose: callback function when popup is closed\n *  @param {function|undefined} options.onshow callback function when popup is shown\n *  @param {Number|Array<number>} options.offsetBox an offset box\n *  @param {ol.OverlayPositioning | string | undefined} options.positionning \n *    the 'auto' positioning var the popup choose its positioning to stay on the map.\n *  @param {Template|function} options.template A template with a list of properties to use in the popup or a function that takes a feature and returns a Template\n *  @param {ol.interaction.Select} options.select a select interaction to get features from\n *  @param {boolean} options.keepSelection keep original selection, otherwise set selection to the current popup feature and add a counter to change current feature, default false\n *  @param {boolean} options.canFix Enable popup to be fixed, default false\n *  @param {boolean} options.showImage display image url as image, default false\n *  @param {boolean} options.maxChar max char to display in a cell, default 200\n *  @api stable\n */\nol.Overlay.PopupFeature = function (options) {\n  options = options || {};\n  ol.Overlay.Popup.call(this, options);\n  this.setTemplate(options.template);\n  this.set('canFix', options.canFix)\n  this.set('showImage', options.showImage)\n  this.set('maxChar', options.maxChar||200)\n  this.set('keepSelection', options.keepSelection)\n  // Bind with a select interaction\n  if (options.select && (typeof options.select.on ==='function')) {\n    this._select = options.select;\n    options.select.on('select', function(e){\n      if (!this._noselect) {\n        if (e.selected[0]) {\n          this.show(e.mapBrowserEvent.coordinate, options.select.getFeatures().getArray(), e.selected[0]);\n        } else {\n          this.hide();\n        }\n      }\n    }.bind(this));\n  }\n};\nol.ext.inherits(ol.Overlay.PopupFeature, ol.Overlay.Popup);\n/** Set the template\n * @param {Template} template A template with a list of properties to use in the popup\n */\nol.Overlay.PopupFeature.prototype.setTemplate = function(template) {\n  this._template = template;\n  if (this._template && this._template.attributes instanceof Array) {\n    var att = {};\n    this._template.attributes.forEach(function (a) {\n      att[a] = true;\n    });\n    this._template.attributes = att;\n  }\n};\n/** Show the popup on the map\n * @param {ol.coordinate|undefined} coordinate Position of the popup\n * @param {ol.Feature|Array<ol.Feature>} features The features on the popup\n * @param {ol.Feature} current The current feature if keepSelection = true, otherwise get the first feature\n */\nol.Overlay.PopupFeature.prototype.show = function(coordinate, features, current) {\n  if (coordinate instanceof ol.Feature \n    || (coordinate instanceof Array && coordinate[0] instanceof ol.Feature)) {\n    features = coordinate;\n    coordinate = null;\n  }\n  if (!(features instanceof Array)) features = [features];\n  this._features = features.slice();\n  if (!this._count) this._count = 1;\n  // Calculate html upon feaures attributes\n  this._count = 1;\n  var f = this.get('keepSelection') ? current || features[0] : features[0];\n  var html = this._getHtml(f);\n  if (html) {\n    if (!this.element.classList.contains('ol-fixed')) this.hide();\n    if (!coordinate || features[0].getGeometry().getType()==='Point') {\n      coordinate = features[0].getGeometry().getFirstCoordinate();\n    }\n    ol.Overlay.Popup.prototype.show.call(this, coordinate, html);\n  } else {\n    this.hide();\n  }\n};\n/**\n * @private\n */\nol.Overlay.PopupFeature.prototype._getHtml = function(feature) {\n  if (!feature) return '';\n  var html = ol.ext.element.create('DIV', { className: 'ol-popupfeature' });\n  if (this.get('canFix')) {\n    ol.ext.element.create('I', { className:'ol-fix', parent: html })\n      .addEventListener('click', function(){\n        this.element.classList.toggle('ol-fixed');\n      }.bind(this));\n  }\n  var template = this._template;\n  // calculate template\n  if (typeof(template) === 'function') {\n    template = template(feature, this._count, this._features.length);\n  } else if (!template || !template.attributes) {\n    template = template || {};\n    template. attributes = {};\n    for (var i in feature.getProperties()) if (i!='geometry') {\n      template.attributes[i] = i;\n    }\n  }  \n  // Display title\n  if (template.title) {\n    var title;\n    if (typeof template.title === 'function') {\n      title = template.title(feature);\n    } else {\n      title = feature.get(template.title);\n    }\n    ol.ext.element.create('H1', { html:title, parent: html });\n  }\n  // Display properties in a table\n  if (template.attributes) {\n    var tr, table = ol.ext.element.create('TABLE', { parent: html });\n    var atts = template.attributes;\n    var featureAtts = feature.getProperties();\n    for (var att in atts) {\n      if (featureAtts.hasOwnProperty(att)) {\n        var a = atts[att];\n        var content, val = featureAtts[att];\n        // Get calculated value\n        if (typeof(a.format)==='function') {\n          val = a.format(val, feature);\n        }\n        // Is entry visible?\n        var visible = true;\n        if (typeof(a.visible)==='boolean') {\n          visible = a.visible;\n        } else if (typeof(a.visible)==='function') {\n          visible = a.visible(feature, val);\n        }\n        if (visible) {\n          tr = ol.ext.element.create('TR', { parent: table });\n          ol.ext.element.create('TD', { html: a.title || att, parent: tr });\n          // Show image or content\n          if (this.get('showImage') && /(http(s?):)([/|.|\\w|\\s|-])*\\.(?:jpg|gif|png)/.test(val)) {\n            content = ol.ext.element.create('IMG',{\n              src: val\n            });\n          } else {\n            content = (a.before||'') + val + (a.after||'');\n            var maxc = this.get('maxChar') || 200;\n            if (typeof(content) === 'string' && content.length>maxc) content = content.substr(0,maxc)+'[...]';\n          }\n          // Add value\n          ol.ext.element.create('TD', {\n            html: content,\n            parent: tr\n          });\n        }\n      }\n    }\n  }\n  // Zoom button\n  ol.ext.element.create('BUTTON', { className: 'ol-zoombt', parent: html })\n    .addEventListener('click', function() {\n      if (feature.getGeometry().getType()==='Point') {\n        this.getMap().getView().animate({\n          center: feature.getGeometry().getFirstCoordinate(),\n          zoom:  Math.max(this.getMap().getView().getZoom(), 18)\n        });\n      } else  {\n        var ext = feature.getGeometry().getExtent();\n        this.getMap().getView().fit(ext, { duration:1000 });\n      }\n    }.bind(this));\n  // Counter\n  if (!this.get('keepSelection') && this._features.length > 1) {\n    var div = ol.ext.element.create('DIV', { className: 'ol-count', parent: html });\n    ol.ext.element.create('DIV', { \n      className: 'ol-prev', \n      parent: div,\n      click: function() {\n        this._count--;\n        if (this._count<1) this._count = this._features.length;\n        html = this._getHtml(this._features[this._count-1]);\n        setTimeout(function() { \n          ol.Overlay.Popup.prototype.show.call(this, this.getPosition(), html); \n        }.bind(this), 350 );\n      }.bind(this)\n    });\n    ol.ext.element.create('TEXT', { html:this._count+'/'+this._features.length, parent: div });\n    ol.ext.element.create('DIV', { \n      className: 'ol-next', \n      parent: div,\n      click: function() {\n        this._count++;\n        if (this._count>this._features.length) this._count = 1;\n        html = this._getHtml(this._features[this._count-1]);\n        setTimeout(function() { \n          ol.Overlay.Popup.prototype.show.call(this, this.getPosition(), html); \n        }.bind(this), 350 );\n      }.bind(this)\n    });\n  }\n  // Use select interaction\n  if (this._select && !this.get('keepSelection')) {\n    this._noselect = true;\n    this._select.getFeatures().clear();\n    this._select.getFeatures().push(feature);\n    this._noselect = false;\n  }\n  this.dispatchEvent({ type: 'select', feature: feature, index: this._count })\n  return html;\n};\n/** Fix the popup\n * @param {boolean} fix\n */\nol.Overlay.PopupFeature.prototype.setFix = function (fix) {\n  if (fix) this.element.classList.add('ol-fixed');\n  else this.element.classList.remove('ol-fixed');\n};\n/** Is a popup fixed\n * @return {boolean} \n */\nol.Overlay.PopupFeature.prototype.getFix = function () {\n  return this.element.classList.contains('ol-fixed');\n};\n/** Get a function to use as format to get local string for an attribute\n * if the attribute is a number: Number.toLocaleString()\n * if the attribute is a date: Date.toLocaleString()\n * otherwise the attibute itself\n * @param {string} locales string with a BCP 47 language tag, or an array of such strings\n * @param {*} options Number or Date toLocaleString options\n * @return {function} a function that takes an attribute and return the formated attribute\n */\nol.Overlay.PopupFeature.localString = function (locales , options) {\n  return function (a) {\n    if (a && a.toLocaleString) {\n      return a.toLocaleString(locales , options);\n    } else {\n      // Try to get a date from a string\n      var date = new Date(a);\n      if (isNaN(date)) return a;\n      else return date.toLocaleString(locales , options);\n    }\n  };\n};\n\n/*\tCopyright (c) 2018 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** A tooltip element to be displayed over the map and attached on the cursor position.\n * @constructor\n * @extends {ol.Overlay.Popup}\n * @param {} options Extend Popup options \n *\t@param {String} options.popupClass the a class of the overlay to style the popup.\n *  @param {number} options.maximumFractionDigits maximum digits to display on measure, default 2\n *  @param {function} options.formatLength a function that takes a number and returns the formated value, default length in meter\n *  @param {function} options.formatArea a function that takes a number and returns the formated value, default length in square-meter\n *  @param {function} options.getHTML a function that takes a feature and the info string and return a formated info to display in the tooltip, default display feature measure & info\n *\t@param {Number|Array<number>} options.offsetBox an offset box\n *\t@param {ol.OverlayPositioning | string | undefined} options.positionning \n *\t\tthe 'auto' positioning var the popup choose its positioning to stay on the map.\n * @api stable\n */\nol.Overlay.Tooltip = function (options) {\n  options = options || {};\n  options.popupClass = options.popupClass || options.className || 'tooltips black';\n  options.positioning = options.positioning || 'center-left';\n  options.stopEvent = !!(options.stopEvent);\n  ol.Overlay.Popup.call(this, options);\n  this.set('maximumFractionDigits', options.maximumFractionDigits||2);\n  if (typeof(options.formatLength)==='function') this.formatLength = options.formatLength;\n  if (typeof(options.formatArea)==='function') this.formatArea = options.formatArea;\n  if (typeof(options.getHTML)==='function') this.getHTML = options.getHTML;\n  this._interaction = new ol.interaction.Interaction({\n    handleEvent: function(e){\n      if (e.type==='pointermove' || e.type==='click') {\n        var info = this.getHTML(this._feature, this.get('info'));\n        if (info) {\n          this.show(e.coordinate, info);\n        }\n        else this.hide();\n        this._coord = e.coordinate;\n      }\n      return true;\n    }.bind(this)\n  });\n};\nol.ext.inherits(ol.Overlay.Tooltip, ol.Overlay.Popup);\n/**\n * Set the map instance the control is associated with\n * and add its controls associated to this map.\n * @param {_ol_Map_} map The map instance.\n */\nol.Overlay.Tooltip.prototype.setMap = function (map) {\n  if (this.getMap()) this.getMap().removeInteraction(this._interaction);\n  ol.Overlay.Popup.prototype.setMap.call(this, map);\n  if (this.getMap()) this.getMap().addInteraction(this._interaction);\n};\n/** Get the information to show in the tooltip\n * The area/length will be added if a feature is attached.\n * @param {ol.Feature|undefined} feature the feature\n * @param {string} info the info string\n * @api\n */\nol.Overlay.Tooltip.prototype.getHTML = function(feature, info) {\n  if (this.get('measure')) return this.get('measure') + (info ? '<br/>'+ info : '');\n  else return info || '';\n};\n/** Set the Tooltip info\n * If information is not null it will be set with a delay,\n * thus watever the information is inserted, the significant information will be set.\n * ie. ttip.setInformation('ok'); ttip.setInformation(null); will set 'ok' \n * ttip.set('info','ok'); ttip.set('info', null); will set null\n * @param {string} what The information to display in the tooltip, default remove information\n */\nol.Overlay.Tooltip.prototype.setInfo = function(what) {\n  if (!what) {\n    this.set('info','');\n    this.hide();\n  }\n  else setTimeout(function() { \n    this.set('info', what); \n    this.show(this._coord, this.get('info'));\n  }.bind(this));\n};\n/** Remove the current featue attached to the tip \n * Similar to setFeature() with no argument\n */\nol.Overlay.Tooltip.prototype.removeFeature = function() {\n  this.setFeature();\n};\n/** Format area to display in the popup. \n * Can be overwritten to display measure in a different unit (default: square-metter).\n * @param {number} area area in m2\n * @return {string} the formated area\n * @api\n */\nol.Overlay.Tooltip.prototype.formatArea = function(area) {\n  if (area > Math.pow(10,-1*this.get('maximumFractionDigits'))) {\n    if (area>10000) {\n      return (area/1000000).toLocaleString(undefined, {maximumFractionDigits: this.get('maximumFractionDigits)')}) + ' km²';\n    } else {\n      return area.toLocaleString(undefined, {maximumFractionDigits: this.get('maximumFractionDigits')}) + ' m²';\n    }\n  } else {\n    return '';\n  }\n};\n/** Format area to display in the popup\n * Can be overwritten to display measure in different unit (default: meter).\n * @param {number} length length in m\n * @return {string} the formated length\n * @api\n */\nol.Overlay.Tooltip.prototype.formatLength = function(length) {\n  if (length > Math.pow(10,-1*this.get('maximumFractionDigits'))) {\n    if (length>100) {\n      return (length/1000).toLocaleString(undefined, {maximumFractionDigits: this.get('maximumFractionDigits')}) + ' km';\n    } else {\n      return length.toLocaleString(undefined, {maximumFractionDigits: this.get('maximumFractionDigits')}) + ' m';\n    }\n  } else {\n    return '';\n  }\n};\n/** Set a feature associated with the tooltips, measure info on the feature will be added in the tooltip\n * @param {ol.Feature|ol.Event} feature an ol.Feature or an event (object) with a feature property\n */\nol.Overlay.Tooltip.prototype.setFeature = function(feature) {\n  // Handle event with a feature as property.\n  if (feature && feature.feature) feature = feature.feature;\n  // The feature\n  this._feature = feature;\n  if (this._listener) {\n    this._listener.forEach(function(l) {\n      ol.Observable.unByKey(l);\n    });\n  }\n  this._listener = [];\n  this.set('measure', '');\n  if (feature) {\n    this._listener.push(feature.getGeometry().on('change', function(e){ \n      var geom = e.target;\n      var measure;\n      if (geom.getArea) {\n        measure = this.formatArea(ol.sphere.getArea(geom, { projection: this.getMap().getView().getProjection() }));\n      } else if (geom.getLength) {\n        measure = this.formatLength(ol.sphere.getLength(geom, { projection: this.getMap().getView().getProjection() }));\n      }\n      this.set('measure', measure);\n    }.bind(this)));\n  }\n};\n\n/*\n\tCopyright (c) 2017 Jean-Marc VIGLINO,\n\treleased under the CeCILL-B license (http://www.cecill.info/).\n\tol.coordinate.convexHull compute a convex hull using Andrew's Monotone Chain Algorithm.\n\t@see https://en.wikipedia.org/wiki/Convex_hull_algorithms\n*/\nol.coordinate.convexHull;\n(function(){\n/** Tests if a point is left or right of line (a,b).\n* @param {ol.coordinate} a point on the line\n* @param {ol.coordinate} b point on the line\n* @param {ol.coordinate} o\n* @return {bool} true if (a,b,o) turns clockwise\n*/\nvar clockwise = function (a, b, o) {\n  return ((a[0] - o[0]) * (b[1] - o[1]) - (a[1] - o[1]) * (b[0] - o[0]) <= 0);\n};\n/** Compute a convex hull using Andrew's Monotone Chain Algorithm\n * @param {Array<ol.geom.Point>} points an array of 2D points\n * @return {Array<ol.geom.Point>} the convex hull vertices\n */\nol.coordinate.convexHull = function (points) {\t// Sort by increasing x and then y coordinate\n  var i;\n  points.sort(function(a, b) {\n    return a[0] == b[0] ? a[1] - b[1] : a[0] - b[0];\n  });\n  // Compute the lower hull\n  var lower = [];\n  for (i = 0; i < points.length; i++) {\n    while (lower.length >= 2 && clockwise(lower[lower.length - 2], lower[lower.length - 1], points[i])) {\n      lower.pop();\n    }\n    lower.push(points[i]);\n  }\n  // Compute the upper hull\n  var upper = [];\n  for (i = points.length - 1; i >= 0; i--) {\n    while (upper.length >= 2 && clockwise(upper[upper.length - 2], upper[upper.length - 1], points[i])) {\n      upper.pop();\n    }\n    upper.push(points[i]);\n  }\n  upper.pop();\n  lower.pop();\n  return lower.concat(upper);\n};\n/* Get coordinates of a geometry */\nvar getCoordinates = function (geom) {\n  var i, p\n  var h = [];\n  switch (geom.getType()) {\n    case \"Point\":h.push(geom.getCoordinates());\n      break;\n    case \"LineString\":\n    case \"LinearRing\":\n    case \"MultiPoint\":h = geom.getCoordinates();\n      break;\n    case \"MultiLineString\":\n      p = geom.getLineStrings();\n      for (i = 0; i < p.length; i++) h.concat(getCoordinates(p[i]));\n      break;\n    case \"Polygon\":\n      h = getCoordinates(geom.getLinearRing(0));\n      break;\n    case \"MultiPolygon\":\n      p = geom.getPolygons();\n      for (i = 0; i < p.length; i++) h.concat(getCoordinates(p[i]));\n      break;\n    case \"GeometryCollection\":\n      p = geom.getGeometries();\n      for (i = 0; i < p.length; i++) h.concat(getCoordinates(p[i]));\n      break;\n    default:break;\n  }\n  return h;\n};\n/** Compute a convex hull on a geometry using Andrew's Monotone Chain Algorithm\n * @return {Array<ol.geom.Point>} the convex hull vertices\n */\nol.geom.Geometry.prototype.convexHull = function() {\n  return ol.coordinate.convexHull(getCoordinates(this));\n};\n})();\n\n/*\n\tCopyright (c) 2018 Jean-Marc VIGLINO,\n\treleased under the CeCILL-B license (http://www.cecill.info/).\n*/\n/** Convert coordinate to French DFCI grid\n * @param {ol/coordinate} coord\n * @param {number} level [0-3]\n * @param {ol/proj/Projection} projection of the coord, default EPSG:27572\n * @return {String} the DFCI index\n */\nol.coordinate.toDFCI = function (coord, level, projection) {\n  if (!level && level !==0) level = 3;\n  if (projection) {\n    if (!ol.proj.get('EPSG:27572')) {\n      // Add Lambert IIe proj \n      if (!proj4.defs[\"EPSG:27572\"]) proj4.defs(\"EPSG:27572\",\"+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs\");\n      ol.proj.proj4.register(proj4);\n    }\n    coord = ol.proj.transform(coord, projection, 'EPSG:27572');\n  }\n  var x = coord[0];\n  var y = coord[1];\n  var s = '';\n  // Level 0\n  var step = 100000;\n  s += String.fromCharCode(65 + Math.floor((x<800000?x:x+200000)/step))\n    + String.fromCharCode(65 + Math.floor((y<2300000?y:y+200000)/step) - 1500000/step);\n  if (level === 0) return s;\n  // Level 1\n  var step1 = 100000/5;\n  s += 2*Math.floor((x%step)/step1);\n  s += 2*Math.floor((y%step)/step1);\n  if (level === 1) return s;\n  // Level 2\n  var step2 = step1 / 10;\n  var x0 = Math.floor((x%step1)/step2);\n  s += String.fromCharCode(65 + (x0<8 ? x0 : x0+2));\n  s += Math.floor((y%step1)/step2);\n  if (level === 2) return s;\n  // Level 3\n  var x3 = Math.floor((x%step2)/500);\n  var y3 = Math.floor((y%step2)/500);\n  if (x3<1) {\n    if (y3>1) s += '.1';\n    else s += '.4';\n  } else if (x3>2) {\n    if (y3>1) s += '.2';\n    else s += '.3';\n  } else if (y3>2) {\n    if (x3<2) s += '.1';\n    else s += '.2';\n  } else if (y3<1) {\n    if (x3<2) s += '.4';\n    else s += '.3';\n  } else {\n    s += '.5';\n  }\n  return s;\n};\n/** Get coordinate from French DFCI index\n * @param {String} index the DFCI index\n * @param {ol/proj/Projection} projection result projection, default EPSG:27572\n * @return {ol/coordinate} coord\n */\nol.coordinate.fromDFCI = function (index, projection) {\n  var coord;\n  // Level 0\n  var step = 100000;\n  var x = index.charCodeAt(0) - 65;\n  x = (x<8 ? x : x-2)*step;\n  var y = index.charCodeAt(1) - 65;\n  y = (y<8 ? y : y-2)*step + 1500000;\n  if (index.length===2) {\n    coord = [x+step/2, y+step/2];\n  } else {\n    // Level 1\n    step /= 5;\n    x += Number(index.charAt(2))/2*step;\n    y += Number(index.charAt(3))/2*step;\n    if (index.length===4) {\n      coord = [x+step/2, y+step/2];\n    } else {\n      // Level 2\n      step /= 10;\n      var x0 = index.charCodeAt(4) - 65;\n      x += (x0<8 ? x0 : x0-2)*step;\n      y += Number(index.charAt(5))*step;\n      if (index.length === 6) {\n        coord = [x+step/2, y+step/2];\n      } else {\n        // Level 3\n        switch (index.charAt(7)) {\n          case '1':\n            coord = [x+step/4, y+3*step/4];\n            break;\n          case '2':\n            coord = [x+3*step/4, y+3*step/4];\n            break;\n          case '3':\n            coord = [x+3*step/4, y+step/4];\n            break;\n          case '4':\n            coord = [x+step/4, y+step/4];\n            break;\n          default:\n            coord = [x+step/2, y+step/2];\n            break;\n        }\n      }\n    }\n  }\n  // Convert ?\n  if (projection) {\n    if (!ol.proj.get('EPSG:27572')) {\n      // Add Lambert IIe proj \n      if (!proj4.defs[\"EPSG:27572\"]) proj4.defs(\"EPSG:27572\",\"+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs\");\n      ol.proj.proj4.register(proj4);\n    }\n    coord = ol.proj.transform(coord, 'EPSG:27572', projection);\n  }\n  return coord;\n};\n/** The string is a valid DFCI index\n * @param {string} index DFCI index\n * @return {boolean}\n */\nol.coordinate.validDFCI = function (index) {\n  if (index.length<2 || index.length>8) return false;\n  if (/[^A-H|^K-N]/.test(index.substr(0,1))) return false;\n  if (/[^B-H|^K-N]/.test(index.substr(1,1))) return false;\n  if (index.length>2) {\n    if (index.length<4) return false;\n    if (/[^0,^2,^4,^6,^8]/.test(index.substr(2,1))) return false;\n    if (/[^0,^2,^4,^6,^8]/.test(index.substr(3,1))) return false;\n  }\n  if (index.length>4) {\n    if (index.length<6) return false;\n    if (/[^A-H|^K-L]/.test(index.substr(4,1))) return false;\n    if (/[^0-9]/.test(index.substr(5,1))) return false;\n  }\n  if (index.length>6) {\n    if (index.length<8) return false;\n    if (index.substr(6,1)!=='.') return false;\n    if (/[^1-5]/.test(index.substr(7,1))) return false;\n  }\n  return true;\n}\n/** Coordinate is valid for DFCI \n * @param {ol/coordinate} coord\n * @param {ol/proj/Projection} projection result projection, default EPSG:27572\n * @return {boolean}\n */\nol.coordinate.validDFCICoord = function (coord, projection) {\n  if (projection) {\n    if (!ol.proj.get('EPSG:27572')) {\n      // Add Lambert IIe proj \n      if (!proj4.defs[\"EPSG:27572\"]) proj4.defs(\"EPSG:27572\",\"+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs\");\n      ol.proj.proj4.register(proj4);\n    }\n    coord = ol.proj.transform(coord, projection, 'EPSG:27572');\n  }\n  // Test extent\n  if (0 > coord[0] || coord[0] > 1200000 ) return false;\n  if (1600000 > coord[1] || coord[1] > 2700000 ) return false;\n  return true;\n};\n\n/*\n\tCopyright (c) 2018 Jean-Marc VIGLINO,\n\treleased under the CeCILL-B license (http://www.cecill.info/).\n*/\n/* Define namespace\n */\nol.graph = {};\n/** \n * @classdesc \n * Compute the shortest paths between nodes in a graph source\n * The source must only contains LinesString.\n * \n * It uses a A* optimisation.\n * You can overwrite methods to customize the result.\n * @see https://en.wikipedia.org/wiki/Dijkstras_algorithm\n * @constructor\n * @fires calculating \n * @fires start\n * @fires finish\n * @fires pause\n * @param {any} options\n *  @param {ol/source/Vector} options.source the source for the edges \n *  @param {integer} [options.maxIteration=20000] maximum iterations before a pause event is fired, default 20000\n *  @param {integer} [options.stepIteration=2000] number of iterations before a calculating event is fired, default 2000\n *  @param {number} [options.epsilon=1E-6] geometric precision (min distance beetween 2 points), default 1E-6\n */\nol.graph.Dijskra = function (options) {\n  options = options || {};\n  this.source = options.source;\n  this.nodes = new ol.source.Vector();\n  // Maximum iterations\n  this.maxIteration = options.maxIteration || 20000;\n  this.stepIteration = options.stepIteration || 2000;\n  // A* optimisation\n  this.astar = true;\n  this.candidat = [];\n  ol.Object.call (this);\n  this.set ('epsilon', options.epsilon || 1E-6);\n};\nol.ext.inherits(ol.graph.Dijskra, ol.Object);\n/** Get the weighting of the edge, for example a speed factor\n * The function returns a value beetween ]0,1]\n * - 1   = no weighting\n * - 0.5 = goes twice more faster on this road\n * \n * If no feature is provided you must return the lower weighting you're using\n * @param {ol/Feature} feature\n * @return {number} a number beetween 0-1 \n * @api\n */\nol.graph.Dijskra.prototype.weight = function(/* feature */) {\n  return 1;\n};\n/** Get the edge direction\n * -  0 : the road is blocked\n * -  1 : direct way\n * - -1 : revers way\n * -  2 : both way\n * @param {ol/Feature} feature\n * @return {Number} 0: blocked, 1: direct way, -1: revers way, 2:both way \n * @api\n */\nol.graph.Dijskra.prototype.direction = function(/* feature */) {\n  return 2;\n};\n/** Calculate the length of an edge\n * @param {ol/Feature|ol/geom/LineString} geom\n * @return {number}\n * @api\n */\nol.graph.Dijskra.prototype.getLength = function(geom) {\n  if (geom.getGeometry) geom = geom.getGeometry();\n  return geom.getLength();\n};\n/** Get the nodes source concerned in the calculation\n * @return {ol/source/Vector}\n */\nol.graph.Dijskra.prototype.getNodeSource = function() {\n  return this.nodes;\n};\n/** Get all features at a coordinate\n * @param {ol/coordinate} coord\n * @return {Array<ol/Feature>}\n */\nol.graph.Dijskra.prototype.getEdges = function(coord) {\n  var extent = ol.extent.buffer (ol.extent.boundingExtent([coord]), this.get('epsilon'));\n  var result = [];\n  this.source.forEachFeatureIntersectingExtent(extent, function(f){\n    result.push(f);\n  });\n  return result;\n};\n/** Get a node at a coordinate\n * @param {ol/coordinate} coord\n * @return {ol/Feature} the node\n */\nol.graph.Dijskra.prototype.getNode = function(coord) {\n  var extent = ol.extent.buffer (ol.extent.boundingExtent([coord]), this.get('epsilon'));\n  var result = [];\n  this.nodes.forEachFeatureIntersectingExtent(extent, function(f){\n    result.push(f);\n  });\n  return result[0];\n};\n/** Add a node\n * @param {ol/coorindate} p\n * @param {number} wdist the distance to reach this node\n * @param {ol/Feature} from the feature used to come to this node\n * @param {ol/Feature} prev the previous node\n * @return {ol/Feature} the node\n * @private\n */\nol.graph.Dijskra.prototype.addNode = function(p, wdist, dist, from, prev) {\n  // Final condition\n  if (this.wdist && wdist > this.wdist) return false;\n  // Look for existing point\n  var node = this.getNode(p);\n  // Optimisation ?\n  var dtotal = wdist + this.getLength(new ol.geom.LineString([this.end, p])) * this.weight();\n  if (this.astar && this.wdist && dtotal > this.wdist) return false;\n  if (node) {\n    // Allready there\n    if (node!==this.arrival && node.get('wdist') <= wdist) return node;\n    // New candidat\n    node.set('dist', dist);\n    node.set('wdist', wdist);\n    node.set('dtotal', dtotal);\n    node.set('from', from);\n    node.set('prev', prev);\n    if (node===this.arrival) {\n      this.wdist = wdist;\n    }\n    this.candidat.push (node);\n  } else {\n    // New candidat\n    node =  new ol.Feature({\n      geometry: new ol.geom.Point(p),\n      from: from, \n      prev: prev, \n      dist: dist || 0, \n      wdist: wdist, \n      dtotal: dtotal, \n    });\n    if (wdist<0) {\n      node.set('wdist', false);\n    }\n    else this.candidat.push (node);\n    // Add it in the node source\n    this.nodes.addFeature(node);\n  }\n  return node;\n};\n/** Get the closest coordinate of a node in the graph source (an edge extremity)\n * @param {ol/coordinate} p\n * @return {ol/coordinate} \n * @private\n */\nol.graph.Dijskra.prototype.closestCoordinate = function(p) {\n  var e = this.source.getClosestFeatureToCoordinate(p);\n  var p0 = e.getGeometry().getFirstCoordinate();\n  var p1 = e.getGeometry().getLastCoordinate();\n  if (ol.coordinate.dist2d(p, p0) < ol.coordinate.dist2d(p, p1)) return p0;\n  else return p1;\n};\n/** Calculate a path beetween 2 points\n * @param {ol/coordinate} start\n * @param {ol/coordinate} end\n * @return {boolean|Array<ol/coordinate>} false if don't start (still running) or start and end nodes\n */\nol.graph.Dijskra.prototype.path = function(start, end) {\n  if (this.running) return false;\n  // Starting nodes\n  start = this.closestCoordinate(start);\n  this.end = this.closestCoordinate(end);\n  if (start[0]===this.end[0] \n    && start[1]===this.end[1]) {\n      this.dispatchEvent({\n        type: 'finish',\n        route: [],\n        wDistance: -1,\n        distance: this.wdist\n      });\n      return false;\n    }\n  // Initialize\n  var self = this;\n  this.nodes.clear();\n  this.candidat = [];\n  this.wdist = 0;\n  this.running = true;\n  // Starting point\n  this.addNode(start, 0);\n  // Arrival\n  this.arrival = this.addNode(this.end, -1);\n  // Start\n  this.nb = 0;\n  this.dispatchEvent({\n    type: 'start'\n  });\n  setTimeout(function() { self._resume(); });\n  return [start, this.end];\n};\n/** Restart after pause\n */\nol.graph.Dijskra.prototype.resume = function() {\n  if (this.running) return;\n  if (this.candidat.length) {\n    this.running = true;\n    this.nb = 0;\n    this._resume();\n  }\n};\n/** Pause \n */\nol.graph.Dijskra.prototype.pause = function() {\n  if (!this.running) return;\n  this.nb = -1;\n};\n/** Get the current 'best way'.\n * This may be used to animate while calculating.\n * @return {Array<ol/Feature>}\n */\nol.graph.Dijskra.prototype.getBestWay = function() {\n  var node, max = -1;\n  for (var i=0, n; n = this.candidat[i]; i++) {\n    if (n.get('wdist') > max) {\n      node = n;\n      max = n.get('wdist');\n    }\n  }\n  // Calculate route to this node\n  return this.getRoute(node);\n};\n/** Go on searching new candidats\n * @private\n */\nol.graph.Dijskra.prototype._resume = function() {\n  if (!this.running) return;\n  while (this.candidat.length) {\n    // Sort by wdist\n    this.candidat.sort (function(a,b) {\n      return (a.get('dtotal') < b.get('dtotal') ? 1 : a.get('dtotal')===b.get('dtotal') ? 0 : -1);\n    });\n    // First candidate\n    var node = this.candidat.pop();\n    var p = node.getGeometry().getCoordinates();\n    // Find connected edges\n    var edges = this.getEdges(p);\n    for (var i=0, e; e=edges[i]; i++) {\n      if (node.get('from')!==e) {\n        var dist = this.getLength (e);\n        if (dist < 0) {\n          console.log ('distance < 0!');\n          // continue;\n        }\n        var wdist = node.get('wdist') + dist * this.weight(e);\n        dist = node.get('dist') + dist;\n        var pt1 = e.getGeometry().getFirstCoordinate();\n        var pt2 = e.getGeometry().getLastCoordinate();\n        var sens = this.direction(e);\n        if (sens!==0) {\n          if (p[0]===pt1[0] && p[1]===pt1[1] && sens!==-1) {\n            this.addNode(pt2, wdist, dist, e, node);\n          }\n          if (p[0]===pt2[0] && p[0]===pt2[0] && sens!==1) {\n            this.addNode(pt1, wdist, dist, e, node);\n          }\n        }\n      }\n      // Test overflow or pause\n      if (this.nb === -1 || this.nb++ > this.maxIteration) {\n        this.running = false;\n        this.dispatchEvent({\n          type: 'pause',\n          overflow: (this.nb !== -1)\n        });\n        return;\n      }\n      // Take time to do something\n      if (!(this.nb % this.stepIteration)){\n        var self = this;\n        window.setTimeout(function() { self._resume() }, 5);\n        this.dispatchEvent({\n          type: 'calculating'\n        });\n        return;\n      }\n    }\n  }\n  // Finish!\n  this.nodes.clear();\n  this.running = false;\n  this.dispatchEvent({\n    type: 'finish',\n    route: this.getRoute(this.arrival),\n    wDistance: this.wdist,\n    distance: this.arrival.get('dist')\n  });\n};\n/** Get the route to a node\n * @param {ol/Feature} node\n * @return {Array<ol/Feature>}\n * @private\n */\nol.graph.Dijskra.prototype.getRoute = function(node) {\n  var route = [];\n  while (node) {\n    route.unshift(node.get('from'));\n    node = node.get('prev');\n  }\n  route.shift();\n  return route;\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n  Usefull function to handle geometric operations\n*/\n/** Distance beetween 2 points\n *\tUsefull geometric functions\n * @param {ol.Coordinate} p1 first point\n * @param {ol.Coordinate} p2 second point\n * @return {number} distance\n */\nol.coordinate.dist2d = function(p1, p2) {\n  var dx = p1[0]-p2[0];\n  var dy = p1[1]-p2[1];\n  return Math.sqrt(dx*dx+dy*dy);\n}\n/** 2 points are equal\n *\tUsefull geometric functions\n * @param {ol.Coordinate} p1 first point\n * @param {ol.Coordinate} p2 second point\n * @return {boolean}\n */\nol.coordinate.equal = function(p1, p2) {\n  return (p1[0]==p2[0] && p1[1]==p2[1]);\n}\n/** Get center coordinate of a feature\n * @param {ol.Feature} f\n * @return {ol.coordinate} the center\n */\nol.coordinate.getFeatureCenter = function(f) {\n  return ol.coordinate.getGeomCenter (f.getGeometry());\n};\n/** Get center coordinate of a geometry\n* @param {ol.Feature} geom\n* @return {ol.Coordinate} the center\n*/\nol.coordinate.getGeomCenter = function(geom) {\n  switch (geom.getType()) {\n    case 'Point': \n      return geom.getCoordinates();\n    case \"MultiPolygon\":\n            geom = geom.getPolygon(0);\n            // fallthrough\n    case \"Polygon\":\n      return geom.getInteriorPoint().getCoordinates();\n    default:\n      return geom.getClosestPoint(ol.extent.getCenter(geom.getExtent()));\n  }\n};\n/** Offset a polyline\n * @param {Array<ol.Coordinate>} coords\n * @param {number} offset\n * @return {Array<ol.Coordinate>} resulting coord\n * @see http://stackoverflow.com/a/11970006/796832\n * @see https://drive.google.com/viewerng/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxqa2dhZGdldHN0b3JlfGd4OjQ4MzI5M2Y0MjNmNzI2MjY\n */\nol.coordinate.offsetCoords = function (coords, offset) {\n  var path = [];\n  var N = coords.length-1;\n  var max = N;\n  var mi, mi1, li, li1, ri, ri1, si, si1, Xi1, Yi1;\n  var p0, p1, p2;\n  var isClosed = ol.coordinate.equal(coords[0],coords[N]);\n  if (!isClosed) {\n    p0 = coords[0];\n    p1 = coords[1];\n    p2 = [\n      p0[0] + (p1[1] - p0[1]) / ol.coordinate.dist2d(p0,p1) *offset,\n      p0[1] - (p1[0] - p0[0]) / ol.coordinate.dist2d(p0,p1) *offset\n    ];\n    path.push(p2);\n    coords.push(coords[N])\n    N++;\n    max--;\n  }\n  for (var i = 0; i < max; i++) {\n    p0 = coords[i];\n    p1 = coords[(i+1) % N];\n    p2 = coords[(i+2) % N];\n    mi = (p1[1] - p0[1])/(p1[0] - p0[0]);\n    mi1 = (p2[1] - p1[1])/(p2[0] - p1[0]);\n    // Prevent alignements\n    if (Math.abs(mi-mi1) > 1e-10) {\n      li = Math.sqrt((p1[0] - p0[0])*(p1[0] - p0[0])+(p1[1] - p0[1])*(p1[1] - p0[1]));\n      li1 = Math.sqrt((p2[0] - p1[0])*(p2[0] - p1[0])+(p2[1] - p1[1])*(p2[1] - p1[1]));\n      ri = p0[0] + offset*(p1[1] - p0[1])/li;\n      ri1 = p1[0] + offset*(p2[1] - p1[1])/li1;\n      si = p0[1] - offset*(p1[0] - p0[0])/li;\n      si1 = p1[1] - offset*(p2[0] - p1[0])/li1;\n      Xi1 = (mi1*ri1-mi*ri+si-si1) / (mi1-mi);\n      Yi1 = (mi*mi1*(ri1-ri)+mi1*si-mi*si1) / (mi1-mi);\n      // Correction for vertical lines\n      if(p1[0] - p0[0] == 0) {\n        Xi1 = p1[0] + offset*(p1[1] - p0[1])/Math.abs(p1[1] - p0[1]);\n        Yi1 = mi1*Xi1 - mi1*ri1 + si1;\n      }\n      if (p2[0] - p1[0] == 0 ) {\n        Xi1 = p2[0] + offset*(p2[1] - p1[1])/Math.abs(p2[1] - p1[1]);\n        Yi1 = mi*Xi1 - mi*ri + si;\n      }\n      path.push([Xi1, Yi1]);\n    }\n  }\n  if (isClosed) {\n    path.push(path[0]);\n  } else {\n    coords.pop();\n    p0 = coords[coords.length-1];\n    p1 = coords[coords.length-2];\n    p2 = [\n      p0[0] - (p1[1] - p0[1]) / ol.coordinate.dist2d(p0,p1) *offset,\n      p0[1] + (p1[0] - p0[0]) / ol.coordinate.dist2d(p0,p1) *offset\n    ];\n    path.push(p2);\n  }\n  return path;\n}\n/** Find the segment a point belongs to\n * @param {ol.Coordinate} pt\n * @param {Array<ol.Coordinate>} coords\n * @return {} the index (-1 if not found) and the segment\n */\nol.coordinate.findSegment = function (pt, coords) {\n  for (var i=0; i<coords.length-1; i++) {\n    var p0 = coords[i];\n    var p1 = coords[i+1];\n    if (ol.coordinate.equal(pt, p0) || ol.coordinate.equal(pt, p1)) {\n      return { index:1, segment: [p0,p1] };\n    } else {\n      var d0 = ol.coordinate.dist2d(p0,p1);\n      var v0 = [ (p1[0] - p0[0]) / d0, (p1[1] - p0[1]) / d0 ];\n      var d1 = ol.coordinate.dist2d(p0,pt);\n      var v1 = [ (pt[0] - p0[0]) / d1, (pt[1] - p0[1]) / d1 ];\n      if (Math.abs(v0[0]*v1[1] - v0[1]*v1[0]) < 1e-10) {\n        return { index:1, segment: [p0,p1] };\n      }\n    }\n  }\n  return { index: -1 };\n};\n/**\n * Split a Polygon geom with horizontal lines\n * @param {Array<ol.Coordinate>} geom\n * @param {number} y the y to split\n * @param {number} n contour index\n * @return {Array<Array<ol.Coordinate>>}\n */\nol.coordinate.splitH = function (geom, y, n) {\n  var x, abs;\n  var list = [];\n  for (var i=0; i<geom.length-1; i++) {\n    // Hole separator?\n    if (!geom[i].length || !geom[i+1].length) continue;\n    // Intersect\n    if (geom[i][1]<=y && geom[i+1][1]>y || geom[i][1]>=y && geom[i+1][1]<y) {\n      abs = (y-geom[i][1]) / (geom[i+1][1]-geom[i][1]);\n      x = abs * (geom[i+1][0]-geom[i][0]) + geom[i][0];\n      list.push ({ contour: n, index: i, pt: [x,y], abs: abs });\n    }\n  }\n  // Sort x\n  list.sort(function(a,b) { return a.pt[0] - b.pt[0] });\n  // Horizontal segment\n  var result = [];\n  for (var j=0; j<list.length-1; j += 2) {\n    result.push([list[j], list[j+1]])\n  }\n  return result;\n};\n/** Create a geometry given a type and coordinates */\nol.geom.createFromType = function (type, coordinates) {\n  switch (type) {\n    case 'LineString': return new ol.geom.LineString(coordinates);\n    case 'LinearRing': return new ol.geom.LinearRing(coordinates);\n    case 'MultiLineString': return new ol.geom.MultiLineString(coordinates);\n    case 'MultiPoint': return new ol.geom.MultiPoint(coordinates);\n    case 'MultiPolygon': return new ol.geom.MultiPolygon(coordinates);\n    case 'Point': return new ol.geom.Point(coordinates);\n    case 'Polygon': return new ol.geom.Polygon(coordinates);\n    default:\n      console.error('[createFromType] Unsupported type: '+type);\n      return null;\n  }\n};\n/** Intersect 2 lines\n * @param {Arrar<ol.coordinate>} d1\n * @param {Arrar<ol.coordinate>} d2\n */\nol.coordinate.getIntersectionPoint = function (d1, d2) {\n  var d1x = d1[1][0] - d1[0][0];\n  var d1y = d1[1][1] - d1[0][1];\n  var d2x = d2[1][0] - d2[0][0];\n  var d2y = d2[1][1] - d2[0][1];\n  var det = d1x * d2y - d1y * d2x;\n  if (det != 0) {\n    var k = (d1x * d1[0][1] - d1x * d2[0][1] - d1y * d1[0][0] + d1y * d2[0][0]) / det;\n    return [d2[0][0] + k*d2x, d2[0][1] + k*d2y];\n  } else {\n    return false;\n  }\n};\n\n/** Split a lineString by a point or a list of points\n *\tNB: points must be on the line, use getClosestPoint() to get one\n* @param {ol.Coordinate | Array<ol.Coordinate>} pt points to split the line\n* @param {Number} tol distance tolerance for 2 points to be equal\n*/\nol.geom.LineString.prototype.splitAt = function(pt, tol) {\n  var i;\n  if (!pt) return [this];\n    if (!tol) tol = 1e-10;\n    // Test if list of points\n    if (pt.length && pt[0].length) {\n      var result = [this];\n      for (i=0; i<pt.length; i++) {\n        var r = [];\n        for (var k=0; k<result.length; k++) {\n          var ri = result[k].splitAt(pt[i], tol);\n          r = r.concat(ri);\n        }\n        result = r;\n      }\n      return result;\n    }\n    // Nothing to do\n    if (ol.coordinate.equal(pt,this.getFirstCoordinate())\n    || ol.coordinate.equal(pt,this.getLastCoordinate())) {\n      return [this];\n    }\n    // Get\n    var c0 = this.getCoordinates();\n    var ci=[c0[0]];\n    var c = [];\n    for (i=0; i<c0.length-1; i++) {\n      // Filter equal points\n      if (ol.coordinate.equal(c0[i],c0[i+1])) continue;\n      // Extremity found\n      if (ol.coordinate.equal(pt,c0[i+1])) {\n        ci.push(c0[i+1]);\n        c.push(new ol.geom.LineString(ci));\n        ci = [];\n      }\n      // Test alignement\n      else if (!ol.coordinate.equal(pt,c0[i])) {\n        var d1, d2, split=false;\n        if (c0[i][0] == c0[i+1][0]) {\n          d1 = (c0[i][1]-pt[1]) / (c0[i][1]-c0[i+1][1]);\n          split = (c0[i][0] == pt[0]) && (0 < d1 && d1 <= 1)\n        } else if (c0[i][1] == c0[i+1][1]) {\n          d1 = (c0[i][0]-pt[0]) / (c0[i][0]-c0[i+1][0]);\n          split = (c0[i][1] == pt[1]) && (0 < d1 && d1 <= 1)\n        } else {\n          d1 = (c0[i][0]-pt[0]) / (c0[i][0]-c0[i+1][0]);\n          d2 = (c0[i][1]-pt[1]) / (c0[i][1]-c0[i+1][1]);\n          split = (Math.abs(d1-d2) <= tol && 0 < d1 && d1 <= 1)\n        }\n        // pt is inside the segment > split\n        if (split) {\n          ci.push(pt);\n          c.push (new ol.geom.LineString(ci));\n          ci = [pt];\n        }\n      }\n      ci.push(c0[i+1]);\n    }\n    if (ci.length>1) c.push (new ol.geom.LineString(ci));\n    if (c.length) return c;\n    else return [this];\n}\n// import('ol-ext/geom/LineStringSplitAt')\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n\tUsefull function to handle geometric operations\n*/\n/*eslint no-constant-condition: [\"error\", { \"checkLoops\": false }]*/\n/**\n * Calculate a MultiPolyline to fill a Polygon with a scribble effect that appears hand-made\n * @param {} options\n *  @param {Number} options.interval interval beetween lines\n *  @param {Number} options.angle hatch angle in radian, default PI/2\n * @return {ol.geom.MultiLineString|null} the resulting MultiLineString geometry or null if none\n */\nol.geom.MultiPolygon.prototype.scribbleFill = function (options) {\n  var scribbles = [];\n  var poly = this.getPolygons();\n  var i, p, s;\n  for (i=0; p=poly[i]; i++) {\n    var mls = p.scribbleFill(options);\n    if (mls) scribbles.push(mls);\n  } \n  if (!scribbles.length) return null;\n  // Merge scribbles\n  var scribble = scribbles[0];\n    var ls;\n    for (i = 0; s = scribbles[i]; i++) {\n        ls = s.getLineStrings();\n        for (var k = 0; k < ls.length; k++) {\n            scribble.appendLineString(ls[k]);\n        }\n    }\n  return scribble;\n};\n/**\n * Calculate a MultiPolyline to fill a Polygon with a scribble effect that appears hand-made\n * @param {} options\n *  @param {Number} options.interval interval beetween lines\n *  @param {Number} options.angle hatch angle in radian, default PI/2\n * @return {ol.geom.MultiLineString|null} the resulting MultiLineString geometry or null if none\n */\nol.geom.Polygon.prototype.scribbleFill = function (options) {\n\tvar step = options.interval;\n  var angle = options.angle || Math.PI/2;\n  var i, k,l;\n  // Geometry + rotate\n\tvar geom = this.clone();\n\tgeom.rotate(angle, [0,0]);\n  var coords = geom.getCoordinates();\n  // Merge holes\n  var coord = coords[0];\n  for (i=1; i<coords.length; i++) {\n    // Add a separator\n    coord.push([]);\n    // Add the hole\n    coord = coord.concat(coords[i]);\n  }\n  // Extent \n\tvar ext = geom.getExtent();\n\t// Split polygon with horizontal lines\n  var lines = [];\n\tfor (var y = (Math.floor(ext[1]/step)+1)*step; y<ext[3]; y += step) {\n    l = ol.coordinate.splitH(coord, y, i);\n    lines = lines.concat(l);\n  }\n  if (!lines.length) return null;\n  // Order lines on segment index\n  var mod = coord.length-1;\n\tvar first = lines[0][0].index;\n\tfor (k=0; l=lines[k]; k++) {\n\t\tlines[k][0].index = (lines[k][0].index-first+mod) % mod;\n\t\tlines[k][1].index = (lines[k][1].index-first+mod) % mod;\n\t}\n  var scribble = [];\n  while (true) {\n    for (k=0; l=lines[k]; k++) {\n      if (!l[0].done) break;\n    }\n    if (!l) break;\n    var scrib = [];\n    while (l) {\n      l[0].done = true;\n      scrib.push(l[0].pt);\n      scrib.push(l[1].pt);\n      var nexty = l[0].pt[1] + step;\n      var d0 = Infinity;\n      var l2 = null;\n      while (lines[k]) {\n        if (lines[k][0].pt[1] > nexty) break;\n        if (lines[k][0].pt[1] === nexty) {\n          var d = Math.min(\n            (lines[k][0].index - l[0].index + mod) % mod,\n            (l[0].index - lines[k][0].index + mod) % mod\n          );\n          var d2 = Math.min(\n            (l[1].index - l[0].index + mod) % mod,\n            (l[0].index - l[1].index + mod) % mod\n          );\n          if (d<d0 && d<d2) {\n            d0 = d;\n            if (!lines[k][0].done) l2 = lines[k];\n            else l2 = null;\n          }\n        }\n        k++;\n      }\n      l = l2;\n    }\n    if (scrib.length) {\n      scribble.push(scrib);\n    }\n  }\n  // Return the scribble as MultiLineString\n  if (!scribble.length) return null;\n  var mline = new ol.geom.MultiLineString(scribble);\n  mline.rotate(-angle,[0,0]);\n\treturn mline.cspline({ pointsPerSeg:8, tension:.9 });\n};\n// import('ol-ext/geom/Scribble')\n/** Geohash encoding/decoding and associated functions\n * (c) Chris Veness 2014-2019 / MIT Licence\n * https://github.com/chrisveness/latlon-geohash\n */\nol.geohash = {\n  // (geohash-specific) Base32 map\n  base32: '0123456789bcdefghjkmnpqrstuvwxyz'\n};\n/** Encodes latitude/longitude to geohash, either to specified precision or to automatically\n * evaluated precision.\n * @param   {ol.coordinate} lonlat Longitude, Latitude in degrees.\n * @param   {number} [precision] Number of characters in resulting geohash.\n * @returns {string} Geohash of supplied latitude/longitude.\n */\nol.geohash.fromLonLat = function(lonlat, precision) {\n  var lon = lonlat[0];\n  var lat = lonlat[1];\n  // infer precision?\n  if (!precision) {\n    // refine geohash until it matches precision of supplied lat/lon\n    for (var p=1; p<=12; p++) {\n        var hash = ol.geohash.fromLonLat([lon, lat], p);\n        var posn = ol.geohash.toLonLat(hash);\n        if (posn.lat==lat && posn.lon==lon) return hash;\n    }\n    precision = 12; // set to maximum\n  }\n  if (precision < 1 || precision > 12) precision = 12;\n  var idx = 0; // index into base32 map\n  var bit = 0; // each char holds 5 bits\n  var evenBit = true;\n  var geohash = '';\n  var latMin =  -90, latMax =  90;\n  var lonMin = -180, lonMax = 180;\n  while (geohash.length < precision) {\n    if (evenBit) {\n      // bisect E-W longitude\n      var lonMid = (lonMin + lonMax) / 2;\n      if (lon >= lonMid) {\n        idx = idx*2 + 1;\n        lonMin = lonMid;\n      } else {\n        idx = idx*2;\n        lonMax = lonMid;\n      }\n    } else {\n      // bisect N-S latitude\n      var latMid = (latMin + latMax) / 2;\n      if (lat >= latMid) {\n        idx = idx*2 + 1;\n        latMin = latMid;\n      } else {\n        idx = idx*2;\n        latMax = latMid;\n      }\n    }\n    evenBit = !evenBit;\n    if (++bit == 5) {\n      // 5 bits gives us a character: append it and start over\n      geohash += ol.geohash.base32.charAt(idx);\n      bit = 0;\n      idx = 0;\n    }\n  }\n  return geohash;\n};\n/** Decode geohash to latitude/longitude \n * (location is approximate centre of geohash cell, to reasonable precision).\n * @param   {string} geohash - Geohash string to be converted to latitude/longitude.\n * @returns {ol.coordinate}\n */\nol.geohash.toLonLat = function(geohash) {\n  var extent = ol.geohash.getExtent(geohash); // <-- the hard work\n  // now just determine the centre of the cell...\n  var latMin = extent[1], lonMin = extent[0];\n  var latMax = extent[3], lonMax = extent[2];\n  // cell centre\n  var lat = (latMin + latMax)/2;\n  var lon = (lonMin + lonMax)/2;\n  // round to close to centre without excessive precision: ⌊2-log10(Δ°)⌋ decimal places\n  lat = lat.toFixed(Math.floor(2-Math.log(latMax-latMin)/Math.LN10));\n  lon = lon.toFixed(Math.floor(2-Math.log(lonMax-lonMin)/Math.LN10));\n  return [Number(lon), Number(lat)];\n};\n/** Returns SW/NE latitude/longitude bounds of specified geohash.\n * @param   {string} geohash Cell that bounds are required of.\n * @returns {ol.extent | false} \n */\nol.geohash.getExtent = function(geohash) {\n  if (!geohash) return false;\n  geohash = geohash.toLowerCase();\n  var evenBit = true;\n  var latMin =  -90, latMax =  90;\n  var lonMin = -180, lonMax = 180;\n  for (var i=0; i<geohash.length; i++) {\n    var chr = geohash.charAt(i);\n    var idx = ol.geohash.base32.indexOf(chr);\n    if (idx == -1) return false;\n    for (var n=4; n>=0; n--) {\n      var bitN = idx >> n & 1;\n      if (evenBit) {\n        // longitude\n        var lonMid = (lonMin+lonMax) / 2;\n        if (bitN == 1) {\n          lonMin = lonMid;\n        } else {\n          lonMax = lonMid;\n        }\n      } else {\n        // latitude\n        var latMid = (latMin+latMax) / 2;\n        if (bitN == 1) {\n          latMin = latMid;\n        } else {\n          latMax = latMid;\n        }\n      }\n      evenBit = !evenBit;\n    }\n  }\n  return [lonMin, latMin, lonMax, latMax];\n};\n/** Determines adjacent cell in given direction.\n * @param   {string} geohash Geohash cel\n * @param   {string} direction direction as char : N/S/E/W.\n * @returns {string|false} \n */\nol.geohash.getAdjacent = function (geohash, direction) {\n  // based on github.com/davetroy/geohash-js\n  geohash = geohash.toLowerCase();\n  direction = direction.toLowerCase();\n  if (!geohash) return false;\n  if ('nsew'.indexOf(direction) == -1) return false;\n  var neighbour = {\n      n: [ 'p0r21436x8zb9dcf5h7kjnmqesgutwvy', 'bc01fg45238967deuvhjyznpkmstqrwx' ],\n      s: [ '14365h7k9dcfesgujnmqp0r2twvyx8zb', '238967debc01fg45kmstqrwxuvhjyznp' ],\n      e: [ 'bc01fg45238967deuvhjyznpkmstqrwx', 'p0r21436x8zb9dcf5h7kjnmqesgutwvy' ],\n      w: [ '238967debc01fg45kmstqrwxuvhjyznp', '14365h7k9dcfesgujnmqp0r2twvyx8zb' ],\n  };\n  var border = {\n      n: [ 'prxz',     'bcfguvyz' ],\n      s: [ '028b',     '0145hjnp' ],\n      e: [ 'bcfguvyz', 'prxz'     ],\n      w: [ '0145hjnp', '028b'     ],\n  };\n  var lastCh = geohash.slice(-1);    // last character of hash\n  var parent = geohash.slice(0, -1); // hash without last character\n  var type = geohash.length % 2;\n  // check for edge-cases which don't share common prefix\n  if (border[direction][type].indexOf(lastCh) != -1 && parent != '') {\n    parent = ol.geohash.getAdjacent(parent, direction);\n  }\n  // append letter for direction to parent\n  return parent + ol.geohash.base32.charAt(neighbour[direction][type].indexOf(lastCh));\n}\n/** Returns all 8 adjacent cells to specified geohash.\n * @param   {string} geohash Geohash neighbours are required of.\n * @returns {{n,ne,e,se,s,sw,w,nw: string}}\n */\nol.geohash.getNeighbours = function(geohash) {\n  return {\n    'n':  ol.geohash.getAdjacent(geohash, 'n'),\n    'ne': ol.geohash.getAdjacent(ol.geohash.getAdjacent(geohash, 'n'), 'e'),\n    'e':  ol.geohash.getAdjacent(geohash, 'e'),\n    'se': ol.geohash.getAdjacent(ol.geohash.getAdjacent(geohash, 's'), 'e'),\n    's':  ol.geohash.getAdjacent(geohash, 's'),\n    'sw': ol.geohash.getAdjacent(ol.geohash.getAdjacent(geohash, 's'), 'w'),\n    'w':  ol.geohash.getAdjacent(geohash, 'w'),\n    'nw': ol.geohash.getAdjacent(ol.geohash.getAdjacent(geohash, 'n'), 'w'),\n  };\n}\n\n/** Compute great circle bearing of two points.\n * @See http://www.movable-type.co.uk/scripts/latlong.html for the original code\n * @param {ol.coordinate} origin origin in lonlat\n * @param {ol.coordinate} destination destination in lonlat\n * @return {number} bearing angle in radian\n */\nol.sphere.greatCircleBearing = function(origin, destination) {\n  var toRad = Math.PI/180;\n  var ori = [ origin[0]*toRad, origin[1]*toRad ];\n  var dest = [ destination[0]*toRad, destination[1]*toRad ];\n  var bearing = Math.atan2(\n    Math.sin(dest[0] - ori[0]) * Math.cos(dest[1]),\n    Math.cos(ori[1]) * Math.sin(dest[1]) - Math.sin(ori[1]) * Math.cos(dest[1]) * Math.cos(dest[0] - ori[0])\n  );\n  return bearing;\n};\n/** \n * Computes the destination point given an initial point, a distance and a bearing\n * @See http://www.movable-type.co.uk/scripts/latlong.html for the original code\n * @param {ol.coordinate} origin stating point in lonlat coords\n * @param {number} distance\n * @param {number} bearing bearing angle in radian\n * @param {*} options\n *  @param {booelan} normalize normalize longitude beetween -180/180, deafulet true\n *  @param {number|undefined} options.radius sphere radius, default 6371008.8\n */\nol.sphere.computeDestinationPoint = function(origin, distance, bearing, options) {\n  options = options || {};\n  var toRad = Math.PI/180;\n  var radius = options.radius || 6371008.8;\n  var phi1 = origin[1] * toRad;\n  var lambda1 = origin[0] * toRad;\n  var delta = distance / radius;\n  var phi2 = Math.asin(\n    Math.sin(phi1) * Math.cos(delta) +\n    Math.cos(phi1) * Math.sin(delta) * Math.cos(bearing)\n  );\n  var lambda2 = lambda1 +\n    Math.atan2(\n      Math.sin(bearing) * Math.sin(delta) * Math.cos(phi1),\n      Math.cos(delta) - Math.sin(phi1) * Math.sin(phi2)\n    );\n  var lon = lambda2 / toRad;\n  // normalise to >=-180 and <=180° \n  if (options.normalize!==false && (lon < -180 || lon > 180)) {\n    lon = ((lon * 540) % 360) - 180;\n  }\n  return [ lon, phi2 / toRad ];\n};\n/** Calculate a track along the great circle given an origin and a destination\n * @param {ol.coordinate} origin origin in lonlat\n * @param {ol.coordinate} destination destination in lonlat\n * @param {number} distance distance between point along the track in meter, default 1km (1000)\n * @param {number|undefined} radius sphere radius, default 6371008.8\n * @return {Array<ol.coordinate>}\n */\nol.sphere.greatCircleTrack = function(origin, destination, options) {\n  options = options || {};\n  var bearing = ol.sphere.greatCircleBearing(origin, destination);\n  var dist = ol.sphere.getDistance(origin, destination, options.radius);\n  var distance = options.distance || 1000;\n  var d = distance;\n  var geom = [origin];\n  while (d < dist) {\n    geom.push(ol.sphere.computeDestinationPoint(origin, d, bearing, { radius: options.radius, normalize: false }));\n    d += distance;\n  }\n  var pt = ol.sphere.computeDestinationPoint(origin, dist, bearing, { radius: options.radius, normalize: false });\n  if (Math.abs(pt[0]-destination[0]) > 1) {\n    if (pt[0] > destination[0]) destination[0] += 360;\n    else destination[0] -= 360;\n  } \n  geom.push(destination);\n  return geom;\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Pulse an extent on postcompose\n*\t@param {ol.coordinates} point to pulse\n*\t@param {ol.pulse.options} options pulse options param\n*\t  @param {ol.projectionLike|undefined} options.projection projection of coords, default no transform\n*\t  @param {Number} options.duration animation duration in ms, default 2000\n*\t  @param {ol.easing} options.easing easing function, default ol.easing.upAndDown\n*\t  @param {ol.style.Stroke} options.style stroke style, default 2px red\n*/\nol.Map.prototype.animExtent = function(extent, options)\n{\tvar listenerKey;\n\toptions = options || {};\n\t// Change to map's projection\n\tif (options.projection)\n\t{\textent = ol.proj.transformExtent (extent, options.projection, this.getView().getProjection());\n\t}\n\t// options\n\tvar start = new Date().getTime();\n\tvar duration = options.duration || 1000;\n\tvar easing = options.easing || ol.easing.upAndDown;\n\tvar width = options.style ? options.style.getWidth() || 2 : 2;\n\tvar color = options.style ? options.style.getColr() || 'red' : 'red';\n\t// Animate function\n\tfunction animate(event) \n\t{\tvar frameState = event.frameState;\n\t\tvar ratio = frameState.pixelRatio;\n\t\tvar elapsed = frameState.time - start;\n\t\tif (elapsed > duration) ol.Observable.unByKey(listenerKey);\n\t\telse\n\t\t{\tvar elapsedRatio = elapsed / duration;\n\t\t\tvar p0 = this.getPixelFromCoordinate([extent[0],extent[1]]);\n\t\t\tvar p1 = this.getPixelFromCoordinate([extent[2],extent[3]]);\n\t\t\tvar context = event.context;\n\t\t\tcontext.save();\n\t\t\tcontext.scale(ratio,ratio);\n\t\t\tcontext.beginPath();\n\t\t\t// var e = easing(elapsedRatio)\n\t\t\tcontext.globalAlpha = easing(1 - elapsedRatio);\n\t\t\tcontext.lineWidth = width;\n\t\t\tcontext.strokeStyle = color;\n\t\t\tcontext.rect(p0[0], p0[1], p1[0]-p0[0], p1[1]-p0[1]);\n\t\t\tcontext.stroke();\n\t\t\tcontext.restore();\n\t\t\t// tell OL3 to continue postcompose animation\n\t\t\tframeState.animate = true;\n\t\t}\n\t}\n\t// Launch animation\n\tlistenerKey = this.on('postcompose', animate.bind(this));\n\tthis.renderSync();\n}\n\n/** Create a cardinal spline version of this geometry.\n *\tOriginal https://github.com/epistemex/cardinal-spline-js\n *\t@see https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline\n *\n * @param {} options\n *\t@param {Number} options.tension a [0,1] number / can be interpreted as the \"length\" of the tangent, default 0.5\n *  @param {Number} options.resolution size of segment to split\n *\t@param {Integer} options.pointsPerSeg number of points per segment to add if no resolution is provided, default add 10 points per segment\n */\n/** Cache cspline calculation on a geometry\n * @param {} options\n *\t@param {Number} options.tension a [0,1] number / can be interpreted as the \"length\" of the tangent, default 0.5\n *  @param {Number} options.resolution size of segment to split\n *\t@param {Integer} options.pointsPerSeg number of points per segment to add if no resolution is provided, default add 10 points per segment\n * @return {ol.geom.Geometry}\n */\nol.geom.Geometry.prototype.cspline = function(options){\n  // Calculate cspline\n  if (this.calcCSpline_){\n    if (this.csplineGeometryRevision != this.getRevision() \n      || this.csplineOption != JSON.stringify(options)) {\n      this.csplineGeometry_ = this.calcCSpline_(options)\n      this.csplineGeometryRevision = this.getRevision();\n      this.csplineOption = JSON.stringify(options);\n    }\n    return this.csplineGeometry_;\n  } else {\t\n    // Default do nothing\n    return this;\n  }\n};\nol.geom.GeometryCollection.prototype.calcCSpline_ = function(options) {\n  var g=[], g0=this.getGeometries();\n  for (var i=0; i<g0.length; i++) {\n    g.push(g0[i].cspline(options));\n  }\n  return new ol.geom.GeometryCollection(g);\n};\nol.geom.MultiLineString.prototype.calcCSpline_ = function(options) {\n  var g=[], lines = this.getLineStrings();\n  for (var i=0; i<lines.length; i++) {\n    g.push(lines[i].cspline(options).getCoordinates());\n  }\n  return new ol.geom.MultiLineString(g);\n};\nol.geom.Polygon.prototype.calcCSpline_ = function(options){\n  var g=[], g0=this.getCoordinates();\n  for (var i=0; i<g0.length; i++){\n    g.push((new ol.geom.LineString(g0[i])).cspline(options).getCoordinates());\n  }\n  return new ol.geom.Polygon(g);\n};\nol.geom.MultiPolygon.prototype.calcCSpline_ = function(options) {\n  var g=[], g0=this.getPolygons();\n  for (var i=0; i<g0.length; i++) {\n    g.push(g0[i].cspline(options).getCoordinates());\n  }\n  return new ol.geom.MultiPolygon(g);\n}\n/** Calculate cspline on coordinates\n * @param {Array<ol.geom.Geometry.coordinate>} line\n * @param {} options\n *\t@param {Number} options.tension a [0,1] number / can be interpreted as the \"length\" of the tangent, default 0.5\n *  @param {Number} options.resolution size of segment to split\n *\t@param {Integer} options.pointsPerSeg number of points per segment to add if no resolution is provided, default add 10 points per segment\n * @return {Array<ol.geom.Geometry.coordinate>}\n */\nol.coordinate.cspline = function(line, options) {\n  if (!options) options={};\n  var tension = typeof options.tension === \"number\" ? options.tension : 0.5;\n  var length = 0;\n  var p0 = line[0];\n  line.forEach(function(p) {\n    length += ol.coordinate.dist2d(p0, p);\n    p0 = p;\n  })\n  var resolution = options.resolution || (length / line.length / (options.pointsPerSeg || 10));\n  var pts, res = [],\t\t\t// clone array\n    x, y,\t\t\t\t\t// our x,y coords\n    t1x, t2x, t1y, t2y,\t\t// tension vectors\n    c1, c2, c3, c4,\t\t\t// cardinal points\n    st, t, i;\t\t\t\t// steps based on num. of segments\n  // clone array so we don't change the original\n  //\n  pts = line.slice(0);\n  // The algorithm require a previous and next point to the actual point array.\n  // Check if we will draw closed or open curve.\n  // If closed, copy end points to beginning and first points to end\n  // If open, duplicate first points to befinning, end points to end\n  if (line.length>2 && line[0][0]==line[line.length-1][0] && line[0][1]==line[line.length-1][1]) {\n    pts.unshift(line[line.length-2]);\n    pts.push(line[1]);\n  } else {\n    pts.unshift(line[0]);\n    pts.push(line[line.length-1]);\n  }\n  // ok, lets start..\n  function dist2d(x1, y1, x2, y2) {\n    var dx = x2-x1;\n    var dy = y2-y1;\n    return Math.sqrt(dx*dx+dy*dy);\n  }\n  // 1. loop goes through point array\n  // 2. loop goes through each segment between the 2 pts + 1e point before and after\n  for (i=1; i < (pts.length - 2); i++) {\n    var d1 = dist2d (pts[i][0], pts[i][1], pts[i+1][0], pts[i+1][1]);\n    var numOfSegments = Math.round(d1/resolution);\n    var d=1;\n    if (options.normalize) {\n      d1 = dist2d (pts[i+1][0], pts[i+1][1], pts[i-1][0], pts[i-1][1]);\n      var d2 = dist2d (pts[i+2][0], pts[i+2][1], pts[i][0], pts[i][1]);\n      if (d1<d2) d = d1/d2;\n      else d = d2/d1;\n    }\n    // calc tension vectors\n    t1x = (pts[i+1][0] - pts[i-1][0]) * tension *d;\n    t2x = (pts[i+2][0] - pts[i][0]) * tension *d;\n    t1y = (pts[i+1][1] - pts[i-1][1]) * tension *d;\n    t2y = (pts[i+2][1] - pts[i][1]) * tension *d;\n    for (t=0; t <= numOfSegments; t++) {\n      // calc step\n      st = t / numOfSegments;\n      // calc cardinals\n      c1 =   2 * Math.pow(st, 3) \t- 3 * Math.pow(st, 2) + 1; \n      c2 = -(2 * Math.pow(st, 3)) + 3 * Math.pow(st, 2); \n      c3 = \t   Math.pow(st, 3)\t- 2 * Math.pow(st, 2) + st; \n      c4 = \t   Math.pow(st, 3)\t- \t  Math.pow(st, 2);\n      // calc x and y cords with common control vectors\n      x = c1 * pts[i][0]\t+ c2 * pts[i+1][0] + c3 * t1x + c4 * t2x;\n      y = c1 * pts[i][1]\t+ c2 * pts[i+1][1] + c3 * t1y + c4 * t2y;\n      //store points in array\n      if (x && y) res.push([x,y]);\n    }\n  }\n  return res;\n};\n/** @private */\nol.geom.LineString.prototype.calcCSpline_ = function(options) {\n  var line = this.getCoordinates();\n  var res = ol.coordinate.cspline(line, options)\n  return new ol.geom.LineString(res);\n}\n// To use this module with ol/geom/Geometry\n// \n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** @typedef {'pointy' | 'flat'} HexagonLayout\n *  Layout of a Hexagon. Flat means the bottom part of the hexagon is flat.\n */\n/**\n* Hexagonal grids\n* @classdesc ol.HexGrid is a class to compute hexagonal grids\n* @see http://www.redblobgames.com/grids/hexagons\n*\n* @constructor ol.HexGrid\n* @extends {ol.Object}\n* @param {Object} [options]\n*\t@param {number} [options.size] size of the exagon in map units, default 80000\n*\t@param {ol.Coordinate} [options.origin] orgin of the grid, default [0,0]\n*\t@param {HexagonLayout} [options.layout] grid layout, default pointy\n*/\nol.HexGrid = function (options)\n{\toptions = options || {};\n\tol.Object.call (this, options);\n\t// Options\n\tthis.size_ = options.size||80000;\n\tthis.origin_ = options.origin || [0,0];\n\tthis.layout_ = this.layout[options.layout] || this.layout.pointy;\n};\nol.ext.inherits(ol.HexGrid, ol.Object);\n/** Layout\n*/\nol.HexGrid.prototype.layout =\n{\tpointy: \n\t[\tMath.sqrt(3), Math.sqrt(3)/2, 0, 3/2, \n\t\tMath.sqrt(3)/3, -1/3, 0, 2/3, \n\t\t// corners\n\t\tMath.cos(Math.PI / 180 * (60 * 0 + 30)), Math.sin(Math.PI / 180 * (60 * 0 + 30)), \n\t\tMath.cos(Math.PI / 180 * (60 * 1 + 30)), Math.sin(Math.PI / 180 * (60 * 1 + 30)), \n\t\tMath.cos(Math.PI / 180 * (60 * 2 + 30)), Math.sin(Math.PI / 180 * (60 * 2 + 30)), \n\t\tMath.cos(Math.PI / 180 * (60 * 3 + 30)), Math.sin(Math.PI / 180 * (60 * 3 + 30)), \n\t\tMath.cos(Math.PI / 180 * (60 * 4 + 30)), Math.sin(Math.PI / 180 * (60 * 4 + 30)), \n\t\tMath.cos(Math.PI / 180 * (60 * 5 + 30)), Math.sin(Math.PI / 180 * (60 * 5 + 30))\n\t],\n\tflat: \n\t[\t3/2, 0, Math.sqrt(3)/2, Math.sqrt(3), 2/3, \n\t\t0, -1/3, Math.sqrt(3) / 3, \n\t\t// corners\n\t\tMath.cos(Math.PI / 180 * (60 * 0)), Math.sin(Math.PI / 180 * (60 * 0)), \n\t\tMath.cos(Math.PI / 180 * (60 * 1)), Math.sin(Math.PI / 180 * (60 * 1)), \n\t\tMath.cos(Math.PI / 180 * (60 * 2)), Math.sin(Math.PI / 180 * (60 * 2)), \n\t\tMath.cos(Math.PI / 180 * (60 * 3)), Math.sin(Math.PI / 180 * (60 * 3)), \n\t\tMath.cos(Math.PI / 180 * (60 * 4)), Math.sin(Math.PI / 180 * (60 * 4)), \n\t\tMath.cos(Math.PI / 180 * (60 * 5)), Math.sin(Math.PI / 180 * (60 * 5))\n\t]\n};\n/** Set layout\n* @param {HexagonLayout | undefined} layout name, default pointy\n*/\nol.HexGrid.prototype.setLayout = function (layout)\n{\tthis.layout_ = this.layout[layout] || this.layout.pointy;\n\tthis.changed();\n}\n/** Get layout\n* @return {HexagonLayout} layout name\n*/\nol.HexGrid.prototype.getLayout = function ()\n{\treturn (this.layout_[9]!=0 ? 'pointy' : 'flat');\n}\n/** Set hexagon origin\n* @param {ol.Coordinate} coord origin\n*/\nol.HexGrid.prototype.setOrigin = function (coord)\n{\tthis.origin_ = coord;\n\tthis.changed();\n}\n/** Get hexagon origin\n* @return {ol.Coordinate} coord origin\n*/\nol.HexGrid.prototype.getOrigin = function ()\n{\treturn this.origin_;\n}\n/** Set hexagon size\n* @param {number} hexagon size\n*/\nol.HexGrid.prototype.setSize = function (s) {\n\tthis.size_ = s || 80000;\n\tthis.changed();\n}\n/** Get hexagon size\n* @return {number} hexagon size\n*/\nol.HexGrid.prototype.getSize = function () {\n\treturn this.size_;\n}\n/** Convert cube to axial coords\n* @param {ol.Coordinate} c cube coordinate\n* @return {ol.Coordinate} axial coordinate\n*/\nol.HexGrid.prototype.cube2hex = function (c)\n{\treturn [c[0], c[2]];\n};\n/** Convert axial to cube coords\n* @param {ol.Coordinate} h axial coordinate\n* @return {ol.Coordinate} cube coordinate\n*/\nol.HexGrid.prototype.hex2cube = function(h)\n{\treturn [h[0], -h[0]-h[1], h[1]];\n};\n/** Convert offset to axial coords\n* @param {ol.Coordinate} h axial coordinate\n* @return {ol.Coordinate} offset coordinate\n*/\nol.HexGrid.prototype.hex2offset = function (h)\n{\tif (this.layout_[9]) return [ h[0] + (h[1] - (h[1]&1)) / 2, h[1] ];\n\telse return [ h[0], h[1] + (h[0] + (h[0]&1)) / 2 ];\n}\n/** Convert axial to offset coords\n* @param {ol.Coordinate} o offset coordinate\n* @return {ol.Coordinate} axial coordinate\n*/\nol.HexGrid.prototype.offset2hex = function(o)\n{\tif (this.layout_[9]) return [ o[0] - (o[1] - (o[1]&1)) / 2,  o[1] ];\n\telse return [ o[0], o[1] - (o[0] + (o[0]&1)) / 2 ];\n}\n/** Convert offset to cube coords\n* @param {ol.Coordinate} c cube coordinate\n* @return {ol.Coordinate} offset coordinate\n* /\nol.HexGrid.prototype.cube2offset = function(c)\n{\treturn hex2offset(cube2hex(c));\n};\n/** Convert cube to offset coords\n* @param {ol.Coordinate} o offset coordinate\n* @return {ol.Coordinate} cube coordinate\n* /\nol.HexGrid.prototype.offset2cube = function (o)\n{\treturn hex2cube(offset2Hex(o));\n};\n/** Round cube coords\n* @param {ol.Coordinate} h cube coordinate\n* @return {ol.Coordinate} rounded cube coordinate\n*/\nol.HexGrid.prototype.cube_round = function(h)\n{\tvar rx = Math.round(h[0])\n\tvar ry = Math.round(h[1])\n\tvar rz = Math.round(h[2])\n\tvar x_diff = Math.abs(rx - h[0])\n\tvar y_diff = Math.abs(ry - h[1])\n\tvar z_diff = Math.abs(rz - h[2])\n\tif (x_diff > y_diff && x_diff > z_diff) rx = -ry-rz\n\telse if (y_diff > z_diff) ry = -rx-rz\n\telse rz = -rx-ry\n\treturn [rx, ry, rz];\n};\n/** Round axial coords\n* @param {ol.Coordinate} h axial coordinate\n* @return {ol.Coordinate} rounded axial coordinate\n*/\nol.HexGrid.prototype.hex_round = function(h)\n{\treturn this.cube2hex( this.cube_round( this.hex2cube(h )) );\n};\n/** Get hexagon corners\n*/\nol.HexGrid.prototype.hex_corner = function(center, size, i)\n{\treturn [ center[0] + size * this.layout_[8+(2*(i%6))], center[1] + size * this.layout_[9+(2*(i%6))]];\n};\n/** Get hexagon coordinates at a coordinate\n* @param {ol.Coordinate} coord\n* @return {Arrary<ol.Coordinate>}\n*/\nol.HexGrid.prototype.getHexagonAtCoord = function (coord)\n{\treturn (this.getHexagon(this.coord2hex(coord)));\n};\n/** Get hexagon coordinates at hex\n* @param {ol.Coordinate} hex\n* @return {Arrary<ol.Coordinate>}\n*/\nol.HexGrid.prototype.getHexagon = function (hex)\n{\tvar p = [];\n\tvar c = this.hex2coord(hex);\n\tfor (var i=0; i<=7; i++)\n\t{\tp.push(this.hex_corner(c, this.size_, i, this.layout_[8]));\n\t}\n\treturn p;\n};\n/** Convert hex to coord\n* @param {ol.hex} hex\n* @return {ol.Coordinate}\n*/\nol.HexGrid.prototype.hex2coord = function (hex)\n{\treturn [\n\t\tthis.origin_[0] + this.size_ * (this.layout_[0] * hex[0] + this.layout_[1] * hex[1]), \n\t\tthis.origin_[1] + this.size_ * (this.layout_[2] * hex[0] + this.layout_[3] * hex[1])\n\t];\n};\n/** Convert coord to hex\n* @param {ol.Coordinate} coord\n* @return {ol.hex}\n*/\nol.HexGrid.prototype.coord2hex = function (coord)\n{\tvar c = [ (coord[0]-this.origin_[0]) / this.size_, (coord[1]-this.origin_[1]) / this.size_ ];\n\tvar q = this.layout_[4] * c[0] + this.layout_[5] * c[1];\n\tvar r = this.layout_[6] * c[0] + this.layout_[7] * c[1];\n\treturn this.hex_round([q, r]);\n};\n/** Calculate distance between to hexagon (number of cube)\n* @param {ol.Coordinate} a first cube coord\n* @param {ol.Coordinate} a second cube coord\n* @return {number} distance\n*/\nol.HexGrid.prototype.cube_distance = function (a, b)\n{\t//return ( (Math.abs(a[0] - b[0]) + Math.abs(a[1] - b[1]) + Math.abs(a[2] - b[2])) / 2 );\n\treturn ( Math.max (Math.abs(a[0] - b[0]), Math.abs(a[1] - b[1]), Math.abs(a[2] - b[2])) );\n};\n(function(){\n/** Line interpolation\n*/\nfunction lerp(a, b, t)\n{\t// for floats\n    return a + (b - a) * t;\n}\nfunction cube_lerp(a, b, t)\n{\t// for hexes\n    return [ \n\t\tlerp (a[0]+1e-6, b[0], t), \n\t\tlerp (a[1]+1e-6, b[1], t),\n\t\tlerp (a[2]+1e-6, b[2], t)\n\t];\n}\n/** Calculate line between to hexagon\n* @param {ol.Coordinate} a first cube coord\n* @param {ol.Coordinate} b second cube coord\n* @return {Array<ol.Coordinate>} array of cube coordinates\n*/\nol.HexGrid.prototype.cube_line = function (a, b)\n{\tvar d = this.cube_distance(a, b);\n\tif (!d) return [a];\n    var results = []\n    for (var i=0; i<=d; i++) \n\t{\tresults.push ( this.cube_round ( cube_lerp(a, b, i/d) ) );\n\t}\n    return results;\n};\n})();\nol.HexGrid.prototype.neighbors =\n{\t'cube':\t[ [+1, -1,  0], [+1,  0, -1], [0, +1, -1], [-1, +1,  0], [-1,  0, +1], [0, -1, +1] ],\n\t'hex':\t[ [+1, 0], [+1,  -1], [0, -1], [-1, 0], [-1, +1], [0, +1] ]\n};\n/** Get the neighbors for an hexagon\n* @param {ol.Coordinate} h axial coord\n* @param {number} direction\n* @return { ol.Coordinate | Array<ol.Coordinate> } neighbor || array of neighbors\n*/\nol.HexGrid.prototype.hex_neighbors = function (h, d)\n{\tif (d!==undefined)\n\t{\treturn [ h[0] + this.neighbors.hex[d%6][0], h[1]  + this.neighbors.hex[d%6][1] ];\n\t}\n\telse\n\t{\tvar n = [];\n\t\tfor (d=0; d<6; d++)\n\t\t{\tn.push ([ h[0] + this.neighbors.hex[d][0], h[1]  + this.neighbors.hex[d][1] ]);\n\t\t}\n\t\treturn n;\n\t}\n};\n/** Get the neighbors for an hexagon\n* @param {ol.Coordinate} c cube coord\n* @param {number} direction\n* @return { ol.Coordinate | Array<ol.Coordinate> } neighbor || array of neighbors\n*/\nol.HexGrid.prototype.cube_neighbors = function (c, d)\n{\tif (d!==undefined)\n\t{\treturn [ c[0] + this.neighbors.cube[d%6][0], c[1]  + this.neighbors.cube[d%6][1], c[2]  + this.neighbors.cube[d%6][2] ];\n\t}\n\telse\n\t{\tvar n = [];\n\t\tfor (d=0; d<6; d++)\n\t\t{\tn.push ([ c[0] + this.neighbors.cube[d][0], c[1]  + this.neighbors.cube[d][1], c[2]  + this.neighbors.cube[d][2] ]);\n\t\t}\n\t\tfor (d=0; d<6; d++) n[d] = this.cube2hex(n[d])\n\t\treturn n;\n\t}\n};\n\n/*\tCopyright (c) 2017 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * French INSEE grids\n * @classdesc a class to compute French INSEE grids, ie. fix area (200x200m) square grid, \n * based appon EPSG:3035\n *\n * @requires proj4\n * @constructor \n * @extends {ol.Object}\n * @param {Object} [options]\n *  @param {number} [options.size] size grid size in meter, default 200 (200x200m)\n */\nol.InseeGrid = function (options) {\n  options = options || {};\n  // Define EPSG:3035 if none\n  if (!proj4.defs[\"EPSG:3035\"]) {\n    proj4.defs(\"EPSG:3035\",\"+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs\");\n    ol.proj.proj4.register(proj4);\n  }\n  ol.Object.call (this, options);\n  // Options\n  var size = Math.max(200, Math.round((options.size||0)/200) * 200);\n  this.set('size', size);\n};\nol.ext.inherits (ol.InseeGrid, ol.Object);\n/** Grid extent (in EPSG:3035)\n */\nol.InseeGrid.extent = [3200000,2000000,4300000,3140000];\n/** Get the grid extent\n * @param {ol.proj.ProjLike} [proj='EPSG:3857']\n */\nol.InseeGrid.prototype.getExtent = function (proj) {\n  return ol.proj.transformExtent(ol.InseeGrid.extent, proj||'EPSG:3035', 'EPSG:3857')\n};\n/** Get grid geom at coord\n * @param {ol.Coordinate} coord\n * @param {ol.proj.ProjLike} [proj='EPSG:3857']\n */\nol.InseeGrid.prototype.getGridAtCoordinate = function (coord, proj) {\n  var c = ol.proj.transform(coord, proj||'EPSG:3857', 'EPSG:3035')\n  var s = this.get('size');\n  var x = Math.floor(c[0]/s) * s;\n  var y = Math.floor(c[1]/s) * s;\n  var geom = new ol.geom.Polygon([[[x,y],[x+s,y],[x+s,y+s],[x,y+s],[x,y]]]);\n  geom.transform('EPSG:3035', proj||'EPSG:3857');\n  return geom;\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Show a markup a point on postcompose\n*\t@deprecated use map.animateFeature instead\n*\t@param {ol.coordinates} point to pulse\n*\t@param {ol.markup.options} pulse options param\n*\t\t- projection {ol.projection|String|undefined} projection of coords, default none\n*\t\t- delay {Number} delay before mark fadeout\n*\t\t- maxZoom {Number} zoom when mark fadeout\n*\t\t- style {ol.style.Image|ol.style.Style|Array<ol.style.Style>} Image to draw as markup, default red circle\n*\t@return Unique key for the listener with a stop function to stop animation\n*/\nol.Map.prototype.markup = function(coords, options)\n{\tvar listenerKey;\n\tvar self = this;\n\toptions = options || {};\n\t// Change to map's projection\n\tif (options.projection)\n\t{\tcoords = ol.proj.transform(coords, options.projection, this.getView().getProjection());\n\t}\n\t// options\n\tvar start = new Date().getTime();\n\tvar delay = options.delay || 3000;\n\tvar duration = 1000;\n\tvar maxZoom = options.maxZoom || 100;\n\tvar easing = ol.easing.easeOut;\n\tvar style = options.style;\n\tif (!style) style = new ol.style.Circle({ radius:10, stroke:new ol.style.Stroke({color:'red', width:2 }) });\n\tif (style instanceof ol.style.Image) style = new ol.style.Style({ image: style });\n\tif (!(style instanceof Array)) style = [style];\n\t// Animate function\n\tfunction animate(event) \n\t{\tvar frameState = event.frameState;\n\t\tvar elapsed = frameState.time - start;\n\t\tif (elapsed > delay+duration) \n\t\t{\tol.Observable.unByKey(listenerKey);\n\t\t\tlistenerKey = null;\n\t\t}\n\t\telse \n\t\t{\tif (delay>elapsed && this.getView().getZoom()>maxZoom) delay = elapsed;\n\t\t\tvar ratio = frameState.pixelRatio;\n\t\t\tvar elapsedRatio = 0;\n\t\t\tif (elapsed > delay) elapsedRatio = (elapsed-delay) / duration;\n\t\t\tvar context = event.context;\n\t\t\tcontext.save();\n\t\t\tcontext.beginPath();\n\t\t\tcontext.globalAlpha = easing(1 - elapsedRatio);\n\t\t\tfor (var i=0; i<style.length; i++)\n\t\t\t{\tvar imgs = style[i].getImage();\n\t\t\t\tvar sc = imgs.getScale(); \n\t\t\t\timgs.setScale(sc*ratio);\n\t\t\t\tevent.vectorContext.setStyle(style[i]);\n\t\t\t\tevent.vectorContext.drawGeometry(new ol.geom.Point(coords));\n\t\t\t\timgs.setScale(sc);\n\t\t\t}\n\t\t\tcontext.restore();\n\t\t\t// tell OL3 to continue postcompose animation\n\t\t\tif (elapsed >= delay) frameState.animate = true;\n\t\t}\n\t}\n\tsetTimeout (function()\n\t\t{\tif (listenerKey) self.renderSync(); \n\t\t}, delay);\n\t// Launch animation\n\tlistenerKey = this.on('postcompose', animate.bind(this));\n\tthis.renderSync();\n\tlistenerKey.stop = function()\n\t{\tdelay = duration = 0;\n\t\tthis.target.renderSync();\n\t};\n\treturn listenerKey;\n}\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Ordering function for ol.layer.Vector renderOrder parameter\n*\tol.ordering.fn (options)\n*\tIt will return an ordering function (f0,f1)\n*\t@namespace\n*/\nol.ordering = {};\n/** y-Ordering\n*\t@return ordering function (f0,f1)\n*/\nol.ordering.yOrdering = function()\n{\treturn function(f0,f1)\n\t{\treturn f1.getGeometry().getExtent()[1] - f0.getGeometry().getExtent()[1] ;\n\t};\n};\n/** Order with a feature attribute\n * @param options\n *  @param {string} options.attribute ordering attribute, default zIndex\n *  @param {function} options.equalFn ordering function for equal values\n * @return ordering function (f0,f1)\n */\nol.ordering.zIndex = function(options)\n{\tif (!options) options = {};\n\tvar attr = options.attribute || 'zIndex';\n\tif (options.equalFn)\n\t{\treturn function(f0,f1)\n\t\t{\tif (f0.get(attr) == f1.get(attr)) return options.equalFn(f0,f1);\n\t\t\telse return f0.get(attr) < f1.get(attr) ? 1:-1;\n\t\t};\n\t}\n\telse\n\t{\treturn function(f0,f1)\n\t\t{\tif (f0.get(attr) == f1.get(attr)) return 0;\n\t\t\telse return f0.get(attr) < f1.get(attr) ? 1:-1;\n\t\t};\n\t}\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Pulse a point on postcompose\n*\t@deprecated use map.animateFeature instead\n*\t@param {ol.coordinates} point to pulse\n*\t@param {ol.pulse.options} pulse options param\n*\t\t- projection {ol.projection||String} projection of coords\n*\t\t- duration {Number} animation duration in ms, default 3000\n*\t\t- amplitude {Number} movement amplitude 0: none - 0.5: start at 0.5*radius of the image - 1: max, default 1\n*\t\t- easing {ol.easing} easing function, default ol.easing.easeOut\n*\t\t- style {ol.style.Image|ol.style.Style|Array<ol.style.Style>} Image to draw as markup, default red circle\n*/\nol.Map.prototype.pulse = function(coords, options)\n{\tvar listenerKey;\n\toptions = options || {};\n\t// Change to map's projection\n\tif (options.projection)\n\t{\tcoords = ol.proj.transform(coords, options.projection, this.getView().getProjection());\n\t}\n\t// options\n\tvar start = new Date().getTime();\n\tvar duration = options.duration || 3000;\n\tvar easing = options.easing || ol.easing.easeOut;\n\tvar style = options.style;\n\tif (!style) style = new ol.style.Circle({ radius:30, stroke:new ol.style.Stroke({color:'red', width:2 }) });\n\tif (style instanceof ol.style.Image) style = new ol.style.Style({ image: style });\n\tif (!(style instanceof Array)) style = [style];\n\tvar amplitude = options.amplitude || 1;\n\tif (amplitude<0) amplitude=0;\n\tvar maxRadius = options.radius || 15;\n\tif (maxRadius<0) maxRadius = 5;\n\t/*\n\tvar minRadius = maxRadius - (options.amplitude || maxRadius); //options.minRadius || 0;\n\tvar width = options.lineWidth || 2;\n\tvar color = options.color || 'red';\n\tconsole.log(\"pulse\")\n\t*/\n\t// Animate function\n\tfunction animate(event) \n\t{\tvar frameState = event.frameState;\n\t\tvar ratio = frameState.pixelRatio;\n\t\tvar elapsed = frameState.time - start;\n\t\tif (elapsed > duration) ol.Observable.unByKey(listenerKey);\n\t\telse\n\t\t{\tvar elapsedRatio = elapsed / duration;\n\t\t\tvar context = event.context;\n\t\t\tcontext.save();\n\t\t\tcontext.beginPath();\n\t\t\tvar e = easing(elapsedRatio)\n\t\t\tcontext.globalAlpha = easing(1 - elapsedRatio);\n\t\t\tconsole.log(\"anim\")\n\t\t\tfor (var i=0; i<style.length; i++)\n\t\t\t{\tvar imgs = style[i].getImage();\n\t\t\t\tvar sc = imgs.getScale(); \n\t\t\t\timgs.setScale(ratio*sc*(1+amplitude*(e-1)));\n\t\t\t\tevent.vectorContext.setStyle(style[i]);\n\t\t\t\tevent.vectorContext.drawGeometry(new ol.geom.Point(coords));\n\t\t\t\timgs.setScale(sc);\n\t\t\t}\n\t\t\tcontext.restore();\n\t\t\t// tell OL3 to continue postcompose animation\n\t\t\tframeState.animate = true;\n\t\t}\n\t}\n\t// Launch animation\n\tlistenerKey = this.on('postcompose', animate.bind(this));\n\tthis.renderSync();\n}\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*\n*  Add a chart style to display charts (pies or bars) on a map \n*/\n/**\n * @requires ol.style.Circle\n * @requires ol.structs.IHasChecksum\n */\n/**\n * @classdesc\n * Set chart style for vector features.\n *\n * @constructor\n * @param {} options\n *\t@param {String} options.type Chart type: pie,pie3D, donut or bar\n *\t@param {number} options.radius Chart radius/size, default 20\n *\t@param {number} options.rotation Rotation in radians (positive rotation clockwise). Default is 0.\n *\t@param {bool} options.snapToPixel use integral numbers of pixels, default true\n *\t@param {_ol_style_Stroke_} options.stroke stroke style\n *\t@param {String|Array<ol.color>} options.colors predefined color set \"classic\",\"dark\",\"pale\",\"pastel\",\"neon\" / array of color string, default classic\n *\t@param {number} options.offsetX X offset in px\n *\t@param {number} options.offsetY Y offset in px\n *\t@param {number} options.animation step in an animation sequence [0,1]\n *\t@param {number} options.max maximum value for bar chart\n * @see [Statistic charts example](../../examples/style/map.style.chart.html)\n * @extends {ol.style.RegularShape}\n * @implements {ol.structs.IHasChecksum}\n * @api\n */\nol.style.Chart = function(opt_options) {\n  var options = opt_options || {};\n  var strokeWidth = 0;\n  if (opt_options.stroke) strokeWidth = opt_options.stroke.getWidth();\n  ol.style.RegularShape.call (this, {\n    radius: options.radius + strokeWidth, \n    fill: new ol.style.Fill({color: [0,0,0]}),\n    rotation: options.rotation,\n    snapToPixel: options.snapToPixel\n  });\n  if (options.scale) this.setScale(options.scale);\n  this._stroke = options.stroke;\n  this._radius = options.radius || 20;\n  this._donutratio = options.donutRatio || 0.5;\n  this._type = options.type;\n  this._offset = [options.offsetX ? options.offsetX : 0, options.offsetY ? options.offsetY : 0];\n  this._animation = (typeof(options.animation) == 'number') ? { animate:true, step:options.animation } : this._animation = { animate:false, step:1 };\n  this._max = options.max;\n  this._data = options.data;\n  if (options.colors instanceof Array) {\n    this._colors = options.colors;\n  } else {\n    this._colors = ol.style.Chart.colors[options.colors];\n    if(!this._colors) this._colors = ol.style.Chart.colors.classic;\n  }\n  this.renderChart_();\n};\nol.ext.inherits(ol.style.Chart, ol.style.RegularShape);\n/** Default color set: classic, dark, pale, pastel, neon\n*/\nol.style.Chart.colors = {\n  \"classic\":\t[\"#ffa500\",\"blue\",\"red\",\"green\",\"cyan\",\"magenta\",\"yellow\",\"#0f0\"],\n  \"dark\":\t\t[\"#960\",\"#003\",\"#900\",\"#060\",\"#099\",\"#909\",\"#990\",\"#090\"],\n  \"pale\":\t\t[\"#fd0\",\"#369\",\"#f64\",\"#3b7\",\"#880\",\"#b5d\",\"#666\"],\n  \"pastel\":\t[\"#fb4\",\"#79c\",\"#f66\",\"#7d7\",\"#acc\",\"#fdd\",\"#ff9\",\"#b9b\"], \n  \"neon\":\t\t[\"#ff0\",\"#0ff\",\"#0f0\",\"#f0f\",\"#f00\",\"#00f\"]\n}\n/**\n * Clones the style. \n * @return {ol.style.Chart}\n */\nol.style.Chart.prototype.clone = function() {\n  var s = new ol.style.Chart({\n    type: this._type,\n    radius: this._radius,\n    rotation: this.getRotation(),\n    scale: this.getScale(),\n    data: this.getData(),\n    snapToPixel: this.getSnapToPixel ? this.getSnapToPixel() : false,\n    stroke: this._stroke,\n    colors: this._colors,\n    offsetX: this._offset[0],\n    offsetY: this._offset[1],\n    animation: this._animation\n  });\n  s.setScale(this.getScale());\n  s.setOpacity(this.getOpacity());\n  return s;\n};\n/** Get data associatied with the chart\n*/\nol.style.Chart.prototype.getData = function() {\n  return this._data;\n}\n/** Set data associatied with the chart\n*\t@param {Array<number>}\n*/\nol.style.Chart.prototype.setData = function(data) {\n  this._data = data;\n  this.renderChart_();\n}\n/** Get symbol radius\n*/\nol.style.Chart.prototype.getRadius = function() {\n  return this._radius;\n}\n/** Set symbol radius\n*\t@param {number} symbol radius\n*\t@param {number} donut ratio\n*/\nol.style.Chart.prototype.setRadius = function(radius, ratio) {\n  this._radius = radius;\n  this.donuratio_ = ratio || this.donuratio_;\n  this.renderChart_();\n}\n/** Set animation step \n*\t@param {false|number} false to stop animation or the step of the animation [0,1]\n*/\nol.style.Chart.prototype.setAnimation = function(step) {\n  if (step===false) {\n    if (this._animation.animate == false) return;\n    this._animation.animate = false;\n  } else {\n    if (this._animation.step == step) return;\n    this._animation.animate = true;\n    this._animation.step = step;\n  }\n  this.renderChart_();\n}\n/** @private\n*/\nol.style.Chart.prototype.renderChart_ = function(pixelratio) {\n  if (!pixelratio) {\n    if (this.getPixelRatio) {\n      pixelratio = window.devicePixelRatio;\n      this.renderChart_(pixelratio);\n      if (this.getPixelRatio && pixelratio!==1) this.renderChart_(1); \n    } else {\n      this.renderChart_(1);\n    }\n    return;\n  }\n  var strokeStyle;\n  var strokeWidth = 0;\n  if (this._stroke)  {\n    strokeStyle = ol.color.asString(this._stroke.getColor());\n    strokeWidth = this._stroke.getWidth();\n  }\n  // no atlas manager is used, create a new canvas\n  var canvas = this.getImage(pixelratio);\n  // draw the circle on the canvas\n  var context = (canvas.getContext('2d'));\n  context.clearRect(0, 0, canvas.width, canvas.height);\n  context.lineJoin = 'round';\n  var sum=0;\n  var i, c;\n  for (i=0; i<this._data.length; i++) {\n    sum += this._data[i];\n  }\n  context.save();\n  // reset transform\n  context.setTransform(pixelratio, 0, 0, pixelratio, 0, 0);\n  // then move to (x, y)\n  context.translate(0,0);\n  var step = this._animation.animate ? this._animation.step : 1;\n  //console.log(this._animation.step)\n  // Draw pie\n  switch (this._type) {\n    case \"donut\":\n    case \"pie3D\":\n    case \"pie\": {\n      var a, a0 = Math.PI * (step-1.5);\n      c = canvas.width/2/pixelratio;\n      context.strokeStyle = strokeStyle;\n      context.lineWidth = strokeWidth;\n      context.save();\n      if (this._type==\"pie3D\") {\n        context.translate(0, c*0.3);\n        context.scale(1, 0.7);\n        context.beginPath();\n        context.fillStyle = \"#369\";\n        context.arc ( c, c*1.4, this._radius *step, 0, 2*Math.PI);\n        context.fill();\n        context.stroke();\n      }\n      if (this._type==\"donut\") {\n        context.save();\n        context.beginPath();\n        context.rect ( 0,0,2*c,2*c );\n        context.arc ( c, c, this._radius *step *this._donutratio, 0, 2*Math.PI);\n        context.clip(\"evenodd\");\n      }\n      for (i=0; i<this._data.length; i++) {\n        context.beginPath();\n        context.moveTo(c,c);\n        context.fillStyle = this._colors[i%this._colors.length];\n        a = a0 + 2*Math.PI*this._data[i]/sum *step;\n        context.arc ( c, c, this._radius *step, a0, a);\n        context.closePath();\n        context.fill();\n        context.stroke();\n        a0 = a;\n      }\n      if (this._type==\"donut\") {\n        context.restore();\n        context.beginPath();\n        context.strokeStyle = strokeStyle;\n        context.lineWidth = strokeWidth;\n        context.arc ( c, c, this._radius *step *this._donutratio, Math.PI * (step-1.5), a0);\n        context.stroke();\n      }\n      context.restore();\n      break;\n    }\n    case \"bar\":\n    default: {\n      var max=0;\n      if (this._max) {\n        max = this._max;\n      } else {\n        for (i=0; i<this._data.length; i++) {\n          if (max < this._data[i]) max = this._data[i];\n        }\n      }\n      var s = Math.min(5,2*this._radius/this._data.length);\n      c = canvas.width/2/pixelratio;\n      var b = canvas.width/pixelratio - strokeWidth;\n      var x, x0 = c - this._data.length*s/2\n      context.strokeStyle = strokeStyle;\n      context.lineWidth = strokeWidth;\n      for (i=0; i<this._data.length; i++) {\n        context.beginPath();\n        context.fillStyle = this._colors[i%this._colors.length];\n        x = x0 + s;\n        var h = this._data[i]/max*2*this._radius *step;\n        context.rect ( x0, b-h, s, h);\n        //console.log ( x0+\", \"+(b-this._data[i]/max*2*this._radius)+\", \"+x+\", \"+b);\n        context.closePath();\n        context.fill();\n        context.stroke();\n        x0 = x;\n      }\n    }\n  }\n  context.restore();\n  // Set Anchor\n  var anchor = this.getAnchor();\n  anchor[0] = c - this._offset[0];\n  anchor[1] = c - this._offset[1];\n};\n\n/*\tCopyright (c) 2016 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc\n * Fill style with named pattern\n *\n * @constructor\n * @param {olx.style.FillPatternOption=}  options\n *\t@param {ol.style.Image|undefined} options.image an image pattern, image must be preloaded to draw on first call\n *\t@param {number|undefined} options.opacity opacity with image pattern, default:1\n *\t@param {olx.style.fillPattern} options.pattern pattern name (override by image option)\n *\t@param {ol.color} options.color pattern color\n *\t@param {ol.style.Fill} options.fill fill color (background)\n *\t@param {number} options.offset pattern offset for hash/dot/circle/cross pattern\n *\t@param {number} options.size line size for hash/dot/circle/cross pattern\n *\t@param {number} options.spacing spacing for hash/dot/circle/cross pattern\n *\t@param {number|bool} options.angle angle for hash pattern / true for 45deg dot/circle/cross\n *\t@param {number} options.scale pattern scale \n * @extends {ol.style.Fill}\n * @implements {ol.structs.IHasChecksum}\n * @api\n */\nol.style.FillPattern = function(options)\n{\tif (!options) options = {};\n\tvar pattern;\n\tvar canvas = this.canvas_ = document.createElement('canvas');\n\tvar scale = Number(options.scale)>0 ? Number(options.scale) : 1;\n\tvar ratio = scale*ol.has.DEVICE_PIXEL_RATIO || ol.has.DEVICE_PIXEL_RATIO;\n\tvar ctx = canvas.getContext('2d');\n\tif (options.image)\n\t{\toptions.image.load();\n\t\tvar i;\n\t\tvar img = options.image.getImage();\n\t\tif (img.width)\n\t\t{\tcanvas.width = Math.round(img.width *ratio);\n\t\t\tcanvas.height = Math.round(img.height *ratio);\n\t\t\tctx.globalAlpha = typeof(options.opacity) == 'number' ? options.opacity:1;\n\t\t\tctx.drawImage(img, 0,0, img.width, img.height, 0, 0, canvas.width, canvas.height);\n\t\t\tpattern = ctx.createPattern(canvas, 'repeat');\n\t\t}\n\t\telse \n\t\t{\tvar self = this;\n\t\t\tpattern = [0,0,0,0];\n\t\t\timg.onload = function ()\n\t\t\t{\tcanvas.width = Math.round(img.width *ratio);\n\t\t\t\tcanvas.height = Math.round(img.height *ratio);\n\t\t\t\tctx.globalAlpha = typeof(options.opacity) == 'number' ? options.opacity:1;\n\t\t\t\tctx.drawImage(img, 0,0, img.width, img.height, 0, 0, canvas.width, canvas.height);\n\t\t\t\tpattern = ctx.createPattern(canvas, 'repeat');\n\t\t\t\tself.setColor(pattern);\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\tvar pat = this.getPattern_(options);\n\t\tcanvas.width = Math.round(pat.width *ratio);\n\t\tcanvas.height = Math.round(pat.height *ratio);\n\t\tctx.beginPath();\n\t\tif (options.fill) \n\t\t{\tctx.fillStyle = ol.color.asString(options.fill.getColor());\n\t\t\tctx.fillRect(0,0, canvas.width, canvas.height);\n\t\t}\n\t\tctx.scale(ratio,ratio);\n\t\tctx.lineCap = \"round\";\n\t\tctx.lineWidth = pat.stroke || 1;\n\t\tctx.fillStyle = ol.color.asString(options.color||\"#000\");\n\t\tctx.strokeStyle = ol.color.asString(options.color||\"#000\");\n\t\tif (pat.circles) for (i=0; i<pat.circles.length; i++)\n\t\t{\tvar ci = pat.circles[i]; \n\t\t\tctx.beginPath();\n\t\t\tctx.arc(ci[0], ci[1], ci[2], 0,2*Math.PI);\n\t\t\tif (pat.fill) ctx.fill();\n\t\t\tif (pat.stroke) ctx.stroke();\n\t\t}\n\t\tif (!pat.repeat) pat.repeat=[[0,0]];\n\t\tif (pat.char)\n\t\t{\tctx.font = pat.font || (pat.width)+\"px Arial\";\n\t\t\tctx.textAlign = 'center';\n\t\t\tctx.textBaseline = 'middle';\n\t\t\tif (pat.angle) \n\t\t\t{\tctx.fillText(pat.char, pat.width/4, pat.height/4);\n\t\t\t\tctx.fillText(pat.char, 5*pat.width/4, 5*pat.height/4);\n\t\t\t\tctx.fillText(pat.char, pat.width/4, 5*pat.height/4);\n\t\t\t\tctx.fillText(pat.char, 5*pat.width/4, pat.height/4);\n\t\t\t\tctx.fillText(pat.char, 3*pat.width/4, 3*pat.height/4);\n\t\t\t\tctx.fillText(pat.char, -pat.width/4, -pat.height/4);\n\t\t\t\tctx.fillText(pat.char, 3*pat.width/4, -pat.height/4);\n\t\t\t\tctx.fillText(pat.char, -pat.width/4, 3*pat.height/4);\n\t\t\t}\n\t\t\telse ctx.fillText(pat.char, pat.width/2, pat.height/2);\n\t\t}\n\t\tif (pat.lines) for (i=0; i<pat.lines.length; i++) for (var r=0; r<pat.repeat.length; r++)\n\t\t{\tvar li = pat.lines[i];\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(li[0]+pat.repeat[r][0],li[1]+pat.repeat[r][1]);\n\t\t\tfor (var k=2; k<li.length; k+=2)\n\t\t\t{\tctx.lineTo(li[k]+pat.repeat[r][0],li[k+1]+pat.repeat[r][1]);\n\t\t\t}\n\t\t\tif (pat.fill) ctx.fill();\n\t\t\tif (pat.stroke) ctx.stroke();\n\t\t\tctx.save()\n\t\t\tctx.strokeStyle = 'red';\n\t\t\tctx.strokeWidth = 0.1;\n\t\t\t//ctx.strokeRect(0,0,canvas.width,canvas.height);\n\t\t\tctx.restore()\n\t\t}\n\t\tpattern = ctx.createPattern(canvas, 'repeat');\n\t\tif (options.offset)\n\t\t{\tvar offset = options.offset;\n\t\t\tif (typeof(offset) == \"number\") offset = [offset,offset];\n\t\t\tif (offset instanceof Array) \n\t\t\t{\tvar dx = Math.round((offset[0]*ratio));\n\t\t\t\tvar dy = Math.round((offset[1]*ratio));\n\t\t\t\t// New pattern\n\t\t\t\tctx.scale(1/ratio,1/ratio)\n\t\t\t\tctx.clearRect(0,0,canvas.width,canvas.height);\n\t\t\t\tctx.translate(dx,dy);\n\t\t\t\tctx.fillStyle = pattern;\n\t\t\t\tctx.fillRect(-dx, -dy, canvas.width,canvas.height);\n\t\t\t\tpattern = ctx.createPattern(canvas, 'repeat');\n\t\t\t}\n\t\t}\n\t}\n\tol.style.Fill.call (this, { color: pattern });\n};\nol.ext.inherits(ol.style.FillPattern, ol.style.Fill);\n/**\n * Clones the style. \n * @return {ol.style.FillPattern}\n */\nol.style.FillPattern.prototype.clone = function()\n{\tvar s = ol.style.Fill.prototype.clone.call(this);\n\ts.canvas_ = this.canvas_;\n\treturn s;\n};\n/** Get canvas used as pattern\n*\t@return {canvas}\n*/\nol.style.FillPattern.prototype.getImage = function()\n{\treturn this.canvas_;\n}\n/** Get pattern\n*\t@param {olx.style.FillPatternOption}\n*/\nol.style.FillPattern.prototype.getPattern_ = function(options)\n{\tvar pat = ol.style.FillPattern.prototype.patterns[options.pattern]\n\t\t|| ol.style.FillPattern.prototype.patterns.dot;\n\tvar d = Math.round(options.spacing)||10;\n\tvar size;\n\tswitch (options.pattern)\n\t{\tcase 'dot':\n\t\tcase 'circle':\n\t\t{\tsize = options.size===0 ? 0 : options.size/2 || 2;\n\t\t\tif (!options.angle)\n\t\t\t{\tpat.width = pat.height = d;\n\t\t\t\tpat.circles = [[ d/2, d/2, size ]]\n\t\t\t\tif (options.pattern=='circle')\n\t\t\t\t{\tpat.circles = pat.circles.concat([\n\t\t\t\t\t\t[ d/2+d, d/2, size ],\n\t\t\t\t\t\t[ d/2-d, d/2, size ],\n\t\t\t\t\t\t[ d/2, d/2+d, size ],\n\t\t\t\t\t\t[ d/2, d/2-d, size ],\n\t\t\t\t\t\t[ d/2+d, d/2+d, size ],\n\t\t\t\t\t\t[ d/2+d, d/2-d, size ],\n\t\t\t\t\t\t[ d/2-d, d/2+d, size ],\n\t\t\t\t\t\t[ d/2-d, d/2-d, size ] ])\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\td = pat.width = pat.height = Math.round(d*1.4);\n\t\t\t\tpat.circles = [[ d/4, d/4, size ], [ 3*d/4, 3*d/4, size ]];\n\t\t\t\tif (options.pattern=='circle')\n\t\t\t\t{\tpat.circles = pat.circles.concat([\n\t\t\t\t\t\t[ d/4+d, d/4, size ],\n\t\t\t\t\t\t[ d/4, d/4+d, size ],\n\t\t\t\t\t\t[ 3*d/4-d, 3*d/4, size ],\n\t\t\t\t\t\t[ 3*d/4, 3*d/4-d, size ],\n\t\t\t\t\t\t[ d/4+d, d/4+d, size ], \n\t\t\t\t\t\t[ 3*d/4-d, 3*d/4-d, size ] ]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 'tile':\n\t\tcase 'square':\n\t\t{\tsize = options.size===0 ? 0 : options.size/2 || 2;\n\t\t\tif (!options.angle)\n\t\t\t{\tpat.width = pat.height = d;\n\t\t\t\tpat.lines = [[ d/2-size, d/2-size, d/2+size, d/2-size, d/2+size, d/2+size, d/2-size,d/2+size, d/2-size, d/2-size ]]\n\t\t\t}\n\t\t\telse\n\t\t\t{\tpat.width = pat.height = d;\n\t\t\t\t//size *= Math.sqrt(2);\n\t\t\t\tpat.lines = [[ d/2-size,d/2, d/2,d/2-size, d/2+size,d/2, d/2,d/2+size, d/2-size,d/2 ]]\n\t\t\t}\n\t\t\tif (options.pattern=='square') pat.repeat = [[0,0], [0,d], [d,0], [0,-d], [-d,0], [-d,-d], [d,d], [-d,d], [d,-d] ]\n\t\t\tbreak;\n\t\t}\n\t\tcase 'cross':\n\t\t{\t// Limit angle to 0 | 45\n\t\t\tif (options.angle) options.angle = 45;\n\t\t}\n\t\t// fallsthrough\n\t\tcase 'hatch':\n\t\t{\tvar a = Math.round(((options.angle||0)-90)%360);\n\t\t\tif (a>180) a -= 360;\n\t\t\ta *= Math.PI/180;\n\t\t\tvar cos = Math.cos(a);\n\t\t\tvar sin = Math.sin(a);\n\t\t\tif (Math.abs(sin)<0.0001)\n\t\t\t{\tpat.width = pat.height = d;\t\n\t\t\t\tpat.lines = [ [ 0,0.5, d, 0.5 ] ];\n\t\t\t\tpat.repeat = [ [0,0], [0,d] ];\n\t\t\t}\n\t\t\telse  if (Math.abs(cos)<0.0001)\n\t\t\t{\tpat.width = pat.height = d;\t\n\t\t\t\tpat.lines = [ [ 0.5,0, 0.5, d] ];\n\t\t\t\tpat.repeat = [ [0,0], [d,0] ];\n\t\t\t\tif (options.pattern=='cross') \n\t\t\t\t{\tpat.lines.push ([ 0,0.5, d, 0.5 ]);\n\t\t\t\t\tpat.repeat.push([0,d]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\tvar w = pat.width = Math.round(Math.abs(d/sin)) || 1;\n\t\t\t\tvar h = pat.height = Math.round(Math.abs(d/cos)) || 1;\n\t\t\t\tif (options.pattern=='cross')\n\t\t\t\t{\tpat.lines = [ [-w,-h, 2*w,2*h], [2*w,-h, -w,2*h] ];\n\t\t\t\t\tpat.repeat = [ [0,0] ];\n\t\t\t\t}\n\t\t\t\telse if (cos*sin>0) \n\t\t\t\t{\tpat.lines = [ [-w,-h, 2*w,2*h] ];\n\t\t\t\t\tpat.repeat = [ [0,0], [w,0], [0,h] ];\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\tpat.lines = [ [2*w,-h, -w,2*h] ];\n\t\t\t\t\tpat.repeat = [ [0,0], [-w,0], [0,h] ];\n\t\t\t\t}\n\t\t\t}\n\t\t\tpat.stroke = options.size===0 ? 0 : options.size||4;\n\t\t\tbreak;\n\t\t}\n\t\tdefault: break;\n\t}\n\treturn pat\n}\n/** Static fuction to add char patterns\n*\t@param {title} \n*\t@param {olx.fillpattern.Option}\n*\t\t- size {integer} default 10\n*\t\t- width {integer} default 10\n*\t\t- height {integer} default 10\n*\t\t- circles {Array<circles>}\n*\t\t- lines: {Array<pointlist>}\n*\t\t- stroke {integer}\n*\t\t- fill {bool}\n*\t\t- char {char}\n*\t\t- font {string} default \"10px Arial\"\n*/\nol.style.FillPattern.addPattern = function (title, options)\n{\tif (!options) options={};\n\tol.style.FillPattern.prototype.patterns[title || options.char] =\n\t{\twidth: options.width || options.size || 10,\n\t\theight: options.height || options.size || 10,\n\t\tfont: options.font,\n\t\tchar: options.char,\n\t\tcircles: options.circles,\n\t\tlines: options.lines,\n\t\trepeat: options.repeat,\n\t\tstroke: options.stroke,\n\t\tangle: options.angle,\n\t\tfill: options.fill\n\t}\n}\n/** Patterns definitions\n\tExamples : http://seig.ensg.ign.fr/fichchap.php?NOFICHE=FP31&NOCHEM=CHEMS009&NOLISTE=1&N=8\n*/\nol.style.FillPattern.prototype.patterns =\n{\n\t\"hatch\":\n\t{\twidth:5,\n\t\theight:5,\n\t\tlines:[[0,2.5,5,2.5]],\n\t\tstroke:1\n\t},\n\t\"cross\":\n\t{\twidth:7,\n\t\theight:7,\n\t\tlines:[[0,3,10,3],[3,0,3,10]],\n\t\tstroke:1\n\t},\n\t\"dot\":\n\t{\twidth:8,\n\t\theight:8,\n\t\tcircles:[[5,5,2]],\n\t\tstroke:false,\n\t\tfill:true,\n\t},\n\t\"circle\":\n\t{\twidth:10,\n\t\theight:10,\n\t\tcircles:[[5,5,2]],\n\t\tstroke:1,\n\t\tfill:false,\n\t},\n\t\"square\":\n\t{\twidth:10,\n\t\theight:10,\n\t\tlines:[[3,3, 3,8, 8,8, 8,3, 3,3]],\n\t\tstroke:1,\n\t\tfill:false,\n\t},\n\t\"tile\":\n\t{\twidth:10,\n\t\theight:10,\n\t\tlines:[[3,3, 3,8, 8,8, 8,3, 3,3]],\n\t\tfill:true,\n\t},\n\t\"woven\":\n\t{\twidth: 12,\n\t\theight: 12,\n\t\tlines: [[ 3,3, 9,9 ],[0,12, 3,9], [9,3, 12,0], [-1,1,1,-1], [13,11,11,13]],\n\t\tstroke: 1\n\t},\n\t\"crosses\":\n\t{\twidth: 8,\n\t\theight: 8,\n\t\tlines: [[ 2,2, 6,6 ],[2,6,6,2]],\n\t\tstroke: 1\n\t},\n\t\"caps\":\n\t{\twidth: 8,\n\t\theight: 8,\n\t\tlines: [[ 2,6, 4,2, 6,6 ]],\n\t\tstroke: 1\n\t},\n\t\"nylon\":\n\t{\twidth: 20,\n\t\theight: 20,\n//\t\tlines: [[ 0,5, 0,0, 5,0 ],[ 5,10, 10,10, 10,5 ], [ 10,15, 10,20, 15,20 ],[ 15,10, 20,10, 20,15 ]],\n//\t\trepeat: [[0,0], [20,0], [0,20], [-20,0], [0,-20], [-20,-20]],\n\t\tlines: [[ 1,6, 1,1, 6,1 ],[ 6,11, 11,11, 11,6 ], [ 11,16, 11,21, 16,21 ],[ 16,11, 21,11, 21,16 ]],\n\t\trepeat: [[0,0], [-20,0], [0,-20] ],\n\t\tstroke: 1\n\t},\n\t\"hexagon\":\n\t{\twidth: 20,\n\t\theight: 12,\n\t\tlines: [[ 0,10, 4,4, 10,4, 14,10, 10,16, 4,16, 0,10 ]],\n\t\tstroke:1,\n\t\trepeat:[[0,0],[10,6],[10,-6],[-10,-6]]\n\t},\n\t\"cemetry\":\n\t{\twidth:15,\n\t\theight:19,\n\t\tlines:[[0,3.5,7,3.5],[3.5,0,3.5,10],\n\t\t\t//[7,12.5,14,12.5],[10.5,9,10.5,19]\n\t\t\t],\n\t\tstroke:1,\n\t\trepeat:[[0,0],[7,9]]\n\t},\n\t\"sand\":\n\t{\twidth:20,\n\t\theight:20,\n\t\tcircles:[[1,2,1],[9,3,1],[2,16,1],\n\t\t\t\t[7,8,1],[6,14,1],[4,19,1],\n\t\t\t\t[14,2,1],[12,10,1],[14,18,1],\n\t\t\t\t[18,8,1],[18,14,1]],\n\t\tfill:1\n\t},\n\t\"conglomerate\":\n\t{\twidth:30,\n\t\theight:20,\n\t\tcircles:[[2,4,1],[17,3,1],[26,18,1],[12,17,1],[5,17,2],[28,11,2]],\n\t\tlines:[[7,5, 6,7, 9,9, 11,8, 11,6, 9,5, 7,5], \n\t\t\t[16,10, 15,13, 16,14, 19,15, 21,13, 22,9, 20,8, 19,8, 16,10], \n\t\t\t[24,6, 26,7, 27,5, 26,4, 24,4, 24,6]],\n\t\tstroke:1\n\t},\n\t\"gravel\":\n\t{\twidth:15,\n\t\theight:10,\n\t\tcircles:[[4,2,1],[5,9,1],[1,7,1]],//[9,9,1],,[15,2,1]],\n\t\tlines:[[7,5, 6,6, 7,7, 8,7, 9,7, 10,5, 9,4, 7,5], [11,2, 14,4, 14,1, 12,1, 11,2]],\n\t\tstroke:1\n\t},\n\t\"brick\":\n\t{\twidth:18,\n\t\theight:16,\n\t\tlines:[\t[0,1,18,1],[0,10,18,10], [6,1,6,10],[12,10,12,18],[12,0,12,1]],\n\t\tstroke:1\n\t},\n\t\"dolomite\":\n\t{\twidth:20,\n\t\theight:16,\n\t\tlines:[[0,1,20,1],[0,9,20,9],[1,9,6,1],[11,9,14,16],[14,0,14.4,1]],\n\t\tstroke:1\n\t},\n\t\"coal\":\n\t{\twidth:20,\n\t\theight:16,\n\t\tlines:[[1,5, 7,1, 7,7], [11,10, 12,5, 18,9], [5,10, 2,15, 9,15,], [15,16, 15,13, 20,16], [15,0, 15,2, 20,0]],\n\t\tfill:1\n\t},\n\t\"breccia\":\n\t{\twidth:20,\n\t\theight:16,\n\t\tlines:[[1,5, 7,1, 7,7, 1,5], [11,10, 12,5, 18,9, 11,10], [5,10, 2,15, 9,15, 5,10], [15,16, 15,13, 22,18], [15,0, 15,2, 20,0] ],\n\t\tstroke:1,\n\t},\n\t\"clay\":\n\t{\twidth:20,\n\t\theight:20,\n\t\tlines:[[0,0, 3,11, 0,20], [11,0, 10,3, 13,13, 11,20], [0,0, 10,3, 20,0], [0,12, 3,11, 13,13, 20,12]],\n\t\tstroke:1\n\t},\n\t\"flooded\":\n\t{\twidth:15,\n\t\theight:10,\n\t\tlines:[\t[0,1,10,1],[0,6,5,6], [10,6,15,6]],\n\t\tstroke:1\n\t},\n\t\"chaos\":\n\t{\twidth:40,\n\t\theight:40,\n\t\tlines:[[40,2, 40,0, 38,0, 40,2], \n\t\t\t[4,0, 3,2, 2,5, 0,0, 0,3, 2,7, 5,6, 7,7, 8,10, 9,12, 9,13, 9,14, 8,14, 6,15, 2,15, 0,20, 0,22, 2,20, 5,19, \n\t\t\t\t8,15, 10,14, 11,12.25, 10,12, 10,10, 12,9, 13,7, 12,6, 13,4, 16,7, 17,4, 20,0, 18,0, 15,3, 14,2, 14,0,\n\t\t\t\t12,1, 11,0, 10,1, 11,4, 10,7, 9,8, 8,5, 6,4, 5,3, 5,1, 5,0, 4,0],\n\t\t\t[7,1, 7,3, 8,3, 8,2, 7,1], [4,3, 5,5, 4,5, 4,3], [34,5, 33,7, 38,10, 38,8, 36,5, 34,5], \n\t\t\t[ 27,0, 23,2, 21,8, 30,0, 27,0], \n\t\t\t[25,8, 26,12, 26,16, 22.71875,15.375, 20,13, 18,15, 17,18, 13,22, 17,21, 19,22, 21,20, 19,18, 22,17, 30,25, \n\t\t\t26,26, 24,28, 21.75,33.34375, 20,36, 18,40, 20,40, 24,37, 25,32, 27,31, 26,38, 27,37, 30,32, 32,35, 36,37, \n\t\t\t38,40, 38,39, 40,40, 37,36, 34,32, 37,31, 36,29, 33,27, 34,24, 39,21, 40,21, 40,16, 37,20, 31,22, 32,25, \n\t\t\t27,20, 29,15, 30,20, 32,20, 34,18, 33,12, 31,11, 29,14, 26,9, 25,8], [39,24, 37,26, 40,28, 39,24], \n\t\t\t[13,15, 9,19, 14,18, 13,15], [18,23, 14,27, 16,27, 17,25, 20,26, 18,23], \n\t\t\t[6,24, 2,26, 1,28, 2,30, 5,28, 12,30, 16,32, 18,30, 15,30, 12,28, 9,25, 7,27, 6,24], \n\t\t\t[29,27, 32,28, 33,31, 30,29, 27,28, 29,27], \n\t\t\t[5,35, 1,33, 3,36, 13,38, 15,35, 10,36, 5,35]],\n\t\tfill:1,\n\t},\n\t\"grass\":\n\t{\twidth:27,\n\t\theight:22,\n\t\tlines: [[0,10.5,13,10.5], [2.5,10,1.5,7], [4.5,10, 4.5,5, 3.5,4 ], [7,10, 7.5,6, 8.5,3], [10,10,11,6]],\n\t\trepeat: [[0,0],[14,10]],\n\t\tstroke:1\n\t},\n\t\"swamp\":\n\t{\twidth:24,\n\t\theight:23,\n\t\tlines:[ [0,10.5,9.5,10.5], [2.5,10,2.5,7], [4.5,10,4.5,4], [6.5,10,6.5,6], [3,12.5,7,12.5] ],\n\t\trepeat: [[0,0],[14,10]],\n\t\tstroke:1\n\t},\n\t\"wave\":\n\t{\twidth:10,\n\t\theight:8,\n\t\tlines:[ [0,0, 5,4, 10,0] ],\n\t\tstroke:1\n\t},\n\t\"vine\":\n\t{\twidth:13,\n\t\theight:13,\n\t\tlines:[[3,0,3,6],[9,7,9,13]],\n\t\tstroke:1.0\n\t},\n\t\"forest\":\n\t{\twidth:55,\n\t\theight:30,\n\t\tcircles:[[7,7,3.5],[20,20,1.5],[42,22,3.5],[35,5,1.5]],\n\t\tstroke:1\n\t},\n\t\"scrub\":\n\t{\twidth:26,\n\t\theight:20,\n\t\tlines:[ [1,4, 4,8, 6,4] ],\n\t\tcircles:[[20,13,1.5]],\n\t\tstroke:1,\n\t},\n\t\"tree\":\n\t{\twidth:30,\n\t\theight:30,\n\t\tlines:[[7.78,10.61,4.95,10.61,4.95,7.78,3.54,7.78,2.12,6.36,0.71,6.36,0,4.24,0.71,2.12,4.24,0,7.78,0.71,9.19,3.54,7.78,4.95,7.07,7.07,4.95,7.78]],\n\t\trepeat: [[3,1],[18,16]],\n\t\tstroke:1\n\t},\n\t\"pine\":\n\t{\twidth:30,\n\t\theight:30,\n\t\tlines:[[5.66,11.31,2.83,11.31,2.83,8.49,0,8.49,2.83,0,5.66,8.49,2.83,8.49]],\n\t\trepeat:[[3,1],[18,16]],\n\t\tstroke:1\n\t},\n\t\"pines\":\n\t{\twidth:22,\n\t\theight:20,\n\t\tlines:[[1,4,3.5,1,6,4],[1,8,3.5,5,6,8],[3.5,1,3.5,11],[12,14.5,14.5,14,17,14.5],[12,18,17,18],[14.5,12,14.5,18]],\n\t\trepeat: [[2,1]],\n\t\tstroke:1\n\t},\n\t\"rock\":\n\t{\twidth:20,\n\t\theight:20,\n\t\tlines:[\t[1,0,1,9],[4,0,4,9],[7,0,7,9], \n\t\t\t\t[10,1,19,1],[10,4,19,4],[10,7,19,7],\n\t\t\t\t[0,11,9,11],[0,14,9,14],[0,17,9,17], \n\t\t\t\t[12,10,12,19],[15,10,15,19],[18,10,18,19] ],\n\t\trepeat:[[0.5,0.5]],\n\t\tstroke:1\n\t},\n\t\"rocks\":\n\t{\twidth:20,\n\t\theight:20,\n\t\tlines:[\t[5,0, 3,0, 5,4, 4,6, 0,3, 0,5, 3,6, 5,9, 3.75,10, 2.5,10, 0,9, 0,10, 4,11, 5,14, 4,15, 0,13,\n\t\t\t0,13, 0,13, 0,14, 0,14, 5,16, 5,18, 3,19, 0,19, -0.25,19.9375, 5,20, 10,19, 10,20, 11,20, 12,19,\n\t\t\t14,20, 15,20, 17,19, 20,20, 20,19, 19,16, 20,15, 20,11, 20,10, 19,8, 20,5, 20,0, 19,0, 20,2, 19,4,\n\t\t\t17,4, 16,3, 15,0, 14,0, 15,4, 11,5, 10,4, 11,0, 10,0, 9,4, 6,5, 5,0,],\n\t\t\t[18,5, 19,6, 18,10, 16,10, 14,9, 16,5, 18,5], \n\t\t\t[5,6, 9,5, 10,6, 10,9, 6,10, 5,6], \n\t\t\t[14,5, 14,8, 13,9, 12,9, 11,7, 12,5, 14,5], \n\t\t\t[ 5,11, 8,10, 9,11, 10,14, 6,15, 6,15, 5,11], \n\t\t\t[13,10, 14,11, 15,14, 15,14, 15,14, 11,15, 10,11, 11,10, 13,10], \n\t\t\t[15,12, 16,11, 19,11, 19,15, 16,14, 16,14, 15,12], \n\t\t\t[6,16, 9,15, 10,18, 5,19, 6,16], \n\t\t\t[10,16, 14,16, 14,18, 13,19, 11,18, 10,16], \n\t\t\t[15,15, 18,16, 18,18, 16,19, 15,18, 15,15]],\n\t\tstroke:1\n\t}\n}\n/**\n * /\nol.style.FillPattern.prototype.getChecksum = function()\n{\n\tvar strokeChecksum = (this.stroke_!==null) ?\n\t\tthis.stroke_.getChecksum() : '-';\n\tvar fillChecksum = (this.fill_!==null) ?\n\t\tthis.fill_.getChecksum() : '-';\n\tvar recalculate = (this.checksums_===null) ||\n\t\t(strokeChecksum != this.checksums_[1] ||\n\t\tfillChecksum != this.checksums_[2] ||\n\t\tthis.radius_ != this.checksums_[3] ||\n\t\tthis.form_+\"-\"+this.glyphs_ != this.checksums_[4]);\n\tif (recalculate) {\n\t\tvar checksum = 'c' + strokeChecksum + fillChecksum \n\t\t\t+ ((this.radius_ !== void 0) ? this.radius_.toString() : '-')\n\t\t\t+ this.form_+\"-\"+this.glyphs_;\n\t\tthis.checksums_ = [checksum, strokeChecksum, fillChecksum, this.radius_, this.form_+\"-\"+this.glyphs_];\n\t}\n\treturn this.checksums_[0];\n};\n/**/\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Flow line style\n * Draw LineString with a variable color / width\n * NB: the FlowLine style doesn't impress the hit-detection.\n * If you want your lines to be sectionable you have to add your own style to handle this.\n * (with transparent line: stroke color opacity to .1 or zero width)\n * @extends {ol.style.Style}\n * @constructor\n * @param {Object} options\n *  @param {boolean} options.visible draw only the visible part of the line, default true\n *  @param {number|function} options.width Stroke width or a function that gets a feature and the position (beetween [0,1]) and returns current width\n *  @param {number} options.width2 Final stroke width (if width is not a function)\n *  @param {number} options.arrow Arrow at start (-1), at end (1), at both (2), none (0), default geta\n *  @param {ol.colorLike|function} options.color Stroke color or a function that gets a feature and the position (beetween [0,1]) and returns current color\n *  @param {ol.colorLike} options.color2 Final sroke color if color is nor a function\n *  @param {ol.colorLike} options.arrowColor Color of arrows, if not defined used color or color2\n *  @param {string} options.lineCap CanvasRenderingContext2D.lineCap 'butt' | 'round' | 'square', default 'butt'\n *  @param {number|ol.size} options.arrowSize height and width of the arrow, default 16\n *  @param {number} options.offset0 offset at line start\n *  @param {number} options.offset1 offset at line end\n */\nol.style.FlowLine = function(options) {\n  if (!options) options = {};\n  ol.style.Style.call (this, { \n    renderer: this._render.bind(this),\n    stroke: options.stroke,\n    text: options.text,\n    zIndex: options.zIndex,\n    geometry: options.geometry\n  });\n  // Draw only visible\n  this._visible = (options.visible !== false);\n  // Width\n  if (typeof options.width === 'function') {\n    this._widthFn = options.width;\n  } else {\n    this.setWidth(options.width);\n  }\n  this.setWidth2(options.width2);\n  // Color\n  if (typeof options.color === 'function') {\n    this._colorFn = options.color;\n  } else {\n    this.setColor(options.color);\n  }\n  this.setColor2(options.color2);\n  // LineCap\n  this.setLineCap(options.lineCap);\n  // Arrow\n  this.setArrow(options.arrow);\n  this.setArrowSize(options.arrowSize);\n  this.setArrowColor(options.arrowColor);\n  // Offset\n  this._offset = [0,0];\n  this.setOffset(options.offset0, 0);\n  this.setOffset(options.offset1, 1);\n};\nol.ext.inherits(ol.style.FlowLine, ol.style.Style);\n/** Set the initial width\n * @param {number} width width, default 0\n */\nol.style.FlowLine.prototype.setWidth = function(width) {\n  this._width = width || 0;\n};\n/** Set the final width\n * @param {number} width width, default 0\n */\nol.style.FlowLine.prototype.setWidth2 = function(width) {\n  this._width2 = width;\n};\n/** Get offset at start or end\n * @param {number} where 0=start, 1=end\n * @return {number} width\n */\nol.style.FlowLine.prototype.getOffset = function(where) {\n  return this._offset[where];\n};\n/** Add an offset at start or end\n * @param {number} width\n * @param {number} where 0=start, 1=end\n */\nol.style.FlowLine.prototype.setOffset = function(width, where) {\n  width = Math.max(0, parseFloat(width));\n  switch(where) {\n    case 0: {\n      this._offset[0] = width;\n      break;\n    }\n    case 1: {\n      this._offset[1] = width;\n      break;\n    }\n  }\n};\n/** Set the LineCap\n * @param {steing} cap LineCap (round or butt), default butt\n */\nol.style.FlowLine.prototype.setLineCap = function(cap) {\n  this._lineCap = (cap==='round' ? 'round' : 'butt');\n};\n/** Get the current width at step\n * @param {ol.feature} feature\n * @param {number} step current drawing step beetween [0,1] \n * @return {number} \n */\nol.style.FlowLine.prototype.getWidth = function(feature, step) {\n  if (this._widthFn) return this._widthFn(feature, step);\n  var w2 = (typeof(this._width2) === 'number') ? this._width2 : this._width;\n  return this._width + (w2-this._width) * step;\n};\n/** Set the initial color\n * @param {ol.colorLike} color\n */\nol.style.FlowLine.prototype.setColor = function(color) {\n  try{\n    this._color = ol.color.asArray(color);\n  } catch(e) {\n    this._color = [0,0,0,1];\n  }\n};\n/** Set the final color\n * @param {ol.colorLike} color\n */\nol.style.FlowLine.prototype.setColor2 = function(color) {\n  try {\n    this._color2 = ol.color.asArray(color);\n  } catch(e) {\n    this._color2 = null;    \n  }\n};\n/** Set the arrow color\n * @param {ol.colorLike} color\n */\nol.style.FlowLine.prototype.setArrowColor = function(color) {\n  try {\n    this._acolor = ol.color.asString(color);\n  } catch(e) {\n    this._acolor = null;    \n  }\n};\n/** Get the current color at step\n * @param {ol.feature} feature\n * @param {number} step current drawing step beetween [0,1] \n * @return {string} \n */\nol.style.FlowLine.prototype.getColor = function(feature, step) {\n  if (this._colorFn) return ol.color.asString(this._colorFn(feature, step));\n  var color = this._color;\n  var color2 = this._color2 || this._color\n  return 'rgba('+\n          + Math.round(color[0] + (color2[0]-color[0]) * step) +','\n          + Math.round(color[1] + (color2[1]-color[1]) * step) +','\n          + Math.round(color[2] + (color2[2]-color[2]) * step) +','\n          + (color[3] + (color2[3]-color[3]) * step)\n          +')';\n};\n/** Get arrow\n */\nol.style.FlowLine.prototype.getArrow = function() {\n  return this._arrow;\n};\n/** Set arrow\n * @param {number} n -1 | 0 | 1 | 2, default: 0\n */\nol.style.FlowLine.prototype.setArrow = function(n) {\n  this._arrow = parseInt(n);\n  if (this._arrow < -1 || this._arrow > 2) this._arrow = 0;\n}\n/** getArrowSize\n * @return {ol.size}\n */\nol.style.FlowLine.prototype.getArrowSize = function() {\n  return this._arrowSize || [16,16];\n};\n/** setArrowSize\n * @param {number|ol.size} size\n */\nol.style.FlowLine.prototype.setArrowSize = function(size) {\n  if (Array.isArray(size)) this._arrowSize = size;\n  else if (typeof(size) === 'number') this._arrowSize = [size,size];\n};\n/** drawArrow\n * @param {CanvasRenderingContext2D} ctx \n * @param {ol.coordinate} p0 \n * @param ol.coordinate} p1 \n * @param {number} width \n * @param {number} ratio pixelratio\n * @private\n */\nol.style.FlowLine.prototype.drawArrow = function (ctx, p0, p1, width, ratio) {\n  var asize = this.getArrowSize()[0] * ratio;\n  var l = ol.coordinate.dist2d(p0, p1);\n  var dx = (p0[0]-p1[0])/l;\n  var dy = (p0[1]-p1[1])/l;\n  width = Math.max(this.getArrowSize()[1]/2, width/2) * ratio;\n  ctx.beginPath();\n  ctx.moveTo(p0[0],p0[1]);\n  ctx.lineTo(p0[0]-asize*dx+width*dy, p0[1]-asize*dy-width*dx);\n  ctx.lineTo(p0[0]-asize*dx-width*dy, p0[1]-asize*dy+width*dx);\n  ctx.lineTo(p0[0],p0[1]);\n  ctx.fill();\n};\n/** Renderer function\n * @param {Array<ol.coordinate>} geom The pixel coordinates of the geometry in GeoJSON notation\n * @param {ol.render.State} e The olx.render.State of the layer renderer\n */\nol.style.FlowLine.prototype._render = function(geom, e) {\n  if (e.geometry.getType()==='LineString') {\n    var i, g, p, ctx = e.context;\n    // Get geometry used at drawing\n    if (!this._visible) {\n      var a = e.pixelRatio / e.resolution;\n      var cos = Math.cos(e.rotation)\n      var sin = Math.sin(e.rotation)\n      g = e.geometry.getCoordinates();\n      var dx = geom[0][0] - g[0][0] * a *cos - g[0][1] * a *sin ;\n      var dy = geom[0][1] - g[0][0] * a * sin + g[0][1] * a * cos;\n      geom = [];\n      for (i=0; p=g[i]; i++) {\n        geom[i] = [\n          dx + p[0] * a * cos + p[1] * a * sin,\n          dy + p[0] * a * sin - p[1] * a * cos,\n          p[2]\n        ];\n      }\n    }\n    var asize = this.getArrowSize()[0] * e.pixelRatio;\n    ctx.save();\n      // Offsets\n      if (this.getOffset(0)) this._splitAsize(geom, this.getOffset(0) * e.pixelRatio)\n      if (this.getOffset(1)) this._splitAsize(geom, this.getOffset(1) * e.pixelRatio, true)\n      // Arrow 1\n      if (geom.length>1 && (this.getArrow()===-1 || this.getArrow()===2)) {\n        p = this._splitAsize(geom, asize);\n        if (this._acolor) ctx.fillStyle = this._acolor;\n        else ctx.fillStyle = this.getColor(e.feature, 0);\n        this.drawArrow(ctx, p[0], p[1], this.getWidth(e.feature, 0), e.pixelRatio);\n      }\n      // Arrow 2 \n      if (geom.length>1 && this.getArrow()>0) {\n        p = this._splitAsize(geom, asize, true);\n        if (this._acolor) ctx.fillStyle = this._acolor;\n        else ctx.fillStyle = this.getColor(e.feature, 1);\n        this.drawArrow(ctx, p[0], p[1], this.getWidth(e.feature, 1), e.pixelRatio);\n      }\n      // Split into\n      var geoms = this._splitInto(geom, 255, 2);\n      var k = 0;\n      var nb = geoms.length;\n      // Draw\n      ctx.lineJoin = 'round';\n      ctx.lineCap = this._lineCap || 'butt';\n      if (geoms.length > 1) {\n        for (k=0; k<geoms.length; k++) {\n          var step = k/nb;\n          g = geoms[k];\n          ctx.lineWidth = this.getWidth(e.feature, step) * e.pixelRatio;\n          ctx.strokeStyle = this.getColor(e.feature, step);\n          ctx.beginPath();\n          ctx.moveTo(g[0][0],g[0][1]);\n          for (i=1; p=g[i]; i++) {\n            ctx.lineTo(p[0],p[1]);\n          }\n          ctx.stroke();\n        }\n      }\n    ctx.restore();\n  }\n};\n/** Split extremity at\n * @param {ol.geom.LineString} geom\n * @param {number} asize\n * @param {boolean} end start=false or end=true, default false (start)\n */\nol.style.FlowLine.prototype._splitAsize = function(geom, asize, end) {\n  var p, p1, p0;\n  var dl, d = 0;\n  if (end) p0 = geom.pop();\n  else p0 = geom.shift();\n  p = p0;\n  while(geom.length) {\n    if (end) p1 = geom.pop();\n    else p1 = geom.shift();\n    dl = ol.coordinate.dist2d(p,p1);\n    if (d+dl > asize) {\n      p = [p[0]+(p1[0]-p[0])*(asize-d)/dl, p[1]+(p1[1]-p[1])*(asize-d)/dl];\n      dl = ol.coordinate.dist2d(p,p0);\n      if (end) {\n        geom.push(p1);\n        geom.push(p);\n        geom.push([p[0]+(p0[0]-p[0])/dl, p[1]+(p0[1]-p[1])/dl]);\n      } else {\n        geom.unshift(p1);\n        geom.unshift(p);\n        geom.unshift([p[0]+(p0[0]-p[0])/dl, p[1]+(p0[1]-p[1])/dl]);\n      }\n      break;\n    }\n    d += dl;\n    p = p1;\n  }\n  return [p0,p];\n};\n/** Split line geometry into equal length geometries\n * @param {Array<ol.coordinate>} geom\n * @param {number} nb number of resulting geometries, default 255\n * @param {number} nim minimum length of the resulting geometries, default 1\n */\nol.style.FlowLine.prototype._splitInto = function(geom, nb, min) {\n  var i, p;\n  // Split geom into equal length geoms\n  var geoms = [];\n  var dl, l = 0;\n  for (i=1; p=geom[i]; i++) {\n    l += ol.coordinate.dist2d(geom[i-1], p);\n  }\n  var length = Math.max (min||2, l/(nb||255));\n  var p0 = geom[0];\n  l = 0;\n  var g = [p0];\n  i = 1;\n  p = geom[1];\n  while (i < geom.length) {\n    var dx = p[0]-p0[0];\n    var dy = p[1]-p0[1];\n    dl = Math.sqrt(dx*dx + dy*dy);\n    if (l+dl > length) {\n      var d = (length-l) / dl;\n      g.push([ \n        p0[0] + dx * d,  \n        p0[1] + dy * d \n      ]);\n      geoms.push(g);\n      p0 =[ \n        p0[0] + dx * d*.9,  \n        p0[1] + dy * d*.9\n      ];\n      g = [p0];\n      l = 0;\n    } else {\n      l += dl;\n      p0 = p;\n      g.push(p0);\n      i++;\n      p = geom[i];\n    }\n  }\n  geoms.push(g);\n  return geoms;\n}\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc\n * A marker style to use with font symbols.\n *\n * @constructor\n * @param {} options Options.\n *  @param {number} options.glyph the glyph name or a char to display as symbol. \n *    The name must be added using the {@link ol.style.FontSymbol.addDefs} function.\n *  @param {string} options.form \n * \t  none|circle|poi|bubble|marker|coma|shield|blazon|bookmark|hexagon|diamond|triangle|sign|ban|lozenge|square\n * \t  a form that will enclose the glyph, default none\n *  @param {number} options.radius\n *  @param {number} options.rotation\n *  @param {number} options.rotateWithView\n *  @param {number} options.opacity\n *  @param {number} options.fontSize, default 1\n *  @param {string} options.fontStyle the font style (bold, italic, bold italic, etc), default none\n *  @param {boolean} options.gradient true to display a gradient on the symbol\n *  @param {_ol_style_Fill_} options.fill\n *  @param {_ol_style_Stroke_} options.stroke\n * @extends {ol.style.RegularShape}\n * @implements {ol.structs.IHasChecksum}\n * @api\n */\nol.style.FontSymbol = function(options) {\n  options = options || {};\n  var strokeWidth = 0;\n  if (options.stroke) {\n    strokeWidth = options.stroke.getWidth();\n  }\n  ol.style.RegularShape.call (this, { \n    radius: options.radius, \n    fill:options.fill,\n    rotation:options.rotation, \n    rotateWithView: options.rotateWithView \n  });\n  if (typeof(options.opacity)==\"number\") this.setOpacity(options.opacity);\n  this.color_ = options.color;\n  this.fontSize_ = options.fontSize || 1;\n  this.fontStyle_ = options.fontStyle || '';\n  this.stroke_ = options.stroke;\n  this.fill_ = options.fill;\n  this.radius_ = options.radius -strokeWidth;\n  this.form_ = options.form || \"none\";\n  this.gradient_ = options.gradient;\n  this.offset_ = [options.offsetX ? options.offsetX :0, options.offsetY ? options.offsetY :0];\n  this.glyph_ = this.getGlyph(options.glyph) || \"\";\n  this.renderMarker_();\n};\nol.ext.inherits(ol.style.FontSymbol, ol.style.RegularShape);\n/** Cool stuff to get the image symbol for a style\n*/\nol.style.Image.prototype.getImagePNG = function() {\n  var canvas = this.getImage();\n  if (canvas) {\n    try { return canvas.toDataURL(\"image/png\"); }\n    catch(e) { return false; }\n  } else {\n    return false;\n  }\n}\n/** \n *\tFont defs\n*/\nol.style.FontSymbol.prototype.defs = { 'fonts':{}, 'glyphs':{} };\n/** Static function : add new font defs \n * @param {String|Object} font the font desciption\n * @param {} glyphs a key / value list of glyph definitions. \n * \t\tEach key is the name of the glyph, \n * \t\tthe value is an object that code the font, the caracter code, \n * \t\tthe name and a search string for the glyph.\n */\nol.style.FontSymbol.addDefs = function(font, glyphs) {\n  var thefont = font;\n  if (typeof(font) == \"string\") thefont = {\"font\":font, \"name\":font, \"copyright\":\"\" };\n  if (!thefont.font || typeof(thefont.font) != \"string\") {\n    console.log(\"bad font def\");\n    return;\n  }\n  var fontname = thefont.font;\n  ol.style.FontSymbol.prototype.defs.fonts[fontname] = thefont;\n  for (var i in glyphs) {\n    var g = glyphs[i];\n    if (typeof(g) == \"string\" && g.length==1) g = { char: g };\n    ol.style.FontSymbol.prototype.defs.glyphs[i] = {\n      font: thefont.font,\n      char: g.char || \"\"+String.fromCharCode(g.code) || \"\",\n      theme: g.theme || thefont.name,\n      name: g.name || i,\n      search: g.search || \"\"\n    };\n  }\n};\n/**\n * Clones the style. \n * @return {ol.style.FontSymbol}\n */\nol.style.FontSymbol.prototype.clone = function() {\n  var g = new ol.style.FontSymbol({\n    glyph: \"\",\n    color: this.color_,\n    fontSize: this.fontSize_,\n    fontStyle: this.fontStyle_,\n    stroke: this.stroke_,\n    fill: this.fill_,\n    radius: this.radius_ + (this.stroke_ ? this.stroke_.getWidth():0),\n    form: this.form_,\n    gradient: this.gradient_,\n    offsetX: this.offset_[0],\n    offsetY: this.offset_[1],\n    opacity: this.getOpacity(),\n    rotation: this.getRotation(),\n    rotateWithView: this.getRotateWithView()\n  });\n  g.setScale(this.getScale());\n  g.glyph_ = this.glyph_;\n  g.renderMarker_();\n  return g;\n};\n/**\n * Get the fill style for the symbol.\n * @return {ol.style.Fill} Fill style.\n * @api\n */\nol.style.FontSymbol.prototype.getFill = function() {\n  return this.fill_;\n};\n/**\n * Get the stroke style for the symbol.\n * @return {_ol_style_Stroke_} Stroke style.\n * @api\n */\nol.style.FontSymbol.prototype.getStroke = function() {\n  return this.stroke_;\n};\n/**\n * Get the glyph definition for the symbol.\n * @param {string|undefined} name a glyph name to get the definition, default return the glyph definition for the style.\n * @return {_ol_style_Stroke_} Stroke style.\n * @api\n */\nol.style.FontSymbol.prototype.getGlyph = function(name) {\n  if (name) return ol.style.FontSymbol.prototype.defs.glyphs[name] || { \"font\":\"none\",\"char\":name.charAt(0),\"theme\":\"none\",\"name\":\"none\", \"search\":\"\"};\n  else return this.glyph_;\n};\n/**\n * Get the glyph name.\n * @return {string} the name\n * @api\n */\nol.style.FontSymbol.prototype.getGlyphName = function() {\n  for (var i in ol.style.FontSymbol.prototype.defs.glyphs) {\n    if (ol.style.FontSymbol.prototype.defs.glyphs[i] === this.glyph_) return i;\n  }\n  return \"\";\n};\n/**\n * Get the stroke style for the symbol.\n * @return {_ol_style_Stroke_} Stroke style.\n * @api\n */\nol.style.FontSymbol.prototype.getFontInfo = function(glyph) {\n  return ol.style.FontSymbol.prototype.defs.fonts[glyph.font];\n}\n/** @private\n */\nol.style.FontSymbol.prototype.renderMarker_ = function(pixelratio) {\n  if (!pixelratio) {\n    if (this.getPixelRatio) {\n      pixelratio = window.devicePixelRatio;\n      this.renderMarker_(pixelratio);\n      if (this.getPixelRatio && pixelratio!==1) this.renderMarker_(1); \n    } else {\n      this.renderMarker_(1);\n    }\n    return;\n  }\n  var strokeStyle;\n  var strokeWidth = 0;\n  if (this.stroke_) {\n    strokeStyle = ol.color.asString(this.stroke_.getColor());\n    strokeWidth = this.stroke_.getWidth();\n  }\n  // get canvas\n  var canvas = this.getImage(pixelratio);\n  //console.log(this.getImage().width+\" / \"+(2 * (this.radius_ + strokeWidth) + 1));\n  /** @type {ol.style.FontSymbol.RenderOptions} */\n  var renderOptions = {\n    strokeStyle: strokeStyle,\n    strokeWidth: strokeWidth,\n    size: canvas.width/pixelratio,\n  };\n  // draw the circle on the canvas\n  var context = (canvas.getContext('2d'));\n  context.clearRect(0, 0, canvas.width, canvas.height);\n  this.drawMarker_(renderOptions, context, 0, 0, pixelratio);\n  // Set Anchor\n  var a = this.getAnchor();\n  a[0] = canvas.width / 2 - this.offset_[0];\n  a[1] = canvas.width / 2 - this.offset_[1];\n  //this.createMarkerHitDetectionCanvas_(renderOptions);\n};\n/**\n * @private\n * @param {ol.style.FontSymbol.RenderOptions} renderOptions\n * @param {CanvasRenderingContext2D} context\n */\nol.style.FontSymbol.prototype.drawPath_ = function(renderOptions, context) {\n  var s = 2*this.radius_+renderOptions.strokeWidth+1;\n  var w = renderOptions.strokeWidth/2;\n  var c = renderOptions.size / 2;\n  // Transfo to place the glyph at the right place\n  var transfo = { fac:1, posX:renderOptions.size / 2, posY:renderOptions.size / 2 };\n  context.lineJoin = 'round';\n  context.beginPath();\n  // Draw the path with the form\n  switch (this.form_) {\n    case \"none\": {\n      transfo.fac=1;  \n      break;\n    }\n    case \"circle\":\n    case \"ban\": {\n      context.arc ( c, c, s/2, 0, 2 * Math.PI, true);\n      break;\n    }\n    case \"poi\": {\n      context.arc ( c, c -0.4*this.radius_, 0.6*this.radius_, 0.15*Math.PI, 0.85*Math.PI, true);\n      context.lineTo ( c-0.89*0.05*s, (0.95+0.45*0.05)*s+w);\n      context.arc ( c, 0.95*s+w, 0.05*s, 0.85*Math.PI, 0.15*Math.PI, true);\n      transfo = { fac:0.45, posX:c, posY:c -0.35*this.radius_ };\n      break;\n    }\n    case \"bubble\": {\n      context.arc ( c, c -0.2*this.radius_, 0.8*this.radius_, 0.4*Math.PI, 0.6*Math.PI, true);\n      context.lineTo ( 0.5*s+w, s+w);\n      transfo = { fac:0.7, posX:c, posY:c -0.2*this.radius_ };\n      break;\n    }\n    case \"marker\": {\n      context.arc ( c, c -0.2*this.radius_, 0.8*this.radius_, 0.25*Math.PI, 0.75*Math.PI, true);\n      context.lineTo ( 0.5*s+w, s+w);\n      transfo = { fac:0.7, posX: c, posY: c -0.2*this.radius_ };\n      break;\n    }\n    case \"coma\": {\n      context.moveTo ( c + 0.8*this.radius_, c -0.2*this.radius_);\n      context.quadraticCurveTo ( 0.95*s+w, 0.75*s+w, 0.5*s+w, s+w);\n      context.arc ( c, c -0.2*this.radius_, 0.8*this.radius_, 0.45*Math.PI, 0, false);\n      transfo = { fac:0.7, posX: c, posY: c -0.2*this.radius_ };\n      break;\n    }\n    default: {\n      var pts;\n      switch (this.form_) {\n        case \"shield\": {\n          pts = [ 0.05,0, 0.95,0, 0.95,0.8, 0.5,1, 0.05,0.8, 0.05,0 ]; \n          transfo.posY = 0.45*s+w ;\n          break;\n        }\n        case \"blazon\": {\n          pts = [ 0.1,0, 0.9,0, 0.9,0.8, 0.6,0.8, 0.5,1, 0.4,0.8, 0.1,0.8, 0.1,0 ]; \n          transfo.fac = 0.8;\n          transfo.posY = 0.4*s+w ;\n          break;\n        }\n        case \"bookmark\": {\n          pts = [ 0.05,0, 0.95,0, 0.95,1, 0.5,0.8, 0.05,1, 0.05,0 ]; \n          transfo.fac = 0.9;\n          transfo.posY = 0.4*s+w ;\n          break;\n        }\n        case \"hexagon\": {\n          pts = [ 0.05,0.2, 0.5,0, 0.95,0.2, 0.95,0.8, 0.5,1, 0.05,0.8, 0.05,0.2 ]; \n          transfo.fac = 0.9;\n          transfo.posY = 0.5*s+w ;\n          break;\n        }\n        case \"diamond\": {\n          pts = [ 0.25,0, 0.75,0, 1,0.2, 1,0.4, 0.5,1, 0,0.4, 0,0.2, 0.25,0 ]; \n          transfo.fac = 0.75 ;\n          transfo.posY = 0.35*s+w ;\n          break;\n        }\n        case \"triangle\": {\n          pts = [ 0,0, 1,0, 0.5,1, 0,0 ]; \n          transfo.fac = 0.6 ;\n          transfo.posY = 0.3*s+w ;\n          break;\n        }\n        case \"sign\": {\n          pts = [ 0.5,0.05, 1,0.95, 0,0.95, 0.5,0.05 ]; \n          transfo.fac = 0.7 ;\n          transfo.posY = 0.65*s+w ;\n          break;\n        }\n        case \"lozenge\": {\n          pts = [ 0.5,0, 1,0.5, 0.5,1, 0,0.5, 0.5,0 ]; \n          transfo.fac = 0.7;\n          break;\n        }\n        case \"square\": \n        default: {\n          pts = [ 0,0, 1,0, 1,1, 0,1, 0,0 ]; \n          break;\n        }\n      }\n      for (var i=0; i<pts.length; i+=2) context.lineTo ( pts[i]*s+w, pts[i+1]*s+w);\n    }\n  }\n  context.closePath();\n  return transfo;\n}\n/**\n * @private\n * @param {ol.style.FontSymbol.RenderOptions} renderOptions\n * @param {CanvasRenderingContext2D} context\n * @param {number} x The origin for the symbol (x).\n * @param {number} y The origin for the symbol (y).\n */\nol.style.FontSymbol.prototype.drawMarker_ = function(renderOptions, context, x, y, pixelratio) {\n  var fcolor = this.fill_ ? this.fill_.getColor() : \"#000\";\n  var scolor = this.stroke_ ? this.stroke_.getColor() : \"#000\";\n  if (this.form_ == \"none\" && this.stroke_ && this.fill_) {\n    scolor = this.fill_.getColor();\n    fcolor = this.stroke_.getColor();\n  }\n  // reset transform\n  context.setTransform(pixelratio, 0, 0, pixelratio, 0, 0);\n  // then move to (x, y)\n  context.translate(x, y);\n  var tr = this.drawPath_(renderOptions, context, pixelratio);\n  if (this.fill_) {\n    if (this.gradient_ && this.form_!=\"none\") {\n      var grd = context.createLinearGradient(0,0,renderOptions.size/2,renderOptions.size);\n      grd.addColorStop (1, ol.color.asString(fcolor));\n      grd.addColorStop (0, ol.color.asString(scolor));\n      context.fillStyle = grd;\n    } else {\n      context.fillStyle = ol.color.asString(fcolor);\n    }\n    context.fill();\n  }\n  if (this.stroke_ && renderOptions.strokeWidth) {\n    context.strokeStyle = renderOptions.strokeStyle;\n    context.lineWidth = renderOptions.strokeWidth;\n    context.stroke();\n  }\n  // Draw the symbol\n  if (this.glyph_.char) {\n    context.font = this.fontStyle_ +' '\n      + (2*tr.fac*(this.radius_)*this.fontSize_)+\"px \"\n      + this.glyph_.font;\n    context.strokeStyle = context.fillStyle;\n    context.lineWidth = renderOptions.strokeWidth * (this.form_ == \"none\" ? 2:1);\n    context.fillStyle = ol.color.asString(this.color_ || scolor);\n    context.textAlign = \"center\";\n    context.textBaseline = \"middle\";\n    var t = this.glyph_.char;\n    if (renderOptions.strokeWidth && scolor!=\"transparent\") context.strokeText(t, tr.posX, tr.posY);\n    context.fillText(t, tr.posX, tr.posY);\n  }\n  if (this.form_==\"ban\" && this.stroke_ && renderOptions.strokeWidth) {\n    context.strokeStyle = renderOptions.strokeStyle;\n    context.lineWidth = renderOptions.strokeWidth;\n    var r = this.radius_ + renderOptions.strokeWidth;\n    var d = this.radius_ * Math.cos(Math.PI/4);\n    context.moveTo(r + d, r - d);\n    context.lineTo(r - d, r + d);\n    context.stroke();\n  }\n};\n/**\n * @inheritDoc\n */\nol.style.FontSymbol.prototype.getChecksum = function() {\n  var strokeChecksum = (this.stroke_!==null) ? this.stroke_.getChecksum() : '-';\n  var fillChecksum = (this.fill_!==null) ? this.fill_.getChecksum() : '-';\n  var recalculate = (this.checksums_===null)\n    || (strokeChecksum != this.checksums_[1] \n    || fillChecksum != this.checksums_[2] \n    || this.radius_ != this.checksums_[3] \n    || this.form_+\"-\"+this.glyphs_ != this.checksums_[4]\n  );\n  if (recalculate) {\n    var checksum = 'c' + strokeChecksum + fillChecksum \n      + ((this.radius_ !== void 0) ? this.radius_.toString() : '-')\n      + this.form_+\"-\"+this.glyphs_;\n    this.checksums_ = [checksum, strokeChecksum, fillChecksum, this.radius_, this.form_+\"-\"+this.glyphs_];\n  }\n  return this.checksums_[0];\n};\n\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*\n*  Photo style for vector features\n*/\n/**\n * @classdesc\n * Set Photo style for vector features.\n *\n * @constructor\n * @param {} options\n *  @param { default | square | round | anchored | folio } options.kind\n *  @param {boolean} options.crop crop within square, default is false\n *  @param {Number} options.radius symbol size\n *  @param {boolean} options.shadow drop a shadow\n *  @param {ol.style.Stroke} options.stroke\n *  @param {String} options.src image src\n *  @param {String} options.crossOrigin The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you want to access pixel data with the Canvas renderer.\n *  @param {Number} options.offsetX Horizontal offset in pixels. Default is 0.\n *  @param {Number} options.offsetY Vertical offset in pixels. Default is 0.\n *  @param {function} options.onload callback when image is loaded (to redraw the layer)\n * @extends {ol.style.RegularShape}\n * @implements {ol.structs.IHasChecksum}\n * @api\n */\nol.style.Photo = function(options) {\n  options = options || {};\n  this.sanchor_ = options.kind==\"anchored\" ? 8:0;\n  this._shadow = (Number(options.shadow) || 0);\n  if (!options.stroke) {\n    options.stroke = new ol.style.Stroke({ width: 0, color: \"#000\"})\n  }\n  var strokeWidth = options.stroke.getWidth();\n  if (strokeWidth<0) strokeWidth = 0;\n  if (options.kind=='folio') strokeWidth += 6;\n  options.stroke.setWidth(strokeWidth);\n  ol.style.RegularShape.call (this, {\n    radius: options.radius + strokeWidth + this.sanchor_/2 + this._shadow/2, \n    points:0\n  //\tfill:new ol.style.Fill({color:\"red\"}) // No fill to create a hit detection Image\n  });\n  // Hack to get the hit detection Image (no API exported)\n  var img = this.getImage();\n  if (!this.hitDetectionCanvas_) {\n    for (var i in this) {\n      if (this[i] && this[i].getContext && this[i]!==img) {\n        this.hitDetectionCanvas_ = this[i];\n        break;\n      }\n    }\n  }\n  // Clone canvas for hit detection\n  this.hitDetectionCanvas_ = document.createElement('canvas');\n  this.hitDetectionCanvas_.width = img.width;\n  this.hitDetectionCanvas_.height = img.height;\n  this._stroke = options.stroke;\n  this._fill = options.fill;\n  this._crop = options.crop;\n  this._crossOrigin = options.crossOrigin;\n  this._kind = options.kind || \"default\";\n  this._radius = options.radius;\n  this._src = options.src;\n  this._offset = [options.offsetX ? options.offsetX :0, options.offsetY ? options.offsetY :0];\n  this._onload = options.onload;\n  if (typeof(options.opacity)=='number') this.setOpacity(options.opacity);\n  if (typeof(options.rotation)=='number') this.setRotation(options.rotation);\n  this.renderPhoto_();\n};\nol.ext.inherits(ol.style.Photo, ol.style.RegularShape);\n/** Set photo offset\n * @param {ol.pixel} offset\n */\nol.style.Photo.prototype.setOffset = function(offset) {\n  this._offset = [offset[0]||0, offset[1]||0];\n  this.renderPhoto_();\n};\n/**\n * Clones the style. \n * @return {ol.style.Photo}\n */\nol.style.Photo.prototype.clone = function() {\n  var i = new ol.style.Photo({\n    stroke: this._stroke,\n    fill: this._fill,\n    shadow: this._shadow,\n    crop: this._crop,\n    crossOrigin: this._crossOrigin,\n    kind: this._kind,\n    radius: this._radius,\n    src: this._src,\n    offsetX: this._offset[0],\n    offsetY: this._offset[1],\n    opacity: this.getOpacity(),\n    rotation: this.getRotation()\n  });\n  i.renderPhoto_();\n  return i;\n};\n/**\n * Draws a rounded rectangle using the current state of the canvas. \n * Draw a rectangle if the radius is null.\n * @param {Number} x The top left x coordinate\n * @param {Number} y The top left y coordinate \n * @param {Number} width The width of the rectangle \n * @param {Number} height The height of the rectangle\n * @param {Number} radius The corner radius.\n */\nCanvasRenderingContext2D.prototype.roundRect = function (x, y, w, h, r) {\n  if (!r) {\n    this.rect(x,y,w,h);\n  } else {\n    if (w < 2 * r) r = w / 2;\n    if (h < 2 * r) r = h / 2;\n    this.beginPath();\n    this.moveTo(x+r, y);\n    this.arcTo(x+w, y, x+w, y+h, r);\n    this.arcTo(x+w, y+h, x, y+h, r);\n    this.arcTo(x, y+h, x, y, r);\n    this.arcTo(x, y, x+w, y, r);\n    this.closePath();\n  }\n  return this;\n};\n/**\n * Draw the form without the image\n * @private\n */\nol.style.Photo.prototype.drawBack_ = function(context, color, strokeWidth, pixelratio) {\n  var shadow = this._shadow;\n  var canvas = context.canvas;\n  context.beginPath();\n  context.fillStyle = color;\n  context.clearRect(0, 0, canvas.width, canvas.height);\n  var width = canvas.width/pixelratio;\n  var height = canvas.height/pixelratio;\n  switch (this._kind) {\n    case 'square': {\n      context.rect(0,0, width-shadow, height-shadow);\n      break;\n    }\n    case 'circle': {\n      context.arc(this._radius+strokeWidth, this._radius+strokeWidth, this._radius+strokeWidth, 0, 2 * Math.PI, false);\n      break;\n    }\n    case 'folio': {\n      var offset = 6;\n      strokeWidth -= offset;\n      context.strokeStyle = 'rgba(0,0,0,0.5)';\n      context.lineWidth = 1;\n      var w = width-shadow-2*offset;\n      var a = Math.atan(6/w);\n      context.save();\n      context.rotate(-a);\n      context.translate(-6,2);\n      context.beginPath();\n      context.rect(offset,offset,w,w);\n      context.stroke();\n      context.fill();\n      context.restore();\n      context.save();\n      context.translate(6,-1);\n      context.rotate(a);\n      context.beginPath();\n      context.rect(offset,offset,w,w);\n      context.stroke();\n      context.fill();\n      context.restore();\n      context.beginPath();\n      context.rect(offset,offset,w,w);\n      context.stroke();\n      break;\n    }\n    case 'anchored': {\n      context.roundRect(this.sanchor_/2,0,width-this.sanchor_-shadow, height-this.sanchor_-shadow, strokeWidth);\n      context.moveTo(width/2-this.sanchor_-shadow/2,height-this.sanchor_-shadow);\n      context.lineTo(width/2+this.sanchor_-shadow/2,height-this.sanchor_-shadow);\n      context.lineTo(width/2-shadow/2,height-shadow);break;\n    }\n    default: {\n      // roundrect\n      context.roundRect(0,0,width-shadow, height-shadow, strokeWidth);\n      break;\n    }\n  }\n  context.closePath();\n};\n/**\n * @private\n */\nol.style.Photo.prototype.renderPhoto_ = function(pixelratio) {\n  if (!pixelratio) {\n    if (this.getPixelRatio) {\n      pixelratio = window.devicePixelRatio;\n      this.renderPhoto_(pixelratio);\n    } else {\n      this.renderPhoto_(1);\n    }\n    return;\n  }\n  var strokeStyle;\n  var strokeWidth = 0;\n  if (this._stroke) {\n    strokeStyle = ol.color.asString(this._stroke.getColor());\n    strokeWidth = this._stroke.getWidth();\n  }\n  var canvas = this.getImage(pixelratio);\n  // Draw hitdetection image\n  var context = this.hitDetectionCanvas_.getContext('2d');\n  this.drawBack_(context,\"#000\",strokeWidth, 1);\n  context.fill();\n  // Draw the image\n  context = canvas.getContext('2d');\n  context.save();\n  context.setTransform(pixelratio, 0, 0, pixelratio, 0, 0);\n  this.drawBack_(context,strokeStyle,strokeWidth, pixelratio);\n  // Draw a shadow\n  if (this._shadow) {\n    context.shadowColor = 'rgba(0,0,0,0.5)';\n    context.shadowBlur = pixelratio*this._shadow/2;\n    context.shadowOffsetX = pixelratio*this._shadow/2;\n    context.shadowOffsetY = pixelratio*this._shadow/2;\n  }\n  context.fill();\n  context.restore();\n  var self = this;\n  var img = this.img_ = new Image();\n  if (this._crossOrigin) img.crossOrigin = this._crossOrigin;\n  img.src = this._src;\n  // Draw image\n  if (img.width) {\n    self.drawImage_(img);\n  } else {\n    img.onload = function() {\n      self.drawImage_(img);\n      // Force change (?!)\n      // self.setScale(1);\n      if (self._onload) self._onload();\n    };\n  }\n  // Set anchor\n  var a = this.getAnchor();\n  a[0] = (canvas.width/pixelratio - this._shadow)/2  - this._offset[0];\n  if (this.sanchor_) {\n    a[1] = canvas.height/pixelratio - this._shadow - this._offset[1];\n  } else {\n    a[1] = (canvas.height/pixelratio - this._shadow)/2 - this._offset[1];\n  }\n};\n/**\n * Draw an timage when loaded\n * @private\n */\nol.style.Photo.prototype.drawImage_ = function(img) {\n  var pixelratio = window.devicePixelRatio;\n  var canvas = this.getImage(pixelratio);\n  // Remove the circle on the canvas\n  var context = (canvas.getContext('2d'));\n  var strokeWidth = 0;\n  if (this._stroke) strokeWidth = this._stroke.getWidth();\n  var size = 2*this._radius;\n  context.save();\n  if (this._kind=='circle') {\n    context.beginPath();\n    context.arc(this._radius+strokeWidth, this._radius+strokeWidth, this._radius, 0, 2 * Math.PI, false);\n    context.clip();\n  }\n  var s, x, y, w, h, sx, sy, sw, sh;\n  // Crop the image to a square vignette\n  if (this._crop) {\n    s = Math.min (img.width/size, img.height/size);\n    sw = sh = s*size;\n    sx = (img.width-sw)/2;\n    sy = (img.height-sh)/2;\n    x = y = 0;\n    w = h = size+1;\n  } else {\n    // Fit the image to the size\n    s = Math.min (size/img.width, size/img.height);\n    sx = sy = 0;\n    sw = img.width;\n    sh = img.height;\n    w = s*sw;\n    h = s*sh;\n    x = (size-w)/2;\n    y = (size-h)/2;\n  }\n  x += strokeWidth + this.sanchor_/2;\n  y += strokeWidth;\n  context.drawImage(img, sx, sy, sw, sh, x, y, w, h);\n  context.restore();\n  // Draw a circle to avoid aliasing on clip\n  if (this._kind=='circle' && strokeWidth) {\n    context.beginPath();\n    context.strokeStyle = ol.color.asString(this._stroke.getColor());\n    context.lineWidth = strokeWidth/4;\n    context.arc(this._radius+strokeWidth, this._radius+strokeWidth, this._radius, 0, 2 * Math.PI, false);\n    context.stroke();\n  }\n};\n\n/*\tCopyright (c) 2019 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/** Profile style\n * Draw a profile on the map\n * @extends {ol.style.Style}\n * @constructor\n * @param {Object} options\n *  @param {ol.style.Stroke} options.stroke \n *  @param {ol.style.Fill} options.fill \n *  @param {number} options.scale z scale \n *  @param {number} options.zIndex \n *  @param {ol.geom.Geometry} options.geometry \n */\nol.style.Profile = function(options) {\n  if (!options) options = {};\n  ol.style.Style.call (this, { \n    renderer: this._render.bind(this),\n    zIndex: options.zIndex,\n    geometry: options.geometry\n  });\n  this.setStroke(options.stroke);\n  this.setFill(options.fill);\n  this.setScale(options.scale);\n};\nol.ext.inherits(ol.style.Profile, ol.style.Style);\n/** Set style stroke\n * @param {ol.style.Stroke}\n */\nol.style.Profile.prototype.setStroke = function(stroke) {\n  this._stroke = stroke || new ol.style.Stroke({ color: '#fff', width: 1 });\n}\n/** Get style stroke\n * @return {ol.style.Stroke}\n */\nol.style.Profile.prototype.getStroke = function() {\n  return this._stroke;\n}\n/** Set style stroke\n * @param {ol.style.Fill}\n */\nol.style.Profile.prototype.setFill = function(fill) {\n  this._fill = fill || new ol.style.Fill({ color: 'rgba(255,255,255,.3' });\n}\n/** Get style stroke\n * @return {ol.style.Fill}\n */\nol.style.Profile.prototype.getFill = function() {\n  return this._fill;\n}\n/** Set z scale\n * @param {number}\n */\nol.style.Profile.prototype.setScale = function(sc) {\n  this._scale = sc || .2;\n}\n/** Get z scale\n * @return {number}\n */\nol.style.Profile.prototype.getScale = function() {\n  return this._scale;\n}\n/** Renderer function\n * @param {Array<ol.coordinate>} geom The pixel coordinates of the geometry in GeoJSON notation\n * @param {ol.render.State} e The olx.render.State of the layer renderer\n */\nol.style.Profile.prototype._render = function(geom, e) {\n  if (!/Z/.test(e.feature.getGeometry().getLayout())) return;\n  var g = e.geometry.getCoordinates();\n  switch (e.geometry.getType()) {\n    case 'LineString': {\n      this._renderLine(geom, g, e.feature.getGeometry(), e);\n      break;\n    }\n    case 'MultiLineString': {\n      e.feature.getGeometry().getLineStrings().forEach(function(l, i) {\n        this._renderLine(geom[i], g[i], l, e);\n      }.bind(this));\n      break;\n    }\n    case 'Point': {\n      break;\n    }\n  }\n};\n/** @private */\nol.style.Profile.prototype._renderLine = function(geom, g, l, e) {\n  var i, p, ctx = e.context;\n  var cos = Math.cos(e.rotation)\n  var sin = Math.sin(e.rotation)\n  var a = e.pixelRatio / e.resolution;\n  var dx = geom[0][0] - g[0][0] * a *cos - g[0][1] * a *sin ;\n  var dy = geom[0][1] - g[0][0] * a * sin + g[0][1] * a * cos;\n  geom = l.getCoordinates();\n  var dz = Infinity;\n  for (i=0; p=geom[i]; i++) {\n    var x = dx + p[0] * a * cos + p[1] * a * sin;\n    var y = dy + p[0] * a * sin - p[1] * a * cos;\n    dz = Math.min(dz, p[2]);\n    geom[i] = [x, y, p[2]];\n  }\n  ctx.save();\n    ctx.fillStyle = ol.color.asString(this.getFill().getColor());\n    ctx.strokeStyle = ol.color.asString(this.getStroke().getColor());\n    ctx.strokeWidth = this.getStroke().getWidth();\n    var p0 = geom[0];\n    var ez = this.getScale() * e.pixelRatio;\n    for (i=1; p=geom[i]; i++) {\n      ctx.beginPath();\n      ctx.moveTo(p0[0],p0[1]);\n      ctx.lineTo(p[0],p[1]);\n      ctx.lineTo(p[0],p[1]-(p[2]-dz)*ez);\n      ctx.lineTo(p0[0],p0[1]-(p0[2]-dz)*ez);\n      ctx.lineTo(p0[0],p0[1]);\n      ctx.fill();\n      p0 = p;\n    }\n    p0 = geom[0];\n    ctx.beginPath();\n    ctx.moveTo(p0[0],p0[1]-(p0[2]-dz)*ez);\n    for (i=1; p=geom[i]; i++) {\n      ctx.lineTo(p[0],p[1]-(p[2]-dz)*ez);\n    }\n    ctx.stroke();\n  ctx.restore();\n};\n\n/** Add a setTextPath style to draw text along linestrings\n@toto letterpadding/spacing, wordpadding/spacing\n*/\n(function()\n{\n/** Internal drawing function called on postcompose\n* @param {ol.eventPoscompose} e postcompose event\n*/\nfunction drawTextPath (e)\n{\t// Prent drawing at large resolution\n\tif (e.frameState.viewState.resolution > this.textPathMaxResolution_) return;\n\tvar extent = e.frameState.extent;\n\tvar c2p = e.frameState.coordinateToPixelTransform;\n\t// Get pixel path with coordinates\n\tvar k;\n\tfunction getPath(c, readable)\n\t{\tvar path1 = [];\n\t\tfor (k=0; k<c.length; k++) \n\t\t{\tpath1.push(c2p[0]*c[k][0]+c2p[1]*c[k][1]+c2p[4]);\n\t\t\tpath1.push(c2p[2]*c[k][0]+c2p[3]*c[k][1]+c2p[5]);\n\t\t}\n\t\t// Revert line ?\n\t\tif (readable && path1[0]>path1[path1.length-2])\n\t\t{\tvar path2 = [];\n\t\t\tfor (k=path1.length-2; k>=0; k-=2)\n\t\t\t{\tpath2.push(path1[k]);\n\t\t\t\tpath2.push(path1[k+1]);\n\t\t\t}\n\t\t\treturn path2;\n\t\t}\n\t\telse return path1;\n\t}\n\tvar ctx = e.context;\n\tctx.save();\n\tctx.scale(e.frameState.pixelRatio,e.frameState.pixelRatio);\n\tvar features = this.getSource().getFeaturesInExtent(extent);\n\tfor (var i=0, f; f=features[i]; i++)\n\t{\t{\tvar style = this.textPathStyle_(f,e.frameState.viewState.resolution);\n\t\t\tfor (var s,j=0; s=style[j]; j++)\n\t\t\t{\t\n\t\t\t\tvar g = s.getGeometry() || f.getGeometry();\n\t\t\t\tvar c;\n\t\t\t\tswitch (g.getType())\n\t\t\t\t{\tcase \"LineString\": c = g.getCoordinates(); break;\n\t\t\t\t\tcase \"MultiLineString\": c = g.getLineString(0).getCoordinates(); break;\n\t\t\t\t\tdefault: continue;\n\t\t\t\t}\n\t\t\t\tvar st = s.getText();\n\t\t\t\tvar path = getPath(c, st.getRotateWithView() );\n\t\t\t\tctx.font = st.getFont();\n\t\t\t\tctx.textBaseline = st.getTextBaseline();\n\t\t\t\tctx.textAlign = st.getTextAlign();\n\t\t\t\tctx.lineWidth = st.getStroke() ? (st.getStroke().getWidth()||0) : 0;\n\t\t\t\tctx.strokeStyle = st.getStroke() ? (st.getStroke().getColor()||\"#fff\") : \"#fff\";\n\t\t\t\tctx.fillStyle = st.getFill() ? st.getFill().getColor()||\"#000\" : \"#000\";\n\t\t\t\t// New params\n\t\t\t\tctx.textJustify = st.getTextAlign()==\"justify\";\n\t\t\t\tctx.textOverflow = st.getTextOverflow ? st.getTextOverflow():\"\";\n\t\t\t\tctx.minWidth = st.getMinWidth ? st.getMinWidth():0;\n\t\t\t\t// Draw textpath\n\t\t\t\tctx.textPath(st.getText()||f.get(\"name\"), path);\n\t\t\t}\n\t\t}\n\t}\n\tctx.restore();\n}\n/** Set the style for features. \n*\tThis can be a single style object, an array of styles, or a function that takes a feature and resolution and \n*\treturns an array of styles. If it is undefined the default style is used. \n*\tIf it is null the layer has no style (a null style). \n*\tSee ol.style for information on the default style.\n*\t@param {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction} style\n*\t@param {Number} maxResolution to display text, default: 0\n*/\nol.layer.Vector.prototype.setTextPathStyle = function(style, maxResolution)\n{\n\t// Remove existing style\n\tif (style===null)\n\t{\tif (this.textPath_) this.unByKey(this.textPath_);\n\t\tthis.textPath_ = null;\n\t\tthis.changed();\n\t\treturn;\n\t}\n\t// New postcompose\n\tif (!this.textPath_)\n\t{\tthis.textPath_ = this.on(['postcompose','postrender'], drawTextPath.bind(this));\n\t}\n\t// Set textPathStyle\n\tif (style===undefined)\n\t{\tstyle = [ new ol.style.Style({ text: new ol.style.Text()}) ];\n\t}\n\tif (typeof(style) == \"function\") this.textPathStyle_ = style;\n\telse this.textPathStyle_ = function() { return style; };\n\tthis.textPathMaxResolution_ = Number(maxResolution) || Number.MAX_VALUE;\n\t// Force redraw\n\tthis.changed();\n}\n/** Add new properties to ol.style.Text\n* to use with ol.layer.Vector.prototype.setTextPathStyle\n* @constructor\n* @param {} options\n*\t@param {visible|ellipsis|string} textOverflow\n*\t@param {number} minWidth minimum width (px) to draw text, default 0\n*/\nol.style.TextPath = function(options)\n{\tif (!options) options={};\n\tol.style.Text.call (this, options);\n\tthis.textOverflow_ = typeof(options.textOverflow)!=\"undefined\" ?  options.textOverflow : \"visible\";\n\tthis.minWidth_ = options.minWidth || 0;\n}\nol.ext.inherits(ol.style.TextPath, ol.style.Text);\nol.style.TextPath.prototype.getTextOverflow = function()\n{\treturn this.textOverflow_; \n};\nol.style.TextPath.prototype.getMinWidth = function()\n{\treturn this.minWidth_; \n};\n/**/\n})();\n/** CanvasRenderingContext2D: draw text along path\n* @param {string} text\n* @param {Array<Number>} path\n*/\nCanvasRenderingContext2D.prototype.textPath = function (text, path)\n{\n\tvar ctx = this;\n\tfunction dist2D(x1,y1,x2,y2)\n\t{\tvar dx = x2-x1;\n\t\tvar dy = y2-y1;\n\t\treturn Math.sqrt(dx*dx+dy*dy);\n\t}\n\tvar di, dpos=0;\n\tvar pos=2;\n\tfunction getPoint(path, dl)\n\t{\tif (!di || dpos+di<dl)\n\t\t{ for (; pos<path.length; )\n\t\t\t{\tdi = dist2D(path[pos-2],path[pos-1],path[pos],path[pos+1]);\n\t\t\t\tif (dpos+di>dl) break;\n\t\t\t\tpos += 2;\n\t\t\t\tif (pos>=path.length) break;\n\t\t\t\tdpos += di;\n\t\t\t}\n\t\t}\n\t\tvar x, y, a, dt = dl-dpos;\n\t\tif (pos>=path.length) \n\t\t{\tpos = path.length-2;\n\t\t}\n\t\tif (!dt) \n\t\t{\tx = path[pos-2];\n\t\t\ty = path[pos-1];\n\t\t\ta = Math.atan2(path[pos+1]-path[pos-1], path[pos]-path[pos-2]);\n\t\t}\n\t\telse\n\t\t{\tx = path[pos-2]+ (path[pos]-path[pos-2])*dt/di;\n\t\t\ty = path[pos-1]+(path[pos+1]-path[pos-1])*dt/di;\n\t\t\ta = Math.atan2(path[pos+1]-path[pos-1], path[pos]-path[pos-2]);\n\t\t}\n\t\treturn [x,y,a];\n\t}\n\tvar letterPadding = ctx.measureText(\" \").width *0.25;\n\tvar start = 0;\n\tvar d = 0;\n\tfor (var i=2; i<path.length; i+=2)\n\t{\td += dist2D(path[i-2],path[i-1],path[i],path[i+1])\n\t}\n\tif (d < ctx.minWidth) return;\n\tvar nbspace = text.split(\" \").length -1;\n\t// Remove char for overflow\n\tif (ctx.textOverflow != \"visible\")\n\t{\tif (d < ctx.measureText(text).width + (text.length-1 + nbspace) * letterPadding)\n\t\t{\tvar overflow = (ctx.textOverflow==\"ellipsis\") ? '\\u2026' : ctx.textOverflow;\n\t\t\tdo\n\t\t\t{\tnbspace = text.split(\" \").length -1;\n\t\t\t\ttext = text.slice(0,text.length-1);\n\t\t\t} while (text && d < ctx.measureText(text+overflow).width + (text.length + overflow.length-1 + nbspace) * letterPadding)\n\t\t\ttext += overflow;\n\t\t}\n\t}\n\tswitch (ctx.textJustify || ctx.textAlign)\n\t{\tcase true: // justify\n\t\tcase \"center\":\n\t\tcase \"end\":\n\t\tcase \"right\":\n\t\t{\t// Text align\n\t\t\tif (ctx.textJustify) \n\t\t\t{\tstart = 0;\n\t\t\t\tletterPadding = (d - ctx.measureText(text).width) / (text.length-1 + nbspace);\n\t\t\t}\n\t\t\telse\n\t\t\t{\tstart = d - ctx.measureText(text).width - (text.length + nbspace) * letterPadding;\n\t\t\t\tif (ctx.textAlign == \"center\") start /= 2;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: break;\n\t}\n\tfor (var t=0; t<text.length; t++)\n\t{\tvar letter = text[t];\n\t\tvar wl = ctx.measureText(letter).width;\n\t\tvar p = getPoint(path, start+wl/2);\n\t\tctx.save();\n\t\tctx.textAlign = \"center\";\n\t\tctx.translate(p[0], p[1]);\n\t\tctx.rotate(p[2]);\n\t\tif (ctx.lineWidth) ctx.strokeText(letter,0,0);\n\t\tctx.fillText(letter,0,0);\n\t\tctx.restore();\n\t\tstart += wl+letterPadding*(letter==\" \"?2:1);\n\t}\n};\n//NB: (Not confirmed)To use this module, you just have to :\n//   import('ol-ext/layer/getpreview')\n/*\tCopyright (c) 2015 Jean-Marc VIGLINO, \n  released under the CeCILL-B license (French BSD license)\n  (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*\n*  Shadow image style for point vector features\n*/\n/**\n * @classdesc\n * Set Shadow style for point vector features.\n *\n * @constructor\n * @param {} options Options.\n *  @param {ol.style.Fill | undefined} options.fill fill style, default rgba(0,0,0,0.5)\n *  @param {number} options.radius point radius\n * \t@param {number} options.blur lur radius, default radius/3\n * \t@param {number} options.offsetX x offset, default 0\n * \t@param {number} options.offsetY y offset, default 0\n * @extends {ol.style.RegularShape}\n * @api\n */\nol.style.Shadow = function(options) {\n  options = options || {};\n  if (!options.fill) options.fill = new ol.style.Fill({ color: \"rgba(0,0,0,0.5)\" });\n  ol.style.RegularShape.call (this,{ radius: options.radius, fill: options.fill });\n  this._fill = options.fill;\n  this._radius = options.radius;\n  this._blur = options.blur===0 ? 0 : options.blur || options.radius/3;\n  this._offset = [options.offsetX ? options.offsetX : 0, options.offsetY ? options.offsetY : 0];\n  this.renderShadow_();\n};\nol.ext.inherits(ol.style.Shadow, ol.style.RegularShape);\n/**\n * Clones the style. \n * @return {ol.style.Shadow}\n */\nol.style.Shadow.prototype.clone = function() {\n  var s = new ol.style.Shadow({\n    fill: this._fill,\n    radius: this._radius,\n    blur: this._blur,\n    offsetX: this._offset[0],\n    offsetY: this._offset[1]\n  });\n  s.setScale(this.getScale());\n  s.setOpacity(this.getOpacity());\n  return s;\n};\n/**\n * @private\n */\nol.style.Shadow.prototype.renderShadow_ = function(pixelratio) {\t\n  if (!pixelratio) {\n    if (this.getPixelRatio) {\n      pixelratio = window.devicePixelRatio;\n      this.renderShadow_(pixelratio);\n      if (this.getPixelRatio && pixelratio!==1) this.renderShadow_(1); \n    } else {\n      this.renderShadow_(1);\n    }\n    return;\n  }\n  var radius = this._radius;\n  var canvas = this.getImage(pixelratio);\n  // Remove the circle on the canvas\n  var context = (canvas.getContext('2d'));\n  context.clearRect(0, 0, canvas.width, canvas.height);\n  context.save();\n  context.beginPath();\n    context.setTransform(pixelratio, 0, 0, pixelratio, 0, 0);\n    context.scale(1,0.5);\n    context.arc(radius, -radius, radius-this._blur, 0, 2 * Math.PI, false);\n    context.fillStyle = '#000';\n    context.shadowColor = this._fill.getColor();\n    context.shadowBlur = 0.7*this._blur*pixelratio;\n    context.shadowOffsetX = 0;\n    context.shadowOffsetY = 1.5*radius*pixelratio;\n  context.closePath();\n  context.fill();\n  context.shadowColor = 'transparent';\n  context.restore();\n  // Set anchor\n  var a = this.getAnchor();\n  a[0] = canvas.width /2 - this._offset[0];\n  a[1] = canvas.height /2 - this._offset[1];\n}\n\n/*\tCopyright (c) 2018 Jean-Marc VIGLINO, \n\treleased under the CeCILL-B license (French BSD license)\n\t(http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * @classdesc\n * Stroke style with named pattern\n *\n * @constructor\n * @param {any}  options\n *\t@param {ol.style.Image|undefined} options.image an image pattern, image must be preloaded to draw on first call\n *\t@param {number|undefined} options.opacity opacity with image pattern, default:1\n *\t@param {olx.style.fillPattern} options.pattern pattern name (override by image option)\n *\t@param {ol.colorLike} options.color pattern color\n *\t@param {ol.style.Fill} options.fill fill color (background)\n *\t@param {number} options.offset pattern offset for hash/dot/circle/cross pattern\n *\t@param {number} options.size line size for hash/dot/circle/cross pattern\n *\t@param {number} options.spacing spacing for hash/dot/circle/cross pattern\n *\t@param {number|bool} options.angle angle for hash pattern / true for 45deg dot/circle/cross\n *\t@param {number} options.scale pattern scale \n * @extends {ol.style.Fill}\n * @implements {ol.structs.IHasChecksum}\n * @api\n */\nol.style.StrokePattern = function(options)\n{\tif (!options) options = {};\n\tvar pattern, i;\n\tvar canvas = this.canvas_ = document.createElement('canvas');\n\tvar scale = Number(options.scale)>0 ? Number(options.scale) : 1;\n\tvar ratio = scale*ol.has.DEVICE_PIXEL_RATIO || ol.has.DEVICE_PIXEL_RATIO;\n\tvar ctx = canvas.getContext('2d');\n\tif (options.image)\n\t{\toptions.image.load();\n\t\tvar img = options.image.getImage();\n\t\tif (img.width)\n\t\t{\tcanvas.width = Math.round(img.width *ratio);\n\t\t\tcanvas.height = Math.round(img.height *ratio);\n\t\t\tctx.globalAlpha = typeof(options.opacity) == 'number' ? options.opacity:1;\n\t\t\tctx.drawImage(img, 0,0, img.width, img.height, 0, 0, canvas.width, canvas.height);\n\t\t\tpattern = ctx.createPattern(canvas, 'repeat');\n\t\t}\n\t\telse \n\t\t{\tvar self = this;\n\t\t\tpattern = [0,0,0,0];\n\t\t\timg.onload = function ()\n\t\t\t{\tcanvas.width = Math.round(img.width *ratio);\n\t\t\t\tcanvas.height = Math.round(img.height *ratio);\n\t\t\t\tctx.globalAlpha = typeof(options.opacity) == 'number' ? options.opacity:1;\n\t\t\t\tctx.drawImage(img, 0,0, img.width, img.height, 0, 0, canvas.width, canvas.height);\n\t\t\t\tpattern = ctx.createPattern(canvas, 'repeat');\n\t\t\t\tself.setColor(pattern);\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\tvar pat = this.getPattern_(options);\n\t\tcanvas.width = Math.round(pat.width *ratio);\n\t\tcanvas.height = Math.round(pat.height *ratio);\n\t\tctx.beginPath();\n\t\tif (options.fill) \n\t\t{\tctx.fillStyle = ol.color.asString(options.fill.getColor());\n\t\t\tctx.fillRect(0,0, canvas.width, canvas.height);\n\t\t}\n\t\tctx.scale(ratio,ratio);\n\t\tctx.lineCap = \"round\";\n\t\tctx.lineWidth = pat.stroke || 1;\n\t\tctx.fillStyle = ol.color.asString(options.color||\"#000\");\n\t\tctx.strokeStyle = ol.color.asString(options.color||\"#000\");\n\t\tif (pat.circles) for (i=0; i<pat.circles.length; i++)\n\t\t{\tvar ci = pat.circles[i]; \n\t\t\tctx.beginPath();\n\t\t\tctx.arc(ci[0], ci[1], ci[2], 0,2*Math.PI);\n\t\t\tif (pat.fill) ctx.fill();\n\t\t\tif (pat.stroke) ctx.stroke();\n\t\t}\n\t\tif (!pat.repeat) pat.repeat=[[0,0]];\n\t\tif (pat.char)\n\t\t{\tctx.font = pat.font || (pat.width)+\"px Arial\";\n\t\t\tctx.textAlign = 'center';\n\t\t\tctx.textBaseline = 'middle';\n\t\t\tif (pat.angle) \n\t\t\t{\tctx.fillText(pat.char, pat.width/4, pat.height/4);\n\t\t\t\tctx.fillText(pat.char, 5*pat.width/4, 5*pat.height/4);\n\t\t\t\tctx.fillText(pat.char, pat.width/4, 5*pat.height/4);\n\t\t\t\tctx.fillText(pat.char, 5*pat.width/4, pat.height/4);\n\t\t\t\tctx.fillText(pat.char, 3*pat.width/4, 3*pat.height/4);\n\t\t\t\tctx.fillText(pat.char, -pat.width/4, -pat.height/4);\n\t\t\t\tctx.fillText(pat.char, 3*pat.width/4, -pat.height/4);\n\t\t\t\tctx.fillText(pat.char, -pat.width/4, 3*pat.height/4);\n\t\t\t}\n\t\t\telse ctx.fillText(pat.char, pat.width/2, pat.height/2);\n\t\t}\n\t\tif (pat.lines) for (i=0; i<pat.lines.length; i++) for (var r=0; r<pat.repeat.length; r++)\n\t\t{\tvar li = pat.lines[i];\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(li[0]+pat.repeat[r][0],li[1]+pat.repeat[r][1]);\n\t\t\tfor (var k=2; k<li.length; k+=2)\n\t\t\t{\tctx.lineTo(li[k]+pat.repeat[r][0],li[k+1]+pat.repeat[r][1]);\n\t\t\t}\n\t\t\tif (pat.fill) ctx.fill();\n\t\t\tif (pat.stroke) ctx.stroke();\n\t\t\tctx.save()\n\t\t\tctx.strokeStyle = 'red';\n\t\t\tctx.strokeWidth = 0.1;\n\t\t\t//ctx.strokeRect(0,0,canvas.width,canvas.height);\n\t\t\tctx.restore()\n\t\t}\n\t\tpattern = ctx.createPattern(canvas, 'repeat');\n\t\tif (options.offset)\n\t\t{\tvar offset = options.offset;\n\t\t\tif (typeof(offset) == \"number\") offset = [offset,offset];\n\t\t\tif (offset instanceof Array) \n\t\t\t{\tvar dx = Math.round((offset[0]*ratio));\n\t\t\t\tvar dy = Math.round((offset[1]*ratio));\n\t\t\t\t// New pattern\n\t\t\t\tctx.scale(1/ratio,1/ratio)\n\t\t\t\tctx.clearRect(0,0,canvas.width,canvas.height);\n\t\t\t\tctx.translate(dx,dy);\n\t\t\t\tctx.fillStyle = pattern;\n\t\t\t\tctx.fillRect(-dx, -dy, canvas.width,canvas.height);\n\t\t\t\tpattern = ctx.createPattern(canvas, 'repeat');\n\t\t\t}\n\t\t}\n\t}\n\toptions.color = pattern;\n\tol.style.Stroke.call (this, options);\n};\nol.ext.inherits(ol.style.StrokePattern, ol.style.Stroke);\n/**\n * Clones the style. \n * @return {ol.style.StrokePattern}\n */\nol.style.StrokePattern.prototype.clone = function() {\n\tvar s = ol.style.Fill.prototype.clone.call(this);\n\ts.canvas_ = this.canvas_;\n\treturn s;\n};\n/** Get canvas used as pattern\n*\t@return {canvas}\n*/\nol.style.StrokePattern.prototype.getImage = function()\n{\treturn this.canvas_;\n}\n/** Get pattern\n*\t@param {olx.style.FillPatternOption}\n*/\nol.style.StrokePattern.prototype.getPattern_ = function(options)\n{\tvar pat = ol.style.FillPattern.prototype.patterns[options.pattern]\n\t\t|| ol.style.FillPattern.prototype.patterns.dot;\n\tvar d = Math.round(options.spacing)||10;\n\tvar size;\n//\tvar d2 = Math.round(d/2)+0.5;\n\tswitch (options.pattern)\n\t{\tcase 'dot':\n\t\tcase 'circle':\n\t\t{\tsize = options.size===0 ? 0 : options.size/2 || 2;\n\t\t\tif (!options.angle)\n\t\t\t{\tpat.width = pat.height = d;\n\t\t\t\tpat.circles = [[ d/2, d/2, size ]]\n\t\t\t\tif (options.pattern=='circle')\n\t\t\t\t{\tpat.circles = pat.circles.concat([\n\t\t\t\t\t\t[ d/2+d, d/2, size ],\n\t\t\t\t\t\t[ d/2-d, d/2, size ],\n\t\t\t\t\t\t[ d/2, d/2+d, size ],\n\t\t\t\t\t\t[ d/2, d/2-d, size ],\n\t\t\t\t\t\t[ d/2+d, d/2+d, size ],\n\t\t\t\t\t\t[ d/2+d, d/2-d, size ],\n\t\t\t\t\t\t[ d/2-d, d/2+d, size ],\n\t\t\t\t\t\t[ d/2-d, d/2-d, size ] ])\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\td = pat.width = pat.height = Math.round(d*1.4);\n\t\t\t\tpat.circles = [[ d/4, d/4, size ], [ 3*d/4, 3*d/4, size ]];\n\t\t\t\tif (options.pattern=='circle')\n\t\t\t\t{\tpat.circles = pat.circles.concat([\n\t\t\t\t\t\t[ d/4+d, d/4, size ],\n\t\t\t\t\t\t[ d/4, d/4+d, size ],\n\t\t\t\t\t\t[ 3*d/4-d, 3*d/4, size ],\n\t\t\t\t\t\t[ 3*d/4, 3*d/4-d, size ],\n\t\t\t\t\t\t[ d/4+d, d/4+d, size ], \n\t\t\t\t\t\t[ 3*d/4-d, 3*d/4-d, size ] ]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 'tile':\n\t\tcase 'square':\n\t\t{\tsize = options.size===0 ? 0 : options.size/2 || 2;\n\t\t\tif (!options.angle)\n\t\t\t{\tpat.width = pat.height = d;\n\t\t\t\tpat.lines = [[ d/2-size, d/2-size, d/2+size, d/2-size, d/2+size, d/2+size, d/2-size,d/2+size, d/2-size, d/2-size ]]\n\t\t\t}\n\t\t\telse\n\t\t\t{\tpat.width = pat.height = d;\n\t\t\t\t//size *= Math.sqrt(2);\n\t\t\t\tpat.lines = [[ d/2-size,d/2, d/2,d/2-size, d/2+size,d/2, d/2,d/2+size, d/2-size,d/2 ]]\n\t\t\t}\n\t\t\tif (options.pattern=='square') pat.repeat = [[0,0], [0,d], [d,0], [0,-d], [-d,0], [-d,-d], [d,d], [-d,d], [d,-d] ]\n\t\t\tbreak;\n\t\t}\n\t\tcase 'cross':\n\t\t{\t// Limit angle to 0 | 45\n\t\t\tif (options.angle) options.angle = 45;\n\t\t}\n\t\t// fallthrough\n\t\tcase 'hatch':\n\t\t{\tvar a = Math.round(((options.angle||0)-90)%360);\n\t\t\tif (a>180) a -= 360;\n\t\t\ta *= Math.PI/180;\n\t\t\tvar cos = Math.cos(a);\n\t\t\tvar sin = Math.sin(a);\n\t\t\tif (Math.abs(sin)<0.0001)\n\t\t\t{\tpat.width = pat.height = d;\t\n\t\t\t\tpat.lines = [ [ 0,0.5, d, 0.5 ] ];\n\t\t\t\tpat.repeat = [ [0,0], [0,d] ];\n\t\t\t}\n\t\t\telse  if (Math.abs(cos)<0.0001)\n\t\t\t{\tpat.width = pat.height = d;\t\n\t\t\t\tpat.lines = [ [ 0.5,0, 0.5, d] ];\n\t\t\t\tpat.repeat = [ [0,0], [d,0] ];\n\t\t\t\tif (options.pattern=='cross') \n\t\t\t\t{\tpat.lines.push ([ 0,0.5, d, 0.5 ]);\n\t\t\t\t\tpat.repeat.push([0,d]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\tvar w = pat.width = Math.round(Math.abs(d/sin)) || 1;\n\t\t\t\tvar h = pat.height = Math.round(Math.abs(d/cos)) || 1;\n\t\t\t\tif (options.pattern=='cross')\n\t\t\t\t{\tpat.lines = [ [-w,-h, 2*w,2*h], [2*w,-h, -w,2*h] ];\n\t\t\t\t\tpat.repeat = [ [0,0] ];\n\t\t\t\t}\n\t\t\t\telse if (cos*sin>0) \n\t\t\t\t{\tpat.lines = [ [-w,-h, 2*w,2*h] ];\n\t\t\t\t\tpat.repeat = [ [0,0], [w,0], [0,h] ];\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\tpat.lines = [ [2*w,-h, -w,2*h] ];\n\t\t\t\t\tpat.repeat = [ [0,0], [-w,0], [0,h] ];\n\t\t\t\t}\n\t\t\t}\n\t\t\tpat.stroke = options.size===0 ? 0 : options.size||4;\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn pat\n};\n\nol.style.Style.defaultStyle;\n(function() {\n// Style\nvar white = [255, 255, 255, 1];\nvar blue = [0, 153, 255, 1];\nvar width = 3;\nvar defaultEditStyle = [\n  new ol.style.Style({\n    stroke: new ol.style.Stroke({ color: white, width: width + 2 })\n  }),\n  new ol.style.Style({\n    image: new ol.style.Circle({\n      radius: width * 2,\n      fill: new ol.style.Fill({ color: blue }),\n      stroke: new ol.style.Stroke({ color: white, width: width / 2 })\n    }),\n    stroke: new ol.style.Stroke({ color: blue, width: width }),\n    fill: new ol.style.Fill({\n      color: [255, 255, 255, 0.5]\n    })\n  })\n];\n/**\n * Get the default style\n * @param {boolean|*} [edit] true to get editing style or a { color, fillColor } object, default get default blue style\n * @return {Array<ol.style.Style>}\n */\nol.style.Style.defaultStyle = function(edit) {\n  if (edit===true) {\n    return defaultEditStyle;\n  } else {\n    edit = edit || {};\n    var fill = new ol.style.Fill({\n      color: edit.fillColor || 'rgba(255,255,255,0.4)'\n    });\n    var stroke = new ol.style.Stroke({\n      color: edit.color || '#3399CC',\n      width: 1.25\n    });\n    var style = new ol.style.Style({\n      image: new ol.style.Circle({\n        fill: fill,\n        stroke: stroke,\n        radius: 5\n      }),\n      fill: fill,\n      stroke: stroke\n    });\n    return [ style ];\n  }\n};\n})();\n\n/*\n* Copyright (c) 2015 Jean-Marc VIGLINO, \n* released under the CeCILL-B license (French BSD license)\n* (http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt).\n*/\n/**\n * Get a style for Geoportail WFS features\n *\n * @param {String} options.typeName \n * @param {any} options\n *  @param {boolean} options.sens\n *  @param {boolean} options.symbol\n * @return {Array<ol.style.Style}\n */\nol.style.geoportailStyle;\n(function(){\nvar cache = {};\nvar styleCount = 0;\n// Troncon de route\nfunction troncon_de_route(options) {\n  // Get color according to road properties\n  var getColor = function (feature) {\n    if (options.vert && feature.get('itineraire_vert')) {\n      if (feature.get('position_par_rapport_au_sol') < 0) return [0, 128, 0, .7];\n      else if (feature.get('position_par_rapport_au_sol') > 0) return [0, 100, 0, 1];\n      else return [0, 128, 0, 1];\n    }\n    if (!feature.get('importance')) return \"magenta\";\n    if (feature.get('nature') === 'Piste cyclable') {\n      return [27,177,27,.5]\n    }\n    if (feature.get('position_par_rapport_au_sol') != \"0\") {\n      var col;\n      switch(feature.get('importance')) {\n        case \"1\": col = [177, 27, 177, 1]; break;\n        case \"2\": col = [177, 27, 27, 1]; break;\n        case \"3\": col = [217, 119, 0, 1]; break;\n        case \"4\": col = [255, 225, 0, 1]; break;\n        case \"5\": col = [204, 204, 204, 1]; break;\n        default: col = [211, 211, 211, 1]; break;\n      }\n      if (feature.get('position_par_rapport_au_sol') < 0) col[3] = .7;\n      return col;\n    } else {\n      switch(feature.get('importance')) {\n        case \"1\": return [255,0,255,1]; \n        case \"2\": return [255,0,0,1]; \n        case \"3\": return [255, 165, 0, 1];\n        case \"4\": return [255,255,0,1]; \n        case \"5\": return [255,255,255,1]; \n        default: return [211, 211, 211, 1];\n      }\n    }\n    // return \"#808080\";\n  }\n  // Get Width\n  var getWidth = function (feature) {\n    return Math.max ( feature.get('largeur_de_chaussee')||2 , 2 );\n  }\n  // Zindex\n  var getZindex = function (feature) {\n    if (!feature.get('position_par_rapport_au_sol')) return 100;\n    var pos = Number(feature.get('position_par_rapport_au_sol'));\n    if (pos>0) return 10 + pos*10 - (Number(feature.get('importance')) || 10);\n    else if (pos<0) return Math.max(4 + pos, 0);\n    else return 10 - (Number(feature.get('importance')) || 10);\n    // return 0;\n  }\n  // Get rotation on the center of the line\n  var lrot = function (geom) {\n    //if (sens != options.direct && sens != options.inverse) return 0;\n    var geo = geom.getCoordinates();\n    var x, y, dl=0, l = geom.getLength();\n    for (var i=0; i<geo.length-1; i++) {\n      x = geo[i+1][0]-geo[i][0];\n      y = geo[i+1][1]-geo[i][1];\n      dl += Math.sqrt(x*x+y*y);\n      if (dl>=l/2) break;\n    }\n    return -Math.atan2(y,x);\n  }\n  // Sens circulation\n  var getSens = function (feature) {\n    if (options.sens && !/double|sans/i.test(feature.get('sens_de_circulation'))) {\n      return new ol.style.Text({\n        text: (feature.get('sens_de_circulation') == 'Sens direct' ? '→' : '←'),\n        font: 'bold 12px sans-serif',\n        placement: 'point',\n        textAlign: 'center',\n        fill: new ol.style.Fill({ color: [0,0,0,.3] }),\n        stroke: new ol.style.Stroke({ color: [0,0,0,.3], width: 1.5 }),\n        rotateWithView: true\n      })\n    }\n    return null;\n  }\n  var getDash = function(feature) {\n    switch (feature.get('nature')) {\n      case 'Escalier': {\n        return [1,4]\n      }\n      case 'Sentier': {\n        return [8,10]\n      }\n    }\n  }\n  var styleId = 'ROUT-'+(styleCount++)+'-'\n  return function (feature) {\n    var id = styleId\n      + feature.get('nature') + '-'\n      + feature.get('position_par_rapport_au_sol') + '-'\n      + feature.get('sens_de_circulation') + '-'\n      + feature.get('position_par_rapport_au_sol') + '-'\n      + feature.get('importance') + '-'\n      + feature.get('largeur_de_chaussee') + '-'\n      + feature.get('itineraire_vert');\n    var style = cache[id];\n    if (!style) {\n      style = cache[id] = [\t\n        new ol.style.Style ({\n          text: getSens(feature),\n          stroke: new ol.style.Stroke({\n            color: getColor(feature),\n            width: getWidth(feature),\n            lineDash: getDash(feature)\n          }),\n          zIndex: getZindex(feature)-100\n        })\n      ];\n    }\n    // Rotation\n    if (style[0].getText()) style[0].getText().setRotation(lrot(feature.getGeometry()));\n    return style;\n  };\n}\nfunction batiment(options) {\n  var getBatiColor = function (feature) {\n    switch (feature.get('nature')) {\n      case \"Industriel, agricole ou commercial\": return [51, 102, 153,1];\n      case \"Remarquable\": return [0,192,0,1];\n      default: \n        switch ( feature.get('usage_1') ) {\n          case 'Résidentiel':\n          case 'Indifférencié': \n            return [128,128,128,1];\n          case 'Industriel':\n          case 'Commercial et services': \n            return [51, 102, 153,1];\n          case \"Sportif\": \n            return [51,153,102,1];\n          case \"Religieux\": \n            return [153,102,51,1];\n          default: return [153,51,51,1];\n        }\n    }\n  }\n  var getSymbol = function (feature) {\n    switch ( feature.get('usage_1') ) {\n      case \"Commercial et services\": return \"\\uf217\";\n      case \"Sportif\": return \"\\uf1e3\";\n      default: return null;\n    }\n  }\n  var styleId = 'BATI-'+(styleCount++)+'-'\n  return function (feature) {\n    if (feature.get('detruit')) return [];\n    var id = styleId \n      + feature.get('usage_1') + '-'\n      + feature.get('nature') + '-'\n      + feature.get('etat_de_l_objet');\n    var style = cache[id];\n    if (!style) {\n      var col = getBatiColor(feature);\n      var colfill = [col[0], col[1], col[1], .5]\n      var projet = !/en service/i.test(feature.get('etat_de_l_objet'));\n      if (projet) colfill[3] = .1;\n      var symbol = (options.symbol ? getSymbol(feature): null);\n      return [\n        new ol.style.Style({\n          text: symbol ? new ol.style.Text({\n            text: symbol,\n            font: '12px FontAwesome',\n            fill: new ol.style.Fill({\n              color: [0,0,0, .6] //col\n            })\n          }) : null,\n          fill: new ol.style.Fill({\n            color: colfill\n          }),\n          stroke: new ol.style.Stroke ({\n            color: col,\n            width: 1.5,\n            lineDash: projet ? [5,5] : null\n          })\n        })\n      ]\n    }\n    return style\n  }\n}\n// Parcelle / cadastre\nfunction parcelle(options) {\n  var style = new ol.style.Style({\n    text: new ol.style.Text({\n      text: '0000',\n      font: 'bold 12px sans-serif',\n      fill: new ol.style.Fill({\n        color: [100, 0, 255, 1]\n      }),\n      stroke: new ol.style.Stroke ({\n        color: [255,255,255, .8],\n        width: 3\n      })\n    }),\n    stroke: new ol.style.Stroke ({\n      color: [255, 165, 0, 1],\n      width: 1.5\n    }),\n    fill: new ol.style.Fill({\n      color: [100, 0, 255, .1]\n    })\n  })\n  return function(feature, resolution) {\n    if (resolution < .8) style.getText().setFont('bold 12px sans-serif');\n    else style.getText().setFont('bold 10px sans-serif');\n    if (options.section) {\n      style.getText().setText(feature.get('section') +'-'+ (feature.get('numero')||'').replace(/^0*/,''));\n    } else {\n      style.getText().setText((feature.get('numero')||'').replace(/^0*/,''));\n    }\n    return style;\n  }\n}\nol.style.geoportailStyle = function(typeName, options) {\n  options = options || {};\n  switch (typeName) {\n    // Troncons de route\n    case 'BDTOPO_V3:troncon_de_route': return troncon_de_route(options);\n    // Bati\n    case 'BDTOPO_V3:batiment': return batiment(options);\n    // Parcelles\n    case 'CADASTRALPARCELS.PARCELLAIRE_EXPRESS:parcelle': return parcelle(options);\n  }\n};\n})();\n"]}