-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Mapbox Cookbook
By :
Map properties are interaction handlers that allow you to customize how a user interacts with the map at runtime. You can enable or disable certain features, such as zoom, dragging, touch zoom, scroll wheel, and many more.
In this recipe, we will use our previous example and modify it to change the map properties programmatically.
You will learn how to change the zoom and center of the map, pan to specific coordinates or bounds, and restrict the movement to a region.
We will add a basic map with a base layer on the screen as in the previous recipe. Then we will use the onClick handler on various screen elements to trigger the panTo or zoomIn method in order to pan or zoom the map programmatically.
In this recipe, we will use the methods we discussed to change the map properties programmatically. Perform the following steps:
chapter-4-example2-starter folder in your favorite text editor. The...
Change the font size
Change margin width
Change background colour