Added default map location to module config & admin map templates#6
Added default map location to module config & admin map templates#6loetie wants to merge 2 commits intoarjan:masterfrom
Conversation
| </div> | ||
| {% else %} | ||
| {_ First add the Google maps API key _} | ||
| {% endif %} |
There was a problem hiding this comment.
I would suggest hiding this block (control-group) completely until the Google Maps API key is filled in, as this looks a bit weird:
Then add a wire to the API key so that when that is filled in, this block is automatically shown. Otherwise you need to close and re-open the configuration dialog before being able to add a start location.
There was a problem hiding this comment.
Good idea. It is now added. Also added the original hardcoded values as fallback values if no location has been selected as default location.
lib/js/admin-geo.js
Outdated
| rscZoomLevel = parseInt(rscZoomLevel, 10); | ||
|
|
||
| defaultLat = parseFloat(defaultLat); | ||
| defautlLng = parseFloat(defautlLng); |
There was a problem hiding this comment.
Wrong name: defautlLng instead of defaultLng (also visible in the JS console).
… available, reload template after api key inserted
| $('#location_lat').trigger("blur"); | ||
| $('#location_lng').trigger("focus"); | ||
| $('#location_lng').trigger("change"); | ||
| $('#location_lng').trigger("blur"); |
There was a problem hiding this comment.
It was needed so the default config save action was triggered when the hidden fields got filled with a new value. So its to simulate that a field has changed and left.
|
Replaced by zotonic#1 |

Currently the map default is located in amsterdam.
It would be better if this was a configured option.
To configure this i added a map in the configure modal with wires to save the values.
The values are passed to the javascript function to be used as default values instead of the currently hardcoded values.