google-maps-android-api-2

How to draw dashed polyline with android google map sdk v2?

独自空忆成欢 提交于 2019-12-17 09:42:12
问题 I've looked through the documentation of polyline and there is no option to make it dashed. Do anybody know how to draw dashed polyline with android google map sdk v2? 回答1: Now in Polyline you can set the pattern to be Dash, Dot or Gap simply apply the following public static final int PATTERN_DASH_LENGTH_PX = 20; public static final int PATTERN_GAP_LENGTH_PX = 20; public static final PatternItem DOT = new Dot(); public static final PatternItem DASH = new Dash(PATTERN_DASH_LENGTH_PX); public

Getting results of nearby places from User's Location using Google Maps API in Android

半腔热情 提交于 2019-12-17 08:54:26
问题 This is the first time using google map API and google places API. I am doing a demo application that displays the list hospitals (for example) nearest to the user's location with routes to each of the hospitals. I been able to get the user's location with the code below the: public class MainActivity extends ActionBarActivity { private GoogleMap map; UiSettings mapSettings; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R

Getting results of nearby places from User's Location using Google Maps API in Android

谁说我不能喝 提交于 2019-12-17 08:54:15
问题 This is the first time using google map API and google places API. I am doing a demo application that displays the list hospitals (for example) nearest to the user's location with routes to each of the hospitals. I been able to get the user's location with the code below the: public class MainActivity extends ActionBarActivity { private GoogleMap map; UiSettings mapSettings; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R

Polygon Touch detection Google Map API V2

a 夏天 提交于 2019-12-17 06:12:06
问题 I'm trying to figure out how best to do this, I have a map with one Polygon drawn on it. Since it doesn't seem as though the Google Maps API V2 has a touch detection on a Polygon. I was wonder if it is possible to detect whether the touch point is inside the Polygon? If so then how, my main goal is to outline a state on a map and when the user taps that state it will show more details inside a custom view. As of now I am able to capture the MapOnClick of the map but when the user taps inside

Polygon Touch detection Google Map API V2

最后都变了- 提交于 2019-12-17 06:12:05
问题 I'm trying to figure out how best to do this, I have a map with one Polygon drawn on it. Since it doesn't seem as though the Google Maps API V2 has a touch detection on a Polygon. I was wonder if it is possible to detect whether the touch point is inside the Polygon? If so then how, my main goal is to outline a state on a map and when the user taps that state it will show more details inside a custom view. As of now I am able to capture the MapOnClick of the map but when the user taps inside

limit scrolling and zooming Google Maps Android API v2

♀尐吖头ヾ 提交于 2019-12-17 06:09:48
问题 I've added GroundOverlay to map and want to limit scrolling and zooming within this area. How to limit scrolling within some bounds on android google maps? Is it possible to get instantly motion points from MapFragment? Please, help me. 回答1: Constraining the camera has (finally!) been added as a feature as part of the release of Google Play Services 9.4 -- you can call setLatLngBoundsForCameraTarget(LatLngBounds bounds) to set the allowed panning area. // Create a LatLngBounds that includes

moveCamera with CameraUpdateFactory.newLatLngBounds crashes

早过忘川 提交于 2019-12-17 03:28:11
问题 I'm making use of the new Android Google Maps API. I create an activity which includes a MapFragment. In the activity onResume I set the markers into the GoogleMap object and then define a bounding box for the map which includes all of the markers. This is using the following pseudo code: LatLngBounds.Builder builder = new LatLngBounds.Builder(); while(data) { LatLng latlng = getPosition(); builder.include(latlng); } CameraUpdate cameraUpdate = CameraUpdateFactory .newLatLngBounds(builder

android Maps API v2 with custom markers

帅比萌擦擦* 提交于 2019-12-17 03:01:01
问题 I want to make maps with custom markers. In API v2 I can set icon, title, etc for markers. But I want to display title with marker at the first onset. Now title displays only when I taping the marker. In v1 was overlays, but in v2 I didn't found anything similar. Edited: Maybe I was not clear enough. Something like Marker.showInfoWindow() in API works only for one marker. I can't show info windows for all of my markers at the same time. Anyway I need to show titles for all of my markers,

java.lang.noclassdeffounderror: com.google.android.gms.R$styleable

喜夏-厌秋 提交于 2019-12-17 03:00:59
问题 I am creating an android application using google maps. here is the code: MapFragActivity.java import android.os.Bundle; import android.support.v4.app.FragmentActivity; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; public class MapFragActivity extends FragmentActivity { private GoogleMap map; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map_frag); map = (

Maps V2 Marker pressed states

会有一股神秘感。 提交于 2019-12-14 01:51:36
问题 In Maps V2, how can I set a pressed state to a Marker? The setIcon() method takes a BitmapDescriptor; I can't see a way to pass an XML selector which would give a pressed and selected state. Is the only way to achieve this to override the OnMarkerClickListener and change the image programmatically? 回答1: There is no way to change the icon for the duration of Marker being pressed as of API v2 version 3.1.36. For the selected state, you may work it around by using OnMarkerClickListener , setting