繁体   English   中英

Openlayers 3 - Multilinestring放大/缩小闪烁层

[英]Openlayers 3 - Multilinestring Zoom-in/out flashing layer

我试图在openlayers 3上绘制两个线串(WKT)。

当缩放(进或出)时,图层会闪烁,有时会显示或隐藏。

有人知道发生了什么吗?

谢谢

代码是:

var rasterLayer = new ol.layer.Tile({ source: new ol.source.MapQuest({ layer: "osm" }) });
var vectorSource = new ol.source.Vector({});
var vectorLayer = new ol.layer.Vector({ source: vectorSource });
var wktFormat = new ol.format.WKT();
var layers = [rasterLayer, vectorLayer];

var olMap = new ol.Map({
        layers: layers,
        target: "map",
        view: new ol.View({ center: ol.proj.transform([-47.4556640445469, -23.5087675969813], "EPSG:4326", "EPSG:3857"), zoom: 15 })
    });

var wkt = "MULTILINESTRING ((-47.4556640445469 -23.5087675969813, -47.455663222553 -23.508781331245),(-47.4597839082327 -23.5090240050454, -47.4597690420473 -23.5090246913242))";
var feature = wktFormat.readFeature(wkt);
feature.getGeometry().transform("EPSG:4326", "EPSG:3857");
feature.setStyle(new ol.style.Style({ stroke: new ol.style.Stroke({ color: "red", width: 9 }) }));
vectorSource.addFeature(feature);

的jsfiddle

解决了https://github.com/openlayers/ol3/pull/5511

谢谢Andreas和Openlayers团队!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM