diff --git a/Minimal-Vector-API.md b/Minimal-Vector-API.md index 7fe13bc..05348e7 100644 --- a/Minimal-Vector-API.md +++ b/Minimal-Vector-API.md @@ -22,6 +22,37 @@ var layer = new ol.layer.Vector({ For data that is already available in memory as string or object, a `data` option can be provided instead of `url`. +Notes and questions from @elemoine: + +So ol.layer.Vector works with a fixed strategy, an HTTP protocol, and a GeoJSON format (using ol2 terms here). What would the API look like if what I want to use is a fixed strategy and, say, a WFS protocol? + +What do we fix in a source type? The strategy? The protocol? Both? I think I would fix the strategy, and get rid of strategies entirely in ol3. + +So: + +```js +var layer = new ol.layer.Vector({ + style: myStyle, + source: new ol.source.VectorFixed({ + protocol: new ol.protocol.WFS({ + url: 'http://example.com/data', + parser: new ol.parser.GeoJSON() + }) + }) +}); +``` + +For Fixed/HTTP/GeoJSON, Fixed/HTTP/TopoJSON, and Fixed/HTTP/KML we can certainly provide convenience classes: ol.source.GeoJSON, ol.source.TopoJSON, and ol.source.KML. E.g. + +```js +var layer = new ol.layer.Vector({ + style: myStyle, + source: new ol.source.GeoJSON({ + url: 'http://example.com/data' + }) +}); +``` + ## Style Vector Data Initially, we can style data with a subset of CartoCSS or SLD, without exposing a style API.