GitHubDroid / GEODROID

0 stars 0 forks source link

ScaleBar Toggle Imperial Feet #4

Closed GitHubDroid closed 11 years ago

GitHubDroid commented 11 years ago

Option to display the scalebar in feet.

GitHubDroid commented 11 years ago

Is it something I an do in MapsActivity.java:

   MapScaleBar mapScaleBar = this.mapView.getMapScaleBar();
        mapScaleBar.setImperialUnits(false);
        mapScaleBar.setText(TextField.KILOMETER, " km"); //$NON-NLS-1$
        mapScaleBar.setText(TextField.METER, " m"); //$NON-NLS-1$

       +mapScaleBar.setText(TextField.FEET, " ft");

can I set setImperialUnits(true).

GitHubDroid commented 11 years ago

Changes:

geodroid.app/src/eu/hydrologis/geopaparazzi/maps/MapsActivity.java

                           MapScaleBar mapScaleBar = this.mapView.getMapScaleBar();
                  //  mapScaleBar.setImperialUnits(false);
                  //  mapScaleBar.setText(TextField.KILOMETER, " km"); //$NON-NLS-1$
                  //  mapScaleBar.setText(TextField.METER, " m"); //$NON-NLS-1$

                        boolean doImperial = preferences.getBoolean(Constants.PREFS_KEY_IMPERIAL, false);
                          mapScaleBar.setImperialUnits(doImperial);
                            if (doImperial) {
                            mapScaleBar.setText(TextField.FOOT, " ft"); //$NON-NLS-1$
                            mapScaleBar.setText(TextField.MILE, " mi"); //$NON-NLS-1$
                             }else{
                            mapScaleBar.setText(TextField.KILOMETER, " km"); //$NON-NLS-1$
                           mapScaleBar.setText(TextField.METER, " m"); //$NON-NLS-1$
                             }