diff --git a/Makefile b/Makefile index cb183041a0..413fa82d69 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ help: @echo @echo "- BASE_URL_PATH Base URL path (current value: $(BASE_URL_PATH))" @echo "- SERVICE_URL Service URL (current value: $(SERVICE_URL))" + @echo "- GEOADMIN_URL Geoadmin URL (current value: $(GEOADMIN_URL))" @echo .PHONY: all @@ -124,12 +125,12 @@ prd/style/print.css: src/style/print.less src/style/app_print.less node_modules prd/index.html: src/index.mako.html prd/lib/build.js prd/style/app.css .build-artefacts/python-venv/bin/mako-render .build-artefacts/python-venv/bin/htmlmin mkdir -p $(dir $@) - .build-artefacts/python-venv/bin/mako-render --var "device=desktop" --var "mode=prod" --var "version=$(VERSION)" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" $< > $@ + .build-artefacts/python-venv/bin/mako-render --var "device=desktop" --var "mode=prod" --var "version=$(VERSION)" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" $< > $@ .build-artefacts/python-venv/bin/htmlmin $@ $@ prd/mobile.html: src/index.mako.html .build-artefacts/python-venv/bin/mako-render .build-artefacts/python-venv/bin/htmlmin mkdir -p $(dir $@) - .build-artefacts/python-venv/bin/mako-render --var "device=mobile" --var "mode=prod" --var "version=$(VERSION)" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" $< > $@ + .build-artefacts/python-venv/bin/mako-render --var "device=mobile" --var "mode=prod" --var "version=$(VERSION)" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" $< > $@ .build-artefacts/python-venv/bin/htmlmin $@ $@ prd/img/: src/img/* @@ -163,16 +164,16 @@ src/style/print.css: src/style/print.less src/style/app_print.less node_modules node_modules/.bin/lessc $(LESS_PARAMETERS) $< $@ src/index.html: src/index.mako.html .build-artefacts/python-venv/bin/mako-render - .build-artefacts/python-venv/bin/mako-render --var "device=desktop" --var "version=" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" $< > $@ + .build-artefacts/python-venv/bin/mako-render --var "device=desktop" --var "version=" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" $< > $@ src/mobile.html: src/index.mako.html .build-artefacts/python-venv/bin/mako-render - .build-artefacts/python-venv/bin/mako-render --var "device=mobile" --var "version=" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" $< > $@ + .build-artefacts/python-venv/bin/mako-render --var "device=mobile" --var "version=" --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" $< > $@ src/TemplateCacheModule.js: src/TemplateCacheModule.mako.js $(SRC_COMPONENTS_PARTIALS_FILES) .build-artefacts/python-venv/bin/mako-render .build-artefacts/python-venv/bin/mako-render --var "partials=$(subst src/,,$(SRC_COMPONENTS_PARTIALS_FILES))" --var "basedir=src" $< > $@ apache/app.conf: apache/app.mako-dot-conf prd/lib/build.js prd/style/app.css .build-artefacts/python-venv/bin/mako-render - .build-artefacts/python-venv/bin/mako-render --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "base_dir=$(CURDIR)" $< > $@ + .build-artefacts/python-venv/bin/mako-render --var "base_url_path=$(BASE_URL_PATH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" --var "base_dir=$(CURDIR)" $< > $@ test/karma-conf-dev.js: test/karma-conf.mako.js .build-artefacts/python-venv/bin/mako-render .build-artefacts/python-venv/bin/mako-render $< > $@ @@ -256,7 +257,7 @@ deploy/deploy-branch.cfg: deploy/deploy-branch.mako.cfg .build-artefacts/last-gi .build-artefacts/python-venv/bin/mako-render --var "git_branch=$(GIT_BRANCH)" $< > $@ rc_branch: rc_branch.mako .build-artefacts/last-git-branch .build-artefacts/python-venv/bin/mako-render - .build-artefacts/python-venv/bin/mako-render --var "base_url=$(GIT_BRANCH)" --var "service_url=$(SERVICE_URL)" $< > $@ + .build-artefacts/python-venv/bin/mako-render --var "base_url=$(GIT_BRANCH)" --var "service_url=$(SERVICE_URL)" --var "geoadmin_url=$(GEOADMIN_URL)" $< > $@ scripts/00-$(GIT_BRANCH).conf: scripts/00-branch.mako-dot-conf .build-artefacts/last-git-branch .build-artefacts/python-venv/bin/mako-render .build-artefacts/python-venv/bin/mako-render --var "git_branch=$(GIT_BRANCH)" $< > $@ diff --git a/rc_dev b/rc_dev index 41aa7bd070..5c8446f711 100644 --- a/rc_dev +++ b/rc_dev @@ -1,3 +1,4 @@ export BASE_URL_PATH=/main export SERVICE_URL=//mf-chsdi3.dev.bgdi.ch +export GEOADMIN_URL=//mf-geoadmin3.dev.bgdi.ch diff --git a/rc_int b/rc_int index 3142a39641..9b08303bbd 100644 --- a/rc_int +++ b/rc_int @@ -1,3 +1,4 @@ export BASE_URL_PATH=/main export SERVICE_URL=//mf-chsdi3.int.bgdi.ch +export GEOADMIN_URL=//mf-geoadmin3.int.bgdi.ch diff --git a/rc_prod b/rc_prod index 466e143d72..494a0bb12c 100644 --- a/rc_prod +++ b/rc_prod @@ -1,4 +1,5 @@ export DEPLOY_TARGET=prod export BASE_URL_PATH=/main export SERVICE_URL=//api3.geo.admin.ch +export GEOADMIN_URL=//map.geo.admin.ch diff --git a/src/components/map/MapService.js b/src/components/map/MapService.js index 3165341ade..8d822d39fa 100644 --- a/src/components/map/MapService.js +++ b/src/components/map/MapService.js @@ -330,7 +330,7 @@ }); this.$get = function($http, gaPopup, gaDefinePropertiesForLayer, - gaMapClick, gaMapUtils, $rootScope) { + gaMapClick, gaMapUtils, gaGlobalOptions, $rootScope) { var Kml = function(proxyUrl) { /** @@ -465,7 +465,7 @@ }; this.proxyUrl = proxyUrl; }; - return new Kml(this.proxyUrl); + return new Kml(gaGlobalOptions.ogcproxyUrl); }; }); diff --git a/src/index.mako.html b/src/index.mako.html index 562ced23ef..8248ad18b6 100644 --- a/src/index.mako.html +++ b/src/index.mako.html @@ -507,7 +507,8 @@

module.constant('gaGlobalOptions', { serviceUrl : '${service_url}', baseUrlPath: '${base_url_path}', - version: '${version}' + version: '${version}', + ogcproxyUrl: location.protocol + '${geoadmin_url}${base_url_path}' + '/ogcproxy?url=' }); module.config(['gaLayersProvider', function(gaLayersProvider) { @@ -526,10 +527,6 @@

'${base_url_path}/${version}rest/services/all/MapServer/'; }]); - module.config(['gaKmlProvider', function(gaKmlProvider) { - gaKmlProvider.proxyUrl = location.protocol + '${service_url}/ogcproxy?url='; - }]); - module.config(['$sceDelegateProvider', function($sceDelegateProvider) { var validatorUrl = 'http://www.kmlvalidator.org/validate.htm'; var whitelist = $sceDelegateProvider.resourceUrlWhitelist();