< FacilMap < Version 1 < API

FacilMap/Version 1/API/HistoryStateHandler

With the HistoryStateHandler FacilMap control, a Permalink to the current map view will always be displayed in the browser’s address bar. This enables the following features:

  • Use of the browser’s back button to jump to the previous map view
  • Easy sharing of links
  • Map view stays the same on page reload.

To add this feature to your OpenLayers map, be sure to include the FacilMap API:

<script type="text/javascript" src="http://api.facilmap.org/facilmap.js"></script>

Then add the control to the map using the following code:

map.addControl(new FacilMap.Control.HistoryStateChanger({ autoActivate: true }));




This article is issued from Openstreetmap. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.