function _getOpenLayersStyle (styleOptions) {
  const style = new Style()

  if ('stroke' in styleOptions) {
    const strokeOptions = {
      color: styleOptions.stroke.color,
      width: styleOptions.stroke.width
    }
    const stroke = new Stroke(strokeOptions)
    style.setStroke(stroke)
  }

  if ('fill' in styleOptions) {
    const fillOptions = {
      color: styleOptions.fill.color
    }
    const fill = new Fill(fillOptions)
    style.setFill(fill)
  }

  if ('image' in styleOptions) {
    const { image } = styleOptions

    if (image.circle) {
      const options = {
        radius: image.circle.radius,
        stroke: new Stroke(image.circle.stroke),
        fill: new Fill(image.circle.fill)
      }
      const circle = new Circle(options)
      style.setImage(circle)
    }

    if (image.icon) {
      const icon = new Icon(image.icon)
      style.setImage(icon)
    }
  }

  return style
}
/** Map style options to OpenLayers style.
 *
 * @param {object} styleOptions - Style options
 * @param {object} styleOptions.stroke - Style options for the outline of the geometry
 * @param {number[]} styleOptions.stroke.color - RGBA color of the outline
 * @param {number} styleOptions.stroke.width - Width of the outline
 * @param {object} styleOptions.fill - Style options for body the geometry
 * @param {number[]} styleOptions.fill.color - RGBA color of the body
 * @param {object} styleOptions.image - Style options for image
 * @return {Style} OpenLayers style
 */
Map style options to OpenLayers style.
Map style options to OpenLayers style .
function _getOpenLayersStyle (styleOptions) {
  const style = new Style()
  if ('stroke' in styleOptions) {
    const strokeOptions = {
      color: styleOptions.stroke.color,
      width: styleOptions.stroke.width
    }
    const stroke = new Stroke(strokeOptions)
    style.setStroke(stroke)
  }
  if ('fill' in styleOptions) {
    const fillOptions = {
      color: styleOptions.fill.color
    }
    const fill = new Fill(fillOptions)
    style.setFill(fill)
  }
  if ('image' in styleOptions) {
    const { image } = styleOptions
    if (image.circle) {
      const options = {
        radius: image.circle.radius,
        stroke: new Stroke(image.circle.stroke),
        fill: new Fill(image.circle.fill)
      }
      const circle = new Circle(options)
      style.setImage(circle)
    }
    if (image.icon) {
      const icon = new Icon(image.icon)
      style.setImage(icon)
    }
  }
  return style
}
function _getOpenLayersStyle ( styleOptions ) { const style = new Style ( ) if ( 'stroke' in styleOptions ) { const strokeOptions = { color : styleOptions . stroke . color , width : styleOptions . stroke . width } const stroke = new Stroke ( strokeOptions ) style . setStroke ( stroke ) } if ( 'fill' in styleOptions ) { const fillOptions = { color : styleOptions . fill . color } const fill = new Fill ( fillOptions ) style . setFill ( fill ) } if ( 'image' in styleOptions ) { const { image } = styleOptions if ( image . circle ) { const options = { radius : image . circle . radius , stroke : new Stroke ( image . circle . stroke ) , fill : new Fill ( image . circle . fill ) } const circle = new Circle ( options ) style . setImage ( circle ) } if ( image . icon ) { const icon = new Icon ( image . icon ) style . setImage ( icon ) } } return style }
Map style options to OpenLayers style.
Map style options to OpenLayers style .