Hello,I have draw the background map.Thanks for Mr.Rick Towler and
Mr.Mark Hadfield a lot.
But I met some difficulties when I try something else,so could you give
me some adivce please.
1, I want to draw some cities above the background map,but the symbols
can not be showed.
I use the code as follows:
;-----------------------------------------------------
;draw cities
cityUV = map_proj_forward(lon, lat, $
map=map_info.smap $
)
;define the symbol
pentagon=OBJ_NEW('IDLgrPolygon', [0.1,0.5,0.9,0.7,0.3], $
[0.6,0.9,0.6,0.1,0.1], $
COLOR=Color_cities $
)
symModel = OBJ_NEW('IDLgrModel')
symModel -> Add, pentagon
symModel -> Scale, 8, 8, 1
symModel -> Translate, -1, -1, 0
ocitiesSymbol = OBJ_NEW('IDLgrSymbol', symModel)
; ocitiesSymbol=OBJ_NEW('IDLgrSymbol',4,$
; color=Color_NoData,$
; thick=8.0,$
; size=[9.0,9.0]$
; )
map_info.ocitiesSymbol=ocitiesSymbol
oPlotCities=OBJ_NEW('IDLgrPlot',cityUV[0,*],cityUV[1,*], $
Symbol=ocitiesSymbol,$
_Extra=extra,$
;Thick=2 ,$
LINESTYLE =6 $
)
map_info.omodel->ADD,oPlotCities
map_info.owindow->DRAW,map_info.oview,/draw_instance
;--------------------------------------------------------
If I change the LINESTYLE value from 6 to 3,The lines has been
showed,but the Symbols also can not be showed .
2,I use the develop model of C# plus axIDLWidgetControl 3.0,I write
the mouse event in C#,so I must obtain the value of IDL's variable from
IDL's .pro file.But I can not get them .The code is as follows:
IDL's code
//////////////////////////////////////////////////////////// ///////////
PRO MouseMove,drawid,x,y
common lonlat_mousemovex,lonlat_mousemovey
widget_control,drawid,get_uvalue=map_info,/no_copy
if size(map_info, /type) eq 0 then return
result = map_info.owindow -> pickdata(map_info.oview, $
map_info.omodel,$
[x,y], xy)
lonlat_mousemove = map_proj_inverse(xy, map = map_info.smap)
map_info.lonlat_mousemovex=lonlat_mousemove[0]
map_info.lonlat_mousemovey=lonlat_mousemove[1]
widget_control,drawid,set_uvalue=map_info,/no_copy
END
C# 's code
///////////////////////////////////////////////////////
private void axIDLDrawWidget1_MouseMoveEvent(object sender,
AxIDLDRAWX3Lib._DIDLDrawX3Events_MouseMoveEvent
e)
{
int myYY=axIDLDrawWidget1.Height-e.y;
string
command="MouseMove,IDLDrawWidget1,"+e.x.ToString()+","+myYY.ToString();
int temp=axIDLDrawWidget1.ExecuteStr(command);
temp=axIDLDrawWidget1.ExecuteStr("widget_control,IDLDrawWidget1,get_value=map_info ");
object
lonlat_mousemovex=axIDLDrawWidget1.GetNamedData("map_info.lonlat_mousemovex ");
object
lonlat_mousemovey=axIDLDrawWidget1.GetNamedData("map_info.lonlat_mousemovey ");
}
I try my best to test above codes,but did not success.
I wish you can help me.
Thanks you
|