less than 1 minute read

Today I learned that you can embed maps in geoJSON and topoJSON format into your markdown files.

For example, you can select desired area in the geojson.io, copy the code and embed it like this:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              33.3845329284668,
              35.318837042777545
            ],
            [
              33.39577674865723,
              35.318837042777545
            ],
            [
              33.39577674865723,
              35.32450954444298
            ],
            [
              33.3845329284668,
              35.32450954444298
            ],
            [
              33.3845329284668,
              35.318837042777545
            ]
          ]
        ]
      }
    }
  ]
}

This snippet will be rendered automatically in your markdown files.

To paste this in GitHub Pages, use following link:

<script src="https://embed.github.com/view/geojson/<username>/<repo>/<ref>/<path_to_file>"></script>

For more information, check out documentation:

Tags:

Categories:

Updated:

Comments