Mapbox-gl-native: non-solid matte

Created on 26 Mar 2014  路  24Comments  路  Source: mapbox/mapbox-gl-native

We should consider a non-solid matte for better context. Consider Apple Maps's grid:

https://dl.dropboxusercontent.com/u/575564/matte.mov

matte

Core MapKit parity archived feature

Most helpful comment

Sorry @stale, but this is still a sometimes requested feature - so I think it's worth revisiting whether or not this would be possible to include. Especially now that some time has passed since the original grid was reverted.

All 24 comments

Yes

@kkaefer how tough is this to hit? Should this be manually drawn somehow or just have a texture used repetitively?

Bump on this. @kkaefer is this difficult? I'm hesitant to just put a texture in there for performance reasons, so I don't know best approach here. But with a blank map, stalls give the appearance of no interaction, when really panning, zooming, and rotating are still working.

:/

If we must can it be suuuper subtle? The apple grid is gross.

Yeah, we can make it very light. We can double back on this later. I think it's important for a demo, though.

-js preloads a couple tiles at much lower zoom levels that get overscaled a ton to fill gaps when panning and zooming. I'm not sure if they provide helpful context, or if overscaling looks terrible.
pantile

I think I mostly have this working if I can just get an image into the sprite. @edenh @nickidlugash what process are we using to add assets to the sprite currently?

This is working pretty well in this branch with a correct sprite image. We'll work on a more refined version with major/minor gridlines next.

We took this back out in https://github.com/mapbox/mapbox-gl-native/commit/7a4a833f39730d9676458e4ca5ee595329649aed for performance reasons, so this still needs to happen.

Can't this be done in the style via background-image when it's desired?

The idea is that the grid represents the "surface" that the map is drawn on, which orients gestural interaction better, before any actual content is drawn. As such, as long as it has zero delay relating to style parsing, tile download/parse/render, and the like, it could work. I think we would need #163 first though, or else background-image would be dependent on the start of initial render for a tile.

+1

This feature is important because, especially in a full-screen-map application on iOS, the user would perceive a hang between the time the style is set and the time content starts to appear. If they鈥檙e in the midst of a gesture, the effect can be especially jarring because the user may end up panning or zooming farther than they expected to.

In order for this feature to match the user experience provided by MapKit, the grid pattern would have to be independent of any style. With respect to any given tile coordinate, it would have to appear from the moment the style is set (before the style is downloaded or parsed) to the moment any non-background layer appears at that tile coordinate. Either this pattern would appear above any background layer, or the background layer would automatically remain hidden (exposing the pattern beneath it) until a non-background layer can appear.

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

Sorry @stale, but this is still a sometimes requested feature - so I think it's worth revisiting whether or not this would be possible to include. Especially now that some time has passed since the original grid was reverted.

This issue was referenced in https://github.com/mapbox/mapbox-gl-native/issues/11814
I agree with @riastrad that we need this feature especially for my case where I need to distinguish background layer and unloaded tile visually

GL-native supports the same UX as GL-JS shown in https://github.com/mapbox/mapbox-gl-native/issues/119#issuecomment-44676773. This is a better UX as showing a grid or nothing at all. @ulusoyca could you elaborate why this is needed for your use-case?

@tobrun Correct me if I am wrong but the comment you pointed assumes that there are preloaded tiles. In my use case, there is no guarantee of preloaded tiles so it makes difficult to distinguish unloaded tile from background layer

that is correct, you will just see the background color. One way to achieve your effect, haven't verified this but should work, would be to updating your style with:

  • adding a fill layer above background layer with current background color and linking a geometry spanning the world.
  • updating background layer to use background-pattern with something as a grid shown in OP

@tobrun

adding a fill layer above background layer with current background color and linking a geometry spanning the world.

  1. Any instructions on how I can link a geometry spanning the world?
  2. Should I add the fill layer programmatically? Is it doable in mapbox studio?

Ok, I was able to add the layer through Mapbox Studio with the following dataset:

  "geometry": {
    "coordinates": [
      [
        [-180, -90],
        [180, -90],
        [180, 90],
        [-180, 90],
        [-180, -90]
      ]
    ],
    "type": "Polygon"
  },
  "type": "Feature",
  "properties": {
    "name": "full_world_cover"
  }

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings