diff --git a/examples/drag-and-drop-image-vector.js b/examples/drag-and-drop-image-vector.js index ce9561924c..5a01905620 100644 --- a/examples/drag-and-drop-image-vector.js +++ b/examples/drag-and-drop-image-vector.js @@ -114,17 +114,15 @@ var map = new ol.Map({ dragAndDropInteraction.on('addfeatures', function(event) { var vectorSource = new ol.source.Vector({ - features: event.features, - projection: event.projection + features: event.features }); - map.getLayers().push(new ol.layer.Image({ + map.addLayer(new ol.layer.Image({ source: new ol.source.ImageVector({ source: vectorSource, style: styleFunction }) })); - var view = map.getView(); - view.fitExtent( + map.getView().fitExtent( vectorSource.getExtent(), /** @type {ol.Size} */ (map.getSize())); }); diff --git a/examples/drag-and-drop.js b/examples/drag-and-drop.js index 830b6bc77b..8a00de3f15 100644 --- a/examples/drag-and-drop.js +++ b/examples/drag-and-drop.js @@ -112,15 +112,13 @@ var map = new ol.Map({ dragAndDropInteraction.on('addfeatures', function(event) { var vectorSource = new ol.source.Vector({ - features: event.features, - projection: event.projection + features: event.features }); - map.getLayers().push(new ol.layer.Vector({ + map.addLayer(new ol.layer.Vector({ source: vectorSource, style: styleFunction })); - var view = map.getView(); - view.fitExtent( + map.getView().fitExtent( vectorSource.getExtent(), /** @type {ol.Size} */ (map.getSize())); });