MapQuest.js

L.mapquest.parking

A class that acts as a simple interface to the Parking API.

Parking Lots API

The function provides parking lot data inside of a given a bounding box. Inside the options object, a upper left (ul) lat,lng object and a lower right (lr) lat, lng object must be given.

Syntax

L.mapquest.key = 'KEY';

var options = {
  boundingBox: {
    ul: {
      lat: '34.0588',
      lng: '-118.2557'
    },
    lr: {
      lat: '34.0455',
      lng: '-118.2316'
    }
  }
};

L.mapquest.parking.lots(options, parkingCallback);

function parkingCallback(error, result) {
  console.log(result);
}

Parameters

  • options required object

    An object containing options from the Parking API.

  • callback required Function

    An error-first callback to be invoked upon completion of the parking lot function call.

Return Value

The Parking API response will be returned.

{
  "parkingLots": [
    {
      "lat": 40.362174,
      "lng": -73.973373,
      "name": "7 E Church St Parking",
      "navigationAddress": {
        "addressType": "NAVIGATION",
        "street": "7 E Church St",
        "city": "Sea Bright",
        "state": "NJ",
        "postal": "07760",
        "country": "US"
      },
      "lotType": "Non-restricted",
      "format": "Surface",
      "polygon": "kfjuFv|nbMK??MJ??L",
      "totalSpaces": 10,
      "phones": [],
      "hours": [
        "Mon-Sun: 24 Hours"
      ],
      "currency": "USD",
      "rates": [],
      "paymentTypes": [],
      "amenities": [
        {
          "name": "Open 24/7",
          "value": "true"
        },
        {
          "name": "Over 7ft. Clearance",
          "value": "true"
        }
      ],
      "distance": 21537
    }
  ]
}