question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

openlayers-5.3.0 create react app

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kekscomcommented, 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.

1reaction
All4Giscommented, Mar 12, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenLayers - Welcome
OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles, vector data and markers loaded...
Read more >
Zoom doesn't change always init value when zoomin. ol 5.3.0 ...
It's a react.js project with OpenLayers 5.3.0. The map is defined in componentDidUpdate() { this.map = new Map({ target: this.container, ...
Read more >
Using OpenLayers 5.3 in TypeScript without Node.js
https://github.com/ca0v/react-lab is an example of a project that uses ... Now I can produce a index.js and index.js.map containing all the ...
Read more >
How to test Open Layers React components with Mocha (part I)
This tutorial is based on the test setup I made for Create React App based on Mocha, Chai, Enzyme and assumes you already...
Read more >
How to create a simple map (with a marker) using OpenLayers
This tutorial is based on OpenLayers Quick Start Guide and the OpenLayers Popup Example and uses version 5.3.0 of the library. I suggest...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found