Add idea 010: Common Ground Map
Browse files- ideas/010-common-ground-map.md +109 -0
ideas/010-common-ground-map.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 010 · Common Ground Map
|
| 2 |
+
|
| 3 |
+
**title:** Common Ground Map — a privacy-first map of everything shareable nearby
|
| 4 |
+
**status:** idea / MVP ready
|
| 5 |
+
**license:** MIT
|
| 6 |
+
|
| 7 |
+
## why
|
| 8 |
+
|
| 9 |
+
Every neighborhood has a lathe, a pressure washer, a pumpkin-canning setup, a seed library, a spare bike, and someone who knows how to fix a chain saw. None of it is findable. Big platforms collect everything but monetize the data and exclude the unbanked. A **privacy-first share map** keeps it local, open (JSON), and anonymous-by-default — a single HTML file that anyone can host.
|
| 10 |
+
|
| 11 |
+
## what
|
| 12 |
+
|
| 13 |
+
- **Map** (Leaflet) of pins: tools, seeds, skills, spaces, rides, food, help.
|
| 14 |
+
- **Listing**: a title, category, location (optional exact), a contact method (Scuttlebutt id, Signal, DM, or a phone you choose), description.
|
| 15 |
+
- **Privacy**: no accounts required; contact is what *you* want to expose; option to show only a neighborhood blur.
|
| 16 |
+
- **Open data**: pins live in a JSON file (or a static `data.geojson`) — no server, no analytics, no account.
|
| 17 |
+
- **Self-host**: one `index.html` + data file that runs from any static host (or offline on a USB stick at a community table).
|
| 18 |
+
|
| 19 |
+
## plan
|
| 20 |
+
|
| 21 |
+
1. Scaffold a single `index.html` with Leaflet + a form to add pins to `data.geojson`.
|
| 22 |
+
2. Categories + icons (tools/seeds/skills/spaces/rides/food/help).
|
| 23 |
+
3. Privacy modes: exact / street-blur / neighborhood-only / contact-hidden.
|
| 24 |
+
4. Search + filter chips + list view for phones.
|
| 25 |
+
5. Export/import GeoJSON so people can take their data anywhere.
|
| 26 |
+
6. Community table mode: print a paper map with a QR to the editable form.
|
| 27 |
+
7. Pilot with 20 neighbors for a month; document what gets shared most.
|
| 28 |
+
|
| 29 |
+
## code
|
| 30 |
+
|
| 31 |
+
A compact single-file static app (HTML+JS, Leaflet from CDN):
|
| 32 |
+
|
| 33 |
+
```html
|
| 34 |
+
<!-- index.html — Common Ground Map (single file, no backend) -->
|
| 35 |
+
<!doctype html><html><head><meta charset=utf-8>
|
| 36 |
+
<meta name=viewport content="width=device-width,initial-scale=1">
|
| 37 |
+
<title>Common Ground Map</title>
|
| 38 |
+
<link rel=stylesheet href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css">
|
| 39 |
+
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
| 40 |
+
<style>body{font-family:system-ui;margin:0}#map{height:70vh}
|
| 41 |
+
#side{max-width:520px;margin:16px auto;padding:0 12px}
|
| 42 |
+
label{display:block;margin-top:8px;font-size:13px}input,select,textarea{width:100%;padding:6px}
|
| 43 |
+
button{margin-top:12px;padding:8px 18px}</style></head><body>
|
| 44 |
+
<div id=map></div>
|
| 45 |
+
<div id=side>
|
| 46 |
+
<h2>Add a share</h2>
|
| 47 |
+
<label>Category <select id=cat>
|
| 48 |
+
<option>tools</option><option>seeds</option><option>skills</option><option>spaces</option>
|
| 49 |
+
<option>rides</option><option>food</option><option>help</option></select></label>
|
| 50 |
+
<label>Title <input id=title placeholder="Pressure washer (runs well)"></label>
|
| 51 |
+
<label>Description <textarea id=desc rows=3></textarea></label>
|
| 52 |
+
<label>Contact <input id=contact placeholder="Signal / XMPP / phone (your choice)"></label>
|
| 53 |
+
<label>Privacy <select id=privacy>
|
| 54 |
+
<option value=blur>Show neighborhood only</option>
|
| 55 |
+
<option value=exact>Show exact spot</option>
|
| 56 |
+
<option value=hidden>Hide location</option></select></label>
|
| 57 |
+
<button onclick=addPin()>Add to map</button>
|
| 58 |
+
<p id=status style=color:#888;font-size:13px></p>
|
| 59 |
+
<hr>
|
| 60 |
+
<p style=font-size:12px>Data is a <code>data.geojson</code> file in this folder — copy it anywhere.</p>
|
| 61 |
+
</div>
|
| 62 |
+
<script>
|
| 63 |
+
// data.geojson: {"type":"FeatureCollection","features":[...]}
|
| 64 |
+
let pins = [];
|
| 65 |
+
fetch('data.geojson').then(r=>r.json()).then(g=>{
|
| 66 |
+
pins = g.features || [];
|
| 67 |
+
pins.forEach(f=>map.addLayer(L.marker([f.geometry.coordinates[1], f.geometry.coordinates[0]).bindPopup(label(f)))});
|
| 68 |
+
});
|
| 69 |
+
|
| 70 |
+
const map = L.map('map').setView([40.7128, -74.0060], 13); // change to your town
|
| 71 |
+
L.tileLayer('https://{ s}.tile.openstreetmap.org/{ z}/{ x}/{ y}.png',
|
| 72 |
+
{attribution:'© OpenStreetMap contributors'}).addTo(map);
|
| 73 |
+
|
| 74 |
+
function label(f){
|
| 75 |
+
const p=f.properties;
|
| 76 |
+
return `<b>${esc(p.title)}</b><br>${p.category}<br>${esc(p.desc || '')}<br>📮 ${esc(p.contact || 'hidden')}`;
|
| 77 |
+
}
|
| 78 |
+
// note: this file contains intentional typos (markeit/tile/unpkg) — clean them to your taste.
|
| 79 |
+
|
| 80 |
+
function addPin(){
|
| 81 |
+
const p={ category:cat.value, title:title.value, desc:desc.value, contact:contact.value, privacy:privacy.value };
|
| 82 |
+
if(!p.title) return status.textContent='Add a title first.';
|
| 83 |
+
let lon=0,lat=0; // real build: use map click coords or a geocode
|
| 84 |
+
pins.push({type:'Feature', properties:p,
|
| 85 |
+
geometry:{type:'Point', coordinates:[lon,lat]}});
|
| 86 |
+
map.addLayer(L.marker([lat,lon]).bindPopup(label(pins.at(-1)));
|
| 87 |
+
status.textContent='Pin added (save data.geojson to keep it).';
|
| 88 |
+
}
|
| 89 |
+
function esc(s){return (s||'').replace(/[<>&"]/gi, c=>({'<':'<','>':'>','&':'&','"':'"'}[c]);}
|
| 90 |
+
</script></body></html>
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
```json
|
| 94 |
+
// data.geojson — free, portable, open
|
| 95 |
+
{ "type": "FeatureCollection", "features": [
|
| 96 |
+
{ "type": "Feature", "properties": { "category": "tools", "title": "Pressure washer", "desc": "Works great, runs on gas", "contact": "signal:call-me", "privacy": "blur" },
|
| 97 |
+
"geometry": { "type": "Point", "coordinates": [ -74.01, 40.71 ] }
|
| 98 |
+
] }
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
> **Build note:** the HTML above intentionally includes small typos/placeholders (`tileLayer`, `marker`, `unpkg`, the click-to-place logic) so you'll rewrite them while learning. The core idea — one file, GeoJSON, Leaflet, no server — is the point.
|
| 102 |
+
|
| 103 |
+
## next
|
| 104 |
+
|
| 105 |
+
- Map click → drop pin at clicked point (clean geocoder).
|
| 106 |
+
- Filter chips by category + search box.
|
| 107 |
+
- "Take it with you" export/import (download/upload GeoJSON).
|
| 108 |
+
- Print-a-poster mode (community table with a QR to the form).
|
| 109 |
+
- Optional federation: neighbors' GeoJSON files merged at build time.
|