android-mapview

Is it possible to show terrain maps with Android MapView class

寵の児 提交于 2019-12-06 15:20:21
Is it possible to show terrain maps similar to this http://maps.google.com/maps?hl=en&ie=UTF8&ll=45.699466,6.389236&spn=0.327066,0.861053&t=p&z=11 using MapView class? You can swap styles of the map with .setSatellite(true or false); true for sattelite map false for road map. This style of map is not supported, yet. 来源: https://stackoverflow.com/questions/6795705/is-it-possible-to-show-terrain-maps-with-android-mapview-class

Google API MapView OutOfMemory after setting the MapView to specific width and height

徘徊边缘 提交于 2019-12-06 14:27:04
i searched for this Problem, and i found some stackoverflow Questions about the same but without any idea how to resolve the problem. I created an activity and i want to add a really small mapview (like 140w X 70h). It is only to show a small preview of where the place is. When you click this little mapview you get a new inflate to a new activity with the hole map. MapView: <com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="140dip" android:layout_height="80dip" android:layout_below="@id/attributes" android:layout_alignParentRight="true" android:apiKey="****"

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

。_饼干妹妹 提交于 2019-12-06 14:26:50
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 onActivityCreated(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MapsInitializer

Error when try to add Google Maps

久未见 提交于 2019-12-06 14:08:09
问题 Couple moths ago i testing this app on Android N and all will work correctly, but now i have error. Now i'am using MapFragment and have this error: 05-09 23:22:35.816 11112-11112/pc.dd.sex_startup E/AndroidRuntime: FATAL EXCEPTION: main Process: pc.dd.sex_startup, PID: 11112 java.lang.RuntimeException: Unable to start activity ComponentInfo{pc.dd.sex_startup/pc.dd.sex_startup.LogIn.Maps.Map}: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating

There is no scroll after adding an Overlay to MapView

时光怂恿深爱的人放手 提交于 2019-12-06 13:59:33
I'm fighting with following problem now: I add a simple overlay to my mapview. It doesn't draw anything, it is just a help overlay for detecting scroll is ended (see response ) Here is the code of it: public class ScrollDetectionOverlay extends Overlay { private static GeoPoint lastLatLon = new GeoPoint(0, 0); private static GeoPoint currLatLon; protected boolean isMapMoving = false; private MapScrollingFinishedListener listener = null; public void setListener(MapScrollingFinishedListener listener) { this.listener = listener; } @Override public boolean onTouchEvent(MotionEvent e, MapView

How to keep map state on device rotation?

放肆的年华 提交于 2019-12-06 13:42:42
I have a nested fragment that i would like to maintain the state when the device orientation changed. It is something like this: I'm instantiate a mapView in the nested fragment and when the device is rotated the user must be in the same place where it was. How can I accomplish this? Thank you Ok, so i was making a mistake. I was calling the function setRetainInstance(true) on the fragment parent and i shouldn't. After deleting that line, it was very simple to keep the map state on device orientation. All i had to do was to save some values on onSaveInstanceState like this: bundle.putDouble(

Clipping/Masking a MapView on Android

久未见 提交于 2019-12-06 12:51:18
问题 I am trying to show a MapView as a circle on Android just like that: protected void onDraw(Canvas canvas) { Path path = new Path(); path.addCircle(400,200,100,Direction.CW); canvas.clipPath(path); super.onDraw(canvas); } Unfortunately the MapView (v2: com.google.android.gms.maps.MapView ) component seems to ignore that and instead just taking the bounds/rect of that circle to draw the map :( I've been searching the web for a while now, not finding a nice solution for that. Is this even

Google Maps marker clusters in Android

帅比萌擦擦* 提交于 2019-12-06 12:49:48
问题 Is there any common way to implement marker clusters for Google Maps in Android apps? I have a database of about 10,000 locations and would like to display them in more intelligent ways than just dumping thousands of markers on a display that's rarely larger than a match box... Ideally, it should be possible to retrieve the markers from a website URL, though I'm not sure if using the usual Async functions for that even makes sense from a usability point of view. 回答1: Clusterkraf would work

Adding multiple annotations to iPhone MapView is slow

被刻印的时光 ゝ 提交于 2019-12-06 12:29:40
问题 I have code that takes a title and an address of a location,then get coordinates from google maps csv, then add annotation. It works, but when I want to add 50 or more annotation at once it freezes for about 30-40 seconds and then displays annotations, so what I want to know is did I screw up memory management and that's why it's so slow, or something else? Can I speed it up? Here is the code: - (void) addAnnotation: (NSString*) annoTitle: (NSString*) annoAddress { NSString *address =

Android - Two Maps in one App

时光怂恿深爱的人放手 提交于 2019-12-06 12:02:44
问题 I got an App where on main screen show google mapView. But I need also in details view show the map. I know that it is impossible to run two maps simultaneously. Everything is working when I want to show something on the main map and later in detailed view, but when I come back to main one, it stops. How to stop main map and come back later to it? 回答1: Having two maps in one app produces many weird application behavior. For example, Ive had overlays from one map show up in the second map.