itemizedoverlay

Android onTap mapView method not working after removing all points

孤人 提交于 2020-01-06 15:40:11
问题 The onTap() method working when there is minimum one point on map but when I remove all points from map then onTap() method is not working and I am unable to add points on map. Please help... Code: private class CustomItemizedOverlay2 extends ItemizedOverlay<OverlayItem> { private ArrayList<OverlayItem> mapOverlays = new ArrayList<OverlayItem>(); private Context context; private GeoPoint center = null; public CustomItemizedOverlay2(Drawable defaultMarker) { super(boundCenterBottom

Bitmap drawable (Map Overlay Item) pixelizes after rotation in android

天大地大妈咪最大 提交于 2020-01-05 05:40:10
问题 I'm trying to rotate an overlay drawable to represent an overlay item in Android. I use this: Bitmap bmpOriginal = BitmapFactory.decodeResource(this.getResources(), R.drawable.map_pin); Bitmap targetBitmap = Bitmap.createBitmap((bmpOriginal.getWidth()), (bmpOriginal.getHeight()), Bitmap.Config.ARGB_8888); Matrix matrix = new Matrix(); matrix.setRotate((float) lock.getDirection(),(float) (bmpOriginal.getWidth()/2), (float)(bmpOriginal.getHeight()/2)); Canvas tempCanvas = new Canvas

Android Mapview: Control ordering of multiple types of OverlayItems?

五迷三道 提交于 2019-12-24 08:56:26
问题 I have searched for a while on this problem but have come up trumps. I have a simple mapview that makes use of custom overlay items on a ManagedOverlay, let's call them redOverlayItem and blueOverlayItem . All the ManagedOverlay does is query my database for a set of locations of varying types and then place them on a map asynchronously. My managed overlay works fine, however I can't seem to be able to control the "z" ordering. For instance, sometimes I have redOverlayItem 's covering

Android Mapview: Control ordering of multiple types of OverlayItems?

只谈情不闲聊 提交于 2019-12-24 08:52:37
问题 I have searched for a while on this problem but have come up trumps. I have a simple mapview that makes use of custom overlay items on a ManagedOverlay, let's call them redOverlayItem and blueOverlayItem . All the ManagedOverlay does is query my database for a set of locations of varying types and then place them on a map asynchronously. My managed overlay works fine, however I can't seem to be able to control the "z" ordering. For instance, sometimes I have redOverlayItem 's covering

Can panning/zooming be disabled in an android MapView while allowing users to click on an ItemizedOverlay?

只愿长相守 提交于 2019-12-24 05:22:15
问题 Is there a way of disabling panning/zooming and keeping map overlays clickable? I am specifically thinking about an ItemizedOverlay that I want to be tappable while denying users from moving around the map's viewport (It's for a game). I've seen the same question answered but the answer sadly doesn't allow for overlay items to be clicked. Thanks alot, best regards, Alex 回答1: I know this question is a little old but I had the same problem and found a workaround, it's not a graceful solution

using mutliple drawables on a mapview

╄→гoц情女王★ 提交于 2019-12-24 01:29:11
问题 I have very limited experience with Mapview, Overlay and ItemizedOverlay. I've seen some simple code examples that use one drawable for overlays and itemizedOverlays but I'm unsure how to approach these requirements: I want more than one drawable on my map view (example: a star-icon for the map center and some other icon for other overlay items) but I want one to be unclickable (the star). Should I use both Overlay and ItemizedOverlay to achieve this? Also, my next problem is a matter of

Controlling OverlayItem size

被刻印的时光 ゝ 提交于 2019-12-21 05:05:00
问题 I'm building a map with a few dozen OverlayItems in a single ItemizedOverlay. My map is made to be viewed very close up (about zoom level 18+), with the OverlayItems in very close proximity to one another. The map looks good when zoomed in. However, if the user zooms out the icons begin to overlap and everything looks incredibly junky. Is there a way to control the OverlayItem icon size so that it scales with the map? If not, is there a way to hide the icons once a specific zoom level is

How to clear / reset an ItemizedOverlay in Android?

落花浮王杯 提交于 2019-12-20 10:21:01
问题 I have a program that is creating an ItemizedOverlay and a map. Everything works fine upon startup. When you close ande re-open the app, I am using onRestart() to get updated information from my server and update the map. The problem is that at this point, the ItemizedOverlay still contains the old items, and then proceeds to add the new data to the existing data. I am looking for a way to clear out the ItemizedOverlay. There does not appear to be an ItemizedOveraly.clear, or any similar

OSMdroid add custom icons to ItemizedOverlay

不问归期 提交于 2019-12-18 13:32:34
问题 I am using ItemizedIconOverlay class and I'm currently displaying events on the map along with the user's position with the same default icon. How do I change the icon set for each overlay? Is there something similar to the google.maps example: drawable = getResources().getDrawable(R.drawable.marker); drawable3 = getResources().getDrawable(R.drawable.disruption); drawable2 = getResources().getDrawable(R.drawable.marker_me); itemizedOverlay = new MyItemizedOverlay(drawable, mapView);

Android 2.1 GoogleMaps ItemizedOverlay ConcurrentModificationException

你说的曾经没有我的故事 提交于 2019-12-18 05:23:16
问题 I cannot figure out the origin of the ConcurrentModificationException . In my activity I'm calling updateMapOverlay() . I'm also calling updateMapOverlay() inside another Thread (a TimerTask ) that is invoked on regular intervals. I'm taking the appropriate locks when invoking updateMapOverlay() from both the threads. Is this problem being caused because I'm invoking updateMapOverlay from inside a non-UI thread (i.e., TimerTask ). Has anyone else faced a similar issue ? private void