Trans Siberian Leaflet

This was a great learning experience. Same as the GitHub example, but now with Leaflet.

/p>

Leaflet code:

In addition we have the following in the header:



So the route is being read directly from a .geojson file. Although it has been renamed to route.js, and “var route = [” has been added to the beginning of the file and “]” to the end.

Trans Siberian GeoJson on GitHub

One of the easiest and low-cost ways of getting your data online is by using GitHub. While mainly aimed for code, it can be used for other things as well.

A great feature is the rendering of .geojson files as maps automatically.

I have a .geojson file of a Trans-Siberian journey in WGS84 (currently the only supported projection). I copy and past this to gist.GitHub.com and name the file TransSiberianSimplified.geojson (I think lowercase is important in the file type). It is then automatically turned into a slippy map. This can then be embedded (for WordPress I have done this by creating a simple html page which simply contains the relevant script, and embedded it using an iframe plugin).