<< Click to Display Table of Contents >>

 

RefreshActiveView

 

 

更新地圖顯示

RefreshActiveView使用範例

import sgpy

# 取得目前地圖

sgd = sgpy.mapping.MapDocument("current")

# 取得data frame

df = sgd.activeDataFrame

#從檔案中仔入圖層,並加入data frame中

lyr = sgpy.mapping.Layer("D:/temp/Line2.shp")

sgpy.mapping.AddLayer(df, lyr,"AUTO_ARRANGE")

# 建立新的Extent位置

ext = sgpy.Extent(307319.656578944, 2776637.25, 308710.892457118, 2776970.39980263)

# 將地圖移到Extent位置上

df.panToExtent(ext) # 將地圖移到位置上

# 地圖更新 (將前面所做的設定,套用到地圖上)

sgpy.RefreshActiveView()

 


©2015 Supergeo Technologies Inc. All rights reserved.