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

within expression returns inconsistent value when point is on the boundary #9411

Closed
zmiao opened this issue Mar 12, 2020 · 0 comments · Fixed by #9428
Closed

within expression returns inconsistent value when point is on the boundary #9411

zmiao opened this issue Mar 12, 2020 · 0 comments · Fixed by #9428
Assignees
Labels

Comments

@zmiao
Copy link
Contributor

zmiao commented Mar 12, 2020

mapbox-gl-js version:
master
browser:
chrome

Steps to Trigger Behavior

Running following style, and zoom in or zoom out.

  "version": 8,
  "sources": {
    "points": {
      "type": "geojson",
      "data": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "geometry": {
              "type": "Point",
              "coordinates": [ 5, 5]
            }
          }
        ]
      }
    },
    "polygon": {
      "type": "geojson",
      "data": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [-5, -5],
                  [5, -5],
                  [5, 5],
                  [-5, 5],
                  [-5,-5]
                ]
              ]
            }
          }
        ]
      }
    }
  },
  "layers": [
    {
      "id": "border",
      "type": "fill",
      "source": "polygon",
      "paint": {
        "fill-color": "black",
        "fill-opacity": 0.5
      }
    },
    {
      "id": "points",
      "type": "circle",
      "source": "points",
      "paint": {
        "circle-color": [
          "case",
          [
            "within",
            {
              "type": "Polygon",
              "coordinates": [
                [
                  [-5, -5],
                  [5, -5],
                  [5, 5],
                  [-5, 5],
                  [-5,-5]
                ]
              ]
            }
          ],
          "red",
          "blue"
        ],
      }
    }
  ]
}

Link to Demonstration

Expected Behavior

The circle keeps blue color

Actual Behavior

The circle color is flickering when zooming in and zooming out.

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

Successfully merging a pull request may close this issue.

1 participant