Use the MapLibre ArcGIS plugin to show places of interest in the basemap style and restrict map interactions.
Prerequisites
- You need an ArcGIS Location Platform or ArcGIS Online account.
- You need to complete Step 2. Display a basemap style.
Steps
Restrict map boundaries
Prevent the map from being dragged too far outside your area of interest by setting maximum geographical bounds. This ensures the view remains within San Francisco.
-
Set the zoom level to
14
to focus the map on downtown San Francisco.Use dark colors for code blocks const map = new maplibregl.Map({ container: "map", center: [-122.402, 37.789], zoom: 14, });
-
Define the bounds as a southwest and northeast coordinate pair.
Use dark colors for code blocks const bounds = [ [-122.534, 37.727], [-122.191, 37.836] ];
-
Pass the bounds array to the
max
property of the map.Bounds Use dark colors for code blocks const map = new maplibregl.Map({ container: "map", center: [-122.402, 37.789], zoom: 14, maxBounds: bounds });
Restrict map interaction
To minimize the amount of tile requests and control user navigation, you can restrict map interactions such as zooming, panning, tilting, and rotating.
- Set map interaction preferences.
Use dark colors for code blocks map.dragRotate.disable() // disable map rotation using right click + drag map.keyboard.disable(); // disable map rotation using keyboard map.touchZoomRotate.disableRotation() // disable map rotation using touch rotation gesture map.touchPitch.disable() // disable touch-based pitch
Display places of interest
-
To display places of interest, such as parks, schools, landmarks, and businesses, add the
places
parameter to the basemap style object.Use dark colors for code blocks preferences: { places: 'all' }
Run the app
Run the app.
The map should display thearcgis/streets
style with places of interest in downtown San Francisco, California. The map restrictions limit the number of tiles the application consumes.
Congratulations!
You have completed the Display a basemap style how-to. The application uses the MapLibre ArcGIS plugin and an access token to display a basemap style with preferences. The map also restricts the map bounds and user interactions to minimize tile usage.
What's next?

Change the basemap style
Switch a vector basemap style on a map.

Display basemap places
Display places of interest on a basemap and get place details.

Search with autosuggest
Search for addresses with partial text using autosuggest.
To explore additional ArcGIS capabilities, go to Tutorials.