google-maps-android-api-2

android maps api v2 adding multiple circles

孤人 提交于 2020-01-06 08:12:59
问题 I'm trying to add a circle to the map every second with an update from the gps. How would I pass the Location location = locationmanager.getLastKnownLocation(provider); to make a new circle every second? Here is what I have so far. public class MainActivity extends Activity implements LocationListener{ Location myLocation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); GoogleMap mMap; mMap = (

android maps api v2 adding multiple circles

自古美人都是妖i 提交于 2020-01-06 08:12:10
问题 I'm trying to add a circle to the map every second with an update from the gps. How would I pass the Location location = locationmanager.getLastKnownLocation(provider); to make a new circle every second? Here is what I have so far. public class MainActivity extends Activity implements LocationListener{ Location myLocation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); GoogleMap mMap; mMap = (

Remove the last plotted line from Google Map Android

让人想犯罪 __ 提交于 2020-01-06 06:59:09
问题 I have the following code which adds a PolylineOptions object to a Polyline array list. The argument passed in is a series of points returned from a query to the Directions API. List<Polyline> polylines = new ArrayList<Polyline>(); public void drawPolylines(List<List<HashMap<String, String>>> result) { PolylineOptions lineOptions = null; // Traversing through all the routes for (int i = 0; i < result.size(); i++) { lineOptions = new PolylineOptions(); // Fetching i-th route List<HashMap

Adding Default Location if User Doesn't Allow Permission for a Fine Location for a Map in Android

心已入冬 提交于 2020-01-06 02:52:08
问题 I am starting to learn about the runtime permissions. I have a map and I made a permission. If user allows fine location - map zooms to his current location, and if he doesn't allow it, the map stays in the place. What I want to do instead of map staying in the place is this: if the user doesn't allow permission for accessing his location, map should zoom in to my custom location (Greenwich). My maps fragment: mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady

How to Implement Place Picker in Android App after Deprecation of previous Maps SDK

只谈情不闲聊 提交于 2020-01-05 08:11:30
问题 I can't understand how I can implement a MapView with an indicator that returns Latitude and Longitude of a place marked by the user. (Just like the food delivery apps) I am able to get the user's current latitude and longitude but not on MapView. All online articles on the implementation of this type of Place Picker are obsolete and generate errors in some parts of the entire procedure. I was unable to find any articles created after the old Maps SDK became obsolete. This below is my noob

Marker Animation on Google Maps Android not working

时光总嘲笑我的痴心妄想 提交于 2020-01-05 04:09:48
问题 I am trying to animate my marker instead of making it jump between the 2 points. For some reason the animation does not work. Every time I get a new current location, I call the below code. if (currentLatitude != 0 && currentLongitude != 0) { String actualRideStartTime = ""; if (currentRideTracking.getActualRideStartTime() != 0) { actualRideStartTime = TIME_FORMAT.format(currentRideTracking .getActualRideStartTime()); } vehicleLocation = new LatLng(currentLatitude, currentLongitude);

Android maps V2 tiles disappear when zooming

↘锁芯ラ 提交于 2020-01-04 13:39:45
问题 I am using Google Maps V2 for Android and have a tile overlay that gets it's tiles from a server online. This all works great and the tiles are displayed correctly at all zoom levels. The issue I am having is when I zoom in/out the current tile is instantly removed from view and the tiles are gone until the next tile has been downloaded. What I would like to happen is the tile will remain and just become pixelated until the new tile is ready. It seems like this is exactly how Google's tile

Draw a curve (bezier curve) between two lat long points on google maps android

ⅰ亾dé卋堺 提交于 2020-01-04 08:55:43
问题 I want to draw a curve (Beizer curve) between two lat-long points. Currently i am referring this post (code is in javascript). Code to get curve points using cubic bezier equation private void drawElementsOnMap(LatLng init, LatLng end) { mMap.addMarker(new MarkerOptions().position(init)); mMap.addMarker(new MarkerOptions().position(end)); LatLngBounds.Builder bc = new LatLngBounds.Builder(); bc.include(init); bc.include(end); mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bc.build(), 100

Draw a curve (bezier curve) between two lat long points on google maps android

為{幸葍}努か 提交于 2020-01-04 08:55:25
问题 I want to draw a curve (Beizer curve) between two lat-long points. Currently i am referring this post (code is in javascript). Code to get curve points using cubic bezier equation private void drawElementsOnMap(LatLng init, LatLng end) { mMap.addMarker(new MarkerOptions().position(init)); mMap.addMarker(new MarkerOptions().position(end)); LatLngBounds.Builder bc = new LatLngBounds.Builder(); bc.include(init); bc.include(end); mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bc.build(), 100

Markers change position with zoom in/out

◇◆丶佛笑我妖孽 提交于 2020-01-04 06:09:03
问题 I'm using the Google Maps API v2 for Android, and I want to place a couple of markers on the map. I have the code as following @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_map, container, false); MapFragment fm = (MapFragment) getFragmentManager().findFragmentById(R.id.map); map = fm.getMap(); rootView.findViewById(R.id.map_hybrid).setSelected(true); map.setMapType(GoogleMap.MAP