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

[HELP] Display Vector Tiles (MVT) from BDNB #2464

Closed
ketourneau opened this issue Nov 15, 2024 · 2 comments
Closed

[HELP] Display Vector Tiles (MVT) from BDNB #2464

ketourneau opened this issue Nov 15, 2024 · 2 comments
Assignees
Labels

Comments

@ketourneau
Copy link
Contributor

We try to use BDNB API to display Vector Tiles of buildings.

We just try to modify vector_tile_raster_2d.html with :

var mvtSource = new itowns.VectorTilesSource({
    zoom:{
        min: 14,
        max: 14,
    },
    style: {
        sources: {
            sourceTiles: {
                type: "xyz",
                tiles: ['https://api.bdnb.io/v2/gorenove/tiles/public/buildings/{z}/{x}/{y}.pbf']
            }
        },
        layers: [
            {
                id: "batiment-groupe",
                type: "fill",
                source: "Gorenove",
                "source-layer": "sql_statement",
                paint: {
                    "fill-color": "#FF0000",
                    "fill-opacity": 1
                }
            }
        ]
    },
});

But the tiles doesn't appear. How we can find layers to correctly configure the style ?

@ftoromanoff
Copy link
Contributor

ftoromanoff commented Nov 18, 2024

Hello,
Using the exact same lines as you copied here, I got some data on the view as soon as you get in a zone where there is tile to display.

I set up the view at:

      // Paris
      const coord = new itowns.Coordinates('EPSG:4326', 2.351323, 48.856712);
      const placement = {
        coord,
        range: 10000,
      };
      const viewerDiv = document.getElementById("viewerDiv");
      const view = new itowns.GlobeView(viewerDiv, placement);

And got :
image
as a result

@ketourneau
Copy link
Contributor Author

Ok thank you, I will try now with PlanarView ! Now I know it works with globe view.

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

No branches or pull requests

2 participants