The Canadian Geospatial Platform (CGP) needs the ability to do Geocoding
Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers on a map, or position the map. Google Maps Geocoding API There is many different APIs on the market to achieve this task. Each one of them has pros and cons and the use of only one API introduce limitations. The idea is the create a wrapper around many APIs and custom sources of geolocated features to be able to build a standard response for CGP tools to interact with.
Sample call to the API:
https://fr59c5usw4.execute-api.ca-central-1.amazonaws.com/dev?q=Meech lake&lang=en&keys=geonames,nominatim
html The demo with embeded viewer is being loaded in public/index.html as a script tag
<script src="https://canadian-geospatial-platform.github.io/geoview/public/cgpv-main.js"></script>
$ git clone https://github.com/Canadian-Geospatial-Platform/geoview-api-geolocator.git
cd geoview-api-geolocator
$ npm install
$ npm run serve
$ npm run build
These 2 librairies are included in the cgpv-main.js file that is referenced by the html page. To access it, add the lines below to your webpack file.
externals: {
react: 'cgpv.react',
'react-dom': 'cgpv.reactDOM',
},