android-mapview

Android (MapView): How to set Zoom level of 4 miles in the mapview?

倖福魔咒の 提交于 2019-12-03 13:56:30
I have a latitude and longitude(GeoPoint) which is the center of map. I want to set zoom level of 4miles distance from latitude and longitude that I have. Thanks in Advance, You can use the setzoom()-function to do so. The code below can be found in this example . mc = mapView.getController(); String coordinates[] = {"1.352566007", "103.78921587"}; double lat = Double.parseDouble(coordinates[0]); double lng = Double.parseDouble(coordinates[1]); p = new GeoPoint( (int) (lat * 1E6), (int) (lng * 1E6)); mc.animateTo(p); mc.setZoom(17); SOLVED : from Androd google API : zoomlevel sets the

using Android Google Maps API to display a Heat Map layer

人盡茶涼 提交于 2019-12-03 13:27:31
问题 I am doing a project in Android, where I have given a list of Geography Points (lat, lng) and each point has an associated Altitude(height) value with it. My task is to create a Heat Map of the given map with varying colors depending on the points altitude value. Does someone know of any existing library for doing the same. Or, it would also be very helpful to me if anyone can give pointers on how it cam be implemented. My only constraint is that it should work in Android. Thanks in advance.

Android MapView display empty

扶醉桌前 提交于 2019-12-03 13:01:11
Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yu.lbs" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <uses-library android:name="com.google.android.maps" /> <activity android:name="com.yu.lbs.MainActivity" android:label="@string/app

Differences between MapView, MapFrament and SupportMapFragment

时光怂恿深爱的人放手 提交于 2019-12-03 11:54:32
I would know the differences because I'm developing an app and I would introduce Google Map API v2 for compiling above Android 2.3. Which should I use? Ferdous Ahamed MapView: A View which displays a map (with data obtained from the Google Maps service). When focused, it will capture key-presses and touch gestures to move the map. Users of this class must forward all the life cycle methods from the Activity or Fragment containing this view to the corresponding ones in this class. Use it if you are going to add a map into a fragment . (you need to update each lifecycle to MapView). See Google

Android how to draw paint in free hand in MapView using overlay?

a 夏天 提交于 2019-12-03 10:08:47
问题 In my app Draw paint in free hand on Map view but searching lot of information finally got from rectangle shape draw on mapview but i want in place of rectangle draw free hand like zigzag how to change my code Any help please.. MapOverlay.java public class MapOverlay extends Overlay { private float x1,y1,x2,y2; private GeoPoint p1=null,p2=null; private MapExampleActivity mv = null; private Paint paint = new Paint(); private Path path = new Path(); private boolean isUp = false; //constructor

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

Remove all Overlays

谁说胖子不能爱 提交于 2019-12-03 08:32:54
I have the following code to add an Overlay myMapView.getOverlays().add(sites); myMapView.invalidate(); I also have the following remove code where sites is a global variable. if (sites != null) { // myMapView.getOverlays().clear(); myMapView.getOverlays().remove(sites); myMapView.invalidate(); sites = null; } Sometimes I am left with duplicates so would like a way to remove all overlays from a map, is this possible? Looks like I did have the answer all along! myMapView.getOverlays().clear() 来源: https://stackoverflow.com/questions/3696415/remove-all-overlays

How to rotate MapView?

*爱你&永不变心* 提交于 2019-12-03 07:28:14
I am a new developer for Android. Tried to rotate MapView in circular motion. But I don't know how to begin. Do you have a simple code to rotate the MapView ? I have done this in the past and it requires to create a custom ViewGroup that rotates the Canvas in the dispatchDraw() method. You also need to increase the size of the MapView (so that it draws enough pixels when rotated.) You will also need to rotate the touch events in dispatchTouchEvent(). Or if you use Android 3.0 you can simply call theMapView.rotate() :) As a general case, you can always created an Affine Transform with the

Differences between ItemizedOverlay and Overlay class

泄露秘密 提交于 2019-12-03 06:20:42
Can someone tell my when to use Overlay or when to use ItemizedOverlay class! What are differences between this two classes? Draw methods do the same thing? Can I use only ItemizedOverlay class in my project or I must use and Overlay as base class! Thanks Overlay is a general overlay. ItemizedOverlay is a subclass that makes it easier to create an overlay that is a discrete series of marked points on the map. So, if you are trying to show a bus route, or shade a region, or something like that, Overlay is the class you want. If you are trying to show a collection of restaurants, or churches, or

How to change the marker for the overlay on tap for android?

孤街浪徒 提交于 2019-12-03 05:56:24
i have made an application in which i need to change the drawable of an overlayitem when a user clicks on it. i am using the following code to achieve this effect: protected boolean onTap(int index) { OverlayItem item = mOverlays.get(index); if(item.getTitle().equals("true")){ if(item.getMarker(OverlayItem.ITEM_STATE_FOCUSED_MASK).equals(greenMarker)){ item.setMarker(orangeMarker); view1ComplainPoleList.add(item.getSnippet()); Log.i("adding",item.getSnippet()); map.invalidate(); } else{ item.setMarker(greenMarker); view1ComplainPoleList.remove(item.getSnippet()); Log.i("removing",item