android-maps

Moving MapFragment (SurfaceView) causes black background flickering

左心房为你撑大大i 提交于 2019-11-26 22:32:22
问题 I'm trying to implement new Android Google Maps API (v2). However it doesn't seem to go well with SlidingMenu. As you may know, MapFragment implementation is based on SurfaceView . The problem is that the SurfaceView doesn't like moving it around - I mean placing it in movable views: ViewPager, ScrollView, ListView, or the aforementioned SlidingMenu . When you move it, it leaves a black hole in the place where its pixels originally layed. It looks something like this. This problem can be

MapView inside a ScrollView?

十年热恋 提交于 2019-11-26 21:50:48
I would like to have a MapView inside a ScrollView, however when I try to scroll the map, the ScrollView takes priority! Is there a way to give the MapView priority when scrolling inside the map, and the ScrollView otherwise? Thanks! I have had a same problem for 10 days, but I got a solution a few minutes ago!! Here is the solution. I made a custom MapView and override onTouchEvent() like this. @Override public boolean onTouchEvent(MotionEvent ev) { int action = ev.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: // Disallow ScrollView to intercept touch events. this.getParent()

Google Maps V2 shows blank screen on android 2.2

人走茶凉 提交于 2019-11-26 21:34:24
问题 I tried following a tutorial on Android Maps V2 Quick Start But when I run the app, a blank map screen is shown. My phone uses android 2.2.1. This is what shows in logcat: 12-07 18:07:52.479: W/dalvikvm(1654): VFY: unable to resolve instance field 24 12-07 18:07:53.129: W/dalvikvm(1654): Unable to resolve superclass of Lmaps/a/du; (411) 12-07 18:07:53.129: W/dalvikvm(1654): Link of class 'Lmaps/a/du;' failed 12-07 18:07:53.139: W/dalvikvm(1654): Unable to resolve superclass of Lmaps/a/ej;

How do I show a marker in Maps launched by geo URI Intent?

人走茶凉 提交于 2019-11-26 21:33:59
I have a application where I want to show different locations (one at the time, picked by user input) by launching Google Maps with their specific geo coordinates. I'm currently using this (with real lat. and long. values of course): Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:<lat>,<long>?z=17")); startActivity(intent); It's quite exactly what I want, except that it doesn't show any indicator or marker for the specified point. It only centers at it's location. Is there some way to get the marker or something else included without using a MapView? Try this: Intent intent =

Google Maps API V2 'Failed to Load Map. Could not contact Google Servers'

瘦欲@ 提交于 2019-11-26 20:45:50
I have checked and double checked my APIkey that I registered on the Google Console however I am still getting the following error: 12-05 16:31:12.940: E/Google Maps Android API(12334): Failed to load map. Could not contact Google servers. What I am seeing is the zoom in/out buttons and the background for the MapView but no Map???!!! Any ideas??? Answer I will post it here because what solved my issue was stated in the comments of the accepted answer below. It was the READ_GSERVICES permission. For some reason the permission wasn't mentioned on the developer site when it came to using them.

How to move the Android Google Maps API Compass Position

谁都会走 提交于 2019-11-26 20:25:45
问题 Does anyone know if you can change the compass position within the map? All I can find is how to enable or disable it. But I need to move it down a bit so my overlay is not obstructing it. 回答1: Use GoogleMap.setPadding() method: https://developers.google.com/maps/documentation/android/map#map_padding 回答2: @Override public void onMapReady(GoogleMap map) { try { final ViewGroup parent = (ViewGroup) mMapView.findViewWithTag("GoogleMapMyLocationButton").getParent(); parent.post(new Runnable() {

what makes my map fragment loading slow?

夙愿已清 提交于 2019-11-26 19:08:50
问题 Performance Enhancement: Previously I saved ALL images in drawable folder, this might be the reason why the map first loads slow, when draw the markers on screen, the image may not fit the screen size. Now I saved images in drawable-mdpi , drawable-hdpi and so on, the app works smoother than before. Hope it helps Original Question: I created a map in a fragment, the source code can be found below. The map fragment is sluggish when the first time it loads. If I go any other fragment and click

Using Google Places API

蹲街弑〆低调 提交于 2019-11-26 15:05:30
I want to develop an application in which i want to display information about places nearby (within 1km )the user by getting its current location.. Say for example i want to display information about Restaurants, Shopping Malls, Hospitals located within 1km related to current location of the android device.. I have gone through this link : Using Google Places API in Android .. But didnt get more. Have anyone used Google Places API in android ? Harry Joy Some points to keep in mind: In order to use Google’s Places API, you will need to register and obtain a Google Map’s API Key. In class

How to show a balloon above a marker in a MapActivity? Isn&#39;t there a widget?

一世执手 提交于 2019-11-26 14:05:08
问题 I dont get the point, why I have to code so much for it. Like, I dont want to care about... the position of the balloon (I just want to assign a geopoint) the layout of a basic balloon (Later on I might want to implement a xml based layout) the number of shown balloons (only display one at a time) the open/close behaviour of the balloon (close, when an other bollon is tabbed) Update Solved it! See my answer below... 回答1: Here is the "the missing widget"... Balloons without icons: https:/

How to center the camera so that marker is at the bottom of screen? (Google map api V2 Android)

我们两清 提交于 2019-11-26 12:54:26
问题 When a marker is clicked, the default behavior for the camera is to center it on screen, but because I usually have long text description in the info window, it\'s more convenient to actually change the camera position so that the marker is on the bottom of screen(making the info window in the center of screen). I think I should be able to do that by overriding onMarkerClick function like below (the default behavior is cancelled when this function return true) @Override public boolean