On Github tschaub / working-with-ol3
var view = new ol.View2D({ center: [0, 0], zoom: 0 }); var map = new ol.Map({ target: 'map', layers: [layer], view: view });hello world example
var osm = new ol.layer.Tile({ source: new ol.source.OSM() });
var bing = new ol.layer.Tile({ source: new ol.source.BingMaps({ // your key here key: 'AlQLZ0-5yk301_ESrmN...', style: 'AerialWithLabels' }) }));tiles galore example
var vector = new ol.layer.Vector({ source: new ol.source.Vector({ url: 'path/to/data.json', parser: new ol.parser.GeoJSON() }) });vector layer example
var style = new ol.style.Style({ symbolizers: [ new ol.style.Fill({ color: '#ff0000', opacity: 0.5 }), new ol.style.Stroke({ color: '#ff00ff', width: 1.5 }) ]});
var style = new ol.style.Style({ rules: [ new ol.style.Rule({ filter: 'type = "highway"', symbolizers: [ new ol.style.Stroke({ width: 3 }) ] }) ]});vector style example
var el = document.getElementById('popup'); var popup = new ol.Overlay({ element: el }); map.addOverlay(popup); map.on('click', function(evt) { popup.setPosition(evt.getCoordinate()); el.className = 'open'; el.innerHTML = 'Hello Mappers!' });overlay example
/** * WARNING: VERY UNSTABLE API TERRAIN BELOW */ var select = new ol.interaction.Select({ layerFilter: function(layer) { return layer === vector; } }); var modify = new ol.interaction.Modify();editing example
watch this space http://ol3js.org/