android-mapview

Custom MKAnnotationView Callout [duplicate]

南笙酒味 提交于 2020-02-11 08:23:09
问题 This question already has answers here : Closed 8 years ago . Possible Duplicates: Custom MKPinAnnotation callout bubble similar to default callout bubble How to customize the callout bubble for MKAnnotationView? Does anyone know, or have code that shows, how to create a custom MKAnnotationView Callout? I mean the actual text bubble and not the pin. Thanks in advance. 回答1: you cannot make a custom MKAnnotationView, you can only custom the callout views left and right, it's just a view, so you

MapView - Have Annotations Appear One at a Time

断了今生、忘了曾经 提交于 2020-02-01 21:32:35
问题 I'm currently adding annotations to my map through a loop... but the annotations are only appearing on my map in groups. Also, on load, only about 4 annotations are actually displayed on the map... but as I move the map a little, all of the annotations that should be there, suddenly appear. How can I get all of the annotations to load in the right place, one at a time? Thanks in advance! Here is the code I'm using to add annotations: NSString *incident; for (incident in weekFeed) { NSString

MapActivity error: force close

怎甘沉沦 提交于 2020-01-25 01:56:05
问题 I created a new MapActivity class MapProba . From main Activity I want to show MapActivity : on button click event I put this code: Intent myIntent = new Intent(this, com.art.mode.MapProba.class); startActivity(myIntent); But I receive force close error. In my xml file I use this code: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <com.google.android.maps.MapView android:id="@+id/map_view"

Distance of two geo point android

不羁的心 提交于 2020-01-23 19:00:51
问题 I am new android application developer. I have create a mapview application where i need to calculate the distance of two geo point.How can i do that. 回答1: Use the Location.distanceBetween method: GeoPoint prev, current; float[] results = new float[3]; Location.distanceBetween(prev.getLatitudeE6()/1E6, prev.getLongitudeE6()/1E6, current.getLatitudeE6()/1E6, current.getLongitudeE6()/1E6, results); 来源: https://stackoverflow.com/questions/6283028/distance-of-two-geo-point-android

Deconflicting markers in map overlays

若如初见. 提交于 2020-01-23 13:02:35
问题 I need to solve the problem of marking thousands of items on a map in a way that's accurate and readable and fast even when the user zooms out so that markers would overlap in confusing ways. It's an Android MapView , but my questions are more general. I am aware of Fluster, grid-based schemes, and various heuristics. These algorithms appear to be inaccurate in that cluster markers don't correspond to the centroid. My application is safety critical, and the markers are fairly big, so

Deconflicting markers in map overlays

拜拜、爱过 提交于 2020-01-23 13:02:24
问题 I need to solve the problem of marking thousands of items on a map in a way that's accurate and readable and fast even when the user zooms out so that markers would overlap in confusing ways. It's an Android MapView , but my questions are more general. I am aware of Fluster, grid-based schemes, and various heuristics. These algorithms appear to be inaccurate in that cluster markers don't correspond to the centroid. My application is safety critical, and the markers are fairly big, so

RecyclerView / MapView crashes when rotating device

孤人 提交于 2020-01-23 02:54:18
问题 I have a Android.Support.V4.Fragment that contains both a MapView and a RecyclerView . These are separate views in the Fragment . The app crashes when the device is rotated: Android.OS.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.v7.widget.RecyclerView$SavedState I am passing the lifecycle methods to the MapView as required by the docs: private MapView mapView; private RecyclerView myRecyclerView; private RecyclerView.LayoutManager myLayoutManager; public

Get GoogleMap snapshot on background

一个人想着一个人 提交于 2020-01-21 12:10:30
问题 I'm trying to get the snapshot of a GoogleMap (from MapView) on background, return it with a callback and show it in an ImageView. While doing this, I'm trying to make getting snapshot part independent from the layout as much as possible (so, trying to avoid adding a MapView to the layout). What I've tried was creating a MapView programmatically with given size, adding some paths and pins on it, getting the snapshot and returning it (all subscribed using RxJava) but I'm getting the following

Android and GoogleMaps: disable the mapView dragging

大兔子大兔子 提交于 2020-01-17 07:39:10
问题 Android and GoogleMaps: Can I disable the mapView dragging without disable the pinch to zoom function? Thx for answer 回答1: Use GestureDetector and SimpleOnGestureListener , use onFling() to detect the distance between the path user did with his finger from the first touch till the release with .getX() and getY() from each MotionEvent and do nothing for x > SOMEMAXVALUE and y > SOMEMAXVALUE . I hope you'll find your way. 回答2: I suggest overridding dispatchDraw() in MapView class and check if

Strange drawing artefact using custom drawable with MapView

风流意气都作罢 提交于 2020-01-15 05:42:29
问题 I'm trying to add my own drawable and use it in a series of overlays on a MapView. The drawable is basically a rounded box with a black outline and a number in the middle. I have managed to achieve this using the code below, however there is what looks like a flag to the left of my box, which I certainly don't think I have drawn - so I'm wondering what it can be. This is an example of the image: Edit - this is what happens if a circle is drawn: My code is below: Custom Drawable: public class