Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Rendering API #219

Open
prushforth opened this issue Dec 7, 2020 · 4 comments · Fixed by #231
Open

Custom Rendering API #219

prushforth opened this issue Dec 7, 2020 · 4 comments · Fixed by #231

Comments

@prushforth
Copy link
Member

prushforth commented Dec 7, 2020

We need to design a mechanism that allows a client to listen for, and handle one or more tile related events.

The idea will be to add some markup to a layer, probably in the form of a <link rel="tile"...> template, which is really only responsible for generating the events, and bundling annotated object(s) to the handler(s), which the client does something to, before relinquishing control back to the browser, which then renders the tile on the screen.

Please comment, suggest and or add to this issue, it's for brainstorming.

I created a label for progressive enhancement for this, which is strictly an API type issue, i.e. not something that will be "covered" by declarative markup, but which will require an interplay of markup, CSS and scripting, per the related issue in the UCR.

@ahmadayubi
Copy link
Member

What might a tile related event be and what would listening for the event be used for?

@prushforth
Copy link
Member Author

I imagine it would be 'tile', (tbd) and the client could listen so that it when received, it could fetch data and return an image or other element (perhaps by creating an img or canvas or svg or other element, and setting a reference to the element as the value of the standard 'tile' event's standard tile.something property, the name of which I won't invent in this comment.

The row,column,zoom of the tile being requested would be properties of the event, so that the client code could generate a URL by some method that would be up to the client code. It might not be as simple as setting a URL template with {x}/{y}/{z}, because if I recall correctly, some map services (e.g. bing maps) do a quad-key hashing before generating a URL, the code of which would be simple but up to the client code.

Let's prototype this and consider throwing it away if it doesn't work out, we'll just use this as an experiment to figure out what element to have emit the 'tile' events and so on (other design considerations tbd).

Discuss here as required.

@prushforth
Copy link
Member Author

Leaflet GridLayer generates events related to individual tiles. We could start with those to see if they fit, map them to <link rel="tile"> i.e. just having such a link element will be enough to generate tile events. We still need to figure out how we expect the script client to handle the events, as we discussed today; perhaps generating an element and attaching it to the event before returning is a possibility. We should look for similar patterns if they exist in the platform.

@prushforth prushforth changed the title Prototype a programmatic way to allow a JavaScript client to render tiles Custom Rendering API Apr 26, 2021
@prushforth
Copy link
Member Author

New API docs page would go here. There may be other things we will want to render besides tiles, so I renamed an am re-opening this issue for future discussions.

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

Successfully merging a pull request may close this issue.

2 participants