New OpenStreetBugs javascript client

View: New views
3 Messages — Rating Filter:   Alert me  

New OpenStreetBugs javascript client

by Candid Dauth-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello there,

a new OpenStreetBugs backend has been there for a while (see
http://wiki.openstreetmap.org/wiki/OpenStreetBugs and
http://wiki.openstreetmap.org/wiki/User:Emka/new_OSB) to resolve problems of
the old one. However, the old JavaScript code is still being used, as the new
API is compatible to the old one.

The current OpenStreetBugs JavaScript code consists of lots of global
functions that call each other, not using object orientation. This leads to
two problems:
1. You cannot properly extend the code. If you want to change the bug icon or
the name of the layer for example, you have to copy the openstreetbugs.js to
your server and change the part in the code. This way, you have to apply bug
fixes yourself. (You could also try to include the original JavaScript file
and then overwrite the global functions, but this is not a very proper way.)
2. You cannot include the layer into multiple maps on one page.

Emka (the author of the new OSB API) asked me to write a new JavaScript
client. For that, I used the class model of OpenLayers and extended the
OpenLayers.Layer.Markers and the OpenLayers.Control classes. This new OSB
client can be extended and easily included into multiple maps on one page. It
is added to a map like a normal Layer. There is also a “read-only” mode where
you cannot comment or close bugs. The documentation is currently available on
http://wiki.openstreetmap.org/wiki/OpenStreetBugs/New_Client, see the
JavaScript code on http://osm.cdauth.de/map/openstreetbugs.js.

The GUI is very similar to the old one, you can test it on
http://osm.cdauth.de/map/ by selecting the “Create OpenStreetBug” tool (the
green circle with the plus in it on the top right toolbar). It is currently
translated to English and German, additional translations would be appreciated
on http://wiki.openstreetmap.org/wiki/OpenStreetBugs/New_Client/Translation.

Currently, many maps link to the current view on OpenStreetBugs, with the new
JavaScript library it becomes possible to show the bugs in their own map. Some
people have also suggested to integrate OpenStreetBugs into openstreetmap.org,
this would now be easily possible.

Are there any suggestions about the new client, especially about its GUI? Does
it work properly on your browsers? What’s your opinion about integrating it in
the Slippy Map on openstreetmap.org?


--
Candid Dauth
Rotbachstr. 9
88433 Schemmerhofen-Ingerkingen
Germany

http://cdauth.de/
mailto:mailinglists@...


_______________________________________________
talk mailing list
talk@...
http://lists.openstreetmap.org/listinfo/talk

signature.asc (205 bytes) Download Attachment

Re: New OpenStreetBugs javascript client

by Florian Lohoff :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Nov 05, 2009 at 06:58:22PM +0100, Candid Dauth wrote:

> Hello there,
>
> a new OpenStreetBugs backend has been there for a while (see
> http://wiki.openstreetmap.org/wiki/OpenStreetBugs and
> http://wiki.openstreetmap.org/wiki/User:Emka/new_OSB) to resolve problems of
> the old one. However, the old JavaScript code is still being used, as the new
> API is compatible to the old one.
>
> The current OpenStreetBugs JavaScript code consists of lots of global
> functions that call each other, not using object orientation. This leads to
> two problems:
> 1. You cannot properly extend the code. If you want to change the bug icon or
> the name of the layer for example, you have to copy the openstreetbugs.js to
> your server and change the part in the code. This way, you have to apply bug
> fixes yourself. (You could also try to include the original JavaScript file
> and then overwrite the global functions, but this is not a very proper way.)
> 2. You cannot include the layer into multiple maps on one page.
I like the idea and tried it - I fail to disable the layer by default
and the other problem i see is the control adding - i liked the old
OSB way of first having to click an icon at the top before a click
to the map adds a bug - otherwise one accidentally adds bugs or at least
lets the form pop up regularly - a click on the map should never alone
trigger an event - typically clicking on the map means click-hold - pan
double-click zoom - so left click should be reserved for navigation and
not other actions ...


/* Openstreetbugs */
var osb = new OpenLayers.Layer.OpenStreetBugs("OpenStreetBugs", { "visibility": false });
map.addLayer(osb);

var osbControl = new OpenLayers.Control.OpenStreetBugs(osb);
map.addControl(osbControl);

Thats basically my code i added ... (http://maxspeed.osm.lab.rfc822.org)

> Are there any suggestions about the new client, especially about its GUI? Does
> it work properly on your browsers? What’s your opinion about integrating it in
> the Slippy Map on openstreetmap.org?

Flo
--
Florian Lohoff                                         flo@...
"Es ist ein grobes Missverständnis und eine Fehlwahrnehmung, dem Staat
im Internet Zensur- und Überwachungsabsichten zu unterstellen."
- - Bundesminister Dr. Wolfgang Schäuble -- 10. Juli in Berlin


_______________________________________________
talk mailing list
talk@...
http://lists.openstreetmap.org/listinfo/talk

signature.asc (196 bytes) Download Attachment

Re: New OpenStreetBugs javascript client

by David Groom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>  Hello there,
>
>  a new OpenStreetBugs backend has been there for a while (see
>  http://wiki.openstreetmap.org/wiki/OpenStreetBugs and
>  http://wiki.openstreetmap.org/wiki/User:Emka/new_OSB) to resolve problems
> of
>  the old one. However, the old JavaScript code is still being used, as the
>  new
>  API is compatible to the old one.
>
>  The current OpenStreetBugs JavaScript code consists of lots of global
>  functions that call each other, not using object orientation. This leads
> to
>  two problems:
>  1. You cannot properly extend the code. If you want to change the bug
> icon
>  or
>  the name of the layer for example, you have to copy the openstreetbugs.js
> to
>  your server and change the part in the code. This way, you have to apply
> bug
>  fixes yourself. (You could also try to include the original JavaScript
> file
>  and then overwrite the global functions, but this is not a very proper
> way.)
>  2. You cannot include the layer into multiple maps on one page.
>
>  Emka (the author of the new OSB API) asked me to write a new JavaScript
>  client. For that, I used the class model of OpenLayers and extended the
>  OpenLayers.Layer.Markers and the OpenLayers.Control classes. This new OSB
>  client can be extended and easily included into multiple maps on one
> page.
>  It
>  is added to a map like a normal Layer. There is also a “read-only”
> mode
>  where
>  you cannot comment or close bugs. The documentation is currently
> available
>  on
>  http://wiki.openstreetmap.org/wiki/OpenStreetBugs/New_Client, see the
>  JavaScript code on http://osm.cdauth.de/map/openstreetbugs.js.
>
>  The GUI is very similar to the old one, you can test it on
>  http://osm.cdauth.de/map/ by selecting the “Create OpenStreetBug”
> tool
>  (the
>  green circle with the plus in it on the top right toolbar). It is
> currently
>  translated to English and German, additional translations would be
>  appreciated
>  on
> http://wiki.openstreetmap.org/wiki/OpenStreetBugs/New_Client/Translation.
>
>  Currently, many maps link to the current view on OpenStreetBugs, with the
>  new
>  JavaScript library it becomes possible to show the bugs in their own map.
>  Some
>  people have also suggested to integrate OpenStreetBugs into
>  openstreetmap.org,
>  this would now be easily possible.
>
>  Are there any suggestions about the new client, especially about its GUI?

It would be good to have a permalink to allow us to open the map view in an
editor.

David


>  Does
>  it work properly on your browsers? What’s your opinion about
> integrating
>  it in
>  the Slippy Map on openstreetmap.org?
>
>
>  --
>  Candid Dauth
>  Rotbachstr. 9
>  88433 Schemmerhofen-Ingerkingen
>  Germany
>
>  http://cdauth.de/
>  mailto:mailinglists@...
>



_______________________________________________
talk mailing list
talk@...
http://lists.openstreetmap.org/listinfo/talk