Save the map position to the URL so that links hit the map in the same state as the initial user.
By default, this control uses pushState,
a feature found in modern webbrowsers, to give you the history of the map without
changing the page URL. You can use traditional hashes (#/0/0/etc
) by
specifying manager: wax.mm.locationHash
in its options object.
<div id='map-div'></div>
<script>
var mm = com.modestmaps;
var tilejson = {
tilejson: '1.0.0',
scheme: 'tms',
tiles: ['http://a.tiles.mapbox.com/mapbox/1.0.0/natural-earth-2/{z}/{x}/{y}.png']
};
var m = new mm.Map('map-div',
new wax.mm.connector(tilejson));
wax.mm.hash(m, tilejson, {
defaultCenter: new mm.Location(39, -98),
defaultZoom: 4,
manager: wax.mm.pushState
});
</script>
var hash = wax.mm.hash(map, tilejson, options)