0
我正在和openlayers一起工作,我可以在地圖上找到一個點,但我無法獲得單個座標。有沒有方法來substr由toShortString()返回的值?
feat = drawLayer.features[0];
var geom = feat.geometry;
var loca = geom.toShortString();
var long = loc.substr(0,9);
alert(geom.toShortString());//returns the correct coords in xx.xxx,xx.xxx format
alert(loca);//returns 2 very large numbers in xx.xxx,xx.xxx format
alert(long);//returns the first, incorrect number
我在做什麼不對,我該如何糾正?
感謝