Add an Image from url into custom InfoWindow google maps v2

I’ve been building a similar app. First of all, the reason your InfoWindow is not showing the downloaded image is because the MapFragment renders the view into a Canvas, and then draws that. What you’re seeing in the info window aren’t the views you created, but a “picture” or “screenshot” of them. You basically need … Read more

How to get center of map for v2 android maps?

I had the same problem. It seems you can get the center this way: mMap.getCameraPosition().target where mMap is the GoogleMap instance from your activity. This will return a LatLng object which basically represents the center of the map. Note that the GeoPoint class is not available anymore. According to http://developer.android.com/reference/com/google/android/gms/maps/model/CameraPosition.html target is “The location that … Read more

Google Maps v2 – set both my location and zoom in

You cannot animate two things (like zoom in and go to my location) in one google map? From a coding standpoint, you would do them sequentially: CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); Here, I move the camera first, then animate the camera, though both could be animateCamera() calls. Whether GoogleMap consolidates these … Read more

Country specific zoom level in Google Maps API

go to http://www.gadm.org/download, download the adm0 file for the Netherlands Combine that polygon (as the inner ring(s)) with a polygon that covers the whole earth use the winding reversal tool to reverse any inner polygons that don’t wind opposite the outer ring. zip up the resulting kml, rename to kmz. Display on the map using … Read more

Adding multiple markers in Google Maps API v2 Android

ArrayList<MarkerData> markersArray = new ArrayList<MarkerData>(); for(int i = 0 ; i < markersArray.size() ; i++) { createMarker(markersArray.get(i).getLatitude(), markersArray.get(i).getLongitude(), markersArray.get(i).getTitle(), markersArray.get(i).getSnippet(), markersArray.get(i).getIconResID()); } protected Marker createMarker(double latitude, double longitude, String title, String snippet, int iconResID) { return googleMap.addMarker(new MarkerOptions() .position(new LatLng(latitude, longitude)) .anchor(0.5f, 0.5f) .title(title) .snippet(snippet) .icon(BitmapDescriptorFactory.fromResource(iconResID))); }