# Issues with avoidPoints and ferry using Leaflet Routing Machine

**URL:** https://ask.openrouteservice.org/t/issues-with-avoidpoints-and-ferry-using-leaflet-routing-machine/6437
**Category:** SDKs
**Created:** [August 26, 2024, 6:56am UTC](https://ask.openrouteservice.org/t/issues-with-avoidpoints-and-ferry-using-leaflet-routing-machine/6437 "2024-08-26T06:56:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Marco\_Miiretto](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/marco_miiretto/32/3156_2.png) [@Marco\_Miiretto](https://ask.openrouteservice.org/u/Marco_Miiretto)
#### Post date: [August 26, 2024, 6:56am UTC](https://ask.openrouteservice.org/t/issues-with-avoidpoints-and-ferry-using-leaflet-routing-machine/6437/1 "2024-08-26T06:56:08Z")

</div>

Hello everyone,

I am developing an app about Venice using Routing.

The problem is that I would like to let tourists pass through the accessible penti provided with ramp and avoid the inaccessible ones.

The app is based on Leaflet and routing machine with leaflet.openrouting service extension,

below I paste the call to your service:

```auto
function getRoute(destination) {
  var userType = $(“#userType”).val();
  var startPoint = $(“#userCurrentPosition”).val().split(“,”);
  var endPoint = destination.split(“,”);
  const apiKey = '5b3ce3597851110001cf6248d9932d42de9e4a52a4ba0dba55a0ddf1';

  const osrRouter = new L.Routing.OpenRouteService(apiKey, {
      “timeout": 30 * 1000,
      “format": ‘json’,
      “host": ‘https://api.openrouteservice.org’,
      “service": ‘directions’,
      “api_version": ‘v2’,
      “profile": ‘foot-walking’,
      “preference": ‘fastest’,
      “routingQueryParams": {
          “language": ‘en’,
          “maneuvers": true,
          “options": {
            “avoid_polygons": {
              “type": ‘multiPolygon’,
              “coordinates": [avoidPoints] // Use the points to avoid loaded from the JSON
          }
              // “avoid_features”: [“steps”]
              
          }
      }
  });

```

Within the variable “avoidPoints” I have the polygons of the bridges to be avoided to avoid.  
Graphically, the line still crosses the bridge it is supposed to avoid.

also i have problems with navigation, where by inserting “profile”: “ferry”  
thank you

---

<div class="post-metadata">

### Author: ![amandus](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/amandus/32/669_2.png) [@amandus](https://ask.openrouteservice.org/u/amandus)
#### Post date: [August 28, 2024, 8:59am UTC](https://ask.openrouteservice.org/t/issues-with-avoidpoints-and-ferry-using-leaflet-routing-machine/6437/2 "2024-08-28T08:59:39Z")

</div>

Hi @Marco_Miiretto,

please make sure you understand what options you can actually pass in your query by reading our [API Documentation](https://openrouteservice.org/dev/#/api-docs/v2/directions/%7Bprofile%7D/post).

- make sure your avoidPoints are formatted as valid GeoJSON, either a Polygon or MultiPolygon object
- we don’t have a `ferry` profile. You could use our `foot-walking` profile which can use ferries if they are not avoided.

Best regards
