As <option> tags can't contain HTML markup the Django Select
widget had to be replaced with a self rendered dropdown, making
the code a little bit more complex
* removed old form step
* removed track_bbox_mode filed no longer needed
* changed active tab from "City search" to "Geographic area" as
Leaflet doesn't seem to properly initialize otherwise, and then
gets confused by setBounds() call from GPX file handler
allows to choose to:
* keep current bounding box (do nothing)
* extend current bbox to fit GPX track
* replace current bbox with GPX bbox
so far only database and user interface parts are implemented,
actual bbox processing following in next commit
Fixed cancel form submission and re-added recreate form button on the
map list. Added map thumbnail display.
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
New website design based on Bootstrap. Complete revamp of the UI
interface and of the interface paradigms. Complete rewrite of the map
creation wizard, now simpler and with less steps.
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
Check that calls to /apis/papersize/ have latitude in [-90.0, 90.0] and
longitude in [-180.0, 180.0].
Signed-off-by: David MENTRE <dmentre@linux-france.org>
We have received several rendering requests with layout and stylesheet
empty. We believe that people might have written scripts against the
previous version of MapOSMatic, and so they didn't fill those
fields. Therefore, we add some form-level validation logic to reject
jobs that have layout and/or stylesheet empty.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
Until now, the stylesheet description strings were coming from the
OcitySMap configuration file, the layout description strings from the
OcitySMap source code, and the paper sizes from the OcitySMap code as
well.
Unfortunately, when MapOSMatic queries the list of stylesheets,
layouts and paper sizes, OcitySMap has no idea of which language the
web site is in. OcitySMap cares about the language in which the map
will be rendered, not the language in which the website is displayed.
Therefore, in order to properly translate the stylesheet descriptions,
layout descriptions and paper sizes, we have to do it from MapOSMatic
itself. The drawback is that MapOSMatic now needs to know the list of
layouts and stylesheets, but there doesn't seem to be other reasonable
solutions.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
This patch makes sure that we can work on the exact same city envelopes
in maposmatic and ocitysmap: we now share ocitysmap's
get_geometry_from_osmid(). Previously, get_bbox_from_osmid crashed if
the osm ID was present multiple times in the polygon table, and
ignored the line table. This patch fixes both, by basing itself on
ocitysmap's 093b95bcf6f54e855b781a9ccd60ce8117b35976.
In d2-ocitysmap2, the zoom factor can be defined in the
stylesheet. This patch makes sure that the stylesheet is chosen before
proposing a list of possible paper sizes. Then it determines the
possible paper sizes from this stylesheet.
When an error occurs while processing the form's data, cleaning up the
data can result in attempting to delete non existent keys. This patch
should make the code tolerant to the half-created form data we have to
deal with in that case.
The problem happened 5 or 6 times within the last 3 weeks.
Significant styling improvements in the map creation wizard, involving
some HTML, CSS and translation changes.
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
Introduce two hidden fields in MapRenderingJobForm to store
paper_width_mm and paper_height_mm. Those two fields are updated by
the JS code when the selected paper size changes. They are then sent
to the server as part of the wizard form and then stored in the
database.
It allows to fix the handling of paper sizes for "Best fit"
renderings.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>