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

Low zoom state and country boundaries lines need normalized kinds #517

Closed
2 tasks
brewin opened this issue Feb 5, 2016 · 6 comments
Closed
2 tasks

Low zoom state and country boundaries lines need normalized kinds #517

brewin opened this issue Feb 5, 2016 · 6 comments

Comments

@brewin
Copy link

brewin commented Feb 5, 2016

Tasks:

  • Normalize boundary kind values (eg country and state, not raw Natural Earth values).
  • Add admin_level to match mid and high zooms (from OSM).

This is more of a breaking change so scheduling for 1.0 milestone.

Original report:

I'm not able to get any admin boundaries to show up using Mapbox GL. The example isn't showing them either even though they're in the style.

{
      "id": "country-boundary",
      "source": "osm",
      "source-layer": "places",
      "type": "line",
      "filter": ["==", "admin_level", "2"],
      "max-zoom": 4,
      "layout": {
        "line-cap": "round",
        "line-join": "round"
      },
      "paint": {
        "line-color": "@building",
      "line-width": {
        "base": 2,
        "stops": [[1, 0.5], [7, 3]]
        }
      }
    }, {
      "id": "state-boundary",
      "source": "osm",
      "source-layer": "places",
      "type": "fill",
      "filter": ["==", "admin_level", "4"],
      "max-zoom": 10,
      "layout": {
        "line-cap": "round",
        "line-join": "round"
      },
      "paint": {
        "fill-color": "@land",
        "fill-outline-color": "#cacecc"
      }
    }
@zerebubuth
Copy link
Member

You're right! That looks like the wrong layer. I think the source-layer should be boundaries instead of places. Could you try that and let us know if it works?

@brewin
Copy link
Author

brewin commented Feb 5, 2016

Still nothing with boundaries.

@brewin
Copy link
Author

brewin commented Feb 6, 2016

I figured out how to get them to show, but I don't think it's correct.

"source-layer": "boundaries",
"filter": ["==", "type", "country"],

I think type should be kind for consistency, and filtering by admin_level doesn't work. Also, there is no mention of the boundaries layer in the docs.

@nvkelso
Copy link
Member

nvkelso commented Feb 6, 2016

Thanks for digging into this! I'll have a closer look on Monday.

Background: There are a few inconsistencies like this today, and normalizing them is something we're committed to for a 1.0 release. It's super helpful to hear feedback like this.

On Feb 6, 2016, at 12:47, brewin notifications@github.com wrote:

I figured out how to get them to show, but I don't think it's correct.

"source-layer": "boundaries",
"filter": ["==", "type", "country"],
I think type should be kind for consistency, and filtering by admin_level doesn't work. Also, there is no mention of the boundaries layer in the docs.


Reply to this email directly or view it on GitHub.

@nvkelso
Copy link
Member

nvkelso commented Feb 8, 2016

Related, our MapboxGL demo should be updated:

mapzen/mapboxgl-vector-tiles#16

@nvkelso nvkelso changed the title State and country boundaries not showing Low zoom state and country boundaries lines need normalized kinds Feb 8, 2016
@nvkelso nvkelso added this to the v1.0.0 launch milestone Feb 8, 2016
@nvkelso
Copy link
Member

nvkelso commented Mar 23, 2016

From the docs:

Gotchas:

  • Admin-0 country and country are equivelant, both should be used in filters.
  • Admin-1 boundary and state are equivelant, both should be used in filters.
  • Don’t rely on Admin-1 statistical boundary, Admin-1 statistical meta bounds, those will probably be removed in future tile versions.

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

No branches or pull requests

4 participants