

























Posted by on February 13, 2014
Github, the online version control repository host for Git, recently added support for GeoJSON files. Sounds boring, right? It actually lets you do something very cool: build your own “dots on a map” website with virtually zero code.
Here’s what you need to do.
{
"type": "FeatureCollection",
"features": [{ "type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [144.9,-37.8]
},
"properties": {
"title": "Scooter",
"description": "Here's a dot",
"marker-size": "medium",
"marker-symbol": "scooter",
"marker-color": "#a59",
"stroke": "#555555",
"stroke-opacity": 1.0,
"stroke-width": 2,
"fill": "#555555",
"fill-opacity": 0.5
}
},
{ "type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [144.4,-37.5]
},
"properties": {
"title": "Cafe",
"description": "Coffee and stuff",
"marker-size": "medium",
"marker-symbol": "cafe",
"marker-color": "#f99",
"stroke": "#555555",
"stroke-opacity": 1.0,
"stroke-width": 2,
"fill": "#555555",
"fill-opacity": 0.5
}
}]
}
It’s worth validating with GeoJSONLint.
<!DOCTYPE html> <html> <body> <script src="https://embed.github.com/view/geojson/stevage/georly/master/test1.geojson?height=500&width=1000"></script> </body> </html>
If you don’t have a website, site44 is an extremely easy way to get started. You place HTML files into your DropBox, and they get automagicked onto the web, with a subdomain: something.site44.com.
That’s it! What’s especially interesting about the hosting on GitHub is it’s a very easy way to have a lightweight shared geospatial database of points, lines or polygons. Here’s how you could add dots to my map:
Using this method, we have a “review before publish” workflow, and a full version history of every change.
This is a nifty tool for prototyping social mapping applications, but it obviously won’t cut it for production purposes:
Soon you’ll want to build a proper application, using tools like MapBox, CloudMade, CartoDB, Leaflet etc.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。