简体   繁体   English

从应用启动Google地图

[英]Launch Google Maps from app

I have setup my app to launch Google maps to a set location using the code below, but the map displays zoomed full and you cant see any roads you have to zoom out manually to see anything. 我已经设置了我的应用,以使用以下代码将Google地图启动到设置的位置,但是地图显示为完整缩放,您看不到必须手动缩小才能看到的任何道路。 How can I set the zoom level with the code below I've tried setZoom(16); 我如何使用下面尝试设置setZoom(16)的代码设置缩放级别? but this has no effect. 但这没有效果。

if (mapnav == 10) {
   String uri = "geo: 53.777969,-1.571474";        
   setZoom(16);

   Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));

   startActivity(i);}

Also can I launch into Directions instead of the map 我也可以进入路线而不是地图

You can specify a zoom level in your URI with for example "geo: 53.777969,-1.571474?z=23" 您可以在URI中指定缩放级别,例如"geo: 53.777969,-1.571474?z=23"

Google Maps 谷歌地图

 geo:latitude,longitude geo:latitude,longitude?z=zoom geo:0,0?q=my+street+address geo:0,0?q=business+near+city 

VIEW 视图

Opens the Maps application to the given location or query. 将地图应用程序打开到给定的位置或查询。 The Geo URI scheme (not fully supported) is currently under development. 目前正在开发Geo URI方案(不完全支持)。
The z field specifies the zoom level. z字段指定缩放级别。 A zoom level of 1 shows the whole Earth, centered at the given lat,lng. 缩放级别1表示整个地球,以给定的纬度为中心。 A zoom level of 2 shows a quarter of the Earth, and so on. 缩放级别2表示地球的四分之一,依此类推。 The highest zoom level is 23. A larger zoom level will be clamped to 23. 最高缩放级别为23。更大的缩放级别将固定为23。

For the google navigation part you can use "google.navigation:q="+location where location are the coordinates. 对于google导航部分,您可以使用"google.navigation:q="+location ,其中location是坐标。 The intent Intent.ACTION_VIEW . 意图Intent.ACTION_VIEW


Resources : 资源:

On the same topic : 在同一主题上:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM