mapbasic 怎样生成图层,想生成一个道路层? 20

例如是怎样做的呢?知道的话发我邮箱谢谢.423550396@qq.com... 例如是怎样做的呢?知道的话发我邮箱谢谢.423550396@qq.com 展开
 我来答
哈利
2011-09-22 · TA获得超过1079个赞
知道大有可为答主
回答量:2258
采纳率:80%
帮助的人:658万
展开全部
给你一段代码你看看吧。

Include "mapbasic.def"
Include "icons.def"
Include "menu.def"

Declare Sub main
Declare Sub open_tables
Declare Sub move_trucks
Declare Sub end_program

Global Use_Animation as Logical

Sub Main
Create Menu "&Animation Layer" As
"&Test Animation Layer" Calling move_trucks,
"&End Program" Calling end_program
Alter Menu Bar Add "&Animation Layer"
Close All
call Open_Tables
End Sub

Sub Open_Tables
Open Table "D:\MapInfo\MapData\tutordata\DC\dcwashs.tab" As DCWASHS Interactive
Open Table "F:\annimate\nodexy" As TRK_XYS Interactive
Open Table "F:\annimate\trucks" As TRUCKS Interactive
Map From DCWASHS
Set Map Center (-77.023, 38.901) zoom 15.65 Units "km"
Set Window Frontwindow() Max
End Sub

Sub move_trucks
dim i as integer
Dim delay as Integer
Dim x,y as Float
Dim truck_symbol as Symbol

Use_Animation = Ask("Do you want to use the Animation Layer feature?","&Yes","&No")
If use_animation then Add Map Layer trucks Animate '采用动态图层与不采用动态图层的区别。
Else Add Map Layer trucks
End If

Fetch First From trk_xys

Do While Not EOT(trk_xys)
x = trk_xys.xcoord
y = trk_xys.ycoord
Update trucks Set Obj = CreatePoint(x,y) Where Rowid = 1
Fetch next from trk_xys
for i = 1 to 2500 '还有其它更好的办法来实现延时吗?
next
Loop

If use_animation Then Remove Map Layer Animate
Else Remove Map Layer trucks
End If
End Sub

Sub end_program
Close All
End Program
End Sub
追问
怎样去创建地名层呢?

参考资料: ww.baidu.com/。http://www.gzhatu.com

12917736427c66b6
2015-10-26 · TA获得超过4.1万个赞
知道大有可为答主
回答量:7541
采纳率:83%
帮助的人:649万
展开全部
代码如下:
Include "mapbasic.def"
Include "icons.def"
Include "menu.def"

Declare Sub main
Declare Sub open_tables
Declare Sub move_trucks
Declare Sub end_program

Global Use_Animation as Logical

Sub Main
Create Menu "&Animation Layer" As
"&Test Animation Layer" Calling move_trucks,
"&End Program" Calling end_program
Alter Menu Bar Add "&Animation Layer"
Close All
call Open_Tables
End Sub

Sub Open_Tables
Open Table "D:\MapInfo\MapData\tutordata\DC\dcwashs.tab" As DCWASHS Interactive
Open Table "F:\annimate\nodexy" As TRK_XYS Interactive
Open Table "F:\annimate\trucks" As TRUCKS Interactive
Map From DCWASHS
Set Map Center (-77.023, 38.901) zoom 15.65 Units "km"
Set Window Frontwindow() Max
End Sub

Sub move_trucks
dim i as integer
Dim delay as Integer
Dim x,y as Float
Dim truck_symbol as Symbol

Use_Animation = Ask("Do you want to use the Animation Layer feature?","&Yes","&No")
If use_animation then Add Map Layer trucks Animate '采用动态图层与不采用动态图层的区别。
Else Add Map Layer trucks
End If

Fetch First From trk_xys

Do While Not EOT(trk_xys)
x = trk_xys.xcoord
y = trk_xys.ycoord
Update trucks Set Obj = CreatePoint(x,y) Where Rowid = 1
Fetch next from trk_xys
for i = 1 to 2500 '还有其它更好的办法来实现延时吗?
next
Loop

If use_animation Then Remove Map Layer Animate
Else Remove Map Layer trucks
End If
End Sub

Sub end_program
Close All
End Program
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
典颐Rv
推荐于2016-03-26 · TA获得超过2.2万个赞
知道大有可为答主
回答量:2615
采纳率:31%
帮助的人:405万
展开全部
Include "mapbasic.def"
Include "icons.def"
Include "menu.def"

Declare Sub main
Declare Sub open_tables
Declare Sub move_trucks
Declare Sub end_program

Global Use_Animation as Logical

Sub Main
Create Menu "&Animation Layer" As
"&Test Animation Layer" Calling move_trucks,
"&End Program" Calling end_program
Alter Menu Bar Add "&Animation Layer"
Close All
call Open_Tables
End Sub

Sub Open_Tables
Open Table "D:\MapInfo\MapData\tutordata\DC\dcwashs.tab" As DCWASHS Interactive
Open Table "F:\annimate\nodexy" As TRK_XYS Interactive
Open Table "F:\annimate\trucks" As TRUCKS Interactive
Map From DCWASHS
Set Map Center (-77.023, 38.901) zoom 15.65 Units "km"
Set Window Frontwindow() Max
End Sub

Sub move_trucks
dim i as integer
Dim delay as Integer
Dim x,y as Float
Dim truck_symbol as Symbol

Use_Animation = Ask("Do you want to use the Animation Layer feature?","&Yes","&No")
If use_animation then Add Map Layer trucks Animate '采用动态图层与不采用动态图层的区别。
Else Add Map Layer trucks
End If

Fetch First From trk_xys

Do While Not EOT(trk_xys)
x = trk_xys.xcoord
y = trk_xys.ycoord
Update trucks Set Obj = CreatePoint(x,y) Where Rowid = 1
Fetch next from trk_xys
for i = 1 to 2500 '还有其它更好的办法来实现延时
next
Loop

If use_animation Then Remove Map Layer Animate
Else Remove Map Layer trucks
End If
End Sub

Sub end_program
Close All
End Program
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式