tangrams / refill-style

From Toner to Tangram
https://tangrams.github.io/refill-style
MIT License
35 stars 12 forks source link

problems importing icons from another basemap style #73

Closed nvkelso closed 7 years ago

nvkelso commented 7 years ago

I can get Walkabout icons to import in Refill locally, but not remotely.

By locally I mean load the raw YAML or ZIP bundled assets locally using Tangram JS.

By remotely I mean load the same YAML or ZIP bundled assets remotely using Tangram JS or the same code in Tangram Play. Sample code (commented), below. Testing files here: refill-style.zip.

Works (desired Refill basemap with Walkabout icons):

screen shot 2017-09-18 at 13 41 52

Broken only Refill

screen shot 2017-09-18 at 13 42 54
# WORKS:
# local ZIP import and local ZIP walkabout icons
#import:
#- dist/refill-style.zip           # dist isn't checked-in to repo, though
#- dist/themes/label-10.zip
#- ../walkabout-style/dist/themes/walkabout-icons.zip
#
# WORKS:
# local YAML import and remote ZIP walkabout icons
import:
- refill-style.yaml
- themes/label-10.yaml
- https://mapzen.com/carto/walkabout-style/6/themes/walkabout-icons.zip
#
# WORKS:
# local ZIP import and remote ZIP walkabout icons
#import:
#  - dist/refill-style.zip           # dist isn't checked-in to repo, though
#  - themes/label-10.yaml
#  - https://mapzen.com/carto/walkabout-style/6/themes/walkabout-icons.zip
#
# totally BROKEN locally and on Tangram Play
#import:
#- https://mapzen.com/carto/refill-style/8/refill-style.zip
## removing this is still broken
#- https://mapzen.com/carto/refill-style/8/themes/label-10.zip
## would have expected at least Walkabout road shields
#- https://mapzen.com/carto/walkabout-style/6/themes/walkabout-icons.zip
#
# totally BROKEN locally
#import:
#- woo.yaml # just a dummy yaml file local with empty layer stub
#- https://mapzen.com/carto/refill-style/8/refill-style.zip
## removing this is still broken
#- https://mapzen.com/carto/refill-style/8/themes/label-10.zip
## would have expected at least Walkabout road shields
#- https://mapzen.com/carto/walkabout-style/6/themes/walkabout-icons.zip
#
# partially BROKEN locally and like a Frankenstein of icons
# ... and Tangram Play can't see the local import so fails
# ... some icons from Refill, some from Walkabout depending on the label step imported
#import:
#- https://mapzen.com/carto/refill-style/8/refill-style.zip
#- themes/label-5.yaml
#- https://mapzen.com/carto/walkabout-style/6/themes/walkabout-icons.zip
## it's not recommended to import two different label steps, but just to see what happens...
#- themes/label-11.yaml

global:
    sdk_mapzen_api_key: vector-tiles-W2tPU-Y
nvkelso commented 7 years ago

We suspect this is because the YAML is being merged correctly, but the texture links to files inside ZIPs are relative to the ZIP and aren't merged like the YAML. Since the texture was already in refill ZIP, it seems like the redefinition of it is ambiguous if the root path should then change the the walkabout ZIP. That's true in my case, but may not always be the case?

bcamper commented 7 years ago

Let me look at expected path behavior in this case in JS.

nvkelso commented 7 years ago

My problem was importing Refill 8 when it needed to be 9:

import:
    - https://mapzen.com/carto/refill-style/9/refill-style.zip
    - https://mapzen.com/carto/refill-style/9/themes/label-10.zip
    #- https://mapzen.com/carto/bubble-wrap-style/8/themes/bubble-wrap-icons.yaml
    #- https://mapzen.com/carto/walkabout-style/6/themes/walkabout-icons.zip
    #- https://mapzen.com/carto/tron-style/5/themes/tron-icons.zip
    #- https://mapzen.com/carto/cinnabar-style/8/themes/cinnabar-icons.zip
bcamper commented 7 years ago

So does this currently work as expected, or no?

nvkelso commented 7 years ago

Works as expected!

Sent from my handsful device.

On Sep 19, 2017, at 12:20, Brett Camper notifications@github.com wrote:

So does this currently work as expected, or no?

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.