android-maps

Can I use AnimationDrawable in an overlay on a MapView?

断了今生、忘了曾经 提交于 2019-11-30 09:59:24
I have created an AnimationDrawable in XML, and it works fine. But on moving the drawable into a MapView as an overlay marker (replacing a static drawable that works fine), the animation stubbornly refuses to play. I've moved the call to start() to a button, for testing, and even when pressed several seconds after the MapView has displayed, the animation doesn't start. I'm seeing nothing in logcat. I know start() needs calling after all the windows are set up, but this seems to be a separate issue. Are AnimationDrawables compatible with MapView? Is there something special I need to do to make

Network provider and GPS provider returning null values

杀马特。学长 韩版系。学妹 提交于 2019-11-30 09:25:04
问题 I want to find the current latitude and longitude of current location but both the network provider and GPS provider returning the null values: public class GPSTracker extends Service implements LocationListener { private final Context mContext; // flag for GPS status boolean isGPSEnabled = false; // flag for network status boolean isNetworkEnabled = false; // flag for GPS status boolean canGetLocation = false; Location location; // location double latitude; // latitude double longitude; //

Map v2 SupportMapFragment inside Viewpager

杀马特。学长 韩版系。学妹 提交于 2019-11-30 00:32:45
Background I have successfuflly added the new map api v2.0 to a ViewPager and the map loads fine. I am using the FragmentViewPager. I run into trouble however when trying to add markers as I cannot get the Fragment by tag as the ViewPager I am using is from the compatibility library and defined in XML, and this "hides" the tag from me. The Question How can I load the new Map v2 with markers SupportMapFragment into a ViewPager that uses a FragmentPagerAdapter . My Attempt So in my nievety I thought could create an elegant solution by extending the SupportMapFragment into a new class that does

Associate an object with Marker (google map v2)

点点圈 提交于 2019-11-29 23:52:04
In my app I have some objects that have their location displayed on the map using markers. The problem is that the only way I've found to handle marker clicks is googleMap.setOnMarkerClickListener(new ... { @Override public void onMarkerClick(Marker marker) { // how to get the object associated to marker??? } }) In other words I get the Marker object while the only interface that I have allows me to set just MarkerOptions. Any way to associate Marker with an object? You can associate arbitrary object by using Marker 's setTag() method Marker amarker = mMap.addMarker(new MarkerOptions()

Android: Setting Zoom Level in Google Maps to include all Marker points

早过忘川 提交于 2019-11-29 20:15:31
I am trying to set zoom level for Maps in android such that it includes all the points in my list. I am using following code. int minLatitude = Integer.MAX_VALUE; int maxLatitude = Integer.MIN_VALUE; int minLongitude = Integer.MAX_VALUE; int maxLongitude = Integer.MIN_VALUE; // Find the boundaries of the item set // item contains a list of GeoPoints for (GeoPoint item : items) { int lat = item.getLatitudeE6(); int lon = item.getLongitudeE6(); maxLatitude = Math.max(lat, maxLatitude); minLatitude = Math.min(lat, minLatitude); maxLongitude = Math.max(lon, maxLongitude); minLongitude = Math.min

google map not working on both emulator and device

时间秒杀一切 提交于 2019-11-29 12:46:56
I am trying to run a simple google map but its not working its showing only map background.checked on both emulator and device. xml file:- <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment"/> Java class import android.os.Bundle; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps

Android google map version 2 shows blank white page?

孤人 提交于 2019-11-29 12:05:45
In my application am using Google map version 2.When i run the application in real device through eclipse means it shows the map.but when i export the application as signed apk and am upload my apk in play store.Then i download the uploaded apk file from play store and am run it in my device but it shows only blank white page.i don't know whats the problem.Can any know.please help me to solve this issue. You have to require signed apk with SHA-1 Step 1: Now locate to jdk in C drive(Considering for windows and assigning C drive) C:\Program Files\Java\jdk1.7.0\bin>keytool -list -v -keystore E:\A

MapFragment in Action Bar Tabs

故事扮演 提交于 2019-11-29 09:50:06
问题 I am trying to build an app that will implement Action Bar tabs. One of the tabs should contain a MapFragment. How can I implement an action bar with tabs, under one of which is a map Fragment? Can you help me with how to proceed with this? Here is what I have so far : main class package com.nfc.demo; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.Activity; import android.app.Fragment; import android.app.FragmentTransaction; import android.os.Bundle; public

Google map not show any thing in map

大城市里の小女人 提交于 2019-11-29 07:54:22
i am showing a map in activity ... but when i run app on device it does not show any thing , it show just white screen and zoom in zoom out options... MAP key is right .. thanks .. AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.edxample.finalmap" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <permission android:name="com.edxample.finalmap.permission.MAPS_RECEIVE" android:protectionLevel="signature" /> <uses-permission android

Embedded Google Map can't get current location in WebView

独自空忆成欢 提交于 2019-11-29 07:17:05
I followed this tutorial: http://android-er.blogspot.com/2013/03/embed-google-map-in-webview.html I'm trying to just use the Google Map in the WebView, but it can't get my current location. I've enabled JavaScript on the WebView. What else do I have to enable? Does anyone know why that might be? Shouldn't it prompt me to use my current location? Note that I am not interested in using a MapView as an alternative whatsoever. I'm trying to find out what I need to set on the WebView or maybe on the device's location services? You should permit the web view to access your location by overriding the