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

MapScript.Ja - layerObj.applySLDURL Diff

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

!!layerObj.applySLDURL メソッド
!!!説明
このレイヤーにSLD(Styled Layer Descriptor)を適用する場合のSLDドキュメントと対象レイヤー名の設定。※SLD:WMSレイヤーを設定する際にユーザーがスタイルを設定する機能。このSLDドキュメントをURLで指定する
public int applySLDURL(
   string sld,
   string stylelayer
);

Public Function applySLDURL(ByVal sld As String, ByVal stylelayer As String) As Integer

!!!サンプル
!!!!コード
Dim _map As New mapObj("")
Dim _layer As New layerObj(_map)

_layer.name = "World"
_layer.connectiontype = MS_CONNECTION_TYPE.MS_WMS
_layer.connection = "http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/ms/openlayers.map&"
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")

_layer.applySLDURL("http://localhost/ms/sld.xml", "World")
!!!!マップファイル
  LAYER
    CONNECTION "http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/ms/openlayers.map&"
    CONNECTIONTYPE WMS
      METADATA
        "wms_srs" "EPSG:4326"
        "wms_name" "oldcity"
        "wms_format" "image/png"
        "wms_sld_body" "auto"
        "wms_server_version" "1.1.1"
      END
    NAME "World"
    PROJECTION
      "init=epsg:4326"
    END
    SIZEUNITS PIXELS
    STATUS ON
    TOLERANCEUNITS PIXELS
    TYPE LINE
    UNITS METERS
    CLASS
      NAME "Unknown"
      METADATA
      END
      STYLE
        ANGLE 360
        COLOR 0 0 255
        SYMBOL 0
      END
    END
  END
!!!参照
[[layerObj メンバ]] | [[(global) 名前空間|http://wiki.fdiary.net/MapScriptJa]]