「OpenLayers開発」地図のポイント座標を取得する方法

サンプルコード:
1.全ての座標
$(“input[@type=hidden][@id $= 'cftKdf’]").each(function() {
var point = this.value;
var features = new OpenLayers.Format.WKT( map.baseLayer.projection).read(point);
vectors.addFeatures(features);
});

2.マウスでクリックされるポイント
$(“a[@id $= 'cftName’]").click(function(){
var pointID = this.id.replace('cftName’, “cftKdf");
var point = document.getElementById(pointID).value;
var features = new OpenLayers.Format.WKT(map.baseLayer.projection).read(point);
if(features)
{
if(features.constructor != Array)
{
features = [features];
}
vectors.destroyFeatures();
vectors.addFeatures(features);
}
})

JavaScript

Posted by arkgame