android-mapview

How to add a sliding drawer a MapView/View that's created programmatically

混江龙づ霸主 提交于 2019-12-10 12:29:52
问题 I've tried to approach this from different angles without luck. Maybe asking a general question can help. Technically I'm using osmdroid's MapView implementation, not Google's Maps API, but I think this question is a more general programmatic Views vs main_activity.xml defined views in onCreate. Basically in my MainActivity if I onCreate a View, like MapView, then set it as the ContentView programmatically, I have to also programmatically add in any other Views I want to display in my app:

GestureDetector Deprecated Issue

血红的双手。 提交于 2019-12-10 12:28:23
问题 I have this code itemizedOverlay = new MyItemizedOverlay(drawable,this); itemizedOverlay.setGestureDetector(new GestureDetector(new MyGestureDetecor())); but new GestureDetector is marked as Deprecated in Eclipse. I want to avoid the use of deprecated methods. How could I fix this problem? What is the non-deprecated form? 回答1: Choose one of the other constructors. There are five defined constructors on GestureDetector. Two -- the ones not including a Context as the first parameter -- are

Overlay behavior when zooming

岁酱吖の 提交于 2019-12-10 12:16:34
问题 I am having trouble with overlays. I have drawn a polygon overlay on the map, however, when I zoom in or out, the edges no longer align with where I want them to. How can I fix this? Here is what it looks like when I start the app (it covers the whole parking lot perfectly): Correct Here is what it looks like when I zoom out (edges no longer line up with parking lot. The overlay looks a bit bigger than the parking lot): Zoomed out Also, it doesn't align well when I zoom in. In this case the

How to get the next page/part/view of file, if i read part of file using MapViewOfFile?

别等时光非礼了梦想. 提交于 2019-12-10 11:55:28
问题 I am trying to use combination of functions CreateFileMapping , MapViewOfFile, FlushViewOfFile. the total buffer size is more than the mapped view. example buffer is 50KB. and mapped view is 2KB. in such scenario, i want to write the total buffer to a physical file, using the above function. First part i am able to write to file. but the remaining part how to write to file. I mean, how to move to next page and write the next part of data. #define MEM_UNIT_SIZE 100 -first module...Memory map

Android doubletap, ontouchevent is not working

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 11:40:29
问题 I need to zoom when double tapping. Why doesn't this work? I worked on it for long time which has no result. No touch event is recognized public class MyMapActivity extends MapActivity implements OnGestureListener{ private MapView mapView; @Override public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView)findViewById(R.id.mapView); mGestureDetector = new

android - map in listview header

橙三吉。 提交于 2019-12-10 11:32:10
问题 In my app i have an activity which contains a image and a list view at the bottom. Following are the things to be done in the activity. 1. the image view at the top of the page must be of swipe type to show other images. 2. when the list view gets scrolled the image must get moved along with it. 3. in the same activity i have a button, when the button is clicked the image must be switcher over to be a mapview. What i have done is, 1. I have the image view and mapview in view switcher of a

MapView v2 snapshot() creates an unfinished Bitmap

家住魔仙堡 提交于 2019-12-10 11:02:28
问题 I'm using the new snapshot() method on the GoogleMap object, and in my SnapshotReadyCallback I'm swapping out the MapView in my layout for an ImageView with the Bitmap passed to me from the callback. The unfortunate thing about this is, even though I'm getting a Bitmap it appears that the snapshot was taken before the map finished rendering. I should also add that this View is being created programmatically, and isn't added to the Activity right away (it's actually being placed in a

There is no scroll after adding an Overlay to MapView

扶醉桌前 提交于 2019-12-10 10:41:42
问题 I'm fighting with following problem now: I add a simple overlay to my mapview. It doesn't draw anything, it is just a help overlay for detecting scroll is ended (see response) Here is the code of it: public class ScrollDetectionOverlay extends Overlay { private static GeoPoint lastLatLon = new GeoPoint(0, 0); private static GeoPoint currLatLon; protected boolean isMapMoving = false; private MapScrollingFinishedListener listener = null; public void setListener(MapScrollingFinishedListener

“MapFragment cannot be resolved to a type” even though I am on API level 17

白昼怎懂夜的黑 提交于 2019-12-10 04:22:51
问题 I just started using MapFragments, and I can get the Map to show in my Activity. I just use a simple XML-layout, and it works as expected: Now, I need to get the Fragment in code, so I can start interacting with the Map. This is where I run into problems: As you can see, the MapFragment (or getFragmentManager) cannot be resolved to a type. I am targeting Android 4, API level 17: and you can also see that I am referencing the Googke Play library. Here is the Manifest, just for clarity: So, the

MapActivity cannot be resolved to a type

时间秒杀一切 提交于 2019-12-10 02:41:59
问题 I'm busy trying to get the MapView included in my Android project. I'm following the MapView tutorial on the Android developer website but I'm getting an error: 'MapActivity cannot be resolved to a type' I tried pressing Ctrl+Shift+O to auto import all classes but it's not helping. When I try to include the Maps libary manually it gives this error: 'The import com.google.android cannot be resolved' I have added the following line (see below) to the Manifest and my target is API 7 (Platform: 2