Skip to content
Discussion options

You must be logged in to vote

Looking at the OpenMapTiles schema (used by MapTiler) looks like they don't provide polygons for land. So it probably won't be possible with this data.

An alternative: rememberGeoJsonSource() with the geometry of the area you want to paint a particular color, and pass it to a FillLayer above the background, below everything else. Something like:

val islandArea = rememberGeoJsonSource(id = "island-area", data = Polygon(...))
Anchor.Replace("background") {
  BackgroundLayer(...) // out of bounds color
  FillLayer(id = "fill-island-area", source = islandArea, color=...) // land color
}

Or, do the opposite; keep the original background, and paint the out of bounds area some color:

val outside…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@matthewadams
Comment options

@sargunv
Comment options

@matthewadams
Comment options

@sargunv
Comment options

Answer selected by sargunv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants