简体   繁体   English

Android地图和地点位置

[英]Android Maps and Places Location

I am building an app that has a map feature and have search all over the internet trying to find a solution to my problem. 我正在构建一个具有地图功能的应用程序,并在互联网上搜索,试图找到我的问题的解决方案。

The problem is, I don't know which method of implementation is best for me. 问题是,我不知道哪种实施方法最适合我。

I want to do two things and I'm sure new programmers are thinking of this too: 我想做两件事,我确信新程序员也在考虑这个问题:

1) I want to make a map view that has the user's location on it and has pin points of locations that I have supplied in a list. 1)我想创建一个具有用户位置的地图视图,并且具有我在列表中提供的位置的引脚点。

2) I want to get the closest store (based on a latitude/longitude list) to the person. 2)我想得到最近的商店(基于纬度/经度列表)给这个人。

Is this possible? 这可能吗? I don't need the entire implementation coded for me. 我不需要为我编写完整的实现。 I just need a starting point. 我只需要一个起点。

Thanks, 谢谢,

Definitely possible. 绝对有可能。 You need 3 things: 你需要3件事:

1)A MapView. 1)MapView。 You need to sign up for a Google Maps id, they have some tutorials for implementing one where you do. 您需要注册Google地图ID,他们有一些教程可以帮助您实现目标。 The Maps API has functionality for showing your location and for putting pins on the map. Maps API具有显示您的位置和在地图上放置图钉的功能。

2)You'll need to get your own location for your calculation. 2)您需要获得自己的位置进行计算。 This is a simple use of the LocationManager and Location classes. 这是LocationManager和Location类的简单使用。

3)You need to get a list of the stores with their latitude and longitude. 3)您需要获得具有纬度和经度的商店列表。 At startup you parse the list, add them to the map overlay, and you can find the distance between you and them using the Location class's distance functions. 在启动时,您解析列表,将它们添加到地图叠加层,您可以使用Location类的距离函数找到您与它们之间的距离。

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

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