How to draw at the current GPS location on MapView

2019-02-15 20:10发布

I'm trying to draw a custom gps-location icon. I'm using MapView and have created a class MyLocationArrow that extends MyLocationOverlay.

I override drawMyLocation() and draw a point at 100,100. But this is the coordinates on screen. How do I get the screen-coordinates from the current GPS-location?

1条回答
倾城 Initia
2楼-- · 2019-02-15 20:46

You can use

android.graphics.Point toPixels(GeoPoint in,
                                android.graphics.Point out)

Converts the given GeoPoint to onscreen pixel coordinates, relative to the top-left of the MapView that provided this Projection.

.

查看更多
登录 后发表回答