Git Product home page Git Product logo

Comments (15)

gberaudo avatar gberaudo commented on May 14, 2024

The last two errors look strange:

  • ol3-cesium/src/core.js:521: found and required struct look compatible;
  • ol3-cesium/src/core.js:746: the displayed function signature is wrong.

There is no feature parameter.
http://openlayers.org/en/master/apidoc/ol.feature_.html#FeatureStyleFunction

How do you get these errors?

from ol-cesium.

ahocevar avatar ahocevar commented on May 14, 2024

@schmidtk Can you please respond to @gberaudo's comment above?

from ol-cesium.

schmidtk avatar schmidtk commented on May 14, 2024

We're building ol3 + ol3-cesium + our application together using the Closure Ant task with advanced compilation. The Closure library and compiler versions we're using are recent as of last week from the GitHub repos. Both of those errors look (hopefully) straightforward to fix though.

[java] ol3-cesium/src/core.js:521: ERROR - actual parameter 1 of Cesium.BillboardCollection.prototype.add does not match formal parameter
[java] found : {image: (HTMLCanvasElement|HTMLVideoElement|Image|null|string), position: Cesium.Cartesian3}
[java] required: {image: string, position: Cesium.Cartesian3}

Cesium.BillboardCollection.prototype.add is only expecting a string, while the ol.style.Image#getImage call has a return type of {HTMLCanvasElement|HTMLVideoElement|Image}. These are incompatible and caused the error.

The externs file should be updated to reflect the possible input types for Billboard.image, which looks to be {Image|Canvas|String|Billboard~CreateImageCallback} from the setImage function. It should accept {HTMLCanvasElement|HTMLVideoElement|Image|string}, with the possible exception of HTMLVideoElement.

[java] ol3-cesium/src/core.js:746: ERROR - "function (this:ol.Feature, number): (Array.<(null|ol.style.Style)>|null)" must be called with a "this" type
[java] style = featureStyle(resolution);

this:ol.Feature isn't a parameter, it's the this context for ol.feature.FeatureStyleFunction. The function should be invoked as featureStyle.call(feature, resolution).

from ol-cesium.

wallw-teal avatar wallw-teal commented on May 14, 2024

Just a couple of notes about the build:

We are using the command line runner, not the ant task. If any of the warning types can be changed to errors without causing compilation errors in the Closure library itself, then we make them errors (it's darn near most of them). I can try to pull down the exact list if you like.

from ol-cesium.

gberaudo avatar gberaudo commented on May 14, 2024

We must add a Makefile target to compile ol3cesium+ol3 together.
Currently we have nothing to test the fixes against and even if we fix
the code today there will always be unnoticed regressions.

Could it be possible that you contribute this target?

In the meanwhile I will create a PR with a 'tentative fix'.
#82

from ol-cesium.

ahocevar avatar ahocevar commented on May 14, 2024

See #2753 for a fix for the first compiler error.

from ol-cesium.

klokan avatar klokan commented on May 14, 2024

Discussed on the meeting:

  • The 1) requires change in ol3 externs - to be done by @ahocevar
  • The 2) camera.js:257 3) camera.js:315 4) camera.js:346 to be fixed on ol3cesium side - it is recent change in ol3 - to be done by @petrsloup
  • The 5) core.js:509 is pixelRatio parameter - to be fixed by @elemoine
  • The 6) core.js:521 and 7) core.js:746 should be already fixed by @gberaudo via #82

from ol-cesium.

schmidtk avatar schmidtk commented on May 14, 2024

I grabbed the latest ol3-cesium code and have a few more compiler errors:

  1. core.js:805: csPrimitive doesn't exist on ol.Feature.
  2. vectorsynchronizer.js:100: csPrimitive doesn't exist on ol.Feature.

I added a note in #88 as well.

from ol-cesium.

ahocevar avatar ahocevar commented on May 14, 2024

See openlayers/openlayers#2785 for the change in the generated externs file. @petrsloup and @gberaudo, please test and let me know if the goog.events.Key issue is fixed.

from ol-cesium.

klokan avatar klokan commented on May 14, 2024

@gberaudo last comment from @schmidtk on #88 is related to the code you created here. It has been only moved during refactoring. Could you please check this?

from ol-cesium.

ahocevar avatar ahocevar commented on May 14, 2024

@gberaudo Can you please take another look at this? Especially if the externs file generated after openlayers/openlayers#2785 is correct, and if the problem pointed out in #88 is addressed here. Thanks.

from ol-cesium.

gberaudo avatar gberaudo commented on May 14, 2024

Hi @ahocevar, the problem pointed out in #88 was (tentatively) addressed
in #95.

See comment
#95 (comment).

A make check using your ol3 branch prints the following olcs compile error:
ERR! compile /home/gberaudo/dev/ol3-cesium/src/camera.js:105: ERROR -
actual parameter 1 of ol.View.prototype.unByKey does not match formal
parameter
ERR! compile found : *
ERR! compile required: (goog.events.ListenableKey|null|number)
ERR! compile this.view_.unByKey(this.viewListenKey_);
ERR! compile ^
ERR! compile
ERR! compile
ERR! compile 1 error(s), 0 warning(s), 96,4% typed
ERR! compile
ERR! Process exited with non-zero status, see log for more detail: 1

from ol-cesium.

ahocevar avatar ahocevar commented on May 14, 2024

Thanks for testing @gberaudo. See #97 for a fix.

from ol-cesium.

ahocevar avatar ahocevar commented on May 14, 2024

@elemoine or @fredj, can you please review openlayers/openlayers#2785? Then we can close this.

from ol-cesium.

ahocevar avatar ahocevar commented on May 14, 2024

Thanks to everyone who helped with this. Closing 😄.

from ol-cesium.

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.