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

openlayers-5.3.0 create react app #120

Open
All4Gis opened this issue Mar 12, 2020 · 7 comments
Open

openlayers-5.3.0 create react app #120

All4Gis opened this issue Mar 12, 2020 · 7 comments

Comments

@All4Gis
Copy link

All4Gis commented Mar 12, 2020

Hi.

I'm trying to integrate this js into a project but when I import the library I get a lot of errors like:

./src/OSMBuildings-OL5.js
  Line 272:9:    Expected an assignment or function call and instead saw an expression  no-unused-expressions
  Line 859:9:    Expected an assignment or function call and instead saw an expression  no-unused-expressions
  Line 1370:32:  'getGeometries' is not defined                                         no-undef
  Line 1380:32:  'getGeometries' is not defined                                         no-undef
  Line 1652:9:   Expected an assignment or function call and instead saw an expression  no-unused-expressions
  Line 2015:9:   '_ring' is not defined                                                 no-undef
  Line 2137:9:   Expected an assignment or function call and instead saw an expression  no-unused-expressions
  Line 2138:9:   Expected an assignment or function call and instead saw an expression  no-unused-expressions
  Line 2342:9:   Expected an assignment or function call and instead saw an expression  no-unused-expressions
  Line 2421:9:   Expected an assignment or function call and instead saw an expression  no-unused-expressions
  Line 2565:9:   'setSize' is not defined                                               no-undef
  Line 2584:9:   'setZoom' is not defined                                               no-undef

Search for the keywords to learn more about each error.

It's a create react app project, but it should work I think.

thanks

@kekscom
Copy link
Owner

kekscom commented Mar 12, 2020

Sounds familiar.
Can you confirm the library works standalone?
Also, could you provide a running sample with your setup? Demo URL, CodePen etc.

@All4Gis
Copy link
Author

All4Gis commented Mar 12, 2020

It works perfectly in standalone app.I'm going to make an example

@All4Gis
Copy link
Author

All4Gis commented Mar 12, 2020

I created a sample repository

npm install and npm start

https://github.com/All4Gis/OSMSample/tree/OSMBuildings

@kekscom
Copy link
Owner

kekscom commented Mar 19, 2020

git checkout OSMBuildings

@kekscom
Copy link
Owner

kekscom commented Mar 19, 2020

From what I see code did not get properly transpiled into ES6. Ideally you could fine tune this process.

Resulting tasks would be refactoring to a modern code base + providing an npm module.

@All4Gis
Copy link
Author

All4Gis commented Mar 19, 2020

Okay, I shall enquire and I'll try to make a working example. thanks

@All4Gis
Copy link
Author

All4Gis commented Apr 21, 2020

I've finally had time to make some changes. It's working.
Here is a link to the example.

https://github.com/All4Gis/OSMSample/tree/OSMBuildings

And live demo
https://all4gis.github.io/OSMSample/

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