android-mapview

Google Maps Android API v2: My location marker always over other markers?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 07:55:32
Currently migrating an Android app using Google Maps to Google Maps Android v2; I want the map to display the built-in location marker, as well as custom markers. With the previous library, I used to draw the location marker 'below' custom markers, with mapView.setReticleDrawMode(ReticleDrawMode.DRAW_RETICLE_UNDER); I can't find a similar option in the new API. Did I miss something? After a bit a searching, I couldn't find such an option. I finally removed the location pin, and added a similar Marker and Circle to the map; since it is a classic Marker, it appears below the other markers. map

Disable moving around in mapview

走远了吗. 提交于 2019-11-30 07:52:47
问题 Is it possible to disable moving inside the google map? 回答1: Even though there is an accepted answer, just providing my answer as it didnt help me. mapView.setClickable(false) does not work all the time, like cases where you have a mapView inside a scrollView. So I created a view object right above the mapView of the same size. Handled the onTouchListener for my overlay view and passed all the touch events to the parent of mapView (ScrollView in my case), hence by-passing all the touch events

android: MapView does not recognize clicks

◇◆丶佛笑我妖孽 提交于 2019-11-30 07:42:36
问题 I simply want a mapview to recognize a click, in order to call another activity. Until now, i tried the regular "onClick",that always worked for me in regular Views, followed by overriding "onTouchEvent" and last but not least using an onClickListener. I out all three ways into the following code. Any help is highly appreciated. import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; import android.os.Bundle; import android.view.MotionEvent; import android.view

Android custom control to display map tiles [closed]

早过忘川 提交于 2019-11-30 07:41:42
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have on my server map tiles sorted on a folder structure like OpenStreetMap (OSM) uses. I need to be able to display these tiles, zoom in/out, pan and rotate the map. I wouldn't start from the scratch to create

Let's solve the “Failed to find style 'mapViewstyle' in current theme” error

半腔热情 提交于 2019-11-30 07:07:36
问题 Sorry to post yet another one of these, but it seems we have yet to document every solution to this issue. Here's what happened: I added a mapview, everything was working peachy. I added a slidingdrawer and moved buttons into it, then changed the root node from a linear to a relative. Since then I get an error in the Graphical Layout of my main.xml class that reads Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different

mapview and cameraupdate in api v2

有些话、适合烂在心里 提交于 2019-11-30 07:07:20
问题 Why the CameraUpdateFactory class is not working in my project? The app crashes if it executes the following command: CameraUpdate pino= CameraUpdateFactory.newLatLng(new LatLng(location.getLatitude(), location.getLongitude())); If i remove that line (and of course the next one), the code successfully starts and shows the map. I need the mapView and i need to use the new api v2. I declare the mapView in layout in this way: <com.google.android.gms.maps.MapView xmlns:android="http://schemas

Don't snap to marker after click in android map v2

被刻印的时光 ゝ 提交于 2019-11-30 06:45:47
问题 Currently Android Map v2 snaps to marker location after click. I want to disable this behavior but see no options to do it. Does anybody know how to fix that? 回答1: Based on what I read from the Markers - Google Maps Android API (https://developers.google.com/maps/documentation/android/marker#marker_click_events) Marker click events You can use an OnMarkerClickListener to listen for click events on the marker. To set this listener on the map, call GoogleMap.setOnMarkerClickListener

MapView.onMapReady never called in Fragment for load Google Map in MapView

陌路散爱 提交于 2019-11-30 05:34:11
问题 I'll try to show a map in my Android application on a fragment named RoeteFragment . If I debug my code I see that the method onMapReady is never called so that the map will not load. The fragment implements OnMapReadyCallback like needed and in the onCreateView I get the MapView and call getMapAsync . If I place a breakpoint on that method, it will always been hit, the breakpoint inside onMapReady never been hit. There is no exception thrown. I've also a valid Google Maps API key in the file

Android Map Zoom to Show all Pins

故事扮演 提交于 2019-11-30 05:25:40
I have 5 pins added to a map. How can I tell the MapView to zoom as much as possible and keep all pins in view? I used this method in a recent project of mine public void centerOverlays() { int minLat = 81 * MapStoresController.MAP_SCALE; int maxLat = -81 * MapStoresController.MAP_SCALE; int minLon = 181 * MapStoresController.MAP_SCALE; int maxLon = -181 * MapStoresController.MAP_SCALE; for (int i = 0; i < overlayItems.size(); i++) { Store s = overlayItems.getItem(i).getStore(); minLat = (int) ((minLat > (s.getLocation().getLatitude() * MapStoresController.MAP_SCALE)) ? s.getLocation()

Android OSM droid - set Max Zoom level

前提是你 提交于 2019-11-30 05:17:35
问题 I am implementing App vith usage of osmdroid mapView. We have maps with max 16 zoom level, but Android allow us to have 18 zoom levels. Do you know how to set maximum zoom level 16 instead of default 18? Thanks Hmyzak 回答1: Update - we have added simple setMin/MaxZoomLevel() methods to MapView in the trunk. It should be included in 3.0.10. See https://code.google.com/p/osmdroid/issues/detail?id=418 for additional info. Original answer: Create your own TileSource class and use that. You can