android-mapview

Set minimum zoom level for MapView

大兔子大兔子 提交于 2019-11-27 02:56:36
问题 Is there a way I can set a minimum zooM level for my MapView?. The map looks really ugly when zoom level is set to one because the whole world map replicated. I would like to block that zoom level. Ideally, it would work whether the user is zooming through gestures or zoom controls. 回答1: Fortunately, i was having an overlay in my MapView. Otherwise, i guess you will have to create one, just for this tiny feature :-/. I wonder why there isn't any other way of doing this easier. Anyways, you

How to layout zoom Control with setBuiltInZoomControls(true)?

房东的猫 提交于 2019-11-27 02:55:38
问题 would like to add a zoom control to the map. I also want to layout the position of the zoom Control instead of the default middle bottom position. I can do this by getZoomControl but it is deprecated. Could anyone tell me how to do this with setBuildtInZoomControls ? 回答1: This is how I got mine working finally (by embedding a ZoomControl in XML layout). mapView = (MapView) this.findViewById(R.id.mapView); ZoomControls zoomControls = (ZoomControls) findViewById(R.id.zoomcontrols); zoomControls

Android Maps Point Clustering

眉间皱痕 提交于 2019-11-27 02:43:26
Is there any code for Point Clustering in android? How can i load thousand pinpoint without having performance issues? Last night i got into PointClustering on Android MapView. Saw that there was nothing out for the community so i would like to share. Groups the geopoints if the projection of them in the mapView is too close. Also renders only the visible poins. UPDATE Code reworked from scrach. Now available at GitHub Code Reworked from scratch Used GVM clustering algorithm (pretty fast but doesn't position clustered point as good as mine) Soon to add previous clustering algorithm too

Double tap: zoom on Android MapView?

佐手、 提交于 2019-11-27 02:12:56
After a little bit of work my route application works fine. The only thing I just want to add is a double tap zoom in function, but I don't know how. Could you give me a hint? reflog Implement GestureListener to receive doubleTap events. see: Fling gesture detection on grid layout azizbekian I've also been searching for an answer/example, but found nowhere working code. Finally, here's the code that's working for me: MyMapActivity.java public class MyMapActivity extends MapActivity implements OnGestureListener, OnDoubleTapListener { private MapView mapView; @Override public void onCreate

How to configure android map sdk v2 to use different keys for production and development?

回眸只為那壹抹淺笑 提交于 2019-11-27 02:12:15
问题 I want to automatically set different android map api V2 keys for development and production. 回答1: Log in to Google APIs Console Under "Simple API Access" click "Edit Allowed Android apps..." on the right side Enter one SHA-1 fingerprint per line like the instructions say: "One SHA1 certificate fingerprint and package name (separated by a semicolon) per line. Example: 45:B5:E4:6F:36:AD:0A:98:94:B4:02:66:2B:12:17:F2:56:26:A0:E0;com.example 45:B6:E4:6F:36:AD:1A:98:94:B4:02:66:2B:12:17:F1:56:26

Android draw route on a Mapview with twoo POI-s

血红的双手。 提交于 2019-11-27 01:30:40
How i can draw a route on a mapview between two poi-s? Sudipta Som go through this codes. Modify the code as per ur requirement MapDirection.java: public class MapDirection extends MapActivity{ MapView mapview; MapRouteOverlay mapoverlay; Context _context; List<Overlay> maplistoverlay; Drawable drawable,drawable2; MapOverlay mapoverlay2,mapoverlay3; GeoPoint srcpoint,destpoint; Overlay overlayitem; public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

android - GC_FOR_ALLOC freed 6346K, 7% free , paused 143ms, total 143ms

 ̄綄美尐妖づ 提交于 2019-11-27 01:20:55
问题 I'm developing an offline mapView using OSMdroid Library. My tilesource loads the tiles but renders quit steadily. But the fact is in my log messages, I keep getting this error: GC_FOR_ALLOC freed 6346K, 7% free , paused 143ms, total 143ms I'm not sure how to debug this? Any ideas, do I have any memory leaks? 回答1: This is not an error, but an information that Garbage collector has run. If you are seeing a lot of those, it might mean that you are making many allocations or have little memory.

Rotate MapView in Android

痴心易碎 提交于 2019-11-27 00:40:39
I am writing an Android app where one of the features is that the map will rotate according to the compass (i.e. if the phone is pointing east, the map will be oriented so that the east side of the map is on top). Previous answers that I have found suggested over writing the onDraw() method in mapView, however, the api changed the method to final so it cannot be overwritten. As a result I have tried to overwrite the dispatchDraw() method like so: Note: -compass is a boolean that if true, rotate the view -bearing is a float variable that has the degrees that the view should rotate protected

How to animate marker in android map api V2?

蹲街弑〆低调 提交于 2019-11-27 00:27:59
I want to implement smooth transition to emulate car marker moving on the map. Is it possible to animate marker in android map api v2? Try out the below code to animate the marker on Google Map V2. You need to use the Interpolator class to apply the animation on the Marker and handle it in the Handler for the animation as below: public void animateMarker(final Marker marker, final LatLng toPosition, final boolean hideMarker) { final Handler handler = new Handler(); final long start = SystemClock.uptimeMillis(); Projection proj = mGoogleMapObject.getProjection(); Point startPoint = proj

MapFragment in ScrollView

百般思念 提交于 2019-11-27 00:09:53
问题 I have one of the new MapFragments in a ScrollView . Actually it's a SupportMapFragment , but anyway. It works, but there are two problems: When scrolled, it leaves a black mask behind. The black covers exactly the area where the map was, except for a hole where the +/- zoom buttons were. See screenshot below. This is on Android 4.0. The view doesn't use requestDisallowInterceptTouchEvent() when the user interacts with the map to prevent the ScrollView intercepting touches, so if you try to