You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, the style has a nice "inverted" or "mask" polygon, dimming everything around the selected item, like this:
I really like this approach, but I would like a little more control over the colors, and would like to apply it elsewhere within my application as well.
I was thinking there may be something like an "inverted-fill" paint property that was applied, but I've been looking through all of the style specs and don't see that as an option, which led me to wonder, what is the default style for this layer?
Additional context
I see there are a number of other issues on MaboxGL-JS around this topic, with people looking for an inverted fill behavior, but, again, it doesn't seem like this has ever actually been implemented in the spec, so I thought I would ask here to see how you are doing it.
The text was updated successfully, but these errors were encountered:
You are right, the documentation is missing the default style and also the links point to the wrong URL. We will fix it.
You can find the default style in the source code. You can provide style for the polygon border (line) and its infill (fill) according to the style specs. For filter the control adds an additional property isMask which is true for the inverted mask polygon.
@zdila, thanks for your quick response and your links to the source code, the behavior of the control makes much more sense now! An update to the docs will be helpful.
I initially came across this when I found that US postal_code responses are actually Point or MultiPoint geometries, so the default style doesn't apply to them. I figured I would need to override the default behavior, calculate a polygon from the multipoint, and then manually style it in a way that matches the other types of geometries. Based on the mask example you linked, I'll start using turf for this.
Is your feature request related to a problem? Please describe.
It's not exactly a problem, but I am trying to modify the style that is applied to a selected item in the geocoder (I'm using MapLibreGL), and in the documentation there is no default listed for the
fullGeometryStyle
option: https://docs.maptiler.com/sdk-js/modules/geocoding/api/api-reference/#geocoding-options.By default, the style has a nice "inverted" or "mask" polygon, dimming everything around the selected item, like this:
I really like this approach, but I would like a little more control over the colors, and would like to apply it elsewhere within my application as well.
I was thinking there may be something like an "inverted-fill" paint property that was applied, but I've been looking through all of the style specs and don't see that as an option, which led me to wonder, what is the default style for this layer?
Additional context
I see there are a number of other issues on MaboxGL-JS around this topic, with people looking for an inverted fill behavior, but, again, it doesn't seem like this has ever actually been implemented in the spec, so I thought I would ask here to see how you are doing it.
The text was updated successfully, but these errors were encountered: