Merge pull request #3586 from probins/dragdrop

Simplify dragAndDropInteraction in examples.
This commit is contained in:
Tim Schaub
2015-04-19 10:03:25 -06:00
2 changed files with 6 additions and 10 deletions
+3 -5
View File
@@ -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()));
});
+3 -5
View File
@@ -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()));
});