-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dt-6141: dynamically add city zones if config file flag assembleGeoJsonZones is true #4935
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hyvä alku! Muutama vika pitää vielä korjata.
app/config.js
Outdated
|
||
if (additionalConfig.default.geoJson) { | ||
if (additionalConfig.default.geoJson.layerConfigUrl) { | ||
fetchDataFromGeoJsonUrl( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tämä ei toimi. Fetch on asynkroninen. Koodin suoritus jatkuu eikä haettu geojson ehdi tulla mukaan lippuvyöhykkeisiin.
app/config.js
Outdated
} | ||
}); | ||
} | ||
if (additionalConfig.default.assembleGeoJsonZones) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tämä ei toimi. Konfiguraation pusketaan keskeneräinen kokelma. Kokoa gejson zonet ensin, ja lisää ne vasta kun pyydettyä konfiguraatiota koostetaan getNamedConfiguration funktiossa.
app/config.js
Outdated
function pushDataToGeoJsonLayers(layer, nameInConfig) { | ||
const nameWithCapitalLetter = | ||
nameInConfig.charAt(0).toUpperCase() + nameInConfig.slice(1); | ||
geoLayers.push({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tämä menee väärin. Karttavalitsimessa pitää näkyä yksi 'Vyöhykkeet' valinta eikä yli 10 kpl. Koosta varsinainen geojson geometria yhteen layeriin.
@@ -108,6 +108,18 @@ class MapLayersDialogContent extends React.Component { | |||
this.updateSetting({ geoJson }); | |||
}; | |||
|
|||
updateGeoJsonSettings = (arr, target) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En ymmärrä mitä tässä on tarkoitus tapahtua. Komponentissa on kaksi samannimistä funktiota 'updateGeoJsonSettings'. Alempi ylikirjoittaa ensimmäisen. Se, että data haetan monesta urlista ei pitöisi vaikuttaa asetuksiin ollenkaan.
app/server.js
Outdated
if (config.useAssembledGeoJsonZones) { | ||
config.geoJson = config.assembledGeoJsons; | ||
} | ||
delete config.assembledGeoJsons; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ihmettelit miksi vyöhykkeet näkyy vain kerran. Syy on tässä: kun vyöhykedata on toimitettu jollekin clientille kerrran, se tuhotaan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totta :)
Proposed Changes
Pull Request Check List
Review