爲什麼不能向Vector添加功能?此代碼不起作用:開放圖層功能
var features = [new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-70.702451, 42.374473), {className: "latarnia"})]
vectors = new OpenLayers.Layer.Vector("warstwa", {
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
format: new OpenLayers.Format.OSM()
}),
features : features,
projection: new OpenLayers.Projection("EPSG:4326")});
map.addLayers([vectors]);
我的意思是向量沒有任何功能。 我試過
layer.addFeatures([feature]);
但它也失敗了。