android-mapview

Drawing multi color PolyLines on Maps V2

╄→гoц情女王★ 提交于 2019-11-30 05:17:33
I am drawing a plain color PolyLine on my map the following way, and it works great: PolylineOptions polyLine = new PolylineOptions(); polyLine.width(5); polyLine.color(Color.RED); polyLine.geodesic(true); for (int i = 0; i < speed.length; i++) { polyLine.add(new LatLng(lat, lng)); } map.addPolyline(polyLine); Now I would want to draw a polyline with different colors between different points, depending on the speed between those two points. There doesn't seem to be an easy way of doing it. I am referring to this question : draw polylines with different colors on v2 maps , and I can add

Moving icons on a Android MapView

淺唱寂寞╮ 提交于 2019-11-30 03:55:46
I'm working on an application that displays the location of moving items on a Google MapView. I need a way to update the position of the icons that represent the items (as well as change the facing of the icons every two seconds as updated data comes in). I currently have an activity in the app that extends MapActivity. On to this I have overlaid a static Overlay that draws some lines on the map and an ItemizedOverlay that draws a static icon. There is a draw() method that claims to be used by animated overlays, but overriding it to do my animations still doesn't make anything animate. Do I

Android MapView does not load unless you touch on the mapview

我是研究僧i 提交于 2019-11-30 02:49:46
问题 I have added a mapview in my android application.I have used correct settings in the manifest and now i'm facing a problem. When i go to the place where i have my map,it displays only the canvas but not the map. If i touch on it only it starts loading. Even then it does not fully load.it loads only to a certain level.if i keep touching the screen it continuously loads. But even then i cannot zoom in or out OR cant even move the map. Is there a solution for this? Have i done something wrong?

MapView adding pushpins on touch

人盡茶涼 提交于 2019-11-30 01:53:24
问题 I managed to get the map shown on the screen. Now the user will move around the map and press on it. After pressing on a point I need to add a push pin on screen on the pressed location. If the user decides to go for another point, when pressing on the chosen point, the first pushpin would disapear and a new one will be drawn on the new location I did like this: public class LocationSelectionActivity extends MapActivity { GeoPoint p; List<Overlay> listOfOverlays; MapOverlay mapOverlay;

Android, How to remove all markers from Google Map V2?

别来无恙 提交于 2019-11-30 01:15:33
I have map view in my fragment. I need to refresh map and add different markers based on condition. So, I should remove last markers from map before add new markers. Actually, some weeks ago app was working fine and suddenly it happened. My code is like this: private void displayData(final List<Venue> venueList) { // Removes all markers, overlays, and polylines from the map. googleMap.clear(); . . . } Last time it was working fine (before new Google Map API announce by Android team in I/O 2013). However, after that I adapted my code to use this new API. Now, I don't know why this method

Always show zoom controls on a MapView

佐手、 提交于 2019-11-29 23:10:05
Is there a way to always show the zoom controls on a MapView? I have added the zoom controls using map=(MapView)findViewById(R.id.map); map.setBuiltInZoomControls(true); but the zoom controls fade in and out. I want them to always be visible. Solved this by putting my own ZoomControls in my layout xml: <ZoomControls android:id="@+id/zoomcontrols" android:layout_width="wrap_content" android:layout_height="wrap_content" /> and then setting up onClickListeners for then to handle the zoom: zoomControls = (ZoomControls) findViewById(R.id.zoomcontrols); zoomControls.setOnZoomInClickListener(new View

Android - Failed to find provider info for com.google.settings in MapView Example

女生的网名这么多〃 提交于 2019-11-29 17:44:39
问题 I'm trying to implement the MapView example which is defined in Android Hello Views example but now I'm facing this error: Failed to find provider info for com.google.settings Any idea why this is happening? 回答1: The MapView example doesn't set API key by default. So you must set it. Here is step by step: Get MD5 from your system %JAVA_HOME%\bin\keytool.exe -list -alias androiddebugkey -keystore "%userprofile%\.android\debug.keystore" -storepass android -keypass android Get API key by pasting

Android Render Google Map inside a Fragment

不羁的心 提交于 2019-11-29 16:57:55
As shown above i have a Fragment Activity which renders two fragements. On the Map Fragment i want to implment and display a Map. Since we need to extend MapActivity i am not sure how it can be done inside a fragment. Trying to implement Solution from ( https://stackoverflow.com/a/10739200/1737771 ) package com.m7.nomad; import android.app.LocalActivityManager; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.actionbarsherlock.app.SherlockFragment; import com.actionbarsherlock.view

Osmdroid offline mode update tiles after zoom

心不动则不痛 提交于 2019-11-29 15:56:36
I'm developing an Android app that uses Osmdroid to display the maps in offline mode. I have an issue when I want to zoom in or out by pinching on the map or using the build-in zoomcontrols. When I zoom in the map tiles are not always correctly rendered and when I zoom out the sometimes there are some gray tiles in the map, sometimes everything is rendered OK. It's not related on the location displayed on the map. My map tiles are stored in an osmdroid zip-file with the Mapnik source in the folder /mnt/sdcard/osmdroid. I'm using osmdroid-3.0.7. So, any help is welcome. See my code below (my

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