diff --git a/example/README.md b/example/README.md index 6247b49..a332fda 100644 --- a/example/README.md +++ b/example/README.md @@ -40,10 +40,12 @@ See a [live-example](./controls/vanilla/index.html) with simple controls. ### Rich controls -More comprehensive controls include the following classes:: +More comprehensive controls include the following classes: -- `MMapSearchControl` – adds a control to the map in the form of a search bar. - It also has built-in suggest hints when entering the name of a place or organization. +#### MMapSearchControl + +`MMapSearchControl` – adds a control to the map in the form of a search bar. +It also has built-in suggest hints when entering the name of a place or organization. `MMapSearchControl` has the following parameters: @@ -55,7 +57,32 @@ More comprehensive controls include the following classes:: `MMapSearchControl` does not display markers on the map, it only returns coordinates and location parameters, the developer is responsible for displaying them on the map. -There is a [live example](./search-control/vanilla/index.html) that demonstrates the possibilities of search control. + +#### MMapRouteControl + +`MMapRouteControl` – adds a control to the map in the form of a route panel. +There are also built-in suggest hint when entering the name of a place, panel control buttons +and the ability to specify a waypoint with a click on the map. + +`MMapRouteControl` has the following parameters: + +| Props name | Description | +| --------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| geolocationTextInput | Text that will be displayed in the input field when the user's geolocation is selected. | +| clearFieldsText | Text of the route reset button. | +| changeOrderText | The text of the route change order button. | +| availableTypes | Array of available route types in the routing panel (`driving`, `transit`, `truck`, `walking`). | +| truckParameters | A parameter object for a truck (only for `type=truck`). | +| waypoints | Array with coordinates of waypoints (`[LngLat, LngLat]`). | +| waypointsPlaceholders | Array with placeholders for waypoint inputs (`[string, string]`). | +| autofocus | Flag that the first waypoint input should be in focus when opening. | +| search | Function that overrides the search function. By default, `mappable.search` is used. | +| suggest | Function that overrides the suggest function. By default, `mappable.suggest` is used. | +| route | Function that overrides the route function. By default, `mappable.route` is used. | +| onMouseMoveOnMap | Callback that is called when the user selects a waypoint on the map. It can be used to display a marker under the user's cursor. | +| onUpdateWaypoints | Callback that is called when the user has changed the waypoints. | +| onRouteResult | Callback that receives a route between waypoints. | +| onBuildRouteError | Callback that is called if the route could not be set (route was not found or server error). | ## Markers and popups