Code example for Marker

Methods: getPosition

0
        Toast.makeText(this, "Drag the markers!", Toast.LENGTH_LONG).show();
        showDistance(); 
    } 
 
    private void showDistance() { 
        double distance = SphericalUtil.computeDistanceBetween(mMarkerA.getPosition(), mMarkerB.getPosition());
        mTextView.setText("The markers are " + formatNumber(distance) + " apart.");
    } 
 
    private void updatePolyline() { 
        mPolyline.setPoints(Arrays.asList(mMarkerA.getPosition(), mMarkerB.getPosition()));
    } 
 
    private String formatNumber(double distance) {
        String unit = "m";
        if (distance < 1) {
            distance *= 1000;
            unit = "mm";
        } else if (distance > 1000) {
            distance /= 1000;
Connect your IDE to all the code out there  Get Codota for Java