镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Allow any vector tile style #51

Open

Description

@gmaclennan

Right now the marker sprites need to be added to any vector tile style that is used. mapbox-gl-js currently only allows one sprite sheet per style, so you need to use Mapbox Studio to add the marker sprites to the style online. Ideally we want to enable any custom style to be used as a background in MapFilter, without modifying the sprites.

My current strategy for solving this is to concatenate the remote sprite file from the map style with the sprite for the marker sprites, using concat-sprites. This can be done dynamically in the browser, but getting the new merged sprite into mapbox-gl-js is a challenge. We could serve the sprite over an objectURL but mapbox-gl-js currently expects both the json and png to share the same url root. We could serve both using Service Workers, but with limited browser support, or create a fork of mapbox-gl-js and write a custom image_sprite.js. I'm thinking the latter might be the easier (hacky) solution for now. Hopefully Mapbox will support dynamic sprites in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions