Unity3d 嵌入GoogleMap
原地址“http://cl314413.blog.163.com/blog/static/190507976201442371753142/
新建工程导入Google Maps for Unity包

打开自带Demo场景,会发现报错了。

大致看了看好像是不能解析HTTP。
然后找寻方法,点开README.txt.

1 Google Maps for Unity
2 ---------------------
3
4 Support: forum.differentmethods.com
5
6 Note: Google Maps for Unity requires UniWeb: http://u3d.as/1Cw
7 This is because the Google Maps API requires the use and respect of cache
8 control headers, which are unsupported by the builtin WWW class.
9
10 Because of this, this package will not work in WebPlayer builds as google
11 does not provide a Cross Domain policy server.
12
13 Getting Started
14 ---------------
15
16 1. Assign the GoogleMap component to your game object.
17
18 2. Setup the parameters in the inspector.
19 2.1 If you want to control the center point and zoom level, make sure that
20 the Auto Locate Center box is unchecked. Otherwise the center point is
21 calculated using Markers and Path parameters.
22
23 3. Each location field can be an address or longitude / latitude.
24
25 4. The markers add pins onto the map, with a single letter label. This label
26 will only display on mid size markers.
27
28 5. The paths add straight lines on the map, between a set of locations.
29
30 6. For in depth information on how the GoogleMap component uses the Google
31 Maps API, see:
32 https://developers.google.com/maps/documentation/staticmaps/#quick_example

可以看到README中标红的第六行告诉我们,unity谷歌地图需要uniweb支持。
然后继续在应用商店搜索,然后下载导入包:

导入包后,可以看到无措可运行:

新建一个场景,添加一个Plane(平面)用来显示地图,添加一个直射光。(用于测试,没做自适应,所以调整平面与相机的距离)

将GoogleMaps中的GoogleMap.cs脚本拖入Plane。

作如图的参数修改:
取消Auto Lacate Center勾选。
填写Center Location的经纬度(设置地图显示的中心)
设置Zoom值为16(用于显示范围)
设置Map Type为RoadMap
设置Size为1024
勾选Double Resolution
Markers是地图中的标记组,设置个数为1(可以为多个),设置标记的大小,颜色和位置(经纬度)
Paths是地图中的路径组,设置个数为1(可以为多个),设置宽度,颜色,填充色(覆盖的范围),选择路经地点(设置为3个地点的经纬度)
点击运行如图:

PS:获取具体地理位置的经纬度方法:
点开网页google地图http://ditu.google.cn/maps?hl=zh-CN&tab=wl,找到要选择的地点最大化,右键该地点,选择"这儿是什么?",地点上方出现绿色箭头,鼠标悬浮出现经纬度。

Unity3d 嵌入GoogleMap的更多相关文章
- Unity3D嵌入WPF教程
Unity3D嵌入WPF教程 创建一个 类库工程 添加 WindowForm 用户控件 (UserControl) 1).引入 UntiyWebPlayer COM 组件 在工具->选择工具箱中 ...
- unity3d 嵌入iOS的 In App Purchase 应用程序内购买
Unity做东西是快,但是有些功能是需要额外开发的,比如 IAP (In App Purchase,应用程序内购买) 还好unity提供了灵活的扩展功能,允许嵌入原生代码来做一些unity未实现的功能 ...
- Unity3d嵌入web网页
应用场景 程序中的界面风格 UI内容等相关内容需要很容易方便的跟新替换,不使用unity传统的热加载方式,也不想使用和H5等做混合APP的时候, 就用嵌入web来实现. 假如我想替换某个背景图,一般来 ...
- Unity3D 将 Unity 嵌入WPF中的一些研究笔记
一. 在 WPF 中使用 WebBrowser,直接打开 WebPlayer.html 以这种方式有一个问题是. 无法在 WebBrowser 的上面 放置其它的控件, 在运行时,都不会显示 . 以 ...
- Unity3d:使用uWebKit插件嵌入网页,网页中的flv视频无法播放
问题描述:unity3d程序,使用uWebKit插件嵌入网页,用来播放FLV视频,有的电脑可以正常播放,有的电脑在网页中播放不了ps:网页中的播放器用的是player.swf解决方案:是由于网页中的播 ...
- WPF嵌入Unity3D代码下载
这不是大家想找的资源,这是给我的一个帖子用的.当然可以使用u3d自带编译器打开.这是给wpf 嵌入u3d的例子贴用http://bbs.csdn.net/topics/391853486?page=1 ...
- Unity3d Android程序嵌入Admob广告条
原地址:http://dong2008hong.blog.163.com/blog/static/4696882720140441353482/ Seems like using a simple A ...
- C# winform嵌入unity3D
最近做项目需要winform嵌入unity的功能,由于完全没接触过这类嵌入的于是在网上搜,有一种方法是UnityWebPlayer插件,也开始琢磨了一段时间,不过一会发现在5.4版本以后这个东西就被淘 ...
- 将unity3d项目嵌入到Android App中使用
创建一个新的AndroidStudio app项目. 1.添加库文件:拷贝unity安装目录下的库文件:Unity\Editor\Data\PlaybackEngines\AndroidPlayer\ ...
随机推荐
- Delphi2007新功能 -- 有限的栈对象
今天使用Delphi2007,一个误输入,无意中发现Delphi2007的record类型居然能够和TObject一样定义方法和属性,而且不需要调用类似TObject.Create方法就能生成一个re ...
- centos 查看 arp
yum install tcpdump -y tcpdump arp :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ...
- [BZOJ2555]SubString LCT+后缀自动机
2555: SubString Time Limit: 30 Sec Memory Limit: 512 MBSubmit: 3253 Solved: 975[Submit][Status][Di ...
- codeforces 739E
官方题解是一个n2logn的dp做法 不过有一个简单易想的费用流做法 对每个小精灵,连边(A,i,1,pi) (B,i,1,ui) (i,t,1,0) (i,t,1,-pi*ui) 最后连边(s,A, ...
- win上使用nvm管理node版本
win上使用nvm管理node版本 若想让nvm管理机器上所有的node版本,首先需要卸载电脑上已有的node(很重要), 然后下载nvm在win上的安装包 windows-nvm的下载地址 下载 下 ...
- debug 英文翻译
declaration of 'int a' shadows a parameter :函数参数里,已经有这两个名称的变量了,指定义了同名的参数,造成了隐藏. expected primary-exp ...
- java.lang.ClassCastException: com.sun.proxy.$Proxy13 cannot be cast to sm.dao.UserDao
在Spring中添加事物管理以后出现的问题 源代码 ApplicationContext applicationContext = new ClassPathXmlApplicationContext ...
- CodeForces - 981D Bookshelves
Discription Mr Keks is a typical white-collar in Byteland. He has a bookshelf in his office with som ...
- AtCoder - 2567 RGB Sequence
Problem Statement There are N squares arranged in a row. The squares are numbered 1, 2, …, N, from l ...
- [Contest20180328]同构
我们先把两棵树的所有节点的儿子排序,然后dfs,记录访问的深度序列 然后可以发现题目中的两个操作都只会在深度序列中删掉一位,不会对其他位有影响(自己画画图就知道了) 对于一个深度序列$d_{1\cdo ...