> GBounds の containsPoint メソッドではダメなのですか?
ご返事ありがとうございます。
実は、最初
var latlangBounds =gpolygon.getBounds();
result = latlangBounds.containsLatLng(gpoint);
でやってだめだったので、別方法を考えたのです。
アドバイスされたGBoundsを使って
var polypoints =[];
for (i=0;i<gpolygon.getVertexCount();i++){
polypoints.push(new GPoint(gpolygon.getVertex(i).lat
(),gpolygon.getVertex(i).lng()));
}
var polybounds = new GBounds(polypoints);
result = polybounds.containsPoint(new GPoint(gpoint.lat(),gpoint.lng
()));
としてやっても、結果は同じでだめでした。
GBoundsのリファレンスの説明には、
Constructs a rectangle that contains all the given points.
と記述され、与えられた点を全て含む長方形(rectangle)の領域となるようです。
従って、いびつな領域だと含まれていないのに含まれてしまう地点が起こりえます。