Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LittleGrayEagle
qplanetosm
提交
11f7f66e
qplanetosm
项目概览
LittleGrayEagle
/
qplanetosm
与 Fork 源项目一致
Fork自
colorEagleStdio / qplanetosm
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
qplanetosm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
11f7f66e
编写于
3月 06, 2016
作者:
丁劲犇
😸
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
We should detect the controls' layernames in multi-ctrl app.
上级
c6b2636d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
44 addition
and
29 deletion
+44
-29
windows_containers/CSharpContainer/Form1.cs
windows_containers/CSharpContainer/Form1.cs
+44
-29
未找到文件。
windows_containers/CSharpContainer/Form1.cs
浏览文件 @
11f7f66e
...
...
@@ -12,9 +12,24 @@ namespace CSharpContainer
{
public
partial
class
CSharpMapContainer
:
Form
{
public
string
m_gridLayerName
;
public
string
m_geomarkerLayerName
;
public
void
init_layer_names
()
{
int
layers
=
axqtaxviewer_planetosm1
.
osm_layer_get_count
();
for
(
int
i
=
0
;
i
<
layers
;
++
i
)
{
string
layername
=
axqtaxviewer_planetosm1
.
osm_layer_get_name
(
i
);
if
(
layername
.
Contains
(
"grid"
))
m_gridLayerName
=
layername
;
if
(
layername
.
Contains
(
"geomarker"
))
m_geomarkerLayerName
=
layername
;
}
}
public
CSharpMapContainer
()
{
InitializeComponent
();
init_layer_names
();
}
//a common message output method
private
void
messageOutput
(
string
strmsg
,
int
intend
=
0
)
...
...
@@ -123,7 +138,7 @@ namespace CSharpContainer
pb_r
+
","
+
pb_g
+
","
+
pb_b
+
","
+
pb_a
+
";"
+
"color_label=0,0,255,96;weight_label=99;size_label=9;"
+
"width="
+
width
+
";height="
+
height
+
";"
;
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
cmd
);
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
cmd
);
}
}
//test function osm_set_remote_address
...
...
@@ -291,28 +306,28 @@ namespace CSharpContainer
private
void
moveLayerUpToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
int
n
=
axqtaxviewer_planetosm1
.
osm_layer_move_up
(
"grid1"
);
int
n
=
axqtaxviewer_planetosm1
.
osm_layer_move_up
(
m_gridLayerName
);
messageOutput
(
"osm_layer_move_up"
);
messageOutput
(
"res = "
+
n
,
4
);
}
private
void
moveLayerDownToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
int
n
=
axqtaxviewer_planetosm1
.
osm_layer_move_down
(
"grid1"
);
int
n
=
axqtaxviewer_planetosm1
.
osm_layer_move_down
(
m_gridLayerName
);
messageOutput
(
"osm_layer_move_down"
);
messageOutput
(
"res = "
+
n
,
4
);
}
private
void
moveLayerTopToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
int
n
=
axqtaxviewer_planetosm1
.
osm_layer_move_top
(
"grid1"
);
int
n
=
axqtaxviewer_planetosm1
.
osm_layer_move_top
(
m_gridLayerName
);
messageOutput
(
"osm_layer_move_top"
);
messageOutput
(
"res = "
+
n
,
4
);
}
private
void
moveLayerBottomToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
int
n
=
axqtaxviewer_planetosm1
.
osm_layer_move_bottom
(
"grid1"
);
int
n
=
axqtaxviewer_planetosm1
.
osm_layer_move_bottom
(
m_gridLayerName
);
messageOutput
(
"osm_layer_move_bottom"
);
messageOutput
(
"res = "
+
n
,
4
);
}
...
...
@@ -327,7 +342,7 @@ namespace CSharpContainer
{
messageOutput
(
"grid1::measure control:"
);
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"grid1"
,
m_gridLayerName
,
"function=get_ruler_status;"
);
Dictionary
<
string
,
string
>
dr
=
string2dict
(
res
);
string
v
;
...
...
@@ -336,11 +351,11 @@ namespace CSharpContainer
int
s
=
System
.
Convert
.
ToInt32
(
v
);
messageOutput
(
"grid1::get_ruler_status="
+
s
,
4
);
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"grid1"
,
m_gridLayerName
,
"function=set_ruler_status;status="
+(~
s
).
ToString
());
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"grid1"
,
m_gridLayerName
,
"function=get_ruler_status;"
);
messageOutput
(
"grid1::set_ruler_status returns "
+
res
,
4
);
...
...
@@ -353,7 +368,7 @@ namespace CSharpContainer
{
messageOutput
(
"grid1::get_polygon:"
);
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"grid1"
,
"function=get_polygon;"
);
(
m_gridLayerName
,
"function=get_polygon;"
);
Dictionary
<
string
,
string
>
dr
=
string2dict
(
res
);
messageOutput
(
dr
,
4
);
}
...
...
@@ -362,7 +377,7 @@ namespace CSharpContainer
{
messageOutput
(
"geomarker1::update_point"
);
//add a round point
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_point;name=point_001;type=1;"
+
"lat=35.2;lon=101.783;"
+
"style_pen=2;color_pen=0,0,255,128;width_pen=3;"
+
...
...
@@ -373,7 +388,7 @@ namespace CSharpContainer
messageOutput
(
res
);
//set props
messageOutput
(
"geomarker1::update_props"
);
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_props;name=point_001;"
+
"LABEL=Neimeng;EXPRESS=YunDa;Pero=NORMAL;"
+
"CheckTime=2014-12-30 07:18:32;"
+
...
...
@@ -381,7 +396,7 @@ namespace CSharpContainer
if
(
res
.
Length
>
0
)
messageOutput
(
res
);
//add a rect point
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_point;name=point_002;type=2;"
+
"lat=45.2;lon=54.783;"
+
"style_pen=4;color_pen=0,134,255,223;width_pen=2;"
+
...
...
@@ -392,7 +407,7 @@ namespace CSharpContainer
messageOutput
(
res
);
//set props
messageOutput
(
"geomarker1::update_props"
);
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_props;name=point_002;"
+
"LABEL=EMS Global;EXPRESS=EMS;IMM=NORMAL;"
+
"CheckTime=2014-12-31 17:18:32;"
+
...
...
@@ -404,7 +419,7 @@ namespace CSharpContainer
private
void
updateLineToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
messageOutput
(
"geomarker1::update_line"
);
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_line;name=line_001;type=3;"
+
"lat0=40;lon0=98;lat1=12;lon1=144;"
+
"style_pen=4;color_pen=255,0,0,96;width_pen=2;"
);
...
...
@@ -412,7 +427,7 @@ namespace CSharpContainer
messageOutput
(
res
);
//set props
messageOutput
(
"geomarker1::update_props"
);
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_props;name=line_001;"
+
"LABEL=A line;"
);
if
(
res
.
Length
>
0
)
...
...
@@ -422,7 +437,7 @@ namespace CSharpContainer
private
void
updatePolygonToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
messageOutput
(
"geomarker1::update_polygon"
);
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_polygon;name=polygon_1;type=4;"
+
"lat0=12.2;lon0=67.3;"
+
"lat1=24.3;lon1=72.8;"
+
...
...
@@ -435,13 +450,13 @@ namespace CSharpContainer
messageOutput
(
res
);
//set props
messageOutput
(
"geomarker1::update_props"
);
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_props;name=polygon_1;"
+
"LABEL=A polygon;"
);
if
(
res
.
Length
>
0
)
messageOutput
(
res
);
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_polygon;name=polygon_2;type=6;"
+
"lat0=-12.2;lon0=-67.3;"
+
"lat1=-24.3;lon1=-72.8;"
+
...
...
@@ -454,7 +469,7 @@ namespace CSharpContainer
messageOutput
(
res
);
//set props
messageOutput
(
"geomarker1::update_props"
);
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_props;name=polygon_2;"
+
"LABEL=A multiline;"
);
if
(
res
.
Length
>
0
)
...
...
@@ -464,7 +479,7 @@ namespace CSharpContainer
private
void
updateIconToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
messageOutput
(
"geomarker1::update_icon"
);
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_icon;name=icon1;"
+
"lat=12.347364;lon=107.3736438;"
+
"icon=default;scale=1.2;rotate=12;smooth=1;"
...
...
@@ -473,7 +488,7 @@ namespace CSharpContainer
messageOutput
(
res
);
//set props
messageOutput
(
"geomarker1::update_props"
);
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=update_props;name=icon1;"
+
"LABEL=A icon;"
);
if
(
res
.
Length
>
0
)
...
...
@@ -483,7 +498,7 @@ namespace CSharpContainer
private
void
existsToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
messageOutput
(
"geomarker1::exists"
);
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=exists;name=point_001;"
);
if
(
res
.
Length
>
0
)
messageOutput
(
res
);
...
...
@@ -492,7 +507,7 @@ namespace CSharpContainer
private
void
deletemarksToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
messageOutput
(
"geomarker1::delete_marks"
);
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=delete_marks;name0=point_001;name1=point_002;name2=line_001;name3=polygon_1;"
+
";name4=polygon_2;name5=icon1"
);
if
(
res
.
Length
>
0
)
...
...
@@ -502,7 +517,7 @@ namespace CSharpContainer
private
void
deletePropsToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
messageOutput
(
"geomarker1::delete_props"
);
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=delete_props;name=point_001;prop0=LABEL;prop1=CheckTime"
);
if
(
res
.
Length
>
0
)
messageOutput
(
string2dict
(
res
));
...
...
@@ -512,7 +527,7 @@ namespace CSharpContainer
{
messageOutput
(
"geomarker1::enum all infos"
);
//first, return all names
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
m_geomarkerLayerName
,
"function=mark_names;"
);
Dictionary
<
string
,
string
>
dct_names
=
string2dict
(
res
);
//for each name, get detailed infomations
...
...
@@ -521,12 +536,12 @@ namespace CSharpContainer
messageOutput
(
"info of "
+
name
+
":"
,
2
);
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
"function=mark;name="
+
name
+
";"
);
(
m_geomarkerLayerName
,
"function=mark;name="
+
name
+
";"
);
messageOutput
(
string2dict
(
res
),
4
);
messageOutput
(
"prop of "
+
name
+
":"
,
2
);
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
"function=props;name="
+
name
+
";"
);
(
m_geomarkerLayerName
,
"function=props;name="
+
name
+
";"
);
messageOutput
(
string2dict
(
res
),
4
);
}
...
...
@@ -540,7 +555,7 @@ namespace CSharpContainer
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
"function=save_xml;xml="
+
dlg
.
FileName
+
";"
);
(
m_geomarkerLayerName
,
"function=save_xml;xml="
+
dlg
.
FileName
+
";"
);
messageOutput
(
"save_xml"
);
messageOutput
(
res
,
4
);
}
...
...
@@ -554,7 +569,7 @@ namespace CSharpContainer
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
string
res
=
axqtaxviewer_planetosm1
.
osm_layer_call_function
(
"geomarker1"
,
"function=load_xml;xml="
+
dlg
.
FileName
+
";"
);
(
m_geomarkerLayerName
,
"function=load_xml;xml="
+
dlg
.
FileName
+
";"
);
messageOutput
(
"load_xml"
);
messageOutput
(
res
,
4
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录