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

tangramLayer and marker class #711

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

tangramLayer and marker class #711

wants to merge 3 commits into from

Conversation

meetar
Copy link
Member

@meetar meetar commented Feb 25, 2019

This is a WIP branch, introducing new tangramLayer and marker classes, to offer an alternative to Leaflet. This will allow further development of more features currently not supported by Leaflet (or supported only partially, or only through plugins). The ultimate goal is a more powerful and flexible library, with a smaller footprint and fewer dependencies.

src/tangramLayer.js provides a similar public API to the existing leafletLayer API, with a few differences:

import Tangram from '../dist/tangram.debug.mjs';

(function () {
    var scene_url = 'demos/scene.yaml';

    /*** Map ***/

    // Create Tangram map in the element called 'map'
    const map = Tangram.tangramLayer('map', {
        scene: scene_url
    });

    /*** Map ***/

    window.addEventListener('load', () => {
        const options = {
            maxZoom: 20,
            zoomSnap: 0,
            keyboard: false,
            center: { lat: 40.70531887544228, lng: -74.00976419448853 },
        };

        map.initialize(options);

        window.scene = map.scene; // set by tangramLayer

    });
    window.map = map;
}());

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.

1 participant