var OverpassLayer = require('overpass-layer')
function cssStyle (style) {
var ret = ''
if ('color' in style) {
ret += 'stroke: ' + style.color + ';'
}
ret += 'stroke-width: ' + ('width' in style ? style.width : '3') + ';'
if ('dashArray' in style) {
ret += 'stroke-dasharray: ' + style.dashArray + ';'
}
if ('dashArray' in style) {
ret += 'stroke-dasharray: ' + style.dashArray + ';'
}
if ('dashOffset' in style) {
ret += 'stroke-dashoffset: ' + style.dashOffset + ';'
}
if ('fillColor' in style) {
ret += 'fill: ' + style.fillColor + ';'
} else if ('color' in style) {
ret += 'fill: ' + style.color + ';'
} else {
ret += 'fill: #3388ff;'
}
if ('fillOpacity' in style) {
ret += 'fill-opacity: ' + style.fillOpacity + ';'
} else {
ret += 'fill-opacity: 0.2;'
}
return ret
}
function markerLine (data) {
var ret = ''
return ret
}
function markerPolygon (data) {
var ret = ''
return ret
}
function markerCircle (style) {
var fillColor = 'fillColor' in style ? style.fillColor : '#f2756a'
var color = 'color' in style ? style.color : '#000000'
var width = 'width' in style ? style.width : 1
return ''
}
function markerPointer (style) {
var fillColor = 'fillColor' in style ? style.fillColor : '#f2756a'
var color = 'color' in style ? style.color : '#000000'
var width = 'width' in style ? style.width : 1
return ''
}
OverpassLayer.twig.extendFunction('markerLine', markerLine)
OverpassLayer.twig.extendFunction('markerCircle', markerCircle)
OverpassLayer.twig.extendFunction('markerPointer', markerPointer)
OverpassLayer.twig.extendFunction('markerPolygon', markerPolygon)
module.exports = {
line: markerLine,
circle: markerCircle,
pointer: markerPointer,
polygon: markerPolygon
}