developmentseed / aep

Africa Electrification Platform - a project for the World Bank
MIT License
4 stars 5 forks source link

Schools not loading #29

Open olafveerman opened 3 years ago

olafveerman commented 3 years ago

What's wrong

When the layer Schools is enabled, nothing shows up on the map. Also no error message in the console, nor any failed tile requests in the network tab.

Troubleshooting

:heavy_check_mark: The tiles themselves are working: https://aep-tiles.staging.derilinx.com/tiles/ke/schools/mapbox.html

:heavy_check_mark: The metadata.json seems ok and in line with the Mapbox config: https://aep-tiles.staging.derilinx.com/tiles/ke/schools/metadata.json

Source:

    "schools": {
      "tiles": [
        "https://aep-tiles.staging.derilinx.com/tiles/ke/schools/{z}/{x}/{y}.pbf"
      ],
      "type": "vector"
    }

Layer:

    {
      "id": "schools",
      "type": "circle",
      "source": "schools",
      "source-layer": "data_layer"
    }

:x: Interestingly enough console.log(theMap.getLayer('schools')) returns this:

filter: (3) ["all", Array(3), Array(3)]
id: "schools"
layout: di {_properties: wi, _values: {…}}
maxzoom: undefined
metadata: {mapbox:group: "a636a5194689e7c1dede11bf3cd8dcac"}
minzoom: undefined
paint: di {_properties: wi, _values: {…}}
source: "composite"
sourceLayer: "landuse"
type: "fill"
visibility: "visible"

My guess is that the layer name clashes with the layer name in the base style. Any thoughts @danielfdsilva ?

danielfdsilva commented 3 years ago

@olafveerman That is correct. The layer and source names cannot match an existing one. This could be validated in the frontend, but it is perhaps easier to run this through the validator.

Any layer id to be added must not be any one:

background
​landcover_foliage
​national_park
​landcover_snow
​industrial
​schools
​hospitals
​cemeteries
​parks
​pitch
​sand
​water
​waterway-river-canal
​barrier_line-land-polygon
​barrier_line-land-line
​aeroway-polygon
​aeroway-runway
​aeroway-taxiway
​ferries
​road-construction
​road-sidewalks
​road-path
​road-steps
​road-trunk_link
​road-motorway_link
​road-pedestrian
​road-service-link-track
​road-street_limited
​road-street
​road-secondary-tertiary
​road-primary
​road-trunk
​road-motorway
​road-rail
​road-subway
​admin-3-4-boundaries
​wb-boundaries-bg
​wb-boundaries
​wb-boundaries-disputed
​admin-2-boundaries-bg
​admin-2-boundaries
​admin-2-boundaries-dispute
​waterway-label
​water-label
​poi-scalerank1
​airport-label
​ferry-label
​road-label-small
​road-label-medium
​road-label-large
​place-islets-archipelago-aboriginal
​place-neighbourhood
​place-suburb
​place-hamlet
​place-village
​place-town
​place-islands
​place-city-sm
​place-city-md
​place-city-lg
​marine-label-sm-ln
​marine-label-sm-pt
​marine-label-md-ln
​marine-label-md-pt
​marine-label-lg-ln
​marine-label-lg-pt
​state-label-sm
​state-label-md
​state-label-lg
​country-label-sm
​country-label-md
​country-label-lg

Any source id to be added must not be any one:

composite