Minor change to vector-wfs example

My linter complains that vectorSource is used before it is defined.
This commit is contained in:
Éric Lemoine
2014-07-03 14:53:04 +02:00
parent 700a0b15b3
commit 6abba32707

View File

@@ -10,10 +10,6 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
goog.require('ol.tilegrid.XYZ');
var loadFeatures = function(response) {
vectorSource.addFeatures(vectorSource.readFeatures(response));
};
var vectorSource = new ol.source.ServerVector({
format: new ol.format.GeoJSON(),
loader: function(extent, resolution, projection) {
@@ -32,6 +28,10 @@ var vectorSource = new ol.source.ServerVector({
projection: 'EPSG:3857'
});
var loadFeatures = function(response) {
vectorSource.addFeatures(vectorSource.readFeatures(response));
};
var vector = new ol.layer.Vector({
source: vectorSource,
style: new ol.style.Style({