如何添加标记只有街道 - 的Andr​​oid开发 [英] How do I add markers to streets only - Android Development

查看:114
本文介绍了如何添加标记只有街道 - 的Andr​​oid开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大量的搜索之后,我还没有找到一个解决方案,为我工作,我真的希望这里有人可以帮助我。首先,我将解释我的问题,然后我会提到一些至今认为我已经尝试的方法/的。

After plenty of searching, I haven't yet found a solution that works for me and I'm really hoping someone here could help me. First I'll explain my problem, and then I'll mention some of the approaches I've attempted/considered so far.

基本上,我开发一个Android应用程序,其中标记随机出现各地用户的位置。美中不足的是,标记需要放置在街道上而已。

Basically, I'm developing an Android app where markers randomly appear around the user's location. The catch is, the markers need to be placed on streets only.

我一直在使用谷歌地图Android的API V2,但我想使用任何与限制,如地理编码来解决。

I've been working with Google Maps Android API V2 but I'm trying to work around using anything with "limitations" such as 'geocoding'.

我用考虑过不同的地图API的,如Nutiteq但我已经遇到了一些麻烦实现它们。这将是很好坚持谷歌,因为我已经熟悉了,但我很愿意去尝试,你可能有任何建议。

I've considered using different map API's such as Nutiteq but I've had some trouble implementing them. It would be nice to stick to Google since I've become familiar with it but I'm willing to try any suggestions you may have.

我甚至考虑装载了谷歌地图API V3在HTML文件中,这样我就可以使用GDirections加载路径从一个点到自己,然后分析这些数据,使用JS谷歌地图Android的API V2,但事实证明GDirections有限制为好。

I have even considered loading up Google Maps API V3 in an html file so that I can use GDirections to load a path from one point to itself and then parse this data to Google Maps Android API V2 using JS but turns out GDirections has a limit as well.

任何人有任何想法如何,我可以去这样做?即使解决方案是哈克,它仍然是东西。

Anyone have any idea how I can go about doing this? Even if the solution is hacky, it's still something.

我是相当新的Andr​​oid开发。

I'm fairly new to Android Development.

推荐答案

滑稽你想要达到的目标。你并不需要加载API V3 HTML。您可以直接使用方向API:<一href="http://maps.googleapis.com/maps/api/directions/json?origin=51,19&destination=51,19&sensor=false">http://maps.googleapis.com/maps/api/directions/json?origin=51,19&destination=51,19&sensor=false

Funny what you want to achieve. You don't need to load API V3 html. You can use directions api directly: http://maps.googleapis.com/maps/api/directions/json?origin=51,19&destination=51,19&sensor=false

它仍然有一定的局限性,但像2000或一天的设备的东西。而你不希望把2000多标记单用户的屏幕,你呢?

It still has limitations, but is was like 2000 or something a day a device. And you don't want to put more than 2000 markers on single user's screen, do you?

这是很容易解析,例如使用GSON。

This is easy to parse, for example with Gson.

这篇关于如何添加标记只有街道 - 的Andr​​oid开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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