You found a bug. See https://github.com/openlayers/ol3/pull/5511 for a fix.
Andreas. On Wed, Jun 22, 2016 at 1:13 PM, Marcos Oto Picarelli Prado via OL3 Dev < ol3-dev+apn2wqc3slt7x3hea31pirytouijxpylg7bbbi21fk2hxcjethygw...@googlegroups.com > wrote: > > <http://stackoverflow.com/questions/37954041/openlayers-3-multilinestring-zoom-in-out-flashing-layer#> > > I'm trying to plot two linestring (WKT) on openlayers 3. > > When zoom (in or out) the layers are flashing and some times show or hide. > > Do some one know what is going on? > > Thanks > > The code is: > > > 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 <http://jsfiddle.net/Lz1t8jpn/4/> > > > Thanks > <http://jsfiddle.net/Lz1t8jpn/4/> > > -- > You received this message because you are subscribed to the Google Groups > "OL3 Dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/ol3-dev. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ol3-dev/30136824-347b-464c-a246-7d25e4b9da8f%40googlegroups.com > <https://groups.google.com/d/msgid/ol3-dev/30136824-347b-464c-a246-7d25e4b9da8f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Andreas Hocevar Geospatial Solutions Engineer | Boundless [email protected] @boundlessgeo -- You received this message because you are subscribed to the Google Groups "OL3 Dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ol3-dev. To view this discussion on the web visit https://groups.google.com/d/msgid/ol3-dev/CAOiJ94j_zMRVUoQALptHfa6D76tM_3XfORE4TJUHHd9d15waSA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
