
正文
vb.net实现地图浏览的简单介绍
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
vb.net程序(VS2010开发)中如何嵌入百度地图?求编程大神指导
这个说简单也简单,百度google都有自己的地图接口,去找一下接口调用说明,里面都有案例。在程序里面调用即可。至于调用后具体的功能则需要查询接口函数。我以前做过google的,百度的实际上也是一样
相关问答
Q1: 用vb.net如何编写图片浏览器的基本步骤功能是:图片的打开、显示、缩放、旋转。
窗体上放一个PictureBox,两个CommandButton,一个FileListBox
Private Sub Command1_Click()
If File1.ListIndex = 0 Then
ShowPic File1.ListCount - 1
Else
ShowPic File1.ListIndex - 1
End If
End Sub
Private Sub Command2_Click()
If File1.ListIndex = File1.ListCount - 1 Then
ShowPic 0
Else
ShowPic File1.ListIndex + 1
End If
End Sub
Private Sub Form_Load()
File1.Visible = False
File1.Pattern = "*.jpg;*.gif" '可以浏览的文件类型,使用分号隔开
File1.Path = App.Path '改成你需要浏览的目录,比如"C:\Pic"
If File1.ListCount 1 Then '目录中图片在两张以上可以浏览
ShowPic 0
Exit Sub
ElseIf File1.ListCount = 1 Then '目录中只有一张图片时只显示这一张
ShowPic 0
End If
Command1.Enabled = False
Command2.Enabled = False
End Sub
Private Sub ShowPic(Index As Long)
File1.ListIndex = Index
Picture1.Picture = LoadPicture(File1.Path "\" File1.List(Index))
End Sub
如果对您有帮助,请记得采纳为满意答案,谢谢!祝您生活愉快!
vaela
Q2: vb.net 如何嵌入地图
新建一个文件,写入下面的代码:
!doctype html
html
head
meta name="viewport" content="initial-scale=1.0, user-scalable=no" /
meta http-equiv="Content-Type" content="text/html; charset=gbk" /
titleBaidu Map V1.2/title
script type="text/javascript" src=";services=true"
!-- add baidu map api --
/script
/head
body
div id="container" style="width: 600px; height: 400px;"
/div
/body
/html
script type="text/javascript"
var map = new BMap.Map("container"); // new Map
var point = new BMap.Point(116.397128, 39.916527); // Location, (经度, 纬度)
map.centerAndZoom(point, 15); // show Map
// 添加缩放功能
map.enableScrollWheelZoom();
map.enableKeyboard();
/script
保存到程序exe同一目录下,文件名:map.html
然后BUTTON点击事件:
WebBrowser1.Navigate(Application.StartupPath "\map.html")
这样就可以了
ps:经纬度可以到百度地图官网去获取
或者到: 去生成代码
Q3: 在vb.net下怎么制作一个图片浏览器,根据用户选择的文件夹,程序自动搜索改文件夹下的图片文件。
Public Class Form1
Private TPS As Integer
Private TPPath() As String '定义不确定元素个数组,及动态数组
Private Sub LoadPhoto()
'将图片路径及图片名加载到数组
Dim JS As Integer '计数用
For Each foundFile As String In My.Computer.FileSystem.GetFiles(CurDir() "\职员图片")
TPS = TPS + 1 '将图片数存入变量中
Next
ReDim TPPath(TPS - 1) '确定数组大小
For Each FoundFile As String In My.Computer.FileSystem.GetFiles(CurDir() "\职员图片")
'将图片路径存入数组
TPPath(JS) = FoundFile
JS = JS + 1
Next
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LoadPhoto()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = TPPath.Length '获取数组大小
Label1.Text = TPPath(1) '获取数组中第2个元素的值
End Sub
Q4: vb.net webbrowser 操作
WebBrowser1.Document.All("labellong").SetAttribute("Value", x)
WebBrowser1.Document.All("labellat ").SetAttribute("Value", y)
WebBrowser1.Document.All("theLocation").InvokeMember("Click")





