Git Product home page Git Product logo

Comments (10)

ahocevar avatar ahocevar commented on June 17, 2024

@codeflyA Sorry, I cannot reproduce this. But since there are several thumbs-up on this, can anyone affected by this issue share a minimal reproduction repository?

from openlayers.

ahocevar avatar ahocevar commented on June 17, 2024

Never mind. Able to reproduce now.

from openlayers.

ahocevar avatar ahocevar commented on June 17, 2024

@codeflyA Does your project have a tsconfig.json? I can only reproduce the issue in projects without a tsconfig.json.

Does the issue go away when you add a tsconfig.json? If you have one already, please share a minimal reproduction repository.

from openlayers.

ahocevar avatar ahocevar commented on June 17, 2024

@codeflyA #15831 should fix this. At least in the case that I could reproduce, it does.

from openlayers.

alok-runner avatar alok-runner commented on June 17, 2024

https://github.com/alok-runner/ol-15830


src/App.tsx:14:7 - error TS2322: Type 'VectorSource<Feature<Circle>>' is not assignable to type 'VectorSource<FeatureLike>'.
  Types of property 'setLoader' are incompatible.
    Type '(loader: FeatureLoader<Feature<Circle>>) => void' is not assignable to type '(loader: FeatureLoader<FeatureLike>) => void'.
      Types of parameters 'loader' and 'loader' are incompatible.
        Types of parameters 'arg4' and 'arg4' are incompatible.
          Type '((arg0: Feature<Circle>[]) => void) | undefined' is not assignable to type '((arg0: FeatureLike[]) => void) | undefined'.
            Type '(arg0: Feature<Circle>[]) => void' is not assignable to type '(arg0: FeatureLike[]) => void'.
              Types of parameters 'arg0' and 'arg0' are incompatible.
                Type 'FeatureLike[]' is not assignable to type 'Feature<Circle>[]'.
                  Type 'FeatureLike' is not assignable to type 'Feature<Circle>'.
                    Type 'Feature<Geometry>' is not assignable to type 'Feature<Circle>'.

14       source: new VectorSource({
         ~~~~~~

src/App.tsx:23:7 - error TS2322: Type 'Cluster' is not assignable to type 'VectorSource<FeatureLike>'.
  Types of property 'setLoader' are incompatible.
    Type '(loader: FeatureLoader<Feature<Geometry>>) => void' is not assignable to type '(loader: FeatureLoader<FeatureLike>) => void'.
      Types of parameters 'loader' and 'loader' are incompatible.
        Types of parameters 'arg4' and 'arg4' are incompatible.
          Type '((arg0: Feature<Geometry>[]) => void) | undefined' is not assignable to type '((arg0: FeatureLike[]) => void) | undefined'.
            Type '(arg0: Feature<Geometry>[]) => void' is not assignable to type '(arg0: FeatureLike[]) => void'.
              Types of parameters 'arg0' and 'arg0' are incompatible.
                Type 'FeatureLike[]' is not assignable to type 'Feature<Geometry>[]'.
                  Type 'FeatureLike' is not assignable to type 'Feature<Geometry>'.
                    Type 'RenderFeature' is missing the following properties from type 'Feature<Geometry>': on, once, un, geometryName_, and 39 more.

23       source: new Cluster({
         ~~~~~~

src/App.tsx:25:9 - error TS2322: Type 'VectorSource<Feature<Point>>' is not assignable to type 'VectorSource<Feature<Geometry>>'.
  Types of property 'setLoader' are incompatible.
    Type '(loader: FeatureLoader<Feature<Point>>) => void' is not assignable to type '(loader: FeatureLoader<Feature<Geometry>>) => void'.
      Types of parameters 'loader' and 'loader' are incompatible.
        Types of parameters 'arg4' and 'arg4' are incompatible.
          Type '((arg0: Feature<Point>[]) => void) | undefined' is not assignable to type '((arg0: Feature<Geometry>[]) => void) | undefined'.
            Type '(arg0: Feature<Point>[]) => void' is not assignable to type '(arg0: Feature<Geometry>[]) => void'.
              Types of parameters 'arg0' and 'arg0' are incompatible.
                Type 'Feature<Geometry>[]' is not assignable to type 'Feature<Point>[]'.
                  Type 'Feature<Geometry>' is not assignable to type 'Feature<Point>'.

25         source: new VectorSource({
           ~~~~~~

  node_modules/ol/source/Cluster.d.ts:52:5
    52     source?: VectorSource<Feature<import("../geom.js").Geometry>> | undefined;
           ~~~~~~
    The expected type comes from property 'source' which is declared here on type 'Options'


from openlayers.

ahocevar avatar ahocevar commented on June 17, 2024

@alok-runner That's a different issue, because ol/source/Cluster is affected here. But it's similar enough for me to attempt adding a fix in #15831.

from openlayers.

codeflyA avatar codeflyA commented on June 17, 2024

the issue happen when i has a tsconfig.json
this is a minimal reproduction repository
[email protected]:codeflyA/openlayerIssue.git
https://github.com/codeflyA/openlayerIssue
@ahocevar

from openlayers.

tschaub avatar tschaub commented on June 17, 2024

@codeflyA - Can you try your example with the latest ol@dev version?

from openlayers.

codeflyA avatar codeflyA commented on June 17, 2024

issue fix in 9.2.1-dev.1715868460880 thanks

from openlayers.

tschaub avatar tschaub commented on June 17, 2024

You can get the fix in the [email protected] release.

from openlayers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.