mylocationoverlay

Maps V2 myLocation blue dot callback

北慕城南 提交于 2019-12-01 12:00:06
问题 I want to be able to click the blue dot (my location) that is shown on the map. Is there anyway to get a callback from that click? Thanks, Martijn 回答1: One possible workaround might be drawing a Marker (with a similar icon) on top of the My Location dot so you can receive the corresponding onMarkerClick() callback. This would also require removing the marker and adding it to the new location everytime there's a location update event, which you can listen to by implementing

How to draw at the current GPS location on MapView using MyLocationOverlay?

て烟熏妆下的殇ゞ 提交于 2019-12-01 01:09:19
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? NickT 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 . . 来源: https://stackoverflow.com/questions/4624993/how-to-draw-at-the-current

Google Maps API Android v2 - “ACCESS_FINE_LOCATION” permission required with my-location layer enabled

♀尐吖头ヾ 提交于 2019-11-28 08:06:43
问题 I want to show the location of the user on a Google Maps enabling my-location layer, but this functionality requires the "ACCESS_FINE_LOCATION" permission to get the location from the GPS. Is it possible to prevent the GoogleMap from trying to get the location from the GPS? If I remove the permission "ACCESS_FINE_LOCATION" in the Manifest file, as soon as I try to display the map, the app crashes with the following error: E/AndroidRuntime(28578): FATAL EXCEPTION: main E/AndroidRuntime(28578):

How can I use a custom bitmap for the “you are here” point in a MyLocationOverlay?

大城市里の小女人 提交于 2019-11-27 13:50:18
I've poured over the docs and haven't been able to figure this out. Is it even possible? Please see this It looks like the correct mechanism to do this is to extend MyLocationOverlay then override the drawMyLocation() protected method. The following uses an arrow to show where "you" are and which way "you" are pointing: package com.example; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Point; import android.location.Location; import com.google.android

Android MapActivity : Couldn't get connection factory client

∥☆過路亽.° 提交于 2019-11-26 22:41:40
I'm trying to get the Map demos working, as provided in the Google API sample projects. I am using AVDs and have tried with versions 8, 10 and 11 and get the same issue. I've generated my own debug key and added to the project. I can see the map on app start up, and can zoom in etc - so I am getting the map tiles, fine. Yes - I have the correct permissions and library set in the Manifest file (as per samples). But, I cannot set a location on the map, either via DDMS or Telnet. I see the following error in LogCat: MapActivity : Couldn't get connection factory client I've read numerous threads

Android MapActivity : Couldn't get connection factory client

那年仲夏 提交于 2019-11-26 08:25:05
问题 I\'m trying to get the Map demos working, as provided in the Google API sample projects. I am using AVDs and have tried with versions 8, 10 and 11 and get the same issue. I\'ve generated my own debug key and added to the project. I can see the map on app start up, and can zoom in etc - so I am getting the map tiles, fine. Yes - I have the correct permissions and library set in the Manifest file (as per samples). But, I cannot set a location on the map, either via DDMS or Telnet. I see the