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

Markerclusterer: Property 'radius' does not exist on type 'SuperClusterViewportOptions'. #724

Open
adamperea opened this issue Aug 14, 2023 · 18 comments · May be fixed by #827 or #836
Open

Markerclusterer: Property 'radius' does not exist on type 'SuperClusterViewportOptions'. #724

adamperea opened this issue Aug 14, 2023 · 18 comments · May be fixed by #827 or #836
Labels
status: investigating The issue is under investigation, which is determined to be non-trivial. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@adamperea
Copy link

Hello,

I have this error since the last update:
Error: node_modules/@googlemaps/markerclusterer/dist/algorithms/superviewport.d.ts:37:28 - error TS2339: Property 'radius' does not exist on type 'SuperClusterViewportOptions'. 37 constructor({ maxZoom, radius, viewportPadding, ...options }: SuperClusterViewportOptions);.

My packages versions are:

  • "@googlemaps/markerclusterer": "^2.4.0"
  • "@types/google.maps": "^3.53.6".

I am using Angular 16.2.0 with typescript 5.1.6. The only place where I am using something from this class is there:
new MarkerClusterer({ map: this.map, algorithm: new SuperClusterAlgorithm({ minPoints: 6 }), });

Could you help me, please?

@adamperea adamperea added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Aug 14, 2023
@wangela
Copy link
Member

wangela commented Aug 14, 2023

If you would like to upvote the priority of this issue, please comment below or react on the original post above with 👍 so we can see what is popular when we triage.

@adamperea Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

@carjimfa
Copy link

carjimfa commented Sep 5, 2023

It also happens to me in a project with Angular 15, TypeScript 4.9.4.

@nikunjgadhiya-rishabh
Copy link

The same happens in my project.

gMap_issue

Angular 11.0.2
Typescript 4.0.5

"@googlemaps/markerclusterer": "^2.3.2"
"@types/google.maps": "^3.53.5"

@luciendub
Copy link

Capture d’écran, le 2023-09-22 à 14 15 31 Same issue in a Ionic Angular project.

@ryandan29
Copy link

The same happens in my project.

@usefulthink usefulthink added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. status: investigating The issue is under investigation, which is determined to be non-trivial. and removed triage me I really want to be triaged. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Sep 29, 2023
@usefulthink
Copy link
Contributor

Can someone provide a minimal reproducible example? Does this only happen in combination with angular?

@jcompagner
Copy link

for me it is the same thing. but not sure that this has anything todo with angular (at least from first sight, this seems to be pure typescript)

for example:

image

that also fails for me because SuperClusterViewportOptions has through 2 interfaces 2 properties..

viewportPadding because of ViewportAlgorithmOptions and maxZoom because of AlgorithmOptions interfaces

not sure what this interface:

export type SuperClusterOptions = SuperCluster.Options<{
[name: string]: any;
}, {
[name: string]: any;
}>;

really does..
because SuperClusterViewportOptions also extends SuperClusterOptions
and this is assignable:

const y: SuperClusterOptions = {maxZoom, radix, viewportPadding};

but not that the completion if "y" then gives me anything..

So not sure what should be happening here.. should it be because of SuperClusterViewportOptions is also a SuperClusterOptions it should just allow everything? but it doesn't seem to do that because it also implements another interface that only defined 2 option properties (through its interface inheritance chain)

@jcompagner
Copy link

image

this is just weird.. i will try to make my sample smaller

but "a" is correct "radius" is not part of that because ViewportAlgorithmOptions doesn't have that

"b" is weird that it doesn't complain on anything because "b" should just be "d" which is the same type but then directly in code, and in "d" you see that it only accepts maxZoom and radius because supercluster.Options has those

And "c" is just the combination of the types of "a" and "b" (and b being kind of "d" type)

so you would expect that "c" would allow what "a" and "b" gives you but it doesn't it only seems to be the same as "a"

So 2 things:

1> why isn't "b" complaining the same as "d" because they should be effectively be the same.

2> why is "c" not a combination of "a" and "b" (or "d") and accepts it all properties that are in that combination..

@jm-ds
Copy link

jm-ds commented Oct 14, 2023

Same error. It's occuring on import. import { MarkerClusterer } from "@googlemaps/markerclusterer";
Angular 16.2.0 with typescript 5.1.6.
"@angular/google-maps": "^16.2.1",
@googlemaps/markerclusterer": "^2.5.0",

@jcompagner
Copy link

this is very weird and i dont know which setting it is exactly

root package.json file

{
  "dependencies": {
    "@angular/core": "^16.2.9",
    "@googlemaps/markerclusterer": "^2.5.0"
  },
  "devDependencies": {
    "@angular/cli": "^16.2.6",
    "@types/google.maps": "^3.54.3",
    "@types/node": "^20.8.5",
    "@types/supercluster": "^7.1.1",
    "tslib": "^2.6.2",
    "typescript": "<5.2"
  }
}

in a "src" sub dir i have this test.ts:

import { SuperClusterOptions, SuperClusterViewportOptions, ViewportAlgorithmOptions} from "@googlemaps/markerclusterer";

class test {
    constructor() {
        
        const radius = 42;
        const maxZoom = 1;
        const viewportPadding = 1;
        const a: ViewportAlgorithmOptions  = {maxZoom, radius, viewportPadding};

        const b: SuperClusterOptions = {maxZoom, radius, viewportPadding};

        const c: SuperClusterViewportOptions = {maxZoom, viewportPadding, radius};
        
        const d: supercluster.Options<{
            [name: string]: any;
        }, {
            [name: string]: any;
        }> =  {maxZoom, radius, viewportPadding};
    }
}

then the errors are correct it generates errors where it should be and there are no errors where it shouldn't be.

then i just drop 1 empty file besides the package.json:

tsconfig.json which just {} inside it

and right away it goes wrong...

So it seems that suddenly even without nothing in the tsconfig.json file there are different kind of defaults that are causing this or some other thing that i don;t understand yet.

The thing is that all angular applications do have tsconfig.json files...

@Guilherme-Bodart
Copy link

Guilherme-Bodart commented Oct 27, 2023

I literally removed this radius from the file '@googlemaps\markerclusterer\dist\algorithms\superviewport.d.ts', where it is called, on line 37, and it worked, I don't even want to know what happens now.
image
image
This is what we call the 'Jeitinho Brasileiro' or 'Gambiarra'

@jm-ds
Copy link

jm-ds commented Oct 27, 2023

I don't even want to know what happens now.

@Guilherme-Bodart You likely just created a black hole that will devour all of humanity, right before Halloween. Good job! :)

@GuilhermeBodart
Copy link

GuilhermeBodart commented Nov 14, 2023

@Guilherme-Bodart You likely just created a black hole that will devour all of humanity, right before Halloween. Good job! :)

I went back to version 2.3.2, and it worked, if one day it works again from version 2.4.0+, someone please let me know 😊

@RomanTikhonov
Copy link

I have the same problem 😢

@jm-ds
Copy link

jm-ds commented Nov 25, 2023

2.5.1 still broken. I reverted to 2.3.2 as @Guilherme-Bodart suggested and will also stay there until this is fixed.

@dreamer-fox
Copy link

can you help me provide your related versions,I reverted to 2.3.2 but still failed; thank you! @Guilherme-Bodart

@GuilhermeBodart
Copy link

can you help me provide your related versions,I reverted to 2.3.2 but still failed; thank you! @Guilherme-Bodart

"@angular/cli": "^16.2.0",
"@googlemaps/js-api-loader": "^1.16.2",
"@googlemaps/markerclusterer": "^2.3.2",
"@types/google.maps": "^3.54.7",

My versions Angular-cli and Google things I use, the error that happens on yours after updating still about radius?

i'm brazilian guy using translate 😊

taserian pushed a commit to taserian/js-markerclusterer that referenced this issue Dec 15, 2023
taserian added a commit to taserian/js-markerclusterer that referenced this issue Dec 15, 2023
@makesh-kumar makesh-kumar linked a pull request Jan 7, 2024 that will close this issue
4 tasks
@HelenKissopoda
Copy link

I reverted to 2.3.2 and it works for me also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: investigating The issue is under investigation, which is determined to be non-trivial. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet