android-mapview

Google API MapView OutOfMemory after setting the MapView to specific width and height

冷暖自知 提交于 2019-12-08 02:01:36
问题 i searched for this Problem, and i found some stackoverflow Questions about the same but without any idea how to resolve the problem. I created an activity and i want to add a really small mapview (like 140w X 70h). It is only to show a small preview of where the place is. When you click this little mapview you get a new inflate to a new activity with the hole map. MapView: <com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="140dip" android:layout_height="80dip"

how to get MapView API in android?

谁说我不能喝 提交于 2019-12-07 22:10:33
问题 how to get MapView API in android? thanks 回答1: That is actually written in Android documentation: Hello, MapView. 回答2: for windows step1: start --> run--> type C:\Documents and Settings\ashish\.android hear you should be pass your current user and find debug.keystore now get the path of debug.keystore C:\Documents and Settings\ashish\.android\debug.keystore now the command for getting MD5 keytool -list -alias androiddebugkey -keystore <path_to_debug_keystore>.keystore -storepass android

mapView not zooming on second try using didUpdateUserLocation

纵然是瞬间 提交于 2019-12-07 21:53:08
问题 i am loading a mapviewcontroller when the view map button is pressed from my mainviewcontroller: - (IBAction)mapButton:(id)sender { MapKitDisplayViewController *mapKitDisplayView = [[MapKitDisplayViewController alloc] init]; [self presentModalViewController:mapKitDisplayView animated:YES]; [mapKitDisplayView release]; mapKitDisplayView = nil; } On startup of this map view this method is called, which correctly zooms to the users location: - (void)mapView:(MKMapView *)myMapView

Animate markers on Google MapView

微笑、不失礼 提交于 2019-12-07 19:57:51
问题 I am working on an Android app that displays multiple markers on a Google MapView. Everything works perfectly but I would like the markers to have an animation when they appear on the map. Here's an example of something similar on iPhone. See 1'20". Here is how I add them to my MapView. for(int i=0; i<myMarkerList.length(); i++){ GeoPoint x = new GeoPoint( (int)(lat*1E6), (int)(lng*1E6)); oItem = new OverlayItem(x, title, String.valueOf(nb_marker)); pin.setAlpha(255); oItem.setMarker(pin); if

How do I find the center of multiple points? Android

六眼飞鱼酱① 提交于 2019-12-07 15:34:29
问题 I have multiple points placed on my MapView and would like to centre the map on these points i.e. not any particular one, just the averaged centre of the lot of them. I know there's a method for this in the Javascript G. Maps API. I was wondering whether there was a prexisting method to do this in Android? 回答1: this question looks suspiciously like one I had some time ago ... Android MapView -setting zoom automatically until all ItemizedOverlay's are visible 回答2: What you are trying to

How to update MapView overlay items from an AsyncTask without ArrayIndexOutOfBoundsException

我与影子孤独终老i 提交于 2019-12-07 13:17:37
问题 I am using a MapView which needs a number of overlay items added to it. I'm finding adding the overlay items is slow and causes the map to ANR when dragged. So I built an AsyncTask to add the overlay items. Initially I found it failed consistently as I was accessing the overlay collection from a background thread, and I gather it is not thread safe. So I changed it so the overlays are only changed from the UI thread. It now works, but only most of the time. It still crashes very occasionally

MapView google maps NullPointerException?

流过昼夜 提交于 2019-12-07 12:29:18
问题 I'm trying create a How to get using MapView. I created a Fragment and a XML to use that. The problem is when I try open the MapView throws a NullPointerException but I can't undertand why. How could I solve it ? XML <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <com.google.android.gms.maps.MapView android:id="@+id/mapView" android:layout_width="match_parent"

Cache whats being draw on MapView in Android

て烟熏妆下的殇ゞ 提交于 2019-12-07 09:41:22
问题 I am developing an app for my Universities campus that displays the campus in a MapView; then using geopoints draws the outlines of the buildings on campus on the mapView using the draw method a class that extents Overlay. There are about 50-60 buildings being drawn, resulting in a very laggy map as the draw method constantly gets drawn over and over. I have looked into my problem and I have found some people mentioning drawing the buildings on a canvas, but I have found no good examples or

How to know when activity is laid out?

痞子三分冷 提交于 2019-12-07 07:42:25
I've got a mapview that I want to put some markers on top of. I'll retrieve these from a webservice when I start the activity, so I need to know the minimum and maximum lat/lng pairs for the current viewport. I'm calling mMapView.getWidth() mMapView.getHeight() But they both return 0 while the activity is starting. I tried putting it in onAttachedToWindow, onResume, onPostCreate, onPostResume, onStart and so on, but to no avail. How can I know that the activity has finished laying out all the views and is ready to give me the correct height and width measurements? I think you have to override

Mapview on tablet: How can I center the map with an offset?

自闭症网瘾萝莉.ら 提交于 2019-12-07 07:05:47
问题 Hint: Here is a similar post with HTML. In the current tablet implementation of my app, I have a fullscreen MapView with some informations displayed in a RelativeLayout on a left panel, like this: (My layout is quite trivial, and I guess there is no need to post it for readability) The problem comes when I want to center the map on a specific point... If I use this code: mapController.setCenter(point); I will of course get the point in the center of the screen and not in the center of the