【发布时间】:2020-12-02 04:13:18
【问题描述】:
我有以下example
var circle = new ol.geom.Circle([-2.59394, 51.45271], 0.001).transform('EPSG:4326', 'EPSG:3857');
//circle.transform('EPSG:4326', 'EPSG:3857');
var feature=new ol.Feature({
geometry: circle
});
var congestionLayer = new ol.layer.Vector({
source: new ol.source.Vector({
features: [feature]
}),
//style: styleFunction,
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(0, 255,0, 0.3)'
}),
stroke: new ol.style.Stroke({
color: '#737373',
width: 2
}),
image: new ol.style.Circle({
radius: 70,
fill: new ol.style.Fill({
color: '#ffcc33'
})
})
}),
visible: true
})
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
congestionLayer
],
view: new ol.View({
center: ol.proj.fromLonLat([-2.59394, 51.45271]),
projection: 'EPSG:3857',
zoom: 14
})
});
我想将圆圈的样式更改为具有相似大小的图标,它应该看起来像this example 这里是绘制圆圈交互具有匹配大小的图标(就像我想为第一个示例执行此操作。
【问题讨论】:
-
@geocodezip 我一定是错误地修改了那个,我刚刚修复了它...它有一个绘制圆圈交互,但不是圆圈显示,而是一个图标将按比例显示圈子
-
您要更改的图标是什么?风格的圆圈?
-
@geocodezip 我想更改第一个示例的样式,以便圆圈显示为相应大小的图标(如在绘图示例中)
标签: openlayers openlayers-3 openlayers-6