Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select workplace using a map #225

Open
mathisdt opened this issue Oct 26, 2022 · 0 comments
Open

select workplace using a map #225

mathisdt opened this issue Oct 26, 2022 · 0 comments
Labels
enhancement new feature

Comments

@mathisdt
Copy link
Owner

Currently the user has to use either the menu item "Here = Work" or type in latitude and longitude of their workplace. At least the manual setting should be replaced by selecting a location on a map.

Here the german magazine c't described how it can be done using OSM (behind a paypall). In short, we could start with this:

  • add implementation 'org.osmdroid:osmdroid-android:6.1.14' to build.gradle
  • initialize the map module with Configuration.getInstance().load(context, PreferenceManager.getDefaultSharedPreferences(context));
  • include MapView into layout (probably a custom setting editor would be best)
GeoPoint point = new GeoPoint(
 52.3859132, 9.8089183); // heise
IMapController mapController =
 mapView.getController();
mapController.setCenter(point);
mapController.setZoom(12.0);
MyLocationNewOverlay myLocation =
 new MyLocationNewOverlay(
  new GpsMyLocationProvider(context),
  mapView);
mapView.getOverlays().add(myLocation);
Bitmap meBitmap = (
 (BitmapDrawable)getDrawable(
  R.drawable.me)).getBitmap();
myLocation.setPersonIcon(meBitmap);
@mathisdt mathisdt added the enhancement new feature label Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new feature
Projects
None yet
Development

No branches or pull requests

1 participant