how can I bind layers from database or add new layer(s) to existing layer?

Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how can I bind layers from database or add new layer(s) to existing layer?

farzaneh_t
This post has NOT been accepted by the mailing list yet.
First of all, I have to say that I'm new to the OpenLayers. I was used OpenLayers 4 in this project. We have a map with group layers that can visible or invisible any of them.
var map = new ol.Map({
            controls: ol.control.defaults().extend([
              new ol.control.FullScreen()
            ]),
        layers: [
          new ol.layer.Tile({
              source: new ol.source.OSM()
          }), new ol.layer.Group({
              layers: [
                new ol.layer.Tile({
                    source: new ol.source.TileJSON({
                        url: 'https://api.tiles.mapbox.com/v3/mapbox.20110804-hoa-foodinsecurity-3month.json?secure',
                        crossOrigin: 'anonymous'
                    })
                }),
                new ol.layer.Tile({
                    source: new ol.source.TileJSON({
                        url: 'https://api.tiles.mapbox.com/v3/mapbox.world-borders-light.json?secure',
                        crossOrigin: 'anonymous'
                    })
                }),
                new ol.layer.Tile({
                    source: new ol.source.TileJSON({
                        url: 'https://api.tiles.mapbox.com/v3/mapbox.world-borders-light.json?secure',
                        crossOrigin: 'anonymous'
                    })
                })
              ]
          })
        ],
        target: 'map',
        view: new ol.View({
            center: ol.proj.fromLonLat([51.360294, 35.713068]),
            zoom: 10
        })
    }); 
now, how can I bind layers from database or add new layer(s) to existing layer?
Loading...