Osmdroid on Wear OS wearable+handheld pair

49 views
Skip to first unread message

Bill Chadwick

unread,
Oct 24, 2019, 9:05:15 AM10/24/19
to osmdroid
I have got an old version of the main osmdroid library code running fine on Wear OS (with online mapping).

The only significant change needed was to add a two finger touch zoom-out at the start of  dispatchTouchEvent in MapView.java .

Together with

        mMapView.setBuiltInZoomControls(false);
        mMapView.setMultiTouchControls(false);

this makes for a usable slippy map. Single finger double tap for zoom in, two finger tap for zoom out + I use MapEventsReceiver  longPressHelper for pan to data bounds..

All this is fine for a stand alone app. When we consider a handheld + wearable pair there are more possibilities.
I would like the watch to be able to use any offline map archives on the handheld. Has anyone looked at doing that? Using the Google play services to communicate between wearable and handheld?

Bill


Below is the code I added to the MapView dispatchTouchEvent

// special two finger touch does zoom out at centre
if ((mMultiTouchController == null) &&
event.getAction() == MotionEvent.ACTION_POINTER_UP) {

if (Configuration.getInstance().isDebugMapView()) {
Log.d(IMapView.LOGTAG, "two fingers up");
}

if (canZoomOut()) {
getController().zoomOut();
}
return true;

}

Alex O'Ree

unread,
Oct 24, 2019, 6:28:33 PM10/24/19
to osmd...@googlegroups.com
i briefly looked into loading offline tile archives on a watch using archives stored on the paired phone. The general conclusion was to either have the phone transfer the archives to the watches storage or to invent some kind of protocol to send the tiles over the bluetooth connection on demand. This could be accomplished by running a tile server on the phone, then http from the watch to the phone. This was a while ago so there may be better solutions now. At the time, storage on watches was very limited and may have not been available to an app.

--
You received this message because you are subscribed to the Google Groups "osmdroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmdroid+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osmdroid/0f2ae357-142a-4993-8d2d-cad584680dc9%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages