Create  Edit  Diff  FrontPage  Index  Search  Changes  History  Source  RSS  wikifarm  Login

layerObj.getWMSFeatureInfoURL

layerObj.getWMSFeatureInfoURL メソッド

説明

WMSレイヤーでのクリックした点でのGetFeatureInfoの結果を返すURLを取得します。

public string getWMSFeatureInfoURL(
   mapObj map,
   int click_x,
   int click_y,
   int feature_count,
   string info_format
);
Public Function getWMSFeatureInfoURL(ByVal map As mapObj, ByVal click_x As Integer, ByVal click_y As Integer, ByVal feature_count As Integer, ByVal info_format As String) As String

サンプル

コード
Dim _map As New mapObj("")
Dim _layer As New layerObj(_map)

_layer.connectiontype = MS_CONNECTION_TYPE.MS_WMS
_layer.connection = "http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/ms/openlayers.map&QUERY_LAYERS=oldcity&"
intRet = _layer.metadata.set("wms_name", "oldcity")
intRet = _layer.metadata.set("wms_srs", "EPSG:4326")
intRet = _layer.metadata.set("wms_server_version", "1.1.1")
intRet = _layer.metadata.set("wms_format", "image/png")

strRet = _layer.getWMSFeatureInfoURL(_map, 10, 10, 1, "MIME")
Debug.WriteLine(strRet)

→結果 http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/ms/openlayers.map&QUERY_LAYERS=oldcity&LAYERS=oldcity&REQUEST=GetFeatureInfo&SERVICE=WMS&FORMAT=image%2Fpng&HEIGHT=700&VERSION=1.1.1&SRS=EPSG:4326&WIDTH=700&BBOX=139%2E686375%2C35%2E606057%2C139%2E833112%2C35%2E752794&TRANSPARENT=TRUE&FEATURE_COUNT=1&INFO_FORMAT=MIME&X=10&EXCEPTIONS=application/vnd.ogc.se_xml&Y=10

この関数を実行するに当たって、WMS の CONNECTION 文字列に、QUERY_LAYERS=layer名 を加えておく必要がある。

マップファイル
 LAYER
   CONNECTION "http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/ms/openlayers.map&QUERY_LAYERS=oldcity&"
   CONNECTIONTYPE WMS
     METADATA
       "wms_srs"	"EPSG:4326"
       "wms_name"	"oldcity"
       "wms_format"	"image/png"
       "wms_server_version"	"1.1.1"
     END
   NAME "World"
   PROJECTION
     "init=epsg:4326"
   END
   SIZEUNITS PIXELS
   STATUS ON
   TOLERANCEUNITS PIXELS
   TYPE POLYGON
   UNITS METERS
   CLASS
     METADATA
     END
     STYLE
       ANGLE 360
       COLOR 200 200 200
       OUTLINECOLOR 100 100 100
       SYMBOL 0
     END
   END
 END

参照

layerObj メンバ | (global) 名前空間

Last modified:2007/02/15 14:14:47
Keyword(s):
References:[layerObj メンバ]