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

Map widget (OSM) #727

Closed
3 of 10 tasks
bittner opened this issue Aug 23, 2019 · 6 comments · Fixed by #2379
Closed
3 of 10 tasks

Map widget (OSM) #727

bittner opened this issue Aug 23, 2019 · 6 comments · Fixed by #2379
Labels
enhancement New features, or improvements to existing features.

Comments

@bittner
Copy link

bittner commented Aug 23, 2019

Expected Behavior

I want to write a maps application that runs cross-platform, on GNU/Linux, Androids and iOS devices. This ticket is to discuss a potential implementation.

I'd prefer to avoid to use a WebView widget (and do JavaScript-style programming with that). With a native widget I hope to be able to do more pythonic, application-style programming.

(Spoiler alert: It must feel awesome, simple and powerful, to be a trigger even for [my] kids to be sucked into the world of application programming! And personally, I love the idea to do just Python, neither Java nor Objective-C, and still create native applications for those platforms!)

I first presented my motivations on Gitter on July 28, 2019. Following that, I've also watched @danyeaw's PyCon presentation, as suggested by @freakboy3742.

Current Behavior

There's no Maps widget availabe in Toga, currently.

Your Environment

  • Python 3 (any version via pyenv; 3.6 or 3.7 preferred)

  • Operating System: Ubuntu 18.04.3 LTS Bionic, (Android and iOS mobile devices secondary)

  • Toga Version: latest (pre-release, following the Briefcase tutorial)

  • Toga Target (the type of app you are trying to generate)

    • android
    • cocoa
    • django -- maybe
    • gtk
    • iOS
    • tvOS
    • watchOS
    • winforms
    • win32
    • Other (please specify)
@bittner
Copy link
Author

bittner commented Aug 23, 2019

Existing native implementations for a Map widget:

Personally, I've tried out the GTK+ osm-gps-map widget with Python, and it works pretty well. Unfortunately though, the project maintainer is not active, not responding on issues or PRs.

@freakboy3742
Copy link
Member

Repeating the encouragement for the idea I gave on Gitter - +1 to this as a concept.

The API spread you've described is promising as well. It's unfortunate that the Linux widget doesn't seem to be actively maintained, but it at least proves that a native map is possible. The GPL license is problematic, though; we won't be able to incorporate that into Toga.

The next step will be to start developing the core API for this new widget. What API calls are common across all these implementation? Which of those methods are we going to expose? Is there an abstraction that Python allows that isn't plausible with the "native" APIs?

@bittner
Copy link
Author

bittner commented Aug 24, 2019

The GPL license is problematic, though; we won't be able to incorporate that into Toga.

Does that mean we can't make Toga depend on it at all or would it be acceptable to require the developer to install osm-gps-maps separately (manually)?

Personal note: (click to expand) Personally, I've stopped seeing a value in licenses that allow for closed source development, at all. In a modern world, in my opinion, the fear of GPL has lost its ground. Sustainable software development must happen in the public. But let's not get off-topic.

I'll try to come up with some potential sample code for the envisioned widget to allow me conclusions about its API. 👍 Hang on (unless you have a better idea).

@freakboy3742
Copy link
Member

We would not be able to make Toga depend on a GPL library at all. LGPL would be fine; but the viral properties of the GPL make it a non starter for inclusion as a dependency in Toga. There is no technicality here that we can work around - this would be the GPL working exactly as intended.

Toga's decision to choose licensing that allows for closed source development was deliberate, and we need to choose the licenses of our dependencies to match.

@leggewie
Copy link
Contributor

We would not be able to make Toga depend on a GPL library at all.

My apologies to nitpick here. The project would actually actually certainly be able to link against GPL-licensed libraries. I assume you might not want to go in that direction, though, as the resultig binaries would be under the more restrictive GPL- license and I understand that you chose MIT-licensing for a reason.

FWIW, nzjrs/osm-gps-map#66 lists https://github.com/supercamel/mapness as an LGPL-licensed alternative to osm-gps-map.

@freakboy3742
Copy link
Member

@leggewie Yes, we are technically able to link to a GPL library. However, that technicality is meaningless in practice, unless we're willing to require all users of Toga to GPL their apps - which I'm not.

An LGPL alternative is more practical; however, is that something that is readily available to install on host systems? One of the guiding principles of Toga is "pip install and nothing else" - the idea that you shouldn't need to navigate obscure build systems to get an app running. mapness uses a programming language I'm not familiar with, and a build system I'm not familiar with; I'm not sure what the process for actually getting this widget in the hands of an end-user would look like.

I'm also mildly worried about the provenance of mapness itself - yes, it's formally released as LGPL, but the author clearly references past contributions to osm-gps-map. This means there would be a line of argument that it could be fruit of a poisonous tree. If there is any architectural similarity between osm-gps-map and mapness (which seems likely), the authors of osm-gps-map would have a legitimate claim that mapness is a derivative work, and thus also covered by the GPL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants