-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add custom url for map component #3160
base: master
Are you sure you want to change the base?
Add custom url for map component #3160
Conversation
Change-Id: Icb86db807e405b2b75df70576462e6023ea6ff58
Change-Id: I1d1c4f6a69a98958173561b46a50ec4ecaa7ce28
Can one of the admins verify this patch? |
@ewpatton, could you please assign for review? |
Also TODO:
|
appinventor/appengine/src/com/google/appinventor/client/OdeMessages.java
Outdated
Show resolved
Hide resolved
appinventor/components/src/com/google/appinventor/components/common/YaVersion.java
Outdated
Show resolved
Hide resolved
...onents/src/com/google/appinventor/components/runtime/util/NativeOpenStreetMapController.java
Show resolved
Hide resolved
appinventor/components/src/com/google/appinventor/components/runtime/Map.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty good first attempt. I've left a few comments. We will also need to add project upgrade paths in YoungAndroidFormUpgrader.java and versioning.js to handle the bump in the Map component's version number. Both of these are no-ops since you're just adding a property.
Done |
I read somewhere in the documentation about removing the label |
Ready for review @ewpatton |
appinventor/components/src/com/google/appinventor/components/runtime/Map.java
Show resolved
Hide resolved
...onents/src/com/google/appinventor/components/runtime/util/NativeOpenStreetMapController.java
Show resolved
Hide resolved
appinventor/components/src/com/google/appinventor/components/runtime/Map.java
Show resolved
Hide resolved
I am not going to be able to add the equivalent code for iOS - will that be OK, @ewpatton ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready
Is there anything more that I can do for you to accept this PR @ewpatton ? |
That's fine. I will work on implementing the iOS version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more minor things otherwise LGTM.
appinventor/appengine/src/com/google/appinventor/client/OdeMessages.java
Outdated
Show resolved
Hide resolved
...ppinventor/client/editor/youngandroid/properties/YoungAndroidMapCustomUrlPropertyEditor.java
Outdated
Show resolved
Hide resolved
...ppinventor/client/editor/youngandroid/properties/YoungAndroidMapCustomUrlPropertyEditor.java
Outdated
Show resolved
Hide resolved
...ppinventor/client/editor/youngandroid/properties/YoungAndroidMapCustomUrlPropertyEditor.java
Outdated
Show resolved
Hide resolved
Ready for review again. |
I am trying to set up a macOS development environment myself, but running into this problem: https://community.appinventor.mit.edu/t/help-required-building-ios-on-macos-vm/118307 @ewpatton EDIT: RESOLVED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- TODO: Needs iOS port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIP: https://github.com/petersmythe/appinventor-sources/tree/ios-testing (including MockMap below)
|
Question for @ewpatton before I commit the iOS port, I would like to test it, is that possible? https://community.appinventor.mit.edu/t/build-ios-ad-hoc-ipa/119540 |
Dear MIT App Inventor community
Firstly, thanks for an awesome project. My kids love it!
I was checking out the Map component, and I see that it makes use of the
osmdroid
library which in turn connects to 1 of 3 tile sources: OpenStreetMap and United States Geological Survey. I observe the OpenStreetMap terms and conditions for using their tile servers:https://operations.osmfoundation.org/policies/tiles/#:~:text=As%20a%20result%2C%20we%20require,free%20for%20everyone%20to%20use.%20Our%20tile%20servers%20are%20not.
With this in mind, I propose a 4th MapType (in addition to Roads, Aerial and Terrain), being Custom, which allows a diligent/heavy/commercial user to set a custom URL using the standard TMS format e.g. https://tile.openstreetmap.org/{z}/{x}/{y}.png. The default map (Roads using OpenStreetMap) will still work for the majority of App Inventor users just exploring the functionality.
A bonus side effect of this fix is that users can now connect to any other online basemaps that they find interesting, and possibly the Map component will be further enhanced in the future to include overlay layers too.
I ask that you please review the changes that I have made, noting that I still need to write the accompanying documentation etc. All the
ant tests
pass. I do not have a local copy of the buildserver running.One possible bug that I discovered is https://community.appinventor.mit.edu/t/literal-left-curly-bracket-cannot-exist-in-simpleproperty-description/112129 which states that a literal
{
cannot exist in the description of a property, e.g. https://tile.openstreetmap.org/{z}/{x}/{y}.png. I have had to include an ugly workaround with square brackets, but I would like to know if there is a better solution.EDIT: resolved with this hint
Another problem that I am facing is in the Designer GUI (ODE), under Appearance > MapType, the dropdown box still only shows the original 3 types (Roads, Aerial, Terrain) even though the code works perfectly and the Blocks GUI shows all 4 types correctly. I am sure an experienced developer will be able to point out the solution to this novice very easily.
EDIT: resolved with this hint
Kindly guide me through the remainder of your contribution process, please. I understand that there is a new release coming up in a week's time - it is possible to incorporate it in there?