android-maps-v2

Google Map Android API v2 : GoogleMap is null

余生颓废 提交于 2019-12-03 08:49:10
I'm trying to explore using the MapView class for GoogleMap display, with no luck, as most codes examples are using MapFragment which I do not want. I am using Google Maps Android API v2. At first, just for testing with here from Google's example , I managed to get the typical normal map to display. public class POnlineMapView extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.online_map_activity); } } The code above works perfectly which show that everything has been set up properly. I am now trying to

New gms.maps.MapView rendering lags a bit when in a ListView?

柔情痞子 提交于 2019-12-03 08:11:18
I'm trying to put an instance of the new MapView in a ListView. New mapview being: com.google.android.gms.maps.MapView I'm turning all interactions off, and setting a fixed height for the view: GoogleMapOptions options = new GoogleMapOptions(); options.mapType(GoogleMap.MAP_TYPE_NORMAL); options.compassEnabled(false); options.rotateGesturesEnabled(false); options.scrollGesturesEnabled(false); options.tiltGesturesEnabled(false); options.zoomControlsEnabled(false); options.zoomGesturesEnabled(false); mMapView = new MapView(getActivity(), options); mMapView.setLayoutParams(new AbsListView

Drop marker slowly from top of screen to location on android map V2

我的梦境 提交于 2019-12-03 08:02:27
问题 I am using android maps v2works fine I can add and remove markers onLong Touch on locations. Problem: I would like to drop the marker slowly into the touched location i.e. I want the user to see the marker floating from the top of the screen to the point where it is dropped(touched location). Currently; the marker just appears on the touched location such that you have to lift you finger to see that it has been dropped. It would be nice to see it coming from the top of the screen. Thanks. 回答1

How can i access all marker on my GoogleMap-Object (android maps v2) and set them (in)visible?

流过昼夜 提交于 2019-12-03 04:00:45
i am currently trying to implement an ActionBar-Button that on usage sets all my markers on my GoogleMap-object visible or invisible. My problem is that i don't know how i can get a reference to all my markers once they have been created and are shown on my map. Im looking for a solution where i stash all my marker-objects into an array, that i can access in other parts of my code aswell. is this approach reasonable? here is what i am thinking of: private Marker[] mMarkerArray = null; for (int i = 0; i < MainActivity.customers.size(); i++) { LatLng location = new LatLng(mData.lat, mData.lng);

Android Google Map API V2 : Open Custom Info Window on Right Side of Marker

半城伤御伤魂 提交于 2019-12-03 03:38:25
问题 I have Integrated Google MAP API V2 for Android. I want to have a Custom Info Window at Onclick of My Marker. Up to that it is fine. i have integrate it. What I want : I want to Show my Custom Info Window on Right Side of Marker Instead of Top of the Marker. Below is the Code I am Using : public class MainActivity extends FragmentActivity { private MainMapFragement mapFragment; private HashMap<Marker, EventInfo> eventMarkerMap; Marker ThirdMarker; @Override protected void onCreate(Bundle

Draw a custom shape in android using XML

社会主义新天地 提交于 2019-12-03 01:47:55
I am adding a custom marker to the android map view. here is the image I am using for it.It looks like as more markers are placed say about 100 the entire app is getting slow. Here is the image I am using for that. Instead of using this image, I am planning to draw this image as a shape in XML. How to do that? Also I am following this tutorial to display a custom marker. Is this custom drawing delaying the app? Whats the best way to do it? It's possible, but looks like does not make sense. Because Google Map requires only bitmap. So you need create bitmap and draw your shape with help of

Android MapView With Sliding Menu Obscures Menu

点点圈 提交于 2019-12-03 00:38:13
I have a map view for android maps api v2 in an activity that uses this sliding menu https://github.com/iPaulPro/SlidingMenu . The sliding menu works great except for on the map page. There is a black view covering the sliding menu that is the exact size of the map. This is an example with the map height set at 100dp to outline what I mean. If I touch that view it will go away. How would I get rid of it or make it transparent? I've tried the requestTransparentRegion() trick. No dice there. smokingoyster Found this stack overflow post ViewPager with Google Maps API v2: mysterious black view and

ClusterManager repaint markers of Google maps v2 utils

梦想的初衷 提交于 2019-12-02 22:33:04
Hi Im making a server request and when I received the request from server, I'm executing on Ui Thread a ClusterManager.addItem() but this items are not painting in the map, only when I make a zoom update (+,-) are showing. Also, I tried to debug the renderer, but onBeforeClusterRendered / onBeforeClusterItemRendered are not called until I update the zoom in map. Any ideas how to refresh map/clusterManager/markers? MarkerManager markerManager = new MarkerManager(map); clusterManager = new ClusterManager<TweetClusterItem>(getActivity(), map, markerManager); clusterManager.setRenderer(new

Drop marker slowly from top of screen to location on android map V2

拜拜、爱过 提交于 2019-12-02 21:30:34
I am using android maps v2works fine I can add and remove markers onLong Touch on locations. Problem: I would like to drop the marker slowly into the touched location i.e. I want the user to see the marker floating from the top of the screen to the point where it is dropped(touched location). Currently; the marker just appears on the touched location such that you have to lift you finger to see that it has been dropped. It would be nice to see it coming from the top of the screen. Thanks. You can achieve this with a code similar to this (untested): final LatLng target = ...; final long

Check if marker is inside circle radius

纵饮孤独 提交于 2019-12-02 18:47:28
I'm trying to know if a given marker is inside a circle radius. In javascript, i can do something like: google.maps.geometry.spherical.computeDistanceBetween(latLngCircleCenter, latLngPoint); But in android, using maps-v2, i'm stucked. Otuyh After a lot of research, i found a very simple solution: float[] distance = new float[2]; Location.distanceBetween( marker.getPosition().latitude, marker.getPosition().longitude, circle.getCenter().latitude, circle.getCenter().longitude, distance); if( distance[0] > circle.getRadius() ){ Toast.makeText(getBaseContext(), "Outside", Toast.LENGTH_LONG).show()