|
|
|
|
@@ -240,9 +240,9 @@ We don't directly support rendered views of commits to HTML documents. Some form
|
|
|
|
|
|
|
|
|
|
In general, rendered views of changes to a document containing embedded HTML will show changes to the elements that are supported in {% data variables.product.product_name %}'s view of the document. Changes to documents containing embedded HTML should always be reviewed in both the rendered and source views for completeness.
|
|
|
|
|
|
|
|
|
|
## Mapping geoJSON files on {% data variables.product.prodname_dotcom %}
|
|
|
|
|
## Mapping GeoJSON/TopoJSON files on {% data variables.product.prodname_dotcom %}
|
|
|
|
|
|
|
|
|
|
{% data variables.product.product_name %} supports rendering geoJSON and topoJSON map files within {% data variables.product.product_name %} repositories. Simply commit the file as you would normally using a `.geojson` or `.topojson` extension. Files with a `.json` extension are also supported, but only if `type` is set to `FeatureCollection`, `GeometryCollection`, or `topology`. Then, navigate to the path of the geoJSON file on GitHub.com.
|
|
|
|
|
{% data variables.product.product_name %} supports rendering GeoJSON and TopoJSON map files within {% data variables.product.product_name %} repositories. Simply commit the file as you would normally using a `.geojson` or `.topojson` extension. Files with a `.json` extension are also supported, but only if `type` is set to `FeatureCollection`, `GeometryCollection`, or `topology`. Then, navigate to the path of the GeoJSON/TopoJSON file on GitHub.com.
|
|
|
|
|
|
|
|
|
|
When you click the paper icon on the right, you'll also see the changes made to that file as part of a commit.
|
|
|
|
|
|
|
|
|
|
@@ -250,12 +250,12 @@ When you click the paper icon on the right, you'll also see the changes made to
|
|
|
|
|
|
|
|
|
|
### Geometry types
|
|
|
|
|
|
|
|
|
|
Maps on {% data variables.product.product_name %} use [Leaflet.js](http://leafletjs.com) and support all the geometry types outlined in [the geoJSON spec](http://www.geojson.org/geojson-spec.html) (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). TopoJSON files should be type "Topology" and adhere to the [topoJSON spec](https://github.com/mbostock/topojson/wiki/Specification).
|
|
|
|
|
Maps on {% data variables.product.product_name %} use [Leaflet.js](http://leafletjs.com) and support all the geometry types outlined in [the geoJSON spec](http://www.geojson.org/geojson-spec.html) (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). TopoJSON files should be type "Topology" and adhere to the [TopoJSON spec](https://github.com/mbostock/topojson/wiki/Specification).
|
|
|
|
|
|
|
|
|
|
{% ifversion geoJSON-with-MapBox %}
|
|
|
|
|
### Styling features
|
|
|
|
|
|
|
|
|
|
You can customize the way features are displayed, such as specifying a particular color or adding a descriptive icon, by passing additional metadata within the geoJSON object's properties. The options are:
|
|
|
|
|
You can customize the way features are displayed, such as specifying a particular color or adding a descriptive icon, by passing additional metadata within the GeoJSON object's properties. The options are:
|
|
|
|
|
|
|
|
|
|
* `marker-size` - `small`, `medium`, or `large`
|
|
|
|
|
* `marker-color` - valid RGB hex color
|
|
|
|
|
@@ -271,7 +271,7 @@ See [version 1.1.0 of the open simplestyle spec](https://github.com/mapbox/simpl
|
|
|
|
|
|
|
|
|
|
### Embedding your map elsewhere
|
|
|
|
|
|
|
|
|
|
Want to make your geoJSON map available someplace other than {% data variables.product.product_name %}? Simply modify this template, and place it in any HTML page that supports javascript (e.g., [{% data variables.product.prodname_pages %}](http://pages.github.com)):
|
|
|
|
|
Want to make your GeoJSON map available someplace other than {% data variables.product.product_name %}? Simply modify this template, and place it in any HTML page that supports JavaScript (e.g., [{% data variables.product.prodname_pages %}](http://pages.github.com)):
|
|
|
|
|
|
|
|
|
|
```html
|
|
|
|
|
<script src="https://embed.github.com/view/geojson/<username>/<repo>/<ref>/<path_to_file>"></script>
|
|
|
|
|
@@ -294,7 +294,7 @@ By default, the embedded map 420px x 620px, but you can customize the output by
|
|
|
|
|
{% ifversion mermaid %}
|
|
|
|
|
### Mapping in Markdown
|
|
|
|
|
|
|
|
|
|
You can embed geoJSON and topoJSON directly in Markdown. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-geojson-and-topojson-maps)."
|
|
|
|
|
You can embed GeoJSON and TopoJSON directly in Markdown. For more information, see "[Creating diagrams](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-geojson-and-topojson-maps)."
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
### Clustering
|
|
|
|
|
@@ -307,7 +307,7 @@ The underlying map data (street names, roads, etc.) are driven by [OpenStreetMap
|
|
|
|
|
|
|
|
|
|
### Troubleshooting
|
|
|
|
|
|
|
|
|
|
If you're having trouble rendering geoJSON files, ensure you have a valid geoJSON file by running it through a [geoJSON linter](http://geojsonlint.com/). If your points aren't appearing where you'd expect (<em>e.g.</em>, in the middle of the ocean), it's likely that the data is in a projection which is currently unsupported. Currently, {% data variables.product.product_name %} only supports the `urn:ogc:def:crs:OGC:1.3:CRS84` projection.
|
|
|
|
|
If you're having trouble rendering GeoJSON files, ensure you have a valid GeoJSON file by running it through a [GeoJSON linter](http://geojsonlint.com/). If your points aren't appearing where you'd expect (<em>e.g.</em>, in the middle of the ocean), it's likely that the data is in a projection which is currently unsupported. Currently, {% data variables.product.product_name %} only supports the `urn:ogc:def:crs:OGC:1.3:CRS84` projection.
|
|
|
|
|
|
|
|
|
|
Additionally, if your `.geojson` file is especially large (over 10 MB), it is not possible to render within the browser. If that's the case, you'll generally see a message that looks something like this:
|
|
|
|
|
|
|
|
|
|
|