#6 General cleanup of the frontend js code

Ouvert
Créé il y a 9 ans par zorun · 1 commentaires
zorun a commenté il y a 9 ans

The current js code is a mess. Some specific issues:

  • it should use the json API to get information about the panorama to display, instead of using javascript variable generated from a template.

  • it is primarily designed for 360° pictures, and does not handle non-360° pictures very well (see issue #1).

  • it implements its own tile display logic, while there probably are libraries to do that.

  • there are multiple systems of coordinates, with conversions between them:

    • the backend uses absolute pixel coordinates (x/y) to refer to points in an image.
    • the frontend uses relative coordinates (x between 0 and 1, y between -0.5 and 0.5) to refer to points in an image.
    • the frontend also uses screen-based coordinates, in pixels. The relation between screen coordinates and image coordinates depends on the zoom level and the current position in the image, and wraps around for 360° images.
    • both frontend and backend also manipulate azimuth and elevation (but that's the point of celutz)
The current js code is a mess. Some specific issues: * it should use the json API to get information about the panorama to display, instead of using javascript variable generated from a template. * it is primarily designed for 360° pictures, and does not handle non-360° pictures very well (see issue #1). * it implements its own tile display logic, while there probably are libraries to do that. * there are multiple systems of coordinates, with conversions between them: * the backend uses absolute pixel coordinates (x/y) to refer to points in an image. * the frontend uses relative coordinates (x between 0 and 1, y between -0.5 and 0.5) to refer to points in an image. * the frontend also uses screen-based coordinates, in pixels. The relation between screen coordinates and image coordinates depends on the zoom level and the current position in the image, and wraps around for 360° images. * both frontend and backend also manipulate azimuth and elevation (but that's the point of celutz)
Alexandre a commenté il y a 8 ans
Collaborateur

Also there is jQuery included, but there are some plain old Javascript codes that could be removed by using jQuery utilities (eg. $.getJSON() instead of getXMLHttpRequest()).

Also there is jQuery included, but there are some plain old Javascript codes that could be removed by using jQuery utilities (eg. `$.getJSON()` instead of `getXMLHttpRequest()`).
Connectez-vous pour rejoindre cette conversation.
Pas d'étiquette
bug
ui
Aucun jalon
Pas d'assignataire
2 Participants
Chargement…
Annuler
Enregistrer
Il n'existe pas encore de contenu.