This example displays a moveable map of Alcatraz Island. Even though the map can still be panned and zoomed, the center of the map cannot be moved outside of the marked area

Code

The H.map.ViewModel represents the position of the map. The sync event is fired whenever the rendered map is synchronized with the view-model data. By listening to the sync event the value of the map.center can be restricted to a certain range.