var point1 = new OpenLayers.Geometry.Point(106,29.15);
var myObj =
{
'deviceId': 101, //属性名用引号括起来,属性间由逗号隔开
'address': 'myName'
};
var fea1 = new OpenLayers.Feature.Vector(point1,myObj);
var point2 = new OpenLayers.Geometry.Point(106,29.05);
var fea2 = new OpenLayers.Feature.Vector(point2,my);
var point3 = new OpenLayers.Geometry.Point(106.21,29.05);
var fea3 = new OpenLayers.Feature.Vector(point3,myObj1);
var v = new Array();
v[0]=fea1;
v[1]=fea2;
v[2]=fea3;
var fstore = new GeoExt.data.FeatureStore({
layer: vecLayer,
feature:v,
fields: [
{name: 'deviceId', type: 'int'},
{name: 'address', type: 'string'}
],
autoLoad: true
});
openlayers 构造 feature 数组
原创
©著作权归作者所有:来自51CTO博客作者hexidlee的原创作品,请联系作者获取转载授权,否则将追究法律责任
下一篇:WIN 环境变量备份
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章