Leaflet Examples



Examples of usage Leaflet library. Based on http://velocrunch.ru project. Related post:

Main features: Implemented examples for map rendering, gpx tracks, performance optimization for large gpx files, markers rendering, track points rendering.

Extra features: combine(concatenate) gpx tracks, get bounds from gpx, convert gpx to geojson format. Convert Garmin gpx track points to json array.

Examples

Map + Single GPX tracks

Demo: example_01.html

Map + multiple GPX tracks(simple)

Demo: example_02.html

Get bounds for GPX tracks

php example_03.php
        Array
        (
        [neLat] => 36.79923084564507
        [neLng] => 21.265787724405527
        [swLat] => 38.496870584785938
        [swLng] => 24.058144837617874
        )
        

Get bounds for multiple GPX tracks.

php example_04.php
        Array
        (
        [0] => /Users/antonshell/Projects/leaflet_examples/gpx/austria-2016/full.gpx
        [1] => /Users/antonshell/Projects/leaflet_examples/gpx/greece-2018/full.gpx
        [2] => /Users/antonshell/Projects/leaflet_examples/gpx/italy-coast-to-coast-2017/full.gpx
        [3] => /Users/antonshell/Projects/leaflet_examples/gpx/italy-dolomity-2017/full-2016.gpx
        [4] => /Users/antonshell/Projects/leaflet_examples/gpx/italy-dolomity-2017/full-2017.gpx
        [5] => /Users/antonshell/Projects/leaflet_examples/gpx/italy-dolomity-2017/laguna.gpx
        [6] => /Users/antonshell/Projects/leaflet_examples/gpx/sardegna-2017/full.gpx
        )
        Array
        (
        [neLat] => 36.79923084564507
        [neLng] => 8.3107243851
        [swLat] => 47.807752154767513
        [swLng] => 24.058144837617874
        )
        

Combine GPX tracks

php example_05.php
Demo: example_05.html

Markers

Demo: example_06.html

Map + multiple GPX tracks(optimized)

php example_07.php
Demo: example_07.html

Track Points(Garmin)

php example_08.php
Demo: example_08.html