Updated Use cases (markdown)

tschaub
2013-03-23 10:31:43 -07:00
parent 9a34b028a9
commit a53217bb79
+2 -2
@@ -27,8 +27,8 @@ var vector = new ol.layer.Vector({
}); });
var map = new ol.Map({ var map = new ol.Map({
layers: [raster, vector],
target: 'map', target: 'map',
layers: [raster, vector],
view: new ol.View2D({ view: new ol.View2D({
projection: 'EPSG:1234', projection: 'EPSG:1234',
center: ol.projection.transform( center: ol.projection.transform(
@@ -38,4 +38,4 @@ var map = new ol.Map({
}); });
``` ```
This alternative can be implemented if the layer knows the map projection. The vector layer would be responsible for calling `source.protocol.read({success: callback})` where the callback would call `source.parser.parseFeatures(data, {projection: projection})` (`data` is supplied to the callback and `projection` comes from the map's view). This alternative can be implemented if the layer knows the map projection. The vector layer would be responsible for calling `source.protocol.read({success: callback})` where the callback would call `source.parser.parseFeatures(data, {projection: projection})` (`data` is supplied to the callback and `projection` comes from the map's view). The layer would maintain a cache of features in the map view's projection, and these would be provided on demand to layer's the renderer.