Interactive Leaflet map showing active clothing drop-box locations in the City of Toronto.
- Interactive map with Leaflet
- Local GeoJSON data from City of Toronto Open Data
- Walking routes using OpenRouteService Directions
- Clone the repo:
git clone https://github.com/z66n/clothing-dropbox
cd clothing-dropbox- Fetch the latest dataset:
npm run fetch-data- Serve the project (must use HTTP/HTTPS for fetch and geolocation):
npx serve . -p 5000
# or
python -m http.server 5000- Open your browser at
http://localhost:5000and allow location access.
-
OpenRouteService API key: Set
ORS_API_KEYin your environment and use the included Netlify serverless function (netlify/functions/getRoute.js). The frontend calls/.netlify/functions/getRouteto request routes securely. -
Data file:
data/clothing-dropboxes.geojson— updated vianpm run fetch-data.
-
Key files:
index.html— main pagescript.js— map setup, data loading, marker/popup behavior, and routing callsfetch-data.js— downloads the GeoJSON datasetnetlify/functions/getRoute.js— serverless function for secure routing
Privacy: Your geolocation is only used locally to calculate routes; it is not stored or sent to this repository.
- Make sure to serve the site via HTTP/HTTPS to enable geolocation and fetch.
- Verify your OpenRouteService API key is valid.
- The dataset is refreshed monthly.
- You can trigger Netlify rebuilds via a build hook to fetch the latest data automatically.
Contributions are welcome! Open issues or PRs, but do not include API keys or secrets.
This project is licensed under the MIT License — see the LICENSE file.