@@ -149,6 +149,7 @@ ckan.module("mappreview", function ($, _) {
149149
150150 const config = JSON . parse ( this . options . config . replace ( / ' / g, '"' ) ) ;
151151 const globalConfig = this . _getGlobalConfig ( ) ;
152+ const clipping_service_url = this . _getGlobalConfig ( ) . clipping_service_url ;
152153
153154 mapboxgl . accessToken = globalConfig . mapbox_api_key ;
154155 const map = new mapboxgl . Map ( {
@@ -862,7 +863,6 @@ ckan.module("mappreview", function ($, _) {
862863 clipping_options [ 'target_cellsize' ] = [ target_pixel_size , - target_pixel_size ] ;
863864 }
864865
865- const clipping_service_url = 'https://clipping-service-897938321824.us-west1.run.app' ;
866866 fetch ( `${ clipping_service_url } /clip` , {
867867 method : "POST" ,
868868 body : JSON . stringify ( clipping_options ) ,
@@ -940,12 +940,9 @@ ckan.module("mappreview", function ($, _) {
940940 document . getElementById ( 'natcap-clip-submit-button' ) . innerHTML = submit_text ;
941941 } ) ;
942942
943- const clipping_endpoint = 'https://clipping-service-897938321824.us-west1.run.app'
944-
945-
946943 function _setEPSGItems ( epsg_code ) {
947944 console . log ( `Updating SRS info for ${ epsg_code } ` ) ;
948- fetch ( `${ clipping_endpoint } /epsg_info?epsg_code=${ epsg_code } ` , {
945+ fetch ( `${ clipping_service_url } /epsg_info?epsg_code=${ epsg_code } ` , {
949946 method : "GET" ,
950947 } ) . then ( epsg_response => {
951948 if ( epsg_response . ok ) {
@@ -981,7 +978,7 @@ ckan.module("mappreview", function ($, _) {
981978 console . log ( 'updating source raster from cog ' + cog ) ;
982979
983980 var epsg_input = document . getElementById ( 'natcapClipSettingEPSGCode' ) ;
984- var cog_stats_url = `${ clipping_endpoint } /info?cog_url=${ encodeURIComponent ( cog ) } ` ; ;
981+ var cog_stats_url = `${ clipping_service_url } /info?cog_url=${ encodeURIComponent ( cog ) } ` ;
985982 fetch ( cog_stats_url ) . then ( response => {
986983 if ( response . ok ) {
987984 return response . json ( ) ;
0 commit comments