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.

geo.lean.js, geo.js, and geo.min.js behave differently at build time

See original GitHub issue

Disclaimer: I’m on 0.19.4, so things may be different now.

Using geo.lean.js (which is the default option as specified in the package.json file) causes a “couldn’t resolve vtk” type of error when building my project. This is annoying but doesn’t seem to interrupt the runtime usage of GeoJS. However, by default CircleCI will not allow for deploying a build using this version, because it treats all warnings as errors during deployment.

Locally, using geo.js instead (by explicitly changing the import statement that brings geo into the code) causes an OOM error, though I am not too sure why.

geo.min.js works both locally and on CircleCI, so I’m using that for now.

So this is both a bug report and a question:

Bug Report

The three built JS files behave very differently, and they probably shouldn’t.

Question

What is the purpose of the three different bundles? When would I use one or the other, if all three were behaving well?

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mantheycommented, Sep 14, 2019

There are two versions: geo.js and geo.lean.js, both of which have minified versions (geo.min.js and geo.lean.min.js). Conceptually, there are some optional dependencies that geo.js has that are not required but add functionality: hammer.js to add touch support, d3 to add some features to the svg renderer, vtk.js to add the vtkjs renderer. geo.js has all of these bundled into its code. geo.lean.js does not, but if they are available in the global namespace, it can still use them.

There was a bug in how vtk.js was referenced in the lean version (webpack optional dependencies have to be of the form try { var foo = require(foo); } catch (err) {}, but we had a log message in the catch). This was fixed in #1018, but hasn’t been released yet, mostly because we haven’t actually gone to a true continue release process and were hoping to roll some other updates into the next release (but could emit a release immediately upon request).

I’m marking this resolved (by #1018).

0reactions
aashish24commented, Mar 17, 2021

I would be incline towards removing vtk.js and require adding it afterwards if someone is using geojs-vtk.js interface. Does that answer your question @manthey

Read more comments on GitHub >

github_iconTop Results From Across the Web

geojs Documentation - Read the Docs
GeoJS is a flexible library for all kinds of geospatial and 2-D visualizations from traditional point markers to 3D climatological simulations.
Read more >
jQuery Geo - GitHub
Small, fast & simple JavaScript mapping and geospatial API as a jQuery plugin - GitHub - jQueryGeo/geo: Small, fast & simple JavaScript mapping...
Read more >
Read Leaflet Tips and Tricks | Leanpub
Using multiple tile layers on your map. Leaflet has a great feature that allows you to easily switch between tile layers when viewing...
Read more >
Inconsistent rendering of map by d3.geoEquirectangular()
I believe you are referencing an issue on github that was concerned with how d3 referenced polygons. The issue can cause the inversion...
Read more >
Google Maps API pricing got you down? See these awesome ...
This modern, open-source JavaScript library has quickly become very popular ... Really curious to see what you #GeoGeeks think about it.
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