Skip to content

tangramLayer and marker class#711

Draft
meetar wants to merge 3 commits intomasterfrom
tangramLayer-merge
Draft

tangramLayer and marker class#711
meetar wants to merge 3 commits intomasterfrom
tangramLayer-merge

Conversation

@meetar
Copy link
Copy Markdown
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