如何显示使用地图API地址的位置? [英] How to display location of address using map api?

查看:139
本文介绍了如何显示使用地图API地址的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在做很多的研究,没有文章没有告诉你如何实际显示的实际地址的位置。如果有任何人知道一个很好的教程,显示此,请让我知道。此外随意离开这里的教程。谢谢

I have been doing alot of research and no articles yet to tell you how to actually show a location of an actual address. If any one knows a good tutorial that shows this please let me know. Also feel free to leave a tutorial here. Thanks

要更具体的我想采取一个地址,并找到它在地图上。我知道我将不得不使用地理编码。但我不想仅仅是纬度和经度。实际位置

To be more specific i would like to take an address and locate it on the map. I know i will have to use geocoding. But i dont want just the lat and lon. the actual location

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

/>

推荐答案

该问题是寻求帮助使用地图的API,但如果这不是你的基本的应用程序,我得到它的工作没有地图API的帮助,它似乎很好地工作。一旦你有你的地址,它没有包括城市,州和/或邮政编码,如果你没有他们,使用以下命令:

This question is asking for help using the map api, but if that's not essential to your app, I got it working without the help of the map api, and it seems to work quite nicely. Once you have your address, which does not have to include the city, state, and/or zip if you don't have them, use the following:

Uri uri = Uri.parse("https://www.google.com/maps/place/" + streetAddress);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

地址例如:[街],[市],[状态] [拉链]

address example: "[street], [city], [state] [zip]"

就在互联网权限 AndroidManifest 是必需的。

Just the Internet permission in the AndroidManifest is required.

这会给用户可用来显示给定的地址,其中所选择的时候,会显示给定的地址的位置应用程序的列表。有人欢迎纠正我,如果我错了,但如果不提供一个城市,州和/或邮政编码,谷歌地图,至少,会发现最接近的物理地址用户的位置相匹配,它是什么,如果给出地址本身不是唯一的。

This will give the user a list of apps available to display the given address, which when chosen, displays the location of the given address. Somebody is welcome to correct me if I'm wrong, but if a city, state, and/or zip are not provided, Google Maps at least, will find the closest physical address to the user's location matching what it was given if the address itself is not unique.

这篇关于如何显示使用地图API地址的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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