如何在创建ol.Feature id时设置它。
迄今的实例和成果:
// attempt 1
var fea = new ol.Feature({ id : 123 });
console.log(fea);
// attempt 2
var fea = new ol.Feature();
fea.id = 123;
console.log(fea);
// attempt 3
var fea = new ol.Feature();
fea.id = "123";
console.log(fea);结果:
尝试1:

企图2:

企图3:

发布于 2015-08-19 10:08:53
创建后使用feature.setId(id)
http://openlayers.org/en/v3.8.2/apidoc/ol.Feature.html#setId
https://stackoverflow.com/questions/32092432
复制相似问题