Skip to content
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

Geojson export of visible layers is missing map / layer default attributes #1706

Open
hholzgra opened this issue Mar 23, 2024 · 3 comments
Open
Labels

Comments

@hholzgra
Copy link

A GeoJSON "visible layers only" download only exports individual geometries attributes, not default attributes from the layer or map level

My test has three layers, the default color on the map set to red, layer 1 having no default color of its own set, layers 2 and 3 having green and magenta set as default colors respectively.

I created two polygons on each layer, one using the default color while the other explicitly set to DarkOrange. See attached screenshot, layers are from left to right, with the top polygon using the default color, the bottom one having the color explicitly set.

Screenshot_2024-03-23_21-52-14

When exporting as "full backup" I can render the exported geojson in my own app (my MapOSMatic fork) just fine.

000123_2024-03-23_07-27_test2

But when doing geojson visible layers export the three top polygons all appear in blue (my default color if nothing is set) instead of read, green and magenta inherited from map or layer defaults, only the bottom polygons all come through as DarkOrange as they have that color explicitly set on the geometries themselves.

000124_2024-03-23_07-28_

The exported files look like this:

Full backup:
umap_backup_test2.json

Geojson all visible layers:
test2.json

@hholzgra hholzgra added the bug label Mar 23, 2024
@hholzgra
Copy link
Author

Checking the two exports for the "color" attribute the full backup (after json reformatting) has:

    "color": "Red",
              "color": "DarkOrange"
        "color": "Lime",
              "color": "DarkOrange"
        "color": "Magenta",
              "color": "DarkOrange"

while the visible layers export only has;

          "color": "DarkOrange"
          "color": "DarkOrange"
          "color": "DarkOrange"

@hholzgra
Copy link
Author

@yohanboniface
Copy link
Member

Not sure how to fix this without pulling each and every property in each and every feature, which sounds suboptimal.

Maybe, when fixing #174 when can expose layers properties also in some way (only in the geojson export format I'd say).

Would that help @hholzgra ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants