Modest Maps JS
✓ Published0🌍 Public
RRandomEtc
Last edited Sep 28, 2011
Created on Sep 28, 2011
This example shows a map of the United States that restricts panning and zooming to a predefined geographic extent, using the Modest Maps JS library. The code overrides the map provider’s `sourceCoordinate` method to reject tile coordinates outside the min and max zoom levels and bounding box, and overrides `map.enforceLimits` to keep the view centered within those bounds. It uses the `MM.TemplatedMapProvider` to load OpenStreetMap tiles from MapQuest’s tile server, and initializes the view with `setCenterZoom` on a location near Oakland, California.
AI-generated descriptionSee issue 57 for discussion and planned improvements.