Spectrum Spatial (SSA/LIM)

Expand all | Collapse all

Adding features from multiple sources to OpenLayers vector layer

  • 1.  Adding features from multiple sources to OpenLayers vector layer

    Posted 01-15-2020 07:51
    Edited by Ott Koik 01-15-2020 07:56
    Hi!

    I'm developing application with snap interaction in SSA  and have some problems with adding features from multiple sources to OpenLayers vector layer.
    I use "vector.getSource().addFeatures((new ol.format.GeoJSON()).readFeatures(data), {featureProjection: 'EPSG:3301'});" after I receive GeoJSON from feature service request and everything works fine with one layer, but as soon as I add another feature service request with similar addFeatures function, some objects from first request disappear: 
    On this picture, all the features from both, blue and orange layers are added to OpenLayers vector source, but for some reason, several polygons from blue layer are not present in OL vector layer (without white fill in this picture).
    Does anyone have any idea, what could cause this problem?

    Best regards,


    ------------------------------
    Ott Koik
    Ruumab OÛ
    Tartu
    ------------------------------


  • 2.  RE: Adding features from multiple sources to OpenLayers vector layer

    Posted 01-15-2020 10:03
    Edited by Ott Koik 01-15-2020 10:06
    Already found a solution for my problem for snap interaction. I still don't know, why I can't add features from multiple sources to vector layer, but it's not important for me anymore.

    Thanks for attention,
    Ott