Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

FillExtrusionLayer not shown for cached tile #8871

Closed
tobrun opened this issue May 3, 2017 · 6 comments
Closed

FillExtrusionLayer not shown for cached tile #8871

tobrun opened this issue May 3, 2017 · 6 comments
Assignees
Labels
Core The cross-platform C++ core, aka mbgl

Comments

@tobrun
Copy link
Member

tobrun commented May 3, 2017

Use-case to reproduce this:

  • startup a map and wait a few seconds
  • press a button to add a FillExtrusionLayer to the map

ezgif com-video-to-gif 47

I'm noticing that

  • FillExtrusionLayer isn't shown for the current cached tile
  • panning shows extrusions on other tiles
  • zooming out shows extrusions, zooming back in removes them again

Side-note, this doesn't occur if you add a FillExtrusionLayer as result of onDidFinishLoadingStyle.

@tobrun tobrun added the Core The cross-platform C++ core, aka mbgl label May 3, 2017
@tobrun tobrun added this to the android-v5.1.0 milestone May 3, 2017
@kkaefer
Copy link
Member

kkaefer commented May 9, 2017

/cc @lbud

@lbud
Copy link
Contributor

lbud commented May 9, 2017

🤕
Does this problem also manifest if you add a different layer type (e.g. a fill layer) at runtime? I can't think of anything about fill extrusion layers that would make them behave differently than other types when it comes to tile parsing 😕

@ivovandongen
Copy link
Contributor

Does this problem also manifest if you add a different layer type

@lbud I have the strong suspicion that it does. See #8833

@tobrun
Copy link
Member Author

tobrun commented May 10, 2017

@lbud to valiidate if this was a general issue with layers, I changed the FillExtrusionLayer with a FillLayer using this geojson source. This seem to be added correctly to the map though the are some differences in setup (filter + geojson source).

Code used:

    try {
      GeoJsonSource jsonSource = new GeoJsonSource("uk-borders", new URL("https://gist.githubusercontent.com/tobrun/085903199b9926950bafe35d1b4f5ff5/raw/b67da310e4df0491899ba452f899d39c05370c32/gistfile1.geojson"));
      mapboxMap.addSource(jsonSource);
    } catch (MalformedURLException e) {
      throw new RuntimeException();
    }
    FillLayer fillLayer = new FillLayer("uk-borders", "uk-borders");
    fillLayer.setProperties(fillColor(Color.LTGRAY), fillOpacity(0.6f));
    fillLayer.setMinZoom(15);
    mapboxMap.addLayer(fillLayer);

@ivovandongen while they could be related. There is a small difference: the buildings disappear again when zooming to the initial zoom level. In #8833, the SymbolAnnotation don't disappear after they where rendered correctly by zooming.

@lbud
Copy link
Contributor

lbud commented May 10, 2017

I got this set up on the MacOS app where I used the same vector layer setup for both layers:

    MGLSource *streetsSource = [self.mapView.style sourceWithIdentifier:@"composite"];
    MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"extrusions" source:streetsSource];
    fillLayer.sourceLayerIdentifier = @"building";
    fillLayer.fillColor = [MGLStyleValue valueWithRawValue:[NSColor blueColor]];
    MGLSource *streetsSource = [self.mapView.style sourceWithIdentifier:@"composite"];
    MGLFillExtrusionStyleLayer *fillExtrusionLayer = [[MGLFillExtrusionStyleLayer alloc] initWithIdentifier:@"extrusions" source:streetsSource];
    fillExtrusionLayer.sourceLayerIdentifier = @"building";
    fillExtrusionLayer.fillExtrusionColor = [MGLStyleValue valueWithRawValue:[NSColor blueColor]];
    fillExtrusionLayer.fillExtrusionHeight = [MGLStyleValue valueWithInterpolationMode:MGLInterpolationModeIdentity sourceStops:nil attributeName:@"height" options:nil];

When adding with the same vector source type, this issue is present in both fill and fill-extrusion layers, so I think it is an issue with parsing new buckets on cached tiles when using runtime styling:
image
image

@jfirebaugh
Copy link
Contributor

I first assumed this must be a regression, probably a recent one, but... I went back as far as the iOS 3.4.0 release (first release with runtime styling), and the bug is reproducible there. So surprisingly I think this has never worked -- addLayer needs to trigger redoing layout of the tiles from its source, and it never has. 🤦‍♂️

@jfirebaugh jfirebaugh self-assigned this May 11, 2017
jfirebaugh added a commit to mapbox/mapbox-gl-js that referenced this issue May 11, 2017
jfirebaugh added a commit to mapbox/mapbox-gl-js that referenced this issue May 11, 2017
chrisvoll pushed a commit to chrisvoll/mapbox-gl-js that referenced this issue May 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

5 participants