
mapbasic 怎样生成图层,想生成一个道路层? 20
3个回答
展开全部
给你一段代码你看看吧。
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
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
展开全部
代码如下:
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
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
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
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询