Bladeren bron

fix: Set proxy for LPIS call based on the host url

fzadrazil 3 jaren geleden
bovenliggende
commit
81563309ce
2 gewijzigde bestanden met toevoegingen van 4 en 1 verwijderingen
  1. 2 0
      .gitignore
  2. 2 1
      src/app/app.service.ts

+ 2 - 0
.gitignore

@@ -1,2 +1,4 @@
 node_modules
 build
+dist
+.vs

+ 2 - 1
src/app/app.service.ts

@@ -81,7 +81,8 @@ export class AppService {
       url: (extent) => {
         const kulturaKod = 1; // Doesn't seem to work
         // eslint-disable-next-line prettier/prettier
-        return 'http://localhost:8085/https://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/foodie/lpis.map' +
+        let proxyPath = window.location.hostname.includes('localhost') ? 'http://localhost:8085/' : '/proxy/';
+        return proxyPath + 'https://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/foodie/lpis.map' +
           '&service=WFS' +
           '&VERSION=1.1.0' +
           '&REQUEST=GetFeature' +