SVG element not visible when using a hex color?

5 просмотров
Перейти к первому непрочитанному сообщению

Rudiman

не прочитано,
27 июн. 2019 г., 08:44:0227.06.2019
– OpenLayers Dev
When i use a hexcolor in my svg the complete svg is not visible..
is that a bug in openlayers??


WORKING

var svg = '<svg width="120" height="120" version="1.1" xmlns="http://www.w3.org/2000/svg">'
+ '<rect x="0" y="0" width="40" height="50" stroke="red" stroke-width="3" "/>'
+ '</svg>';


NOT WORKING

var svg = '<svg width="120" height="120" version="1.1" xmlns="http://www.w3.org/2000/svg">'
+ '<rect x="0" y="0" width="40" height="50" stroke="#ff0000" stroke-width="3" "/>'
+ '</svg>';




var style = new ol.style.Style({
  image: new ol.style.Icon({
opacity: 1,
src: 'data:image/svg+xml;utf8,' + svg,
scale: 1
  })
});
Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений