1

I have developed a Google based android map application which points my current location and I succeeded in that. But,the marker I am using has a circle in it and it is dark blue in color when it is zoomed in and this is somewhat odd. We can't trace the nearby places to us. I used locationoverlay for this. This is my code:

private void setMaptoLocation(Location location) {
    mapView.setBuiltInZoomControls(true);
    mapView.setTraffic(true);
    int LAT = (int) (location.getLatitude() * 1E6);
    int LNG = (int) (location.getLongitude() * 1E6);
    GeoPoint point = new GeoPoint(LAT, LNG);
    MapController mapController = mapView.getController();
    mapController.setCenter(point);
    MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this,mapView);
    myLocationOverlay.enableMyLocation();
    mapView.getOverlays().add(myLocationOverlay);
    mapController.animateTo(point);
}

Can anybody do a suggestion please to change the color of the circle / to make it transparent, so that the mapview will be a little more better. Thanks in advance!!!
This is the view that I am getting

mbm29414
  • 11,558
  • 6
  • 56
  • 87
thampi joseph
  • 700
  • 1
  • 8
  • 20

2 Answers2

0

In Google Maps API v2, I think the overlay is not required. Now you can change your circle color as follows;

// Create an ellipse centered at Sydney.
    PolygonOptions options = new PolygonOptions();
    int numPoints = 400;
    float semiHorizontalAxis = 10f;
    float semiVerticalAxis = 5f;
    double phase = 2 * Math.PI / numPoints;
    for (int i = 0; i <= numPoints; i++) {
        options.add(new LatLng(SYDNEY.latitude + semiVerticalAxis * Math.sin(i * phase),
                SYDNEY.longitude + semiHorizontalAxis * Math.cos(i * phase)));
    }
//Here you can change the color of the circle market called as "plygon" on Google Maps API v

    mSYDNEYcircle = mMap.addPolygon(new options
            .strokeWidth(float width)
            .strokeColor(Color.BLACK)
            .fillColor(Color.YELLOW));

For more information, please see the Google API v2 Guide.

enter image description here

BBonDoo
  • 766
  • 5
  • 14
0

You can add Circle to the map by using following CircleOption function, its default fill color is transparent. This function will draw the circle around your location:

 map.addCircle(new CircleOptions()
     .center(new LatLng(Your_Location))
     .radius(10000) //radius in meters
     .strokeColor(Color.BLUE); //border color default is black

Above code makes your circle transparent. You can also fill the circle color by using .fillColor(Color.argb()) property in CircleOptions,