android-mapview

How to display direction arrows in the map marker for google maps v2 android

こ雲淡風輕ζ 提交于 2020-01-03 10:07:06
问题 I want to display markers like these below on my android map application. I Know I have to use custom marker for this I also have the angle calculated but I don't know how to display the arrow on the marker. Any pointers will be helpful and Thanks in advance. 来源: https://stackoverflow.com/questions/19693969/how-to-display-direction-arrows-in-the-map-marker-for-google-maps-v2-android

How to get LatLngBounds of visible region in titled map in andorid

帅比萌擦擦* 提交于 2020-01-03 03:01:08
问题 I tried the following code. LatLngBounds b = googleMap.getProjection() .getVisibleRegion().latLngBounds; LatLng bNE = b.northeast; LatLng bSW = b.southwest; It's not giving correct bounding coordinates if tilt is set to the map 回答1: As mentioned in the Google Maps API doc VisibleRegion, the visible region for a map's camera can be in the form of a rectangle in case the camera is centered over the map region which will give you correct bounding coordinates. While it can also be in the form of

Changing User Agent in OSMDroid

被刻印的时光 ゝ 提交于 2020-01-03 02:56:08
问题 Is it possible to change User Agent I send with every tile request in OSMDroid? I'm currently getting 403 Forbidden error whenever I try to download a tile (as described in another SO question), probably because OSMDroid itself has been banned. 回答1: Please follow Issue 515 to track this issue. We have implemented a fix and we will release a proper update soon. We will be providing a factory interface for customizing the user-agent. 回答2: It looks like the only way to specify the User Agent is

How can I get current location on mapview using fragment class?

荒凉一梦 提交于 2020-01-02 14:01:09
问题 Hello I am new in android development and i want to get current location in mapview using fragment class. when i am adding setMyLocationEnabled method it is asking for permissions and i have added all the permissions in manifest. Please help me . Gmaps.java (fragment) public class Gmaps extends Fragment implements OnMapReadyCallback { private GoogleMap googleMap; private MapView mapView; private boolean mapsSupported = true; private GoogleApiClient mGoogleApiClient; @Override public void

MapView v2 keeping Context around

◇◆丶佛笑我妖孽 提交于 2020-01-01 08:38:08
问题 When using the MapView from the latest google maps API, I am getting a memory leak because MapView is holding onto my activity. I used Leak Canary and have this trace D/LeakCanary﹕ * GC ROOT com.google.android.gms.location.internal.t.a D/LeakCanary﹕ * references com.google.android.gms.location.internal.s.a D/LeakCanary﹕ * references com.google.maps.api.android.lib6.d.v.c D/LeakCanary﹕ * references com.google.maps.api.android.lib6.d.aj.b D/LeakCanary﹕ * references com.google.maps.api.android

You attempted to set the key on an object that is meant to be immutable and has been frozen

不打扰是莪最后的温柔 提交于 2020-01-01 08:13:08
问题 In the following example: MapView displays elements of a ListView as annotations Clicking on a ListView element should result in painting it in blue color. Bonus if the MapView and ListView efficiently use the state object Modifying the DataSource of ListView seems to cause the conflict when the active attribute gets modified: You attempted to set the key 'active' with the value 'false' on an object that is meant to be immutable and has been frozen. What is the right way of setting the state?

Scale Map Markers by Zoom, Android

戏子无情 提交于 2020-01-01 05:24:27
问题 I have lot of markers on my map. Zooming in each marker shows me a position. but zooming out the markers are overlapping each other and it is more difficult do determine the position of a marker. Is there a way to scale the marker image depending on the zoom factor? 回答1: Depends on how you draw your marker. If your marker is just a bitmap/drawable, simply use matrix.postScale() Matrix matrix = new Matrix(); matrix.postScale(2f, 2f); // douple the size canvas.drawBitmap(mBitmap, matrix, mPaint

How to rotate MapView?

淺唱寂寞╮ 提交于 2020-01-01 03:10:09
问题 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 ? 回答1: 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

How to rotate MapView?

╄→尐↘猪︶ㄣ 提交于 2020-01-01 03:10:06
问题 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 ? 回答1: 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

Android Map is plain white screen - no errors

只谈情不闲聊 提交于 2019-12-31 03:45:43
问题 XML (activity_maptest.xml): <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.MapFragment"/> Java (Maptest.java): package com.example.app; import android.app.Activity; import android.os.Bundle; public class Maptest extends Activity { public class MapActivity extends Activity { @Override protected void