This repository has been archived by the owner on Aug 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow creating projects for locations that don't have an ingested City
Rather than using the city endpoint for the autocomplete in the new project form and the lab header, we now use a Google geocoder, and make a separate AJAX call to the API to determine if that lat/lon has data. This will allow us to support a broader number of locations than we do currently. Closes #333 Closes #266 Closes #251
- Loading branch information
Showing
16 changed files
with
230 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Point } from 'geojson'; | ||
|
||
export interface ProximityProperties { | ||
ocean: boolean; | ||
} | ||
|
||
/* tslint:disable:variable-name */ | ||
export interface MapCellProperties { | ||
datasets: string[]; | ||
distance_meters: number; | ||
proximity: ProximityProperties; | ||
} | ||
/* tslint:enable:variable-name */ | ||
|
||
export interface MapCell { | ||
type: string; | ||
geometry: Point; | ||
properties: MapCellProperties; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Response } from '@angular/http'; | ||
import { Point } from 'geojson'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
import { MapCell } from '../models/map-cell.model'; | ||
import { LabApiHttp } from '../auth/api-http.service'; | ||
import { apiHost } from '../constants'; | ||
|
||
@Injectable() | ||
export class MapCellService { | ||
|
||
constructor(private apiHttp: LabApiHttp) {} | ||
|
||
nearest(point: Point, distance: number): Observable<MapCell[]> { | ||
const url = `${apiHost}/api/map-cell/${point.coordinates[1]}/${point.coordinates[0]}?distance=${distance}`; | ||
return this.apiHttp.get(url) | ||
.map((resp) => { | ||
return resp.json() || [] as MapCell[]; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export const environment = { | ||
production: true, | ||
distance: 32000, | ||
googleMapsApiKey: 'AIzaSyDbVOdIZAq4rBo94p947kCBo_KKPyqFf9I', | ||
}; |
Oops, something went wrong.