简体   繁体   English

指向Android Studio中Google Maps中的位置

[英]Pointing to a location in Google Maps in Android Studio

I am working on an app using android studio where cell data is saved in a database with it's corresponding location in latitude and longitude coordinates and users can access this data when there is no service to find a way to a good to better service. 我正在使用android studio开发的应用程序,其中单元格数据在纬度和经度坐标中的对应位置保存在数据库中,并且当没有服务时,用户可以访问此数据,以找到更好的服务方式。 The data will be drawn to a google maps activity and color coordinated to represent the color but I also want to add an arrow the points from current location to the best cell service within a radius that I will set up. 数据将被绘制到google maps activity并且颜色经过协调以代表颜色,但是我还想添加一个箭头,指示从current location到我将要设置的半径内的最佳像元服务的点。

Is it possible to draw an arrow to accomplish the task of pointing to a data point that is drawn? 是否可以绘制箭头来完成指向所绘制数据点的任务? any info that points me in the right direction or the answer will help, thank you. 任何指向我正确方向或答案的信息都会有所帮助,谢谢。

EDIT The arrow design I have in mind points to the better signal but does not connect to the other location. 编辑我想到的箭头设计指向更好的信号,但没有连接到其他位置。 I will figure out a more complex pointing device later in development so I am just looking for information on the possibility of a short pointer arrow that represents a "GO THAT WAY" response. 我将在以后的开发中找到一个更复杂的定点设备,因此我只是在寻找有关表示“前进方式”响应的短指针箭头的可能性的信息。

You can use Ground overlays , where you can set particular image at given latlong. 您可以使用地面叠加层,在其中可以将特定图像设置为给定的latlong。

LatLng NEWARK = new LatLng(40.714086, -74.228697);

GroundOverlayOptions newarkMap = new GroundOverlayOptions()
    .image(BitmapDescriptorFactory.fromResource(R.drawable.newark_nj_1922))
    .position(NEWARK, 8600f, 6500f);
map.addGroundOverlay(newarkMap);

for rotating the image you can look 用于旋转图像,您可以看

https://stackoverflow.com/a/4332278/7386743 https://stackoverflow.com/a/4332278/7386743

Are you talking about creating line between the two points ? 您是在谈论在两点之间划定界限吗? Could you clearify more what do you exactly need ? 您能否进一步说明您到底需要什么? If it creating a line then you can use polyline 如果它创建一条线,那么您可以使用折线

GoogleMap map;
Polyline line = map.addPolyline(new PolylineOptions()
 .add(new LatLng(51.5, -0.1), new LatLng(40.7, -74.0))
 .width(5)
 .color(Color.RED));

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

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