如何将我的谷歌地图应用程序转换为谷歌地球应用程序? [英] How do I convert my google maps application into a google earth application?

查看:198
本文介绍了如何将我的谷歌地图应用程序转换为谷歌地球应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在maps.google.com上,您可以看到一个关于Google地图应用程序如何能够顺利地变成谷歌地球应用程序的精彩示例。



我正在开发一个Google地图应用程序,与API版本3一起工作。我在Google Earth API总结中阅读了以下内容:
$ b


如果您有现有的地图API网站
,您可以使用
作为一行代码来使您的页面三维化。


但是我搜索了几个小时,却没有发现任何线索如何在我的应用程序中启用3D。我已经在google.maps.Map构造函数中构建了我的应用程序,并且包含此url中的google mas API: http://maps.google.com/maps/api/js



有人知道我在说什么和/或知道如何在Google地图应用程序中启用3D应用程序1行?



Codemonkey

解决方案

要将Google地球实例添加到地图,只需使用 GMap2.addMapType()将地图 G_SATELLITE_3D_MAP 添加到地图中>。

  var map = new GMap2(document.getElementById(map_canvas),{size:new GSize(640,480)} ); 
map.setCenter(new GLatLng(42.366662,-71.106262),11);

//启用地球图类型
map.addMapType(G_SATELLITE_3D_MAP);

var mapControl = new GMapTypeControl();
map.addControl(mapControl);
map.setMapType(G_SATELLITE_3D_MAP);

以下是关于将地图Api与Google Earth插件集成v2的信息
< a href =http://code.google.com/apis/maps/documentation/javascript/v2/services.html#Earth =nofollow> http://code.google.com/apis/maps/ documentation / javascript / v2 / services.html#Earth

On maps.google.com you can see a brilliant example on how a google maps application can suddenly turn into a google earth application smoothly.

I'm developing a google maps application, working with API version 3. I read the following line in the Google Earth API summary

If you have an existing Maps API site, you can 3D-enable your page with as little as one line of code.

But I have searched for hours without finding any clue how to enable 3D in my application. I've built my application on the google.maps.Map constructor and included the google mas API from this url: http://maps.google.com/maps/api/js

Does anyone know what I'm talking about and/or know how to enable 3D in a google maps application in 1 line?

Codemonkey

解决方案

To add the Google Earth instance to your map, simply add the G_SATELLITE_3D_MAP to your map with GMap2.addMapType().

var map = new GMap2(document.getElementById("map_canvas"),{ size: new GSize(640,480) } );
map.setCenter(new GLatLng(42.366662,-71.106262), 11);

// Enable the Earth map type
map.addMapType(G_SATELLITE_3D_MAP);

var mapControl = new GMapTypeControl();
map.addControl(mapControl);
map.setMapType(G_SATELLITE_3D_MAP);

Here is the information on Integrating v2 of the maps Api with the Google Earth Plugin http://code.google.com/apis/maps/documentation/javascript/v2/services.html#Earth

这篇关于如何将我的谷歌地图应用程序转换为谷歌地球应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆