2

TIL - Adding maps to Github markdown files/blog posts

 2 years ago
source link: https://sbulav.github.io/til/til-adding-maps-to-github-markdown/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

TIL - Adding maps to Github markdown files/blog posts

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: github

Categories: TIL

Updated: June 29, 2022

Previous Next

You May Also Enjoy


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK