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

When using two providers if the same layer name exists across providers we need to alert the user. #81

Closed
ARolek opened this issue Sep 7, 2016 · 0 comments
Labels
Milestone

Comments

@ARolek
Copy link
Member

ARolek commented Sep 7, 2016

Currently a config like the following will stop rendering in OpenLayers v3 after it hits the second water layer. All subsequently configured layers will not show up. This is only an issue if we have two providers configured with the same layer name and they're both set to render at a certain zoom.

Notice we have two different providers, each with a layer named water. The MVT spec requires unique layer names.

[[providers]]
name = "provider1"
type = "postgis"
host = "localhost"
port = 5432
database = "osm_water" 
user = "admin"
password = ""

    [[providers.layers]]
    name = "water"
    geometry_fieldname = "geom"
    id_fieldname = "gid"
    sql = """
        SELECT 
            gid, ST_AsBinary(geom) AS geom 
        FROM 
            simplified_water_polygons 
        WHERE 
            geom && !BBOX!
    """

[[providers]]
name = "provider2"
type = "postgis"
host = "localhost"
port = 5432
database = "osm_sd" 
user = "foo"
password = ""

    [[providers.layers]]
    name = "water"
    geometry_fieldname = "way"
    id_fieldname = "osm_id"
    sql = """
        SELECT 
            osm_id, ST_AsBinary(way) AS way, name 
        FROM 
            planet_osm_polygon 
        WHERE 
            way && !BBOX! AND (waterway IS NOT NULL OR water IS NOT NULL)
    """

[[maps]]
name = "osm"

    [[maps.layers]]
    provider_layer = "provider1.water"
    min_zoom = 10
    max_zoom = 20

    [[maps.layers]]
    provider_layer = "provider2.water"
    min_zoom = 10
    max_zoom = 20
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

1 participant