rockandror / consuldemocracy

Consul - Open Government and E-Participation Web Software
GNU Affero General Public License v3.0
1 stars 0 forks source link

A2. Geolocation map #8

Closed taitus closed 6 years ago

taitus commented 7 years ago

What

Allow to geolocate budget investments and proposals on the map.

Original definition was:

Propuesta ciudadana y presupuesto participativo (prioritario en este último ?, importante en ambas) La propuesta se podrá geolocalizar, por el usuario administrador o creador de la propuesta, en un mapa. La opción a elegir debe ser open street maps. El mapa se mostrará al pulsar sobre la pestaña de “localización”.

How

We have to resolve two problems here: How administrators can configure application map default configuration at backend, and How to allow users to geolocate their proposals and budget investments at frontend.

How administrators can configure application map

First of all we have to create a way to allow forks to easily setup their city map. To achieve this we may create some settings records and an admin page or section to allow administrators to manage city map.

How to store data To store this data and save it into settings table we should add new action "update_map" to admin/settings controller to allow administrators to configure the map by drag and drop a marker along the map.

We have to create next secrets entries on default scope:

  map_tiles_provider: "//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
  map_tiles_provider_attribution: "&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors"

We have to create next secrets entries on production scope:

  map_tiles_provider: "//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
  map_tiles_provider_attribution: "&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors"

We have to create next settings records:

# Map feature setting
Setting.create(key: 'feature.map', value: true)

# Greenwich default global position coordinates
Setting.create(key: 'map_latitude', value: 51.48)
Setting.create(key: 'map_longitude', value: 0)
Setting.create(key: 'map_zoom', value: 10)

We may need some js resources to use OpenStreetsMaps and to consume map tiles provider.

How to manage the city map on frontend

Screenshots

Backend user interface (settings#index): Feature deactivated -> Map not rendered captura de pantalla 2017-08-07 a las 12 42 31

Backend user interface: Feature activated -> Map rendered captura de pantalla 2017-08-07 a las 12 31 02

Frontend new proposal or budget investment without marker new-proposal-no-marker

Frontend new proposal or budget investment with marker new-proposal-marker

Frontend show proposal or budget investment map location proposal-show

Download the images on the first upload proposal-show-download-images-on-first-upload

Load images from cache load-images-from-cache

Warnings

See https://operations.osmfoundation.org/policies/tiles/ to investigate further.

agileontheweb commented 7 years ago

Después una charlar con Alberto estos es lo que me contesto.

He revisado lo que me has pasado y te cuento:

Revisando mis bookmarks he encontrado esto: https://uxdesign.cc/design-better-forms-96fadca0f49c es un buen artículo para inspirarse

Hay un punto llamado Ditch the * and denote optional fields así que esa opción es la que más me gusta, para poner ese (opcional) mejor que un <h4> como wrapper que no es lo más correcto se puede utilizar un <p class="help-text">(opcional)</p>

Para usar esto hay que poner dos cosas, a ese ´

´ añadirle “class” e “id”:

(opcional)

En el input al que hace referencia añadirle el atributo: aria: {describedby: "responsible-name-help-text"}` (con el mismo id anterior)

Tienes un ejemplo de esto para fijarte en app/views/organizations/registrations/new.html.erb (Líneas 12-15) y está explicado en los docs de Foundation: http://foundation.zurb.com/sites/docs/forms.html#help-text-accessibility-

Para ese texto “(opcional)” se podría crear una key tipo t("shared.form.optional_field") así se puede usar sin duplicar :slightly_smiling_face:

Después de todo este rollo, quedaría algo como esta imagen

form_help_text

Otra cosa, cambiar en el texto la palabra click con clic.