google-maps-android-api-2

How to remove single marker using Google Maps V2? [duplicate]

吃可爱长大的小学妹 提交于 2019-12-02 16:03:23
This question already has an answer here: Remove a marker from a GoogleMap 9 answers The only method that removes markers from map is clear. However it clears all markers from the map. I want to remove only single marker or group of markers. How could i achieve this? Alexey Zakharov After adding the marker it is possible to obtain its reference: Marker marker = map.addMarker(..); The Marker class has a remove method: I got the same problem, so to fix it I'm doing mMap = super.getMap(); map.clear(); I wrote up a blog post on how to remove Markers when they are moved off the screen, and adding

Android - Cant get latitude/longitude value to store and pass on variable

烂漫一生 提交于 2019-12-02 15:21:41
问题 I am trying to store the latitude/longitude to variables x3 and x4 to pass on Spot[] array but it returns 0. I tried printing it on onConnected method and it works fine. I also tried other methods to add marker on google map and I put map.addMarker on onConnected method instead but my app closes. If u can suggest where to put addMarker please do. Thanks. GoogleMap map; private static Location mLastLocation; private static GoogleApiClient mGoogleApiClient; static double x3; static double x4;

Issue with Google Maps Android Api v2

匆匆过客 提交于 2019-12-02 15:05:21
问题 I have been trying to implement a sample application in order to study the working of Google maps API. I have been struck with the configuration itself. I can't seem to run the application. Here's my code at Github :- https://github.com/siva54/SampleMapApplication And here's my logcat :- 02-11 15:09:07.492: I/Process(10080): Sending signal. PID: 10080 SIG: 9 02-11 15:09:17.012: E/dalvikvm(10364): Could not find class 'com.google.android.gms.maps.model.MarkerOptions', referenced from method

Android Map v2 Program Crashes at start

情到浓时终转凉″ 提交于 2019-12-02 14:03:06
问题 I've searched for a week and tested all the solutions said, but nonestrong text worked! I've tried every thing said in: Google Maps Android API v2 - Getting Started and lot's of others SO solutions... I tried to test on my Mobile Phone but it crashes in start. Main Activity: package com.google.balakharekechi; import android.app.Activity; import android.os.Bundle; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

Get my location

家住魔仙堡 提交于 2019-12-02 13:39:04
I have a ListFragment and I want to get the my location. In my Manifest I have added this: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> and my ListFragment´s code is here, but not works: public class ListaLugaresFragment extends ListFragment implements LocationListener { GoogleMap googleMap; Location location; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { v= inflater.inflate(R.layout.lista, container, false); LocationManager lm = (LocationManager) getActivity().getSystemService(getActivity().LOCATION

Open URL from custom info window, Android Google Maps V2

廉价感情. 提交于 2019-12-02 12:25:26
I am using android google maps api v2 with many markers displayed on it. Each time you click on a marker a custom info window with specific tittle/snippet is open. The problem is that I cannot click on the URL "www.news.com". Please find below the options of my marker. How can I specify that the "www.news.com" is a HTML URL link inside the .snippet attribute, and when user clicking on it to open directly in mobiles explorer? mMap.addMarker(new MarkerOptions() .position(new LatLng(39.686286, 19.838443)) .title("HELLO") .snippet("Name: \nSurname: \nphone: XXX \nwebsite: www.news.com") .icon

Error inflating class fragment Android Map v2

孤街醉人 提交于 2019-12-02 12:19:47
问题 I know this is a duplicate question, but solutions from previous post doesn't worked for me. Thats why am asking this question. I am trying to implement Google Map V2 in Android App, I got below error 06-26 19:24:51.035: E/AndroidRuntime(7679): FATAL EXCEPTION: main 06-26 19:24:51.035: E/AndroidRuntime(7679): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.titutorial.mapdemo/com.titutorial.mapdemo.MainActivity}: android.view.InflateException: Binary XML file line #2:

This app won't run unless you update Google Play Services (via Bazaar)

安稳与你 提交于 2019-12-02 09:59:01
I'm testing out the new Google Maps API V2 for Android, and I'm getting this message when the app launches: This is running on an 4.1 emulator. Here is my AndroidManifest.xml file: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.maptest" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <permission android:name="com.example.maptest.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> <uses-permission android:name="com.example.maptest.permission.MAPS_RECEIVE"/> <uses

Google Map custom Marker Out of Memory Error (API V2)

ε祈祈猫儿з 提交于 2019-12-02 09:31:47
问题 I'm using the following code to set marker with user's own image in his/her gallery. But I get out of memory error all the time so I guess my implementation is wrong. Another interesting behavior I found is that if the marker isn't in the view, the error doesn't occur immediately. But once I move the camera to where that marker is the error appears again. (In short, I never get a chance to see my image) Codes I use: //on button click, send user to gallery to choose image he/she wants to use

Issue with Google Maps Android Api v2

左心房为你撑大大i 提交于 2019-12-02 09:30:36
I have been trying to implement a sample application in order to study the working of Google maps API. I have been struck with the configuration itself. I can't seem to run the application. Here's my code at Github :- https://github.com/siva54/SampleMapApplication And here's my logcat :- 02-11 15:09:07.492: I/Process(10080): Sending signal. PID: 10080 SIG: 9 02-11 15:09:17.012: E/dalvikvm(10364): Could not find class 'com.google.android.gms.maps.model.MarkerOptions', referenced from method com.myapp.gasapplication.MainActivity.setUpMap 02-11 15:09:17.012: W/dalvikvm(10364): VFY: unable to