Skip to content

A leaflet plugin that provides a hook to save the map state as JSON.

License

Notifications You must be signed in to change notification settings

tesera/leaflet-save

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leaflet-save

A leaflet plugin that provides a hook to save the map state as JSON.

    var state = map.save();
    // post state to an endpoint
    // http.post(mapState);

    // save state to local storage
    // localStorage.set('map', mapState);

    console.log(state);
{
    "zoom": 4,
    "center": [
        46.07323062540835,
        -99.27246093750001
    ],
    "bounds": [
        [
            68.46379955520322,
            -127.88085937500001
        ],
        [
            8.928487062665504,
            -70.66406250000001
        ]
    ]
}

About

A leaflet plugin that provides a hook to save the map state as JSON.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published