linz / basemaps

NZ’s authoritative and open digital basemap service for LINZ and the public.
https://basemaps.linz.govt.nz
Other
92 stars 16 forks source link

fix(lambda-tiler): Remove the stylejson metadata, sprite, glphys if no required. #3280

Closed Wentao-Kuang closed 2 months ago

Wentao-Kuang commented 2 months ago

Motivation

We should remove metadata, sprite, glphys if not defined from style config. empty sprite or glphys will broken the maplire.

{
  "version": 8,
  "id": "st_aerial",
  "name": "aerial",
  "sources": {
    "basemaps-aerial": {
      "tileSize": 256,
      "tiles": [
        "[https://dev.basemaps.linz.govt.nz/v1/tiles/aerial/WebMercatorQuad/{z}/{x}/{y}.webp?api=c01hzzbj62y83k27kw7pd89jsw1&config=TmVmbYRQjL9T2JWgyaSie193b4D1qZnBD8hjaSqPFYSsEvEYYhaGYKrcnYE9V7NUW5A8WmuM3FpWejcebdKmVDGzTMLXbMvmCSs2XouTFdCmeHCAfTLyzMmr3YxANL1"
      ],
      "type": "raster"
    },
    "basemaps-terrian": {
      "tileSize": 256,
      "tiles": [
        "https://dev.basemaps.linz.govt.nz/v1/tiles/elevation/WebMercatorQuad/{z}/{x}/{y}.png?api=c01hzzbj62y83k27kw7pd89jsw1&config=TmVmbYRQjL9T2JWgyaSie193b4D1qZnBD8hjaSqPFYSsEvEYYhaGYKrcnYE9V7NUW5A8WmuM3FpWejcebdKmVDGzTMLXbMvmCSs2XouTFdCmeHCAfTLyzMmr3YxANL1"
      ],
      "type": "raster-dem"
    }
  },
  "layers": [
    {
      "id": "basemaps-aerial",
      "source": "basemaps-aerial",
      "type": "raster"
    }
  ],
  "metadata": {},
  "glyphs": "",
  "sprite": ""
}

Modification

Only add these optional filed if defined in the getStyleJSON Api

Checklist

If not applicable, provide explanation of why.