# All files / lib/geocoder nominatimmapquestgeocoder.js

100% Statements 12/12
100% Branches 4/4
100% Functions 1/1
100% Lines 12/12

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    242x
    2x

    2x
    8x

    7x
    1x

    6x
    6x

    2x

    2x
    2x

    2x
     var util                  = require('util'),
        OpenStreetMapGeocoder = require('./openstreetmapgeocoder');

    /**
     * Constructor
     */
    var NominatimMapquestGeocoder = function NominatimMapquestGeocoder(httpAdapter, options) {
        NominatimMapquestGeocoder.super_.call(this, httpAdapter, options);

        if (!this.options.apiKey || this.options.apiKey == 'undefined') {
          throw new Error(this.constructor.name + ' needs an apiKey');
        }
        this.options.key = this.options.apiKey;
        delete this.options.apiKey;
    };

    util.inherits(NominatimMapquestGeocoder, OpenStreetMapGeocoder);

    NominatimMapquestGeocoder.prototype._endpoint = 'http://open.mapquestapi.com/nominatim/v1/search';
    NominatimMapquestGeocoder.prototype._endpoint_reverse = 'http://open.mapquestapi.com/nominatim/v1/reverse';

    module.exports = NominatimMapquestGeocoder;