Skip to content

Programmatic way to allow a JavaScript client to render tiles #231

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

Merged
merged 10 commits into from
Jan 15, 2021

Conversation

ahmadayubi
Copy link
Member

@ahmadayubi ahmadayubi commented Jan 5, 2021

Link emits 'tile' events which have x, y, zoom and a callback in details that allows the user to append to the tile on the map at a given coordinate.

For example:

let tileEventSource = document.querySelector("body > mapml-viewer > layer- > extent > link");
tileEventSource.addEventListener("tile", (e) => {
    let cusTile = document.createElement("IFRAME");
    cusTile .src = "https://www.youtube.com/embed/yI2oS2hoL0k?autoplay=1&mute=1";
    cusTile .width = 256;
    cusTile .height = 256;
    e.detail.appendTile(cusTile );
});

There's a full example in debug/clientTile.html

Closes #219

@ahmadayubi ahmadayubi marked this pull request as ready for review January 7, 2021 14:25
@prushforth prushforth merged commit 5bc36bf into Maps4HTML:master Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Rendering API
2 participants