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

MapScript.Ja - mapObj.embedLegend Diff

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

!!mapObj.embedLegend メソッド
!!!説明
ラベルキャッシュに凡例を描画する。地図に埋め込まれた凡例を描く。

Public Function embedLegend(ByVal image As imageObj) As Integer

public int embedLegend(
    imageObj image
);

Public Function embedLegend(ByVal image As imageObj) As Integer


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

With _map.legend
    .postlabelcache = mapscript.MS_TRUE
    .status = mapscript.MS_EMBED
    .height = 100
    .width = 100
    .template = "legend.html"
End With

_layer.labelcache = mapscript.MS_TRUE
_layer.postlabelcache = mapscript.MS_TRUE

_img = _map.draw

_map.embedLegend(_img)
_map.drawLabelCache(_img)


""各レイヤーのラベルキャッシュを設定して、postlabelcache を有効にすることで地図内に凡例を埋め込むことができる
!!!!マップファイル
  LEGEND
    IMAGECOLOR 255 255 255
    KEYSIZE 20 10
    KEYSPACING 5 5
    LABEL
      SIZE MEDIUM
      TYPE BITMAP
      BUFFER 0
      COLOR 0 0 0
      FORCE FALSE
      MINDISTANCE -1
      MINFEATURESIZE -1
      OFFSET 0 0
      PARTIALS TRUE
      POSITION CC
    END
    POSITION LL
    POSTLABELCACHE TRUE
    STATUS EMBED
    TEMPLATE "legend.html"
  END
!!!参照

[[mapObj メンバ]] | [[(global) 名前空間|http://wiki.fdiary.net/MapScriptJa]]