我正在使用openlayers 3来创建一个带有矢量特征的地图.到现在为止还挺好.
我有几个矢量图层,分组在一个名为projecten的变量中.
var projecten = new ol.layer.Group({
title: 'Projecten',
layers: [
new ol.layer.Vector({
title: 'EVZ Den Dungen',
source: new ol.source.GeoJSON(
/** @type {olx.source.GeoJSONOptions} */ ({
object: EVZDenDungen,
projection: 'EPSG:3857'
})),
style: function(feature, resolution) {
return lookup[feature.get('landschapselement')];
}
}),
new ol.layer.Vector({
title: 'EVZ Croy',
source: new ol.source.GeoJSON(
/** @type {olx.source.GeoJSONOptions} */ ({
object: EVZCroy,
projection: 'EPSG:3857'
})),
style: function(feature, resolution) {
return lookup[feature.get('landschapselement')];
}
}),
new ol.layer.Vector({
title: 'Natuurcompensatie Gasselsbroek',
source: new ol.source.GeoJSON(
/** @type {olx.source.GeoJSONOptions} */ ({
object: NatuurcompensatieGasselsbroek, …Run Code Online (Sandbox Code Playgroud)