Closed WohnungNDS closed 2 years ago
It works (more or less)!
I added another layer in the site_config.yml
subfolder: maps
# The label to use in the "Download GeoJSON" button:
label: indicator.map
# The minimum zoom at which this layer should be visible.
min_zoom: 0
# The maximum zoom at which this layer should be visible.
max_zoom: 20
# Whether or not these boundaries should display statically on lower layers.
staticBorders: false
-
subfolder: worldmap
# The label to use in the "Download GeoJSON" button:
label: indicator.map
# The minimum zoom at which this layer should be visible.
min_zoom: 0
# The maximum zoom at which this layer should be visible.
max_zoom: 20
# Whether or not these boundaries should display statically on lower layers.
staticBorders: false
`
But somethin is wrong with the zoom as you can see here
It is a world map. I want to show from which country people come to lower syxony.....
@WohnungNDS I think you need to change the value of minZoom here: https://github.com/WohnungNDS/IM_Site/blob/develop/_config.yml#L178
However this will change site-wide
No problem @WohnungNDS
For minZoom
and maxZoom
under map_options, that controls the total minimum/maximum zoom, no matter what layer is displayed
min_zoom
and max_zoom
under map_layers, tells the map what layer to show.
For example if you have
map_options:
minZoom: 0
maxZoom: 10
you may want:
map_layers:
- subfolder: maps
label: indicator.map
min_zoom: 6
max_zoom: 10
staticBorders: false
- subfolder: worldmap
label: indicator.map
min_zoom: 0
max_zoom: 5
staticBorders: false
This would create a nested zoom functionality where if data for both layers is available on an indicator, the 'worldmap' layer would show when zoomed out to the max and until you zoom in 6 times. Once you zoom in 6 times or more, the 'maps' layer would show until you get to zoom 10. Once you get to zoom 10 you won't be able to zoom in any more.
Note: all min_zoom
s should be greater than minZoom
and all max_zoom
s should be less than maxZoom
@LucyGwilliamAdmin it works! But there is another download button under my map as you can see here
@WohnungNDS I think it's because you are using two different geojson/map layers within the indicator. See how it's the same in this UK indicator: https://sdgdata.gov.uk/3-a-1/.
I'm not sure why they both say Karte though
@LucyGwilliamAdmin Thank you I have fixed this.... But there are more promlems with my geojson files. to me it is not clear how SDG decides which Goejson file schould be used..... Sometimes I get Errors like this.... But I have no idea what this error means
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/sdg/outputs/OutputGeoJson.py", line 148, in <listcomp> disaggregations = [self.clean_disaggregations(disaggregation) for disaggregation in disaggregations] File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/sdg/outputs/OutputGeoJson.py", line 214, in clean_disaggregations del disaggregations[self.id_column] KeyError: 'GeoCode' Error: Process completed with exit code 1.
@LucyGwilliamAdmin In this indicator this geojson is used the id property is "LAGS"
in this indicator I want to use this Geojson and use the id property "staat_schlues"
If I change my config_data in this line https://github.com/WohnungNDS/IM_Data/blob/29222f4487b1255f64648065eeb05f25881181c4/config_data.yml#L121
to id_property: staat_schlues
I get the mentioned error above
@LucyGwilliamAdmin @brockfanning
Hello,
three questions before I start a new try add two geojson filfes to have different maps:
1) Where do I have to store my geojson files. All in the same folder or is it better to have one folder for each geojson?
2) are there any restrictions for the file names?
3) and has the output_subfolder: maps
to be different from my folder holding my geojson file?
Thank you
Hi @WohnungNDS
output_subfolder
necessarily needs to be different from the folder holding your geojson file but each of the layers should have distinct names. Again take a look at UK example to see how we did it.@WohnungNDS is this one still needed or have you resolved your issue?
@LucyGwilliamAdmin It works fine... But the zoom values are different from the documentation...
No problem @WohnungNDS
For minZoom and maxZoom under map_options, that controls the total minimum/maximum zoom, no matter what layer is displayed
min_zoom and max_zoom under map_layers, tells the map what layer to show.
For example if you have
map_options: minZoom: 0 maxZoom: 10 you may want:
map_layers:
Note: all min_zooms should be greater than minZoom and all max_zooms should be less than maxZoom
Originally posted by @LucyGwilliamAdmin in #1213 (comment)
My current settings are:
`map_layers:
find my config file here
@WohnungNDS so is it all resolved then?
I do have one comment from looking at your config - your min_zooms are less than your minZoom and your max_zooms are greater than your maxZoom
@LucyGwilliamAdmin Yes, that's right, but the only way it works....At the moment I haven't time to get in this... Perhaps we leave it open and i will get back in this ina couple of weeks...
Oh right, that's strange - something definitely sounds off.
@WohnungNDS In reading through this issue I'm having a hard time understanding. Would it be possible for you to summarize with answers to these questions?
@brockfanning
this issue is more or less solved. The map is working as expected. Tho only thing is, that in my _site_config.yml the min and max zoom values are different from the values recommended in the documentaiton
@christoph-LSN Sorry I missed this. To be clear, the documentation is only showing defaults/examples, and not necessarily recommendations. I do think we need better names for those settings. The 'minZoom' and 'maxZoom' under 'map_options' are named OK, but under 'map_layers' they probably should be 'visible_above' and 'visible_below' or something like that.
Do you think the documentation needs any changes or additions?
@brockfanning
probably should be 'visible_above' and 'visible_below' or something like that.
Yes, this may be a good idea...
Please complete the following information Data_repo Geojsonfile1 : NI_Kurz_diss.geojson Geojsonfile2: world_custom.geojson
Data or metadata issue: Data/Map/GeoJson Input format: CSV, Geojson
Describe the bug I have two different geojson files in my datarepo. geojsonfile1 covers the administrative local boundaries of lower saxony, geojsonfile2 covers the boundaries off all states over the world.
The idea is to show where people from all over the world come to lower saxony. eg 1234 from Poland 1222 from Turkey tbc
I add in my data_config file this:
And added some test data to indicator Data 4.1.3
The map is shown more ore less correctly as you can see here
But now the other maps eg in indicator 1.1.1 contains no boundaries an also no data. There should be shown boundaries from Geojsonfile1 and data form indicator 1.1.1
Do I have to do changes in my site _config file too? Any Ideas?