google-maps-android-api-2

Check for existing markers before adding another

∥☆過路亽.° 提交于 2019-12-10 18:01:11
问题 Google Maps API v2 Whilst I was waiting for another app to be finalised I was creating another out of interest that would only enable 1 marker to be added to a map at a time (I love maps I do). I currently have this code which will clear the map if a marker already exists and then add another one. But what I wanted was for it to show a message telling to user to clear the map before it will allow another marker to be added. @Override public void onMapClick(LatLng position){ if (position !=

Android onLocationChanged with Direction using Google Map Api v2

只谈情不闲聊 提交于 2019-12-10 17:56:17
问题 I am making a tourist map for android with Google Map Markers and Polylines and I succeeded in doing that but now i need to add something that can make my app more friendly user. so I wanted to put this feature to my app. Something like that. with live update when the user move. Anyhow this my app I don't know how to start on that placing DIRECTION. anyone can help me? Tried using this method but i failed. ` @Override public void onLocationChanged(Location location) { // Getting latitude of

Android Google Maps dynamic fragment in RecyclerView holder

筅森魡賤 提交于 2019-12-10 16:16:44
问题 I'm trying to add Google Maps fragments into a RecyclerView in Android. I was reading about it and I saw that I need to create the fragments dynamically instead of doing it by XML to avoid the duplicate ID errors. Here is my adapter code : public class MapViewHolder extends RecyclerView.ViewHolder { protected FrameLayout mapContainer; public MapViewHolder(View v){ super(v); view = v; mapContainer = (FrameLayout) v.findViewById(R.id.mapContainer); } } private void bindMapRow(final

Map Fragment couldn't be modified after Fragment Reload

旧街凉风 提交于 2019-12-10 16:15:39
问题 I have an activity with Navigation Drawer and HomeFragment . HomeFragment contains two nested fragments (child fragments): SupportMapFragment and ActionFragment . I declare the GoogleMap object sMap as static in HomeFragment , so it can be accessed and modified by the nested fragment ActionFragment . Everything works fine in the first run. The map can be manipulated from within the ActionFragment . But when the HomeFragment is removed and reloaded at a later point of time, the map could only

How to pass more than just title and snippet to getInfoContents in custom InfoWindow for Android

拜拜、爱过 提交于 2019-12-10 16:04:56
问题 I have a InfoWindowAdapter class in my Android app that refers to an xml layout containing three TextViews. I add a new marker using the code below within an addMarker() method: mapView.addMarker(new MarkerOptions() .position(latLon) .title(titleText) .snippet(snippetText) .icon(BitmapDescriptorFactory.fromResource(R.drawable.pin_green))); mapView.setInfoWindowAdapter(new InfoWindow(getLayoutInflater())); mapView.setOnInfoWindowClickListener(this); I then set the text of my two infowindow

Trying to show StreetView in by using Google Maps Android API v2 in android but not able to get it working

无人久伴 提交于 2019-12-10 15:05:23
问题 I am trying since long time to show the StreetView of particular location in Android but unfortunately unable to succeed. What i require is that if i provide a position(LAT,LONG) to the map it should show the streetview of that particular position. Following is the working code that shows Map, 3D map, hybrid map, sattlatite view etc etc.. BUT not showing the STREETVIEW... mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); mMap.addMarker(new

Is it possible in Android Google maps to change default location from South Africa to Australia?

北城以北 提交于 2019-12-10 14:40:39
问题 I want to confirm one thing in Google maps that is why Google maps always showing South Africa as default location ... Can't we change Australia as Default one . If GPRS enabled I can trace the current location if not i want to show Sidney in Australia . Is it possible ??? 回答1: Google Maps will show the user's current location if you ask for it. You can also manually set the "default" location by moving the map to give a particular location. CameraUpdate point = CameraUpdateFactory.newLatLng

How do I pass custom data to Google Maps v2 InfoWindowAdapter?

我的未来我决定 提交于 2019-12-10 13:37:04
问题 I am trying to take advantage of an InfoWindowAdapter to provide custom content for the InfoView. I'm pulling down a JSONArray from my web service and adding the Markers but I'm not seeing how to pass the detail to the call back via a Marker. @Override public View getInfoWindow(Marker marker) In the Javascript API I was able to just set arbitrary marker info. I want to be able to pass info that can be used as conditionals for the custom content, example a marker.status string. So something

receiving ambiguous sky screen while loading google map

不羁岁月 提交于 2019-12-10 13:19:41
问题 while loading google map on device i am receiving below screen sometimes.it comes on second load as shown below. otherwise it comes perfectly as normal google map with route I am using SupportmapFragment and get googleMap object as. supportMapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map_view_fragment); below is code for displaying map in activity/fragment public static void drawRouteIntoMap(final List<? extends MapHelper> position, final GoogleMap

Defining a CameraUpdate with LatLngBounds with different padding values

﹥>﹥吖頭↗ 提交于 2019-12-10 12:36:39
问题 Is there a function that allows specifying default padding values for different edges of the MapFragment , i.e. similar to CameraUpdateFactory.newLatLngBounds(LatLngBounds bounds, int padding) which already exists, but instead something like CameraUpdateFactory.newLatLngBounds(LatLngBounds bounds, int paddingTop, int paddingLeft, int paddingBottom, int paddingRight) ? Why I need this : In my MapFragment I have a half transparent layer on top. Therefore I need a wider padding at the top than