Reputation: 256
I'm trying to plot a marker with specific co-ordinates in Google map v2 but it doesnt show the marker on the given Position.
I did go to google but didn't find anything helpful any help please...
if (googleMap == null) {
googleMap = ((MapFragment) getFragmentManager().findFragmentById(
R.id.map)).getMap();
// check if map is created successfully or not
if (googleMap == null) {
Toast.makeText(getApplicationContext(),
"Sorry! unable to create maps", Toast.LENGTH_SHORT)
.show();
double latitude = 13.094192 ;
double longitude = 80.121689;
MarkerOptions marker = new MarkerOptions().position(new LatLng(latitude, longitude)).title("Hello Maps ");
// adding marker
googleMap.addMarker(marker);
Upvotes: 0
Views: 7400
Reputation: 18933
Change with this:
if (googleMap !=null){
Marker hamburg = map.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude))
.title("Hello Maps"));
}
Upvotes: 2