Code example for Marker

Methods: getPositiongetTitlesetSnippet

0
		mMap.setOnMarkerClickListener(new OnMarkerClickListener() {
			 
			@Override 
			public boolean onMarkerClick(Marker arg0) {
				if(mActPosition!=null){
				Double dx = 71.5 * (arg0.getPosition().longitude - mActPosition.longitude);
				Double dy = 111.3 * (arg0.getPosition().latitude - mActPosition.latitude);
			mDistance = Math.sqrt(dx * dx + dy * dy);
			DecimalFormat df = new DecimalFormat("##0.0");
			if(!arg0.getTitle().equalsIgnoreCase("Ihre Position")){
			if(mDistance > 1.0){				
				arg0.setSnippet("Entfernung: "+df.format(mDistance)+"km");
			}else{ 
				mDistance = mDistance*1000;
				arg0.setSnippet("Entfernung: "+df.format(mDistance)+"m");
				} 
				} 
				} 
				return false; 
				 
Contextual code suggestions in your IDE  Get Codota for Java