I have klokantech docker container for openmaptiles. Now I want take the KML of the country border and grey all outside the country.

2 Answers 2


A solution may be to use a Leaflet plugin that inverts polygons, such as Leaflet.snogylop. An example.

enter image description here

  • not bad! But I look for a solution for mapbox gl js.
    – Gerd
    Nov 16, 2017 at 8:42
  • Consider that Mapbox GL and Leaflet can be used together using mapbox-gl-leaflet. Nov 16, 2017 at 9:56

The interesting polygon is a difference of bounding box and the border polygon. This difference polygon you can hide. For making difference it's good to use the turfjs tool.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.