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

featureStyles for drag-and-drop layers have no visible effect #1764

Closed
Grammostola opened this issue May 8, 2023 · 0 comments · Fixed by #1770
Closed

featureStyles for drag-and-drop layers have no visible effect #1764

Grammostola opened this issue May 8, 2023 · 0 comments · Fixed by #1770
Labels
bug May be fixed by a core developer

Comments

@Grammostola
Copy link
Contributor

If a set of Origo style styles are defined under the featureStyles prop for the drag and drop control these styles are not adhered to when matching geometry type layers (without their own style) are dragged and dropped unto the map
To Reproduce
Steps to reproduce the behavior:

  1. Have a drag and drop control defined something like
    {
      "name": "draganddrop",
      "options": {
        "groupName": "drag-and-drop-layers",
        "groupTitle": "Insläppta lager",
        "featureStyles":  {
          "Point": [{
            "circle": {
              "radius": 8,
              "stroke": {
                "color": [0, 0, 90, 1],
                "width": 2
              },
              "fill": {
                "color": [0, 0, 90, 1]
              }
            }
          }],
          "LineString": [{
            "stroke": {
              "color": [0, 0, 0, 1],
              "width": 5
            }
          },
          {
            "stroke": {
              "color": [0, 0, 0, 1],
              "width": 3
            }
          }],
          "MultiLineString": [{
            "stroke": {
              "color": [0, 0, 0, 1],
              "width": 5
            }
          },
          {
            "stroke": {
              "color": [0, 0, 0, 1],
              "width": 3
            }
          }],
          "Polygon": [{
            "stroke": {
              "color": [0, 0, 0, 1],
                "width": 5
              }
            },
            {
              "fill": {
                "color": [0, 0, 0, 1]
              }
            }
          ],
          "MultiPolygon": [{
            "stroke": {
              "color": [0, 0, 0, 1],
                "width": 5
              }
            },
            {
              "fill": {
                "color": [0, 0, 0, 1]
              }
            }
          ]
        }
      }
    },
  1. Drag a polygon or multipolygon geojson into the map

Expected behavior
A polygon as black as midnight in January in the far reaches of the northern hemisphere

Current behaviour
An Origo-blue polygon

Additional context

  • The drag and drop control sends a style param with an array of two style functions to viewer.addLayer(). (These appear to describe something black) . Somewhere after that the only thing applied visibly is what is in style/stylefunctions/default.js
  • The same is the result for the default featureStyles defined in draganddrop.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug May be fixed by a core developer
Projects
None yet
2 participants