eamena-project / eamena-arches-dev

development repository of the EAMENA Arches-powered database platform
https://eamena.org/home
GNU Affero General Public License v3.0
5 stars 3 forks source link

Authorise reverse Geocoding #43

Open zoometh opened 7 months ago

zoometh commented 7 months ago

Authorize Mapbox reverse geocoding

According to the documentation, it should be as simple, adding a single line (commented here) authorising the reverse geocoding in /opt/arches/ENV/lib/python3.8/site-packages/arches/app/media/js/viewmodels/map.js:

this.setupMap = function(map) {
            map.on('load', function() {
                require(['mapbox-gl', 'mapbox-gl-geocoder'], function(MapboxGl, MapboxGeocoder) {
                    map.addControl(new MapboxGl.NavigationControl(), 'top-left');
                    map.addControl(new MapboxGl.FullscreenControl({
                        container: $(map.getContainer()).closest('.workbench-card-wrapper')[0]
                    }), 'top-left');
                    map.addControl(new MapboxGeocoder({
                        accessToken: MapboxGl.accessToken,
                        mapboxgl: MapboxGl,
                        placeholder: arches.geocoderPlaceHolder,
                        // reverseGeocode: true,
                        bbox: arches.hexBinBounds
                    }), 'top-right');

see: https://community.archesproject.org/t/reverse-geocoding-zoom-in-from-coordinates/1852