Restrict a moveable map to a given rectangular area
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
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.