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

vectorGrid dependency removed> #374

Open
cscrum opened this issue Dec 3, 2024 · 1 comment
Open

vectorGrid dependency removed> #374

cscrum opened this issue Dec 3, 2024 · 1 comment

Comments

@cscrum
Copy link

cscrum commented Dec 3, 2024

using Angular 17, @bluehalo/ngx-leaflet 19.0.0, leaflet: 1.9.4
I recently upgraded a project from Angular 14 and am doing some major rewrites so updating all packages where I can. I have vector tiles that I am serving from my own server, but after upgrading to bluehalo from the previous maintainer, angular is complaining that:

Module '"leaflet"' has no exported member 'vectorGrid'.

I see in the old package.json for ngx-leaflet there was a dependency for leaflet.vectorgrid, but that is no longer included. I have tried installing leaflet.vectorgrid manually but I still get the error above. Is there a way to fix this? Or is there a better way to display vector tiles on my angular leaflet map?

I used to have:

const vectorTileOptions = {
vectorTileLayerStyles: vectorTileStyling,
renderer: renderer,
zIndex: 1000,
interactive: true, // Make sure that this VectorGrid fires mouse/pointer events
};

const tlayer = vectorGrid.protobuf(tileurl + '/{z}/{x}/{y}.pbf',
vectorTileOptions,
).on('click', function(e) { })

And I had to add a namespace in my typings.d.ts file like this:
import * as L from "leaflet";
declare module "leaflet" {
namespace vectorGrid {
export function protobuf(url: string, options?: any): any;
}
}

but none of this works now. Any help would be appreciated.

@reblace
Copy link
Contributor

reblace commented Dec 10, 2024

I don't think we ever directly included Leaflet.VectorGrid in any of our releases. It's possible that something else has broken how you were including it. Can you include your old package.json?

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

No branches or pull requests

2 participants