Use ol.format.GeoJSON in icon example
This commit is contained in:
+6
-4
@@ -18,9 +18,7 @@ var raster = new ol.layer.Tile({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var vectorSource = new ol.source.Vector();
|
var features = new ol.format.GeoJSON().readFeatures({
|
||||||
|
|
||||||
new ol.format.GeoJSON().readObject({
|
|
||||||
'type': 'FeatureCollection',
|
'type': 'FeatureCollection',
|
||||||
'features': [{
|
'features': [{
|
||||||
'type': 'Feature',
|
'type': 'Feature',
|
||||||
@@ -34,7 +32,11 @@ new ol.format.GeoJSON().readObject({
|
|||||||
'coordinates': [0, 0]
|
'coordinates': [0, 0]
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}, vectorSource.addFeature, vectorSource);
|
});
|
||||||
|
|
||||||
|
var vectorSource = new ol.source.Vector({
|
||||||
|
features: features
|
||||||
|
});
|
||||||
|
|
||||||
var styleArray = [new ol.style.Style({
|
var styleArray = [new ol.style.Style({
|
||||||
image: ol.icon.renderIcon('data/icon.png')
|
image: ol.icon.renderIcon('data/icon.png')
|
||||||
|
|||||||
Reference in New Issue
Block a user