# add_layers.js

var options1 = {
    id: "demo1",
    layers: [
        {
            type: 'Tile',
            source: {
                name: 'BingMaps',
                key: 'your Bing Maps key from http://www.bingmapsportal.com/ here'
            }
        }, {
            type: 'Vector',
            source: {
                name: 'Vector',
                format: 'GeoJSON',
                url: 'https://openlayers.org/en/v3.19.1/examples/data/geojson/countries.geojson'
            }
        }
    ]
};

var map = new C9.Map(options1);
// you can also use createLayer function
/*
map.createLayer({
    type: 'Tile',
    source: {
        name: 'BingMaps',
        key: 'your Bing Maps key from http://www.bingmapsportal.com/ here'
    }
});

map.createLayer({
    type: 'Vector',
    source: {
        name: 'Vector',
        format: 'GeoJSON',
        url: 'https://openlayers.org/en/v3.19.1/examples/data/geojson/countries.geojson'
    }
});

// you can create layer from geojson file by use createLayerFromGeojson function
// this funtion use image tile to render some features from geojson, it runs smoother than rendering from vector tile
map.createLayerFromGeojson({url: 'https://openlayers.org/en/v3.19.1/examples/data/geojson/countries.geojson'})
*/
map.draw();