Closed malenki closed 10 years ago
Note that after some conversation on IRC, the URL was set correctly to https://api.openstreetmap.org/api/
. The notes plugin is mangling the URL to work around a rails bug that is removing the second slash after https:
.
Can't you use core functions to deal with API requests?
Core functions don't support notes, so we extended OsmApi
to support notes. This bit of code that generates the (broken) base URL is also used in the JOSM code, so I'm wondering how JOSM works at all...
The bug is in NotesApi.getBaseUrl() it has been fixed in core some days ago: https://josm.openstreetmap.de/changeset/6840/josm/
This is a very bad practive to copy/paste core functions in plugins instead of calling them. If you can't, please create a core enhancement ticket and we'll change visibility.
I would prefer that the notes plugin work for as many JOSM users as possible. Forcing everyone to update to some future version of JOSM where you've fixed the visibility of sendRequest()
seems silly.
I don't find this silly. I can show you statistics and you will see the vast majority of users run at least the current tested version. Many people use WebStart, a lot of others are accustomed to manually update their version. Don't forget also the previous versions of each plugin are remembered and delivered to users still running an old version of JOSM, so that's not a problem at all. It's even a good thing as it may encourage those users to upgrade their JOSM if they want to use your very latest features.
I fully understand you need to extend OsmApi for notes-specific functions, but duplicating deep core features such as API request sending mechanism is really not a good idea.
But it's your call. We can help you to achieve a better integration, unless you don't want to.
I think @ToeBee was thinking about submitting a patch to add notes support to OsmApi in core. In the mean time, I'll file a JOSM trac ticket to ask for a sendRequest()
to change to protected.
Yes, my goal has been to improve the notes API code to the point where it can be included in core. But that hasn't happened yet. I think my last hangup was something to do with the progress monitor stuff...
sendRequest() is now protected :)
I'm guessing we need to make the plugin depend on >= 6891 to fix this?
6875 is enough: https://josm.openstreetmap.de/changeset/6875/josm/
I've set JOSM to use as API url this one: https:/api.openstreetmap.org/api/0.6/
Now JOSM does not display OSM notes anymore, instead the log at the CLI reads like this: