开发者

Get user location on map?

I have a map view that zooms and places markers. I to get the users location on start up. How would I go about do开发者_如何转开发ing this? Thanks in advance.


By on startup - I assume its application start up. Just register a LocationListener before you have your map view displayed. The callback to the LocationListener should give you the current co-ordinates. You can now use these co-ordinates to place markers.


   GeoPoint geoPoint = new GeoPoint((int) (your_location_variable.getLatitude() * 1E6),(int) (your_location_variable.getLongitude() * 1E6));
    mapController.animateTo(geoPoint);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜