Skip to content

Commit

Permalink
Rename interface IGeocoder to match README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Nov 27, 2020
1 parent 9240331 commit 812b149
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions src/control.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as L from 'leaflet';
import { Nominatim } from './geocoders/index';
import { GeocoderAPI, GeocodingResult } from './geocoders/api';
import { IGeocoder, GeocodingResult } from './geocoders/api';

export interface GeocoderControlOptions extends L.ControlOptions {
collapsed: boolean;
expand: string;
placeholder: string;
errorMessage: string;
iconLabel: string;
geocoder?: GeocoderAPI;
geocoder?: IGeocoder;
showUniqueResult: boolean;
showResultIcons: boolean;
suggestMinLength: number;
Expand Down
2 changes: 1 addition & 1 deletion src/geocoders/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ReverseGeocodingResult extends GeocodingResult {

export type GeocodingCallback = (result: GeocodingResult[]) => void;

export interface GeocoderAPI {
export interface IGeocoder {
geocode(query: string, cb: GeocodingCallback, context?: any): void;
suggest?(query: string, cb: GeocodingCallback, context?: any): void;
reverse?(
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/arcgis.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -12,7 +12,7 @@ import {

export interface ArcGisOptions extends GeocoderOptions {}

export class ArcGis implements GeocoderAPI {
export class ArcGis implements IGeocoder {
options: ArcGisOptions = {
serviceUrl: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer',
apiKey: ''
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/bing.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { jsonp } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -11,7 +11,7 @@ import {

export interface BingOptions extends GeocoderOptions {}

export class Bing implements GeocoderAPI {
export class Bing implements IGeocoder {
options: BingOptions = {
serviceUrl: 'https://dev.virtualearth.net/REST/v1/Locations'
};
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/google.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -11,7 +11,7 @@ import {

export interface GoogleOptions extends GeocoderOptions {}

export class Google implements GeocoderAPI {
export class Google implements IGeocoder {
options: GoogleOptions = {
serviceUrl: 'https://maps.googleapis.com/maps/api/geocode/json'
};
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/here.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -15,7 +15,7 @@ export interface HereOptions extends GeocoderOptions {
reverseGeocodeProxRadius: null;
}

export class HERE implements GeocoderAPI {
export class HERE implements IGeocoder {
options: HereOptions = {
serviceUrl: 'https://geocoder.api.here.com/6.2/',
app_id: '',
Expand Down
6 changes: 3 additions & 3 deletions src/geocoders/latlng.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as L from 'leaflet';
import { GeocoderAPI, GeocodingCallback, GeocodingResult } from './api';
import { IGeocoder, GeocodingCallback, GeocodingResult } from './api';

export interface LatLngOptions {
/**
* The next geocoder to use
*/
next?: GeocoderAPI;
next?: IGeocoder;
sizeInMeters: number;
}

Expand Down Expand Up @@ -75,7 +75,7 @@ export function parseLatLng(query: string): L.LatLng | undefined {
}
}

export class LatLng implements GeocoderAPI {
export class LatLng implements IGeocoder {
options: LatLngOptions = {
next: undefined,
sizeInMeters: 10000
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/mapbox.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -11,7 +11,7 @@ import {

export interface MapboxOptions extends GeocoderOptions {}

export class Mapbox implements GeocoderAPI {
export class Mapbox implements IGeocoder {
options: MapboxOptions = {
serviceUrl: 'https://api.mapbox.com/geocoding/v5/mapbox.places/'
};
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/mapquest.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -11,7 +11,7 @@ import {

export interface MapQuestOptions extends GeocoderOptions {}

export class MapQuest implements GeocoderAPI {
export class MapQuest implements IGeocoder {
options: MapQuestOptions = {
serviceUrl: 'https://www.mapquestapi.com/geocoding/v1'
};
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/neutrino.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -13,7 +13,7 @@ export interface NeutrinoOptions extends GeocoderOptions {
userId: string;
}

export class Neutrino implements GeocoderAPI {
export class Neutrino implements IGeocoder {
options: NeutrinoOptions = {
userId: undefined,
apiKey: undefined,
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/nominatim.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { template, getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand Down Expand Up @@ -48,7 +48,7 @@ export interface NominatimOptions extends GeocoderOptions {
htmlTemplate: (r: NominatimResult) => string;
}

export class Nominatim implements GeocoderAPI {
export class Nominatim implements IGeocoder {
options: NominatimOptions = {
serviceUrl: 'https://nominatim.openstreetmap.org/',
htmlTemplate: function(r: NominatimResult) {
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/open-location-code.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as L from 'leaflet';
import { GeocoderAPI, GeocodingCallback, GeocodingResult } from './api';
import { IGeocoder, GeocodingCallback, GeocodingResult } from './api';

export interface OpenLocationCodeOptions {
OpenLocationCode: OpenLocationCodeApi;
Expand All @@ -21,7 +21,7 @@ export interface CodeArea {
codeLength: number;
}

export class OpenLocationCode implements GeocoderAPI {
export class OpenLocationCode implements IGeocoder {
options: OpenLocationCodeOptions;
constructor(options?: Partial<OpenLocationCodeOptions>) {
L.Util.setOptions(this, options);
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/opencage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -11,7 +11,7 @@ import {

export interface OpenCageOptions extends GeocoderOptions {}

export class OpenCage implements GeocoderAPI {
export class OpenCage implements IGeocoder {
options: OpenCageOptions = {
serviceUrl: 'https://api.opencagedata.com/geocode/v1/json'
};
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/pelias.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -11,7 +11,7 @@ import {

export interface PeliasOptions extends GeocoderOptions {}

export class Pelias implements GeocoderAPI {
export class Pelias implements IGeocoder {
options: PeliasOptions = {
serviceUrl: 'https://api.geocode.earth/v1'
};
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/photon.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -15,7 +15,7 @@ export interface PhotonOptions extends GeocoderOptions {
htmlTemplate?: (r: any) => string;
}

export class Photon implements GeocoderAPI {
export class Photon implements IGeocoder {
options: PhotonOptions = {
serviceUrl: 'https://photon.komoot.io/api/',
reverseUrl: 'https://photon.komoot.io/reverse/',
Expand Down
4 changes: 2 additions & 2 deletions src/geocoders/what3words.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as L from 'leaflet';
import { getJSON } from '../util';
import {
GeocoderAPI,
IGeocoder,
GeocoderOptions,
GeocodingCallback,
geocodingParams,
Expand All @@ -11,7 +11,7 @@ import {

export interface What3WordsOptions extends GeocoderOptions {}

export class What3Words implements GeocoderAPI {
export class What3Words implements IGeocoder {
options: What3WordsOptions = {
serviceUrl: 'https://api.what3words.com/v2/'
};
Expand Down

0 comments on commit 812b149

Please sign in to comment.