python-sprints / python-sprints.github.io

Python Sprints website
https://python-sprints.github.io/
12 stars 55 forks source link

Move map related javascript code to site.js and confirm all works - make it reusable #91

Closed Tomasz-Kluczkowski closed 6 years ago

Tomasz-Kluczkowski commented 6 years ago

Currently we have the javascript code for the chapters map embedded in the html. I would like to have it in the site.js file and make it reusable as I plan on adding the location map to the events' detailed view (similar as it is in Meetup.com). See if we can reorganise this code to make it easily accessible without embedding it directly into the html.

Tomasz-Kluczkowski commented 6 years ago

Moved javascript code related to map generation to on_load.js which is now added as a script link to include: _includes/head.html and contains the initMap function which is google API's callback. Changed the variables used in the initMap to make it universal and also changed functionality to make map self focus on bounds of all locations (if more than one provided) or centre on one location (if only one provided - like it is required in the post detailed view).