如何检测用户何时使用Android中的Google Maps API进入或退出高速公路? 我构建一个Android应用程序,我需要检测用户何时进入或退出高速公路。 我正在使用Google Maps API实时跟踪用户的位置。 我如何确定用户是否...

问题描述 投票:0回答:1
您可以使用this Answer

中的thim thim thim -this Answer thim -the Answer that Answer tht tht Answer thim this Answers标记某些颜色的高速公路。具体来说,您只需为带有水和设置水颜色以外的所有功能的LAT/LON坐标的一个像素地图(尺寸= 1x1)创建请求。纯红色(0xff0000)。这样的东西:

https://maps.googleapis.com/maps/api/staticmap?&center={YOUR_LAT},{YOUR_LON}&zoom={YOUR_ZOOM}&size=1x1&style=feature:all|visibility:off&style=feature:highways|visibility:on&style=feature:highways|color:0xFF0000&key={YOUR_API_KEY}

然后下载并检查颜色。如果纯红色(0xff0000)用户在高速公路上(如果不是),则是在高速公路上。您需要时间进行此检查,以便准确地进入高速公路进入/退出。

java android google-maps google-maps-api-3 google-maps-android-api-2
1个回答
0
投票
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.