How to add map overlay names on map

Introduction:

    Adding map overlays (Markers) and text on the map. Identify locations on the map where the markers to be add use standard icon for maps look and feel. Using API we can able to change the icons color, image or anchor point. Markers are added to the map with the GoogleMap.addMarker(markerOptions) method.
    Orientation of the marker does not change if the device rotating, tilting or zooming the map because it is drawn oriented against the device's screen rather than the map's surface.
    By Customizing the marker involves setting a number of properties that affect the visual behavior of the marker.
    Markers support customization through following properties:
  • Position of latitude and longitude values is required for the Marker object on the map
  • Title displayed in the info window when use taps on the marker
  • Snippet is the additional text which displays just below the title
    Below snippet is the example which creates a simple marker, with the default icon.
		
static final LatLng LOCATION_NAME = new LatLng(77.23456, 102.96298); Marker name_of_location = mMap.addMarker(new MarkerOptions() .position(LOCATION_NAME));
    With the title()and snippet() methods, we can add additional content to the marker that will appear in info window. When marker is clicked.
		
static final LatLng LOCATION_NAME = new LatLng(77.23456, 102.96298); Marker name_of_location = mMap.addMarker(new MarkerOptions() .position(LOCATION_NAME) .title("Name:My Location") .snippet("Description or address"));

Adding Name/Text to the marker:

    Add text on the map same as the text drawing in normal screen Adding Text to the layout or map:
		
@Override protected void onDraw(Canvas c) { super.onDraw(c); // draw some text using FILL style paint.setStyle(Paint.Style.FILL); //turn antialiasing on paint.setAntiAlias(true); paint.setTextSize(30); c.drawText("Add Some Text here which appears on the Visible Screen ", 70, 115, paint); }

Add text by hard coding or get name or title of the marker from DB and add to canvas.drawText() Method

		
@Override protected void onDraw(Canvas c) { super.onDraw(c); // draw some text using FILL style paint.setStyle(Paint.Style.FILL); //turn antialiasing on paint.setAntiAlias(true); paint.setTextSize(30); c.drawText("tableInfo.getTitle()", 75, 110, paint); }

For more information reffere this links

https://developers.google.com/maps/documentation/android/marker#customize_a_marker http://bestsiteinthemultiverse.com/2008/11/android-graphics-example/ http://developer.android.com/reference/android/graphics/Canvas.html#drawText%28java.lang.String,%20float,%20float,%20android.graphics.Paint%29
HTML Comment Box is loading comments...