android-maps

Android - Maps Cannot show

百般思念 提交于 2019-12-06 13:45:25
问题 i wanna show google maps on my android application. show i do some basic step like this : AndroidManifest.xml <uses-permission android:name="android.permission.INTERNET" /> maps.xml <view android:id="@+id/mv" class="com.google.android.maps.MapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:clickable="true" android:apiKey="0cNoErXkpZDlKvCYr_OFj5xZD39-***********" /> and this is may maps class, import and onCreate method import com

Google Maps Android API v2: GooglePlayServicesNotAvailableException not thrown anymore

て烟熏妆下的殇ゞ 提交于 2019-12-06 12:54:29
After updating Google Play Services to version 18, seems that GooglePlayServicesNotAvailableException can't be used anymore. This piece of code: try { MapsInitializer.initialize(ctx); } catch (GooglePlayServicesNotAvailableException e) { e.printStackTrace(); } generates this error: Unreachable catch block for GooglePlayServicesNotAvailableException. This exception is never thrown from the try statement body How can I achieve the same result now? Thanks Now the function initialize() returns a ConnectionResult so you can do something like this: if (MapsInitializer.initialize(ctx) !=

Google Maps marker clusters in Android

帅比萌擦擦* 提交于 2019-12-06 12:49:48
问题 Is there any common way to implement marker clusters for Google Maps in Android apps? I have a database of about 10,000 locations and would like to display them in more intelligent ways than just dumping thousands of markers on a display that's rarely larger than a match box... Ideally, it should be possible to retrieve the markers from a website URL, though I'm not sure if using the usual Async functions for that even makes sense from a usability point of view. 回答1: Clusterkraf would work

Android - Two Maps in one App

时光怂恿深爱的人放手 提交于 2019-12-06 12:02:44
问题 I got an App where on main screen show google mapView. But I need also in details view show the map. I know that it is impossible to run two maps simultaneously. Everything is working when I want to show something on the main map and later in detailed view, but when I come back to main one, it stops. How to stop main map and come back later to it? 回答1: Having two maps in one app produces many weird application behavior. For example, Ive had overlays from one map show up in the second map.

Mark current location on google map

断了今生、忘了曾经 提交于 2019-12-06 11:55:06
How to mark my current location on google map? I am using google place API. I have to show all near places from my current position. All places are showing on google map, but how to show my current position? The code is given below: public class PoliceStationMapActivity extends FragmentActivity implements LocationListener { private ArrayList<Place> mArrayListPoliceStations; private GoogleMap mMap; private LocationManager locManager; private double latitude; private double longitude; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Event for marker position change

耗尽温柔 提交于 2019-12-06 08:51:25
问题 I'm using the new Google Maps for Android v2. Is there a way to set a listener for marker position change? For example when the user drag the marker. 回答1: Quoting the documentation: You can use an OnMarkerDragListener to listen for drag events on a marker. To set this listener on the map, call GoogleMap.setOnMarkerDragListener. To drag a marker, a user must long press on the marker. When the user takes their finger off the screen, the marker will stay in that position. When a marker is

Views Don't Update Until MapView is Touched

好久不见. 提交于 2019-12-05 18:48:47
I have an Activity that mostly consists of a large MapView. On top of that MapView, I have a couple of other Views that I'm attempting to interact with programmatically. My first problem occurred when I tried to use an AnimationListener to animate one of the Views on top of the MapView. The AnimationListener would not fire until I touched the MapView. This was fixed by ditching the AnimationListener and calling setVisibility() and other code sequentially. It's not ideal, but it works fine. My current problem occurs when trying to update a TextView that's on top of the MapView. I set the text,

Customize color scheme of google maps V2 in android

二次信任 提交于 2019-12-05 18:39:18
Currently I'm working with google maps v2 in my android application and i've faced a problem of colour scheme customization of maps. I saw it's possible in web with javascript here https://developers.google.com/maps/customize and http://jsfiddle.net/SQvej/ some example in js var settingsItemsMap = { zoom: 12, center: new google.maps.LatLng(40.768516981, -73.96927308), zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE }, styles:[ { featureType: "water", stylers: [ { hue: "#F4B741"} ] }, { featureType: "road", stylers: [ { hue: "#ff0000" } ] } ], mapTypeId: google.maps.MapTypeId

For Android Map api v2 Description references non existing library google-play-services_lib\bin\google-play-services_lib.jar

早过忘川 提交于 2019-12-05 16:48:51
问题 I have import google-play-services_lib into my workspace and Add google project into MYProject it give mr error: Description Resource Path Location Type The container 'Android Dependencies' references non existing library 'D:\Android Workspace\google-play-services_lib\bin\google-play-services_lib.jar' HBuddy Build path Build Path Problem Description Resource Path Location Type The project cannot be built until build path errors are resolved HBuddy Unknown Java Problem and I have already

Google Play Services missing on Android 2.2 emulator while using Google Maps API v2

我的梦境 提交于 2019-12-05 13:40:37
Hey I am trying to use Google Maps on my emulator even though I've installed Google Play Services library when I run the app it says This app won't run without Google Play Services which are missing from your phone on LogCat I get the warning about it but not really sure why I am getting this. my MainActivity.java package com.mapsmaps; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.Menu; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; public class MainActivity extends FragmentActivity {