openlayer(ポリゴン)の描画機能を使おうとしています。エンド ユーザーが多角形を描画することは可能です。しかし、Java スクリプトを使用してポリゴンを描画したいと考えています。openlayer の insertXY および insertDeltaXY 関数を使用しようとしていますが、「オブジェクトはプロパティまたはメソッド 'insertXY' をサポートしていません」という js エラーが発生します。
以下は私のコードの塊です。
var draw = new OpenLayers.Control.DrawFeature(
vectorLayer,
OpenLayers.Handler.Polygon }
);
map.addControl(draw);
draw.activate();
//Listen for sketch events on the layer
draw.layer.events.on({
featureadded: that.PolygonAdded
});
//Draw polygon if provided from codebehind
//Insert a point in the current sketch given x & y coordinates
handler.insertXY(cords[0], cords[1]);
//Insert a point given offsets from the previously inserted point.
handler.insertDeltaXY(cords[2], cords[3]);
handler.insertDeltaXY(cords[4], cords[5]);
.....
どんな助けでも大歓迎です。